@instructure/platform-modules 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/adapters/canvasGraphql/index.d.ts.map +1 -1
  2. package/dist/adapters/canvasGraphql/queries.d.ts +13 -1
  3. package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
  4. package/dist/chunks/ModulesProgressBar-B4fXbi-4.js +2516 -0
  5. package/dist/components/FilterSelect.d.ts.map +1 -1
  6. package/dist/components/ModuleCard.d.ts.map +1 -1
  7. package/dist/components/ModuleItemRow.d.ts +3 -4
  8. package/dist/components/ModuleItemRow.d.ts.map +1 -1
  9. package/dist/components/ModulesProgressBar.d.ts +5 -1
  10. package/dist/components/ModulesProgressBar.d.ts.map +1 -1
  11. package/dist/edit/EditModuleCard.d.ts +17 -0
  12. package/dist/edit/EditModuleCard.d.ts.map +1 -0
  13. package/dist/edit/EditModuleItemRow.d.ts +9 -0
  14. package/dist/edit/EditModuleItemRow.d.ts.map +1 -0
  15. package/dist/edit/ModulesEditActions.d.ts +7 -0
  16. package/dist/edit/ModulesEditActions.d.ts.map +1 -0
  17. package/dist/edit/ModulesEditView.d.ts +10 -0
  18. package/dist/edit/ModulesEditView.d.ts.map +1 -0
  19. package/dist/edit/ModulesEditView.stories.d.ts +16 -0
  20. package/dist/edit/ModulesEditView.stories.d.ts.map +1 -0
  21. package/dist/edit/controls/AddItemMenu.d.ts +6 -0
  22. package/dist/edit/controls/AddItemMenu.d.ts.map +1 -0
  23. package/dist/edit/controls/AddModuleButton.d.ts +6 -0
  24. package/dist/edit/controls/AddModuleButton.d.ts.map +1 -0
  25. package/dist/edit/controls/InlineRename.d.ts +5 -0
  26. package/dist/edit/controls/InlineRename.d.ts.map +1 -0
  27. package/dist/edit/controls/ItemActionsMenu.d.ts +7 -0
  28. package/dist/edit/controls/ItemActionsMenu.d.ts.map +1 -0
  29. package/dist/edit/controls/ItemPublishToggle.d.ts +6 -0
  30. package/dist/edit/controls/ItemPublishToggle.d.ts.map +1 -0
  31. package/dist/edit/controls/ModuleActionsMenu.d.ts +6 -0
  32. package/dist/edit/controls/ModuleActionsMenu.d.ts.map +1 -0
  33. package/dist/edit/controls/ModulePublishMenu.d.ts +6 -0
  34. package/dist/edit/controls/ModulePublishMenu.d.ts.map +1 -0
  35. package/dist/edit/controls/ModuleSettingsModal.d.ts +6 -0
  36. package/dist/edit/controls/ModuleSettingsModal.d.ts.map +1 -0
  37. package/dist/edit/controls/PublishAllMenu.d.ts +6 -0
  38. package/dist/edit/controls/PublishAllMenu.d.ts.map +1 -0
  39. package/dist/edit/controls/ViewAsLearnerButton.d.ts +6 -0
  40. package/dist/edit/controls/ViewAsLearnerButton.d.ts.map +1 -0
  41. package/dist/edit/index.d.ts +4 -0
  42. package/dist/edit/index.d.ts.map +1 -1
  43. package/dist/edit.js +509 -128
  44. package/dist/index.js +1218 -1986
  45. package/locales/en.json +12 -1
  46. package/package.json +1 -1
  47. package/dist/chunks/useModulesPageData-BFCZuChP.js +0 -1639
package/dist/index.js CHANGED
@@ -1,68 +1,49 @@
1
- import { w as vt, I as Ro, M as ko, a as Oo, b as xo, i as Yt, c as Do, v as je, F as No, h as zo, o as gt, m as me, d as qo, g as $o, e as Fo, f as Uo, u as _e, j as P, r as Bo, k as Go, l as Wo, n as An, s as Ho, p as Ko, q as jo, t as Yo, E as Vo, x as Qo, y as Xo, z as Zo, A as Jo, B as er, C as tr, D as nr, G as Fe } from "./chunks/useModulesPageData-BFCZuChP.js";
2
- import { H as ma, J as ga, a6 as pa, a7 as fa, a8 as ha, aj as Ia, a9 as _a, aa as Ea, ab as ya, ac as ba, _ as Sa, V as Ma, X as Ta, L as Ca, N as va, O as wa, P as Pa, Q as Aa, S as La, R as Ra, T as ka, U as Oa, a2 as xa, Y as Da, ai as Na, Z as za, ak as qa, $ as $a, W as Fa, a0 as Ua, ae as Ba, a1 as Ga, af as Wa, ag as Ha, ah as Ka, K as ja, a3 as Ya, a4 as Va, ad as Qa, a5 as Xa } from "./chunks/useModulesPageData-BFCZuChP.js";
3
- import { jsx as r, jsxs as g, Fragment as Q } from "react/jsx-runtime";
4
- import { createContext as or, useContext as rr, useRef as k, useMemo as F, isValidElement as wt, useCallback as V, memo as Ln, Fragment as Rn, cloneElement as ir, useState as j, useEffect as W, useId as sr } from "react";
5
- import { canvasFetch as Vt } from "@instructure/platform-canvas-fetch";
6
- import { z as b } from "zod";
7
- import { gql as we } from "graphql-tag";
8
- import { Pill as kn } from "@instructure/ui-pill/v11_7";
9
- import { useQueryClient as lr, QueryClient as ar, QueryClientProvider as cr } from "@tanstack/react-query";
10
- import { ScreenReaderContent as Ye } from "@instructure/ui-a11y-content";
11
- import { SimpleSelect as Qt } from "@instructure/ui-simple-select/v11_7";
12
- import { Text as S } from "@instructure/ui-text/v11_7";
13
- import { LockInstUIIcon as Pt, CircleAlertInstUIIcon as fe, CircleCheckInstUIIcon as At, ClockFadingInstUIIcon as Lt, CircleDashedInstUIIcon as Rt, CalendarInstUIIcon as ur, CornerDownRightInstUIIcon as dr, IconArrowOpenUpLine as mr, IconArrowOpenDownLine as gr, IconClockLine as On, IconAiColoredSolid as pr, IconAiSolid as fr, IconArrowOpenStartLine as hr, IconArrowOpenEndLine as Ir } from "@instructure/ui-icons";
14
- import { useTheme as xn, InstUISettingsProvider as _r } from "@instructure/emotion";
15
- import { Flex as I } from "@instructure/ui-flex/v11_7";
16
- import { Link as Dn } from "@instructure/ui-link/v11_7";
17
- import { View as E } from "@instructure/ui-view/v11_7";
18
- import { isValid as ht, colorToRGB as It, overlayColors as Er, alpha as yr, color2hex as Nn, contrast as le, darken as br, lighten as Sr } from "@instructure/ui-color-utils";
19
- import { politeAnnounce as K, getLiveRegion as We, TruncateWithTooltip as Mr } from "@instructure/platform-instui-bindings";
20
- import { Alert as ae } from "@instructure/ui-alerts/v11_7";
21
- import { IconButton as _t, CloseButton as Tr, Button as H } from "@instructure/ui-buttons/v11_7";
22
- import { Heading as Ie } from "@instructure/ui-heading/v11_7";
23
- import { Pagination as zn } from "@instructure/ui-pagination/v11_7";
24
- import { ProgressBar as Cr } from "@instructure/ui-progress/v11_7";
25
- import { Spinner as kt } from "@instructure/ui-spinner/v11_7";
26
- import { Tooltip as qn } from "@instructure/ui-tooltip/v11_7";
27
- import { WithBreakpoints as vr } from "@instructure/platform-with-breakpoints";
28
- import { Modal as wr, ModalHeader as Pr, ModalBody as Ar, ModalFooter as Lr } from "@instructure/ui-modal/v11_7";
29
- import { CheckboxGroup as Xt, Checkbox as pt } from "@instructure/ui-checkbox/v11_7";
30
- import { RadioInputGroup as Rr, RadioInput as Zt } from "@instructure/ui-radio-input/v11_7";
31
- import { TextArea as kr } from "@instructure/ui-text-area/v11_7";
32
- import { List as Jt, ListItem as en } from "@instructure/ui-list/v11_7";
33
- const $n = or(null), Or = () => {
34
- };
35
- function Ql({
36
- host: e,
37
- onEvent: t,
38
- children: n
39
- }) {
40
- const o = k(t);
41
- o.current = t;
42
- const i = F(
43
- () => (s) => o.current({ event: s, host: e }),
44
- [e]
45
- );
46
- return /* @__PURE__ */ r($n.Provider, { value: i, children: n });
47
- }
48
- function Ve() {
49
- return rr($n) ?? Or;
50
- }
51
- function Fn(e) {
1
+ import { w as Ve, I as Sn, M as yn, a as Tn, b as bn, i as ft, c as Pn, v as Ze, h as Cn, o as Ue, m as ne, d as vn, e as Ln, g as wn, f as An, j as Rn, u as x, k as Te, D as kn, l as _e, n as On, p as Xe, q as Je, r as Dn, s as qn, t as zn, x as Nn, y as Ot, z as xn, A as Dt, B as qt, C as $n, E as Un, F as Fn, G as Bn, H as Gn, J as Wn, K as Hn, L as Yn, N as jn, O as Qn, P as Kn, Q as Vn, R as Zn, S as Ie } from "./chunks/ModulesProgressBar-B4fXbi-4.js";
2
+ import { a8 as io, T as ro, U as so, ao as oo, ap as lo, aq as ao, aF as uo, ar as co, as as mo, at as go, au as po, ab as fo, a4 as ho, V as Mo, ad as _o, a7 as Io, aA as Eo, ag as So, ah as yo, X as To, aC as bo, Y as Po, Z as Co, _ as vo, $ as Lo, a1 as wo, a6 as Ao, a0 as Ro, a2 as ko, a3 as Oo, ai as Do, ak as qo, a9 as zo, aE as No, aa as xo, aG as $o, ac as Uo, a5 as Fo, ae as Bo, aw as Go, af as Wo, aB as Ho, ax as Yo, aD as jo, ay as Qo, az as Ko, aj as Vo, W as Zo, al as Xo, am as Jo, av as el, an as tl } from "./chunks/ModulesProgressBar-B4fXbi-4.js";
3
+ import { canvasFetch as ht } from "@instructure/platform-canvas-fetch";
4
+ import { z as Mt } from "zod";
5
+ import { gql as J } from "graphql-tag";
6
+ import { jsx as s, jsxs as m, Fragment as W } from "react/jsx-runtime";
7
+ import { Pill as Xn } from "@instructure/ui-pill/v11_7";
8
+ import { useQueryClient as Jn, QueryClient as ei, QueryClientProvider as ti } from "@tanstack/react-query";
9
+ import { useCallback as U, useMemo as F, useId as ni, memo as ii, useRef as k, useEffect as B, useState as G } from "react";
10
+ import { ScreenReaderContent as zt } from "@instructure/ui-a11y-content";
11
+ import { SimpleSelect as _t } from "@instructure/ui-simple-select/v11_7";
12
+ import { Text as b } from "@instructure/ui-text/v11_7";
13
+ import { IconArrowOpenUpLine as ri, IconArrowOpenDownLine as si, IconClockLine as Nt, IconAiColoredSolid as oi, IconAiSolid as li } from "@instructure/ui-icons";
14
+ import { politeAnnounce as N, getLiveRegion as Se, TruncateWithTooltip as ai } from "@instructure/platform-instui-bindings";
15
+ import { InstUISettingsProvider as ui } from "@instructure/emotion";
16
+ import { Alert as X } from "@instructure/ui-alerts/v11_7";
17
+ import { IconButton as di, CloseButton as ci, Button as z } from "@instructure/ui-buttons/v11_7";
18
+ import { Flex as _ } from "@instructure/ui-flex/v11_7";
19
+ import { Heading as ue } from "@instructure/ui-heading/v11_7";
20
+ import { Link as mi } from "@instructure/ui-link/v11_7";
21
+ import { List as Ge, ListItem as We } from "@instructure/ui-list/v11_7";
22
+ import { Pagination as xt } from "@instructure/ui-pagination/v11_7";
23
+ import { ProgressBar as gi } from "@instructure/ui-progress/v11_7";
24
+ import { Spinner as et } from "@instructure/ui-spinner/v11_7";
25
+ import { Tooltip as pi } from "@instructure/ui-tooltip/v11_7";
26
+ import { View as M } from "@instructure/ui-view/v11_7";
27
+ import { WithBreakpoints as fi } from "@instructure/platform-with-breakpoints";
28
+ import { Modal as hi, ModalHeader as Mi, ModalBody as _i, ModalFooter as Ii } from "@instructure/ui-modal/v11_7";
29
+ import { CheckboxGroup as It, Checkbox as Fe } from "@instructure/ui-checkbox/v11_7";
30
+ import { RadioInputGroup as Ei, RadioInput as Et } from "@instructure/ui-radio-input/v11_7";
31
+ import { TextArea as Si } from "@instructure/ui-text-area/v11_7";
32
+ function $t(e) {
52
33
  return e === "module" ? "module" : "module item";
53
34
  }
54
- class Un extends Error {
55
- constructor(t, n, o) {
35
+ class Ut extends Error {
36
+ constructor(t, n, r) {
56
37
  super(
57
- `Canvas returned ${Fn(t)} ${n} without a usable ${o}. This is a partial response; refusing to guess a value for it.`
58
- ), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = o;
38
+ `Canvas returned ${$t(t)} ${n} without a usable ${r}. This is a partial response; refusing to guess a value for it.`
39
+ ), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = r;
59
40
  }
60
41
  }
61
- function Bn(e, t, n) {
42
+ function Ft(e, t, n) {
62
43
  if (e != null) return e;
63
- throw new Un(t, n, "published");
44
+ throw new Ut(t, n, "published");
64
45
  }
65
- function xr(e, t) {
46
+ function yi(e, t) {
66
47
  if (e.onUnsupportedItem) {
67
48
  e.onUnsupportedItem(t);
68
49
  return;
@@ -71,16 +52,16 @@ function xr(e, t) {
71
52
  `[platform-modules] dropped module item ${t.id}: content type "${t.typename ?? "null"}" is outside the closed ModuleItemType enum. Pass \`onUnsupportedItem\` to handle these yourself.`
72
53
  );
73
54
  }
74
- function Gn(e, t) {
55
+ function Bt(e, t) {
75
56
  if (e.onUnsupportedStatus) {
76
57
  e.onUnsupportedStatus(t);
77
58
  return;
78
59
  }
79
60
  console.warn(
80
- `[platform-modules] ${Fn(t.subject)} ${t.id}: status "${t.value}" is outside the closed status enum and was ignored. Pass \`onUnsupportedStatus\` to handle these yourself.`
61
+ `[platform-modules] ${$t(t.subject)} ${t.id}: status "${t.value}" is outside the closed status enum and was ignored. Pass \`onUnsupportedStatus\` to handle these yourself.`
81
62
  );
82
63
  }
83
- const Dr = /* @__PURE__ */ new Map([
64
+ const Ti = /* @__PURE__ */ new Map([
84
65
  ["Assignment", "assignment"],
85
66
  ["Quiz", "quiz"],
86
67
  ["Discussion", "discussion"],
@@ -92,21 +73,21 @@ const Dr = /* @__PURE__ */ new Map([
92
73
  ["SubHeader", "sub_header"],
93
74
  ["PeerReviewSubAssignment", "assignment"]
94
75
  ]);
95
- function Nr(e) {
76
+ function bi(e) {
96
77
  const t = e == null ? void 0 : e.__typename;
97
78
  if (!t) return null;
98
- const n = Dr.get(t);
79
+ const n = Ti.get(t);
99
80
  return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
100
81
  }
101
- const zr = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
102
- function Wn(e) {
82
+ const Pi = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
83
+ function Gt(e) {
103
84
  if (!e) return null;
104
- const t = zr.exec(e);
85
+ const t = Pi.exec(e);
105
86
  if (!t) return null;
106
- const [, n, o, i, s, l] = t, a = Number(n ?? 0) * 7 * 24 * 60 + Number(o ?? 0) * 24 * 60 + Number(i ?? 0) * 60 + Number(s ?? 0) + Number(l ?? 0) / 60;
107
- return Math.round(a);
87
+ const [, n, r, o, i, l] = t, u = Number(n ?? 0) * 7 * 24 * 60 + Number(r ?? 0) * 24 * 60 + Number(o ?? 0) * 60 + Number(i ?? 0) + Number(l ?? 0) / 60;
88
+ return Math.round(u);
108
89
  }
109
- const qr = /* @__PURE__ */ new Set([
90
+ const Ci = /* @__PURE__ */ new Set([
110
91
  "must_view",
111
92
  "must_mark_done",
112
93
  "must_contribute",
@@ -114,18 +95,18 @@ const qr = /* @__PURE__ */ new Set([
114
95
  "min_score",
115
96
  "min_percentage"
116
97
  ]);
117
- function $r(e) {
118
- return qr.has(e) ? e : "unknown";
98
+ function vi(e) {
99
+ return Ci.has(e) ? e : "unknown";
119
100
  }
120
- function Fr(e) {
101
+ function Li(e) {
121
102
  return {
122
103
  itemId: String(e.id),
123
- type: $r(e.type),
104
+ type: vi(e.type),
124
105
  minScore: e.minScore ?? null,
125
106
  minPercentage: e.minPercentage ?? null
126
107
  };
127
108
  }
128
- function Hn(e) {
109
+ function Wt(e) {
129
110
  return {
130
111
  hasNextPage: (e == null ? void 0 : e.hasNextPage) ?? !1,
131
112
  endCursor: (e == null ? void 0 : e.endCursor) ?? null,
@@ -135,36 +116,36 @@ function Hn(e) {
135
116
  totalNrOfPages: (e == null ? void 0 : e.totalNrOfPages) ?? null
136
117
  };
137
118
  }
138
- const Ur = /* @__PURE__ */ new Set(["min_score", "min_percentage"]);
139
- function Br(e) {
119
+ const wi = /* @__PURE__ */ new Set(["min_score", "min_percentage"]);
120
+ function Ai(e) {
140
121
  var t;
141
122
  for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
142
123
  if (n) return n;
143
124
  return null;
144
125
  }
145
- function Kn(e, t) {
126
+ function Ht(e, t) {
146
127
  if (!e) return;
147
- const n = new Map(t.map((s) => [s.itemId, s.type])), o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
148
- for (const s of e.requirementsMet ?? []) {
149
- if (!s) continue;
150
- const l = String(s.id);
151
- n.get(l) === s.type && o.add(l);
128
+ const n = new Map(t.map((i) => [i.itemId, i.type])), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
129
+ for (const i of e.requirementsMet ?? []) {
130
+ if (!i) continue;
131
+ const l = String(i.id);
132
+ n.get(l) === i.type && r.add(l);
152
133
  }
153
- for (const s of e.incompleteRequirements ?? []) {
154
- if (!s) continue;
155
- const l = String(s.id);
156
- n.get(l) === s.type && Ur.has(s.type) && i.set(l, s.score ?? null);
134
+ for (const i of e.incompleteRequirements ?? []) {
135
+ if (!i) continue;
136
+ const l = String(i.id);
137
+ n.get(l) === i.type && wi.has(i.type) && o.set(l, i.score ?? null);
157
138
  }
158
139
  return {
159
140
  locked: e.locked === !0 || e.workflowState === "locked",
160
141
  workflowState: e.workflowState ?? null,
161
142
  completed: e.completed === !0 || e.workflowState === "completed",
162
143
  started: e.started === !0 || e.workflowState === "started",
163
- requirementsMetItemIds: o,
164
- incompleteRequirementScores: i
144
+ requirementsMetItemIds: r,
145
+ incompleteRequirementScores: o
165
146
  };
166
147
  }
167
- const Gr = /* @__PURE__ */ new Map([
148
+ const Ri = /* @__PURE__ */ new Map([
168
149
  ["LOCKED", "locked"],
169
150
  ["MISSING", "missing"],
170
151
  ["INCOMPLETE", "incomplete"],
@@ -172,16 +153,16 @@ const Gr = /* @__PURE__ */ new Map([
172
153
  ["IN_PROGRESS", "in_progress"],
173
154
  ["NOT_STARTED", "not_started"]
174
155
  ]);
175
- function Wr(e, t, n) {
156
+ function ki(e, t, n) {
176
157
  if (e == null) return;
177
- const o = Gr.get(e);
178
- return o || Gn(n, {
158
+ const r = Ri.get(e);
159
+ return r || Bt(n, {
179
160
  subject: "moduleItem",
180
161
  id: String(t),
181
162
  value: e
182
- }), o;
163
+ }), r;
183
164
  }
184
- const Hr = /* @__PURE__ */ new Map([
165
+ const Oi = /* @__PURE__ */ new Map([
185
166
  ["LOCKED", "locked"],
186
167
  ["MISSING", "missing"],
187
168
  ["MISSING_AND_INCOMPLETE", "missing_and_incomplete"],
@@ -190,122 +171,122 @@ const Hr = /* @__PURE__ */ new Map([
190
171
  ["IN_PROGRESS", "in_progress"],
191
172
  ["NOT_STARTED", "not_started"]
192
173
  ]);
193
- function Kr(e, t, n) {
174
+ function Di(e, t, n) {
194
175
  if (e == null) return;
195
- const o = Hr.get(e);
196
- return o || Gn(n, { subject: "module", id: String(t), value: e }), o;
176
+ const r = Oi.get(e);
177
+ return r || Bt(n, { subject: "module", id: String(t), value: e }), r;
197
178
  }
198
- function jr(e, t, n, o = {}) {
199
- var c, u;
179
+ function qi(e, t, n, r = {}) {
180
+ var a, d;
200
181
  if (!n) return;
201
- const i = e.requirementCount ?? t.length, s = Math.min(n.requirementsMetItemIds.size, i), l = ((c = e.submissionStatistics) == null ? void 0 : c.missingAssignmentCount) ?? 0, a = [...n.incompleteRequirementScores.values()].filter(
202
- (d) => d != null
182
+ const o = e.requirementCount ?? t.length, i = Math.min(n.requirementsMetItemIds.size, o), l = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0, u = [...n.incompleteRequirementScores.values()].filter(
183
+ (g) => g != null
203
184
  ).length;
204
185
  return {
205
- status: Kr(e.moduleStatus, e._id, o) ?? (n.locked ? "locked" : void 0),
206
- requirementsMet: s,
207
- requirementCount: i,
208
- percentComplete: i > 0 ? Math.round(s / i * 100) : 0,
209
- nextDueAt: ((u = e.submissionStatistics) == null ? void 0 : u.nextDueAt) ?? null,
186
+ status: Di(e.moduleStatus, e._id, r) ?? (n.locked ? "locked" : void 0),
187
+ requirementsMet: i,
188
+ requirementCount: o,
189
+ percentComplete: o > 0 ? Math.round(i / o * 100) : 0,
190
+ nextDueAt: ((d = e.submissionStatistics) == null ? void 0 : d.nextDueAt) ?? null,
210
191
  missingCount: l,
211
- incompleteCount: a
192
+ incompleteCount: u
212
193
  };
213
194
  }
214
- function Yr(e, t, n, o = {}, i) {
215
- var u, d, m;
216
- const s = String(e._id), l = Nr(e.content);
195
+ function zi(e, t, n, r = {}, o) {
196
+ var d, g, p;
197
+ const i = String(e._id), l = bi(e.content);
217
198
  if (!l)
218
- return xr(o, { id: s, typename: ((u = e.content) == null ? void 0 : u.__typename) ?? null }), null;
219
- const a = Br(e.content), c = n.get(s) ?? null;
199
+ return yi(r, { id: i, typename: ((d = e.content) == null ? void 0 : d.__typename) ?? null }), null;
200
+ const u = Ai(e.content), a = n.get(i) ?? null;
220
201
  return {
221
- id: s,
202
+ id: i,
222
203
  moduleId: t,
223
204
  title: e.title ?? "",
224
205
  type: l,
225
206
  position: e.position ?? 0,
226
207
  indent: e.indent ?? 0,
227
- published: Bn(e.published, "moduleItem", s),
208
+ published: Ft(e.published, "moduleItem", i),
228
209
  url: e.url ?? null,
229
210
  newTab: e.newTab ?? !1,
230
- completionRequirement: c,
231
- dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((d = e.content) == null ? void 0 : d.dueAt) ?? null,
232
- status: i ? Wr(e.moduleItemStatus, s, o) ?? (i.locked ? "locked" : void 0) : void 0,
233
- pointsPossible: ((m = e.content) == null ? void 0 : m.pointsPossible) ?? null,
234
- extensions: vt(
211
+ completionRequirement: a,
212
+ dueAt: (u == null ? void 0 : u.cachedDueDate) ?? ((g = e.content) == null ? void 0 : g.dueAt) ?? null,
213
+ status: o ? ki(e.moduleItemStatus, i, r) ?? (o.locked ? "locked" : void 0) : void 0,
214
+ pointsPossible: ((p = e.content) == null ? void 0 : p.pointsPossible) ?? null,
215
+ extensions: Ve(
235
216
  void 0,
236
- Wn(e.estimatedDuration)
217
+ Gt(e.estimatedDuration)
237
218
  )
238
219
  };
239
220
  }
240
- function jn(e, t, n, o, i) {
241
- const s = [];
221
+ function Yt(e, t, n, r, o) {
222
+ const i = [];
242
223
  for (const l of e ?? []) {
243
224
  if (!l) continue;
244
- const a = Yr(
225
+ const u = zi(
245
226
  l,
246
227
  t,
247
228
  n,
248
- o,
249
- i
229
+ r,
230
+ o
250
231
  );
251
- a && s.push(a);
232
+ u && i.push(u);
252
233
  }
253
- return s;
234
+ return i;
254
235
  }
255
- function Yn(e) {
236
+ function jt(e) {
256
237
  const t = [], n = /* @__PURE__ */ new Map();
257
- for (const o of e ?? []) {
258
- if (!o) continue;
259
- const i = Fr(o);
260
- t.push(i), n.set(i.itemId, i);
238
+ for (const r of e ?? []) {
239
+ if (!r) continue;
240
+ const o = Li(r);
241
+ t.push(o), n.set(o.itemId, o);
261
242
  }
262
243
  return { list: t, byItemId: n };
263
244
  }
264
- function Vr(e, t = {}) {
265
- var u, d;
245
+ function Ni(e, t = {}) {
246
+ var d, g;
266
247
  const n = String(e._id);
267
248
  if (e.moduleItemsTotalCount == null)
268
- throw new Un("module", n, "moduleItemsTotalCount");
269
- const { list: o, byItemId: i } = Yn(e.completionRequirements), s = e.moduleItemsConnection, l = s != null && !((u = s.pageInfo) != null && u.hasNextPage), a = Kn(e.progression, o), c = l ? jn(s.nodes, n, i, t, a) : void 0;
249
+ throw new Ut("module", n, "moduleItemsTotalCount");
250
+ const { list: r, byItemId: o } = jt(e.completionRequirements), i = e.moduleItemsConnection, l = i != null && !((d = i.pageInfo) != null && d.hasNextPage), u = Ht(e.progression, r), a = l ? Yt(i.nodes, n, o, t, u) : void 0;
270
251
  return {
271
252
  id: n,
272
253
  name: e.name ?? "",
273
254
  position: e.position ?? 0,
274
- published: Bn(e.published, "module", n),
255
+ published: Ft(e.published, "module", n),
275
256
  itemCount: e.moduleItemsTotalCount,
276
- items: c,
277
- estimatedDurationMinutes: Wn(e.estimatedDuration) || void 0,
257
+ items: a,
258
+ estimatedDurationMinutes: Gt(e.estimatedDuration) || void 0,
278
259
  unlockAt: e.unlockAt ?? null,
279
260
  prerequisiteModules: (e.prerequisites ?? []).filter(
280
- (m) => m != null
281
- ).map((m) => ({ id: String(m.id), name: m.name ?? "" })),
261
+ (p) => p != null
262
+ ).map((p) => ({ id: String(p.id), name: p.name ?? "" })),
282
263
  requirementCount: e.requirementCount ?? null,
283
264
  requireSequentialProgress: e.requireSequentialProgress ?? !1,
284
- completionRequirements: o,
285
- progress: jr(e, o, a, t),
286
- collapsed: ((d = e.progression) == null ? void 0 : d.collapsed) ?? null
265
+ completionRequirements: r,
266
+ progress: qi(e, r, u, t),
267
+ collapsed: ((g = e.progression) == null ? void 0 : g.collapsed) ?? null
287
268
  };
288
269
  }
289
- function Qr(e, t = {}) {
290
- var i;
291
- const n = (i = e == null ? void 0 : e.legacyNode) == null ? void 0 : i.modulesConnection, o = [];
292
- for (const s of (n == null ? void 0 : n.nodes) ?? [])
293
- s && o.push(Vr(s, t));
294
- return { modules: o, pageInfo: Hn(n == null ? void 0 : n.pageInfo) };
270
+ function xi(e, t = {}) {
271
+ var o;
272
+ const n = (o = e == null ? void 0 : e.legacyNode) == null ? void 0 : o.modulesConnection, r = [];
273
+ for (const i of (n == null ? void 0 : n.nodes) ?? [])
274
+ i && r.push(Ni(i, t));
275
+ return { modules: r, pageInfo: Wt(n == null ? void 0 : n.pageInfo) };
295
276
  }
296
- function Xr(e, t, n = {}) {
297
- const o = e == null ? void 0 : e.legacyNode, { list: i, byItemId: s } = Yn(o == null ? void 0 : o.completionRequirements), l = o == null ? void 0 : o.moduleItemsConnection, a = Kn(o == null ? void 0 : o.progression, i);
277
+ function $i(e, t, n = {}) {
278
+ const r = e == null ? void 0 : e.legacyNode, { list: o, byItemId: i } = jt(r == null ? void 0 : r.completionRequirements), l = r == null ? void 0 : r.moduleItemsConnection, u = Ht(r == null ? void 0 : r.progression, o);
298
279
  return {
299
- items: jn(l == null ? void 0 : l.nodes, t, s, n, a),
300
- pageInfo: Hn(l == null ? void 0 : l.pageInfo)
280
+ items: Yt(l == null ? void 0 : l.nodes, t, i, n, u),
281
+ pageInfo: Wt(l == null ? void 0 : l.pageInfo)
301
282
  };
302
283
  }
303
- const Zr = we`
284
+ const Ui = J`
304
285
  fragment PlatformModulesSubmissionFields on Submission {
305
286
  _id
306
287
  cachedDueDate
307
288
  }
308
- `, Vn = we`
289
+ `, Qt = J`
309
290
  fragment PlatformModulesItemFields on ModuleItem {
310
291
  _id
311
292
  title
@@ -353,8 +334,8 @@ const Zr = we`
353
334
  }
354
335
  }
355
336
  }
356
- ${Zr}
357
- `, Qn = we`
337
+ ${Ui}
338
+ `, Kt = J`
358
339
  fragment PlatformModulesProgressionFields on ModuleProgression {
359
340
  workflowState
360
341
  completed
@@ -374,14 +355,74 @@ const Zr = we`
374
355
  score
375
356
  }
376
357
  }
377
- `, Jr = we`
358
+ `, Vt = J`
359
+ fragment PlatformModulesModuleFields on Module {
360
+ _id
361
+ name
362
+ position
363
+ published
364
+ unlockAt
365
+ moduleItemsTotalCount
366
+ estimatedDuration @include(if: $includeEstimatedDuration)
367
+ moduleStatus
368
+ requirementCount
369
+ requireSequentialProgress
370
+ prerequisites {
371
+ id
372
+ name
373
+ }
374
+ completionRequirements {
375
+ id
376
+ type
377
+ minScore
378
+ minPercentage
379
+ }
380
+ progression {
381
+ collapsed
382
+ ...PlatformModulesProgressionFields
383
+ }
384
+ submissionStatistics {
385
+ nextDueAt
386
+ missingAssignmentCount
387
+ }
388
+ }
389
+ ${Kt}
390
+ `, Fi = J`
378
391
  query PlatformModulesGetModules(
379
392
  $courseId: ID!
380
393
  $first: Int
381
394
  $after: String
382
395
  $before: String
383
396
  $last: Int
384
- $includeItems: Boolean!
397
+ $includeEstimatedDuration: Boolean!
398
+ $filter: ModuleFilterInput
399
+ ) {
400
+ legacyNode(_id: $courseId, type: Course) {
401
+ ... on Course {
402
+ modulesConnection(first: $first, after: $after, before: $before, last: $last, filter: $filter) {
403
+ nodes {
404
+ ...PlatformModulesModuleFields
405
+ }
406
+ pageInfo {
407
+ hasNextPage
408
+ hasPreviousPage
409
+ endCursor
410
+ startCursor
411
+ totalCount
412
+ totalNrOfPages
413
+ }
414
+ }
415
+ }
416
+ }
417
+ }
418
+ ${Vt}
419
+ `, Bi = J`
420
+ query PlatformModulesGetModulesWithItems(
421
+ $courseId: ID!
422
+ $first: Int
423
+ $after: String
424
+ $before: String
425
+ $last: Int
385
426
  $itemsFirst: Int!
386
427
  $includeSubmissions: Boolean!
387
428
  $includeEstimatedDuration: Boolean!
@@ -392,35 +433,8 @@ const Zr = we`
392
433
  ... on Course {
393
434
  modulesConnection(first: $first, after: $after, before: $before, last: $last, filter: $filter) {
394
435
  nodes {
395
- _id
396
- name
397
- position
398
- published
399
- unlockAt
400
- moduleItemsTotalCount
401
- estimatedDuration @include(if: $includeEstimatedDuration)
402
- moduleStatus
403
- requirementCount
404
- requireSequentialProgress
405
- prerequisites {
406
- id
407
- name
408
- }
409
- completionRequirements {
410
- id
411
- type
412
- minScore
413
- minPercentage
414
- }
415
- progression {
416
- collapsed
417
- ...PlatformModulesProgressionFields
418
- }
419
- submissionStatistics {
420
- nextDueAt
421
- missingAssignmentCount
422
- }
423
- moduleItemsConnection(first: $itemsFirst) @include(if: $includeItems) {
436
+ ...PlatformModulesModuleFields
437
+ moduleItemsConnection(first: $itemsFirst) {
424
438
  nodes {
425
439
  ...PlatformModulesItemFields
426
440
  }
@@ -442,9 +456,9 @@ const Zr = we`
442
456
  }
443
457
  }
444
458
  }
445
- ${Vn}
446
- ${Qn}
447
- `, ei = we`
459
+ ${Vt}
460
+ ${Qt}
461
+ `, Gi = J`
448
462
  query PlatformModulesGetModuleItems(
449
463
  $moduleId: ID!
450
464
  $first: Int
@@ -482,27 +496,27 @@ const Zr = we`
482
496
  }
483
497
  }
484
498
  }
485
- ${Vn}
486
- ${Qn}
499
+ ${Qt}
500
+ ${Kt}
487
501
  `;
488
- function Xn() {
502
+ function Zt() {
489
503
  return new DOMException("The operation was aborted.", "AbortError");
490
504
  }
491
- function Ue(e) {
492
- if (e != null && e.aborted) throw Xn();
505
+ function Ee(e) {
506
+ if (e != null && e.aborted) throw Zt();
493
507
  }
494
- function tn(e, t) {
495
- return t ? new Promise((n, o) => {
496
- const i = () => o(Xn());
497
- t.addEventListener("abort", i, { once: !0 }), e.then(n, o).finally(() => t.removeEventListener("abort", i));
508
+ function St(e, t) {
509
+ return t ? new Promise((n, r) => {
510
+ const o = () => r(Zt());
511
+ t.addEventListener("abort", o, { once: !0 }), e.then(n, r).finally(() => t.removeEventListener("abort", o));
498
512
  }) : e;
499
513
  }
500
- const nn = [
514
+ const yt = [
501
515
  "COMPLETED",
502
516
  "INCOMPLETE",
503
517
  "IN_PROGRESS",
504
518
  "NOT_STARTED"
505
- ], on = /* @__PURE__ */ new Map([
519
+ ], Tt = /* @__PURE__ */ new Map([
506
520
  ["locked", ["LOCKED"]],
507
521
  ["missing", ["MISSING"]],
508
522
  ["missing_and_incomplete", ["MISSING_AND_INCOMPLETE"]],
@@ -510,24 +524,24 @@ const nn = [
510
524
  ["complete", ["COMPLETE"]],
511
525
  ["in_progress", ["IN_PROGRESS"]],
512
526
  ["not_started", ["NOT_STARTED"]]
513
- ]), ti = {
527
+ ]), Wi = {
514
528
  module: { completionStatus: ["eq"], moduleStatus: ["eq"], dueWithinDays: ["within"] }
515
529
  };
516
- function ni(e, t) {
530
+ function Hi(e, t) {
517
531
  if (!e) return null;
518
532
  if (e.target === "module" && e.field === "completionStatus" && e.op === "eq") {
519
533
  const n = e.value;
520
- if (!nn.includes(n))
534
+ if (!yt.includes(n))
521
535
  throw new Error(
522
- `"${e.value}" is not a ModuleCompletionStatus (${nn.join(", ")}).`
536
+ `"${e.value}" is not a ModuleCompletionStatus (${yt.join(", ")}).`
523
537
  );
524
538
  return { completionStatus: n };
525
539
  }
526
540
  if (e.target === "module" && e.field === "moduleStatus" && e.op === "eq") {
527
- const n = typeof e.value == "string" ? on.get(e.value) : void 0;
541
+ const n = typeof e.value == "string" ? Tt.get(e.value) : void 0;
528
542
  if (!n)
529
543
  throw new Error(
530
- `"${String(e.value)}" is not a ModuleStatus (${[...on.keys()].join(", ")}).`
544
+ `"${String(e.value)}" is not a ModuleStatus (${[...Tt.keys()].join(", ")}).`
531
545
  );
532
546
  return { moduleStatus: n };
533
547
  }
@@ -540,881 +554,332 @@ function ni(e, t) {
540
554
  `Canvas GraphQL cannot serve ${e.target}.${e.field} "${e.op}". It compiles module.completionStatus eq, module.moduleStatus eq and module.dueWithinDays within.`
541
555
  );
542
556
  }
543
- function rn(e, t, n) {
557
+ function Be(e, t, n) {
544
558
  return e.kind === "before" ? { first: null, after: null, before: e.cursor, last: n } : e.kind === "last" ? { first: null, after: null, before: null, last: e.count } : { first: t, after: e.kind === "after" ? e.cursor : null, before: null, last: null };
545
559
  }
546
- function Xl({
560
+ function Bs({
547
561
  executeQuery: e,
548
- inlineItemLimit: t = xo,
549
- nodeBudget: n = Ro,
550
- onUnsupportedItem: o,
551
- onUnsupportedStatus: i,
552
- studentId: s,
562
+ inlineItemLimit: t = bn,
563
+ nodeBudget: n = Sn,
564
+ onUnsupportedItem: r,
565
+ onUnsupportedStatus: o,
566
+ studentId: i,
553
567
  validate: l = !0,
554
- capabilities: a = ti,
555
- includeEstimatedDuration: c = !1
568
+ capabilities: u = Wi,
569
+ includeEstimatedDuration: a = !1
556
570
  }) {
557
- const u = s != null, d = { onUnsupportedItem: o, onUnsupportedStatus: i };
571
+ const d = i != null, g = { onUnsupportedItem: r, onUnsupportedStatus: o };
558
572
  return {
559
573
  inlineNodeBudget: n,
560
- capabilities: a,
574
+ capabilities: u,
561
575
  async listModules({
562
- courseId: m,
563
- page: p = { kind: "first" },
564
- pageSize: h,
565
- includeItems: _,
566
- filter: A,
567
- dueRange: v,
568
- inlineItemsFirst: z,
569
- inlineFirst: U,
570
- signal: M
576
+ courseId: p,
577
+ page: h = { kind: "first" },
578
+ pageSize: f,
579
+ includeItems: I,
580
+ filter: v,
581
+ dueRange: L,
582
+ inlineItemsFirst: $,
583
+ inlineFirst: O,
584
+ signal: S
571
585
  }) {
572
- Ue(M);
573
- const L = _ ? Math.min(U ?? h, h) : h, J = Math.min(z ?? t, t), X = Math.max(1, Math.min(J, Math.floor(n / L))), C = rn(p, L, h), R = await tn(
574
- e(Jr, {
575
- courseId: m,
576
- ...C,
577
- includeItems: _,
578
- itemsFirst: X,
579
- includeSubmissions: u,
580
- includeEstimatedDuration: c,
581
- studentId: s ?? null,
582
- filter: ni(A, v)
583
- }),
584
- M
585
- );
586
- Ue(M);
587
- const B = Qr(R, d);
588
- return l ? Oo.parse(B) : B;
586
+ Ee(S);
587
+ const C = Hi(v, L);
588
+ let Y;
589
+ if (I) {
590
+ const w = Math.min(O ?? f, f), H = Math.min($ ?? t, t), A = Math.max(1, Math.min(H, Math.floor(n / w)));
591
+ Y = e(
592
+ Bi,
593
+ {
594
+ courseId: p,
595
+ ...Be(h, w, f),
596
+ itemsFirst: A,
597
+ includeSubmissions: d,
598
+ includeEstimatedDuration: a,
599
+ studentId: i ?? null,
600
+ filter: C
601
+ }
602
+ );
603
+ } else
604
+ Y = e(Fi, {
605
+ courseId: p,
606
+ ...Be(h, f, f),
607
+ includeEstimatedDuration: a,
608
+ filter: C
609
+ });
610
+ const j = await St(Y, S);
611
+ Ee(S);
612
+ const T = xi(j, g);
613
+ return l ? Tn.parse(T) : T;
589
614
  },
590
615
  async listModuleItems({
591
- moduleId: m,
592
- page: p = { kind: "first" },
593
- pageSize: h,
594
- signal: _
616
+ moduleId: p,
617
+ page: h = { kind: "first" },
618
+ pageSize: f,
619
+ signal: I
595
620
  }) {
596
- Ue(_);
597
- const A = await tn(
598
- e(ei, {
599
- moduleId: m,
600
- ...rn(p, h, h),
601
- includeSubmissions: u,
602
- includeEstimatedDuration: c,
603
- studentId: s ?? null
621
+ Ee(I);
622
+ const v = await St(
623
+ e(Gi, {
624
+ moduleId: p,
625
+ ...Be(h, f, f),
626
+ includeSubmissions: d,
627
+ includeEstimatedDuration: a,
628
+ studentId: i ?? null
604
629
  }),
605
- _
630
+ I
606
631
  );
607
- Ue(_);
608
- const v = Xr(A, m, d);
609
- return l ? ko.parse(v) : v;
632
+ Ee(I);
633
+ const L = $i(v, p, g);
634
+ return l ? yn.parse(L) : L;
610
635
  },
611
636
  async setModuleCollapsed({
612
- courseId: m,
613
- moduleId: p,
614
- collapsed: h,
615
- signal: _
637
+ courseId: p,
638
+ moduleId: h,
639
+ collapsed: f,
640
+ signal: I
616
641
  }) {
617
- await Vt(
642
+ await ht(
618
643
  {
619
- path: `/courses/${m}/modules/${p}/collapse`,
644
+ path: `/courses/${p}/modules/${h}/collapse`,
620
645
  method: "POST",
621
- body: { collapse: h },
622
- signal: _
646
+ body: { collapse: f },
647
+ signal: I
623
648
  },
624
- b.unknown()
649
+ Mt.unknown()
625
650
  );
626
651
  },
627
652
  async setAllModulesCollapsed({
628
- courseId: m,
629
- collapsed: p,
630
- signal: h
653
+ courseId: p,
654
+ collapsed: h,
655
+ signal: f
631
656
  }) {
632
- await Vt(
657
+ await ht(
633
658
  {
634
- path: `/courses/${m}/collapse_all_modules`,
659
+ path: `/courses/${p}/collapse_all_modules`,
635
660
  method: "POST",
636
- params: { collapse: p ? 1 : 0 },
637
- signal: h
661
+ params: { collapse: h ? 1 : 0 },
662
+ signal: f
638
663
  },
639
- b.unknown()
664
+ Mt.unknown()
640
665
  );
641
666
  }
642
667
  };
643
668
  }
644
- const Zl = 1e3;
645
- function oi({
669
+ const Gs = 1e3;
670
+ function Yi({
646
671
  queryClient: e,
647
672
  courseId: t,
648
673
  module: n,
649
- item: o
674
+ item: r
650
675
  }) {
651
676
  return {
652
677
  module: n,
653
- item: o,
654
- invalidateModuleItems: async (i) => {
678
+ item: r,
679
+ invalidateModuleItems: async (o) => {
655
680
  await Promise.all([
656
- Do(e, t, i),
657
- Yt(e, t)
681
+ Pn(e, t, o),
682
+ ft(e, t)
658
683
  ]);
659
684
  },
660
- invalidateModuleList: () => Yt(e, t)
685
+ invalidateModuleList: () => ft(e, t)
661
686
  };
662
687
  }
663
- function Jl(e, t) {
664
- return je(e).filter(
688
+ function Ws(e, t) {
689
+ return Ze(e).filter(
665
690
  (n) => n.visible == null || n.visible(t) === !0
666
691
  );
667
692
  }
668
- const Pe = b.object({
669
- label: b.string(),
670
- order: b.number(),
671
- hidden: b.boolean().optional()
672
- });
673
- function ge(e) {
674
- return b.record(b.string(), e);
675
- }
676
- const ri = ge(Pe.strict()), Ot = (e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "bigint" || typeof e == "boolean" || wt(e) || Array.isArray(e) && e.every(Ot), Zn = (e) => {
677
- var t;
678
- return e == null || typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
679
- }, ii = Pe.extend({
680
- icon: b.custom(Ot, { message: "icon must be a ReactNode" }),
681
- renderIcon: b.custom(Zn, {
682
- message: "renderIcon must be a function of the item, not a React component"
683
- })
684
- }).strict(), Jn = (e) => {
685
- var t;
686
- return typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
687
- }, sn = (e) => e == null || Jn(e), ln = Pe.extend({
688
- onSelect: b.custom(Jn, {
689
- message: "onSelect must be a function taking an ActionContext"
690
- }),
691
- visible: b.custom(sn, {
692
- message: "visible must be a function taking an ActionContext, not a React component"
693
- }),
694
- renderModal: b.custom(sn, {
695
- message: "renderModal must be a function taking an ActionContext, not a React component"
696
- })
697
- }).strict();
698
- function Be() {
699
- return b.custom((e) => typeof e == "function", {
700
- message: "Expected a function"
701
- });
702
- }
703
- const si = Pe.extend({
704
- render: b.custom((e) => typeof e == "function", {
705
- message: "render must be a function taking a MetaFieldContext"
706
- }),
707
- icon: b.custom(Ot, { message: "icon must be a ReactNode" }),
708
- renderIcon: b.custom(Zn, {
709
- message: "renderIcon must be a function of the field context, not a React component"
710
- })
711
- }).strict(), li = Pe.extend({
712
- predicate: b.custom((e) => typeof e == "function", {
713
- message: "predicate must be a function of the module and a FilterContext"
714
- }),
715
- query: No.optional(),
716
- unfiltered: b.boolean().optional()
717
- }).strict(), Me = () => b.custom((e) => typeof e == "function", { message: "Expected a function" }).optional(), ai = b.object({
718
- getItemHref: Me(),
719
- getItemEditHref: Me(),
720
- getModuleHref: Me(),
721
- onItemClick: Me()
722
- }).strict(), ci = b.object({
723
- createModule: b.boolean().optional(),
724
- updateModule: b.boolean().optional(),
725
- deleteModule: b.boolean().optional(),
726
- reorderModules: b.boolean().optional(),
727
- setModulesPublished: b.boolean().optional(),
728
- createModuleItem: b.boolean().optional(),
729
- updateModuleItem: b.boolean().optional(),
730
- deleteModuleItem: b.boolean().optional(),
731
- reorderModuleItems: b.boolean().optional()
732
- }).strict(), ui = b.object({
733
- formatters: b.object({
734
- moduleLabel: Be(),
735
- dateTime: Be(),
736
- points: Be(),
737
- progress: Be()
738
- }).strict(),
739
- itemTypes: ge(ii),
740
- itemStatuses: ri,
741
- itemMeta: ge(si),
742
- filters: ge(li),
743
- moduleActions: ge(ln),
744
- itemActions: ge(ln),
745
- navigation: ai,
746
- permissions: ci,
747
- notify: Me()
748
- });
749
- function eo(e, t = {}) {
750
- const n = Object.keys(t).filter((i) => !zo(e, i));
693
+ function Xt(e, t = {}) {
694
+ const n = Object.keys(t).filter((o) => !Cn(e, o));
751
695
  if (n.length > 0)
752
696
  throw new Error(
753
697
  `Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
754
698
  );
755
- const o = {
756
- formatters: gt(e.formatters, t.formatters),
757
- itemTypes: me(e.itemTypes, t.itemTypes),
758
- itemStatuses: me(e.itemStatuses, t.itemStatuses),
759
- itemMeta: me(e.itemMeta, t.itemMeta),
760
- filters: me(e.filters, t.filters),
761
- moduleActions: me(e.moduleActions, t.moduleActions),
762
- itemActions: me(e.itemActions, t.itemActions),
763
- navigation: gt(e.navigation, t.navigation),
764
- permissions: gt(e.permissions, t.permissions),
699
+ const r = {
700
+ formatters: Ue(e.formatters, t.formatters),
701
+ itemTypes: ne(e.itemTypes, t.itemTypes),
702
+ itemStatuses: ne(e.itemStatuses, t.itemStatuses),
703
+ itemMeta: ne(e.itemMeta, t.itemMeta),
704
+ filters: ne(e.filters, t.filters),
705
+ moduleActions: ne(e.moduleActions, t.moduleActions),
706
+ itemActions: ne(e.itemActions, t.itemActions),
707
+ navigation: Ue(e.navigation, t.navigation),
708
+ permissions: Ue(e.permissions, t.permissions),
765
709
  notify: t.notify ?? e.notify
766
710
  };
767
- return ui.parse(o), o;
711
+ return vn.parse(r), r;
768
712
  }
769
- const di = "organizeNewPlacement", mi = {
713
+ const ji = "organizeNewPlacement", Qi = {
770
714
  label: "metaFieldNewPlacementLabel",
771
715
  order: 5,
772
- render: ({ item: e, t }) => Fo(e) ? /* @__PURE__ */ r(kn, { color: "success", children: t("organizeNewItemPill") }) : null
773
- }, gi = (e) => Object.fromEntries(Object.keys(e).map((t) => [t, { hidden: !0 }])), pi = (e) => eo(e, {
774
- itemMeta: { [di]: mi },
775
- filters: gi(e.filters),
716
+ render: ({ item: e, t }) => An(e) ? /* @__PURE__ */ s(Xn, { color: "success", children: t("organizeNewItemPill") }) : null
717
+ }, Ki = (e) => Object.fromEntries(Object.keys(e).map((t) => [t, { hidden: !0 }])), Vi = (e) => Xt(e, {
718
+ itemMeta: { [ji]: Qi },
719
+ filters: Ki(e.filters),
776
720
  formatters: {
777
- moduleLabel: (t, n, { t: o }) => {
778
- if (qo(n)) return o("organizeNewModuleLabel");
779
- const i = $o(n);
780
- return i === 0 ? null : o("organizeItemsAddedLabel", { count: i });
721
+ moduleLabel: (t, n, { t: r }) => {
722
+ if (Ln(n)) return r("organizeNewModuleLabel");
723
+ const o = wn(n);
724
+ return o === 0 ? null : r("organizeItemsAddedLabel", { count: o });
781
725
  }
782
726
  }
783
727
  });
784
- function ea(e = {}) {
785
- return eo(Uo, e);
728
+ function Hs(e = {}) {
729
+ return Xt(Rn, e);
786
730
  }
787
- function ta(e) {
788
- const t = lr();
789
- return V(
790
- (n, o) => oi({ queryClient: t, courseId: e, module: n, item: o }),
731
+ function Ys(e) {
732
+ const t = Jn();
733
+ return U(
734
+ (n, r) => Yi({ queryClient: t, courseId: e, module: n, item: r }),
791
735
  [t, e]
792
736
  );
793
737
  }
794
- function Ae() {
795
- const { formatters: e } = _e(), { t, locale: n, timezone: o } = P();
796
- return F(() => {
797
- const i = { t, locale: n, timezone: o }, s = (l, a) => e.dateTime(l, a, i);
798
- return {
799
- moduleLabel: (l, a) => e.moduleLabel(l, a, i) || null,
800
- dueByline: (l, a) => t("dueByline", { when: s(l, a) }),
801
- pastDueByline: (l, a) => t("pastDueByline", { when: s(l, a) }),
802
- unlockByline: (l, a) => t("unlockByline", { when: s(l, a) }),
803
- unlockedByline: (l, a) => t("unlockedByline", { when: s(l, a) }),
804
- estimatedDurationByline: (l) => Go(t, l),
805
- remainingDurationByline: (l) => Bo(t, l),
806
- points: (l) => e.points(l, i),
807
- progress: (l, a, c) => e.progress(l, a, c, i)
808
- };
809
- }, [e, t, n, o]);
810
- }
811
- const fi = 20, hi = 4.5, an = 7, Ii = 5, _i = 20, to = "#000000", no = "#FFFFFF", oo = {
812
- primary: { semantic: "base", textKey: "baseTextColor", borderKey: "baseBorderColor" },
813
- info: { semantic: "info", textKey: "infoTextColor", borderKey: "infoBorderColor" },
814
- success: { semantic: "success", textKey: "successTextColor", borderKey: "successBorderColor" },
815
- warning: { semantic: "warning", textKey: "warningTextColor", borderKey: "warningBorderColor" }
816
- }, Ei = {
817
- card: {
818
- primary: { fill: "#E8EAEC", stroke: "#8D959F", text: "#273540" },
819
- info: { fill: "#D5E4F2", stroke: "#2B7ABC", text: "#23649A" },
820
- success: { fill: "#CDE7D8", stroke: "#03893D", text: "#02642C" },
821
- warning: { fill: "#F5DBCC", stroke: "#CF4A00", text: "#A13900" }
822
- },
823
- row: {
824
- primary: { fill: "#DEE1E4", stroke: "#8D959F", text: "#273540" },
825
- info: { fill: "#CADCEA", stroke: "#2B7ABC", text: "#1E5685" },
826
- success: { fill: "#C2DFD0", stroke: "#03893D", text: "#02642C" },
827
- warning: { fill: "#EBD2C4", stroke: "#CF4A00", text: "#A13900" }
828
- }
829
- };
830
- function yi(e, t) {
831
- const n = Er(
832
- It(e),
833
- It(yr(t, fi))
834
- );
835
- return Nn(n);
836
- }
837
- function bi(e, t, n) {
838
- const o = le(n, t) >= an ? an : hi;
839
- return Math.min(o, Math.max(le(e, to), le(e, no)));
840
- }
841
- function Si(e, t, n) {
842
- const o = bi(e, t, n);
843
- if (le(e, t) >= o) return t;
844
- const i = le(e, to) > le(e, no) ? br : Sr;
845
- let s = t;
846
- for (let l = 0; l < _i && le(e, s) < o; l++)
847
- s = i(s, Ii);
848
- return Nn(s);
849
- }
850
- function Mi(e) {
851
- return ht(e) && It(e).a === 1;
852
- }
853
- function cn(e, t) {
854
- var n;
855
- return t === "card" ? (n = e == null ? void 0 : e.elevatedSurface) == null ? void 0 : n.base : e == null ? void 0 : e.muted;
856
- }
857
- function un(e, t, n, o) {
858
- var l, a, c, u;
859
- const i = Ei[n][e], s = t;
860
- try {
861
- const d = s == null ? void 0 : s.newTheme, m = (l = d == null ? void 0 : d.semantics) == null ? void 0 : l.call(d, d.primitives);
862
- if (!m) return i;
863
- const { semantic: p } = oo[e], h = cn((u = (c = (a = s == null ? void 0 : s.themeOverride) == null ? void 0 : a.semantics) == null ? void 0 : c.color) == null ? void 0 : u.background, n) ?? cn(m.color.background, n) ?? "", _ = o.stroke ?? m.color.stroke[p], A = o.label ?? m.color.text[p];
864
- if (!Mi(h) || !ht(_) || !ht(A)) return i;
865
- const v = yi(h, _);
866
- return { fill: v, stroke: _, text: Si(v, A, h) };
867
- } catch {
868
- return i;
869
- }
870
- }
871
- const dn = /* @__PURE__ */ new WeakMap();
872
- function ro(e, t, n, o = {}) {
873
- if (typeof t != "object" || t === null)
874
- return un(e, t, n, o);
875
- let i = dn.get(t);
876
- i === void 0 && (i = /* @__PURE__ */ new Map(), dn.set(t, i));
877
- const s = `${n}:${e}:${o.stroke ?? ""}:${o.label ?? ""}`, l = i.get(s);
878
- if (l !== void 0) return l;
879
- const a = un(e, t, n, o);
880
- return i.set(s, a), a;
881
- }
882
- function Ge(e, t) {
883
- const { textKey: n, borderKey: o } = oo[e];
884
- return (i, s) => {
885
- const l = i, { fill: a, stroke: c, text: u } = ro(e, s, t, {
886
- stroke: l == null ? void 0 : l[o],
887
- label: l == null ? void 0 : l[n]
888
- });
889
- return { backgroundColor: a, [n]: u, [o]: c };
890
- };
891
- }
892
- function mn(e) {
893
- return {
894
- primary: Ge("primary", e),
895
- info: Ge("info", e),
896
- success: Ge("success", e),
897
- warning: Ge("warning", e)
898
- };
899
- }
900
- const Ti = {
901
- card: mn("card"),
902
- row: mn("row")
903
- }, Ci = "#9242B4", vi = "#9E58BD";
904
- function gn(e) {
905
- return (t, n) => {
906
- var l, a, c, u;
907
- const { fill: o, stroke: i, text: s } = ro("primary", n, e, {
908
- stroke: ((a = (l = n.colors) == null ? void 0 : l.contrasts) == null ? void 0 : a.violet4570) ?? vi,
909
- label: ((u = (c = n.colors) == null ? void 0 : c.contrasts) == null ? void 0 : u.violet5790) ?? Ci
910
- });
911
- return { backgroundColor: o, baseTextColor: s, baseBorderColor: i };
912
- };
913
- }
914
- const xt = {
915
- tone: "primary",
916
- icon: /* @__PURE__ */ r(ur, { size: "sm" }),
917
- themes: {
918
- card: gn("card"),
919
- row: gn("row")
920
- }
921
- }, Te = {
922
- not_started: { tone: "primary", icon: /* @__PURE__ */ r(Rt, { size: "sm" }) },
923
- in_progress: { tone: "info", icon: /* @__PURE__ */ r(Lt, { size: "sm" }) },
924
- complete: { tone: "success", icon: /* @__PURE__ */ r(At, { size: "sm" }) },
925
- missing: { tone: "warning", icon: /* @__PURE__ */ r(fe, { size: "sm" }) },
926
- incomplete: { tone: "warning", icon: /* @__PURE__ */ r(fe, { size: "sm" }) },
927
- missing_and_incomplete: { tone: "warning", icon: /* @__PURE__ */ r(fe, { size: "sm" }) },
928
- locked: { tone: "primary", icon: /* @__PURE__ */ r(Pt, { size: "sm" }) }
929
- }, wi = {
930
- not_started: { tone: "primary", icon: /* @__PURE__ */ r(Rt, { size: "sm" }) },
931
- in_progress: { tone: "info", icon: /* @__PURE__ */ r(Lt, { size: "sm" }) },
932
- complete: { tone: "success", icon: /* @__PURE__ */ r(At, { size: "sm" }) },
933
- incomplete: { tone: "warning", icon: /* @__PURE__ */ r(fe, { size: "sm" }) },
934
- missing: { tone: "warning", icon: /* @__PURE__ */ r(fe, { size: "sm" }) },
935
- locked: { tone: "primary", icon: /* @__PURE__ */ r(Pt, { size: "sm" }) }
936
- };
937
- function io(e, t, n, o) {
938
- switch (t) {
939
- case "not_started":
940
- return e("moduleStatusNotStarted");
941
- case "in_progress":
942
- return e("moduleStatusInProgress");
943
- case "complete":
944
- return e("moduleStatusComplete");
945
- case "missing":
946
- return e("moduleStatusMissing", { count: n });
947
- case "incomplete":
948
- return e("moduleStatusIncomplete", { count: o });
949
- case "missing_and_incomplete":
950
- return e("moduleStatusMissingAndIncomplete", {
951
- missing: e("moduleStatusMissing", { count: n }),
952
- incomplete: e("moduleStatusIncomplete", { count: o })
953
- });
954
- case "locked":
955
- return e("moduleStatusLocked");
956
- }
957
- }
958
- function Pi(e, t) {
959
- switch (t) {
960
- case "not_started":
961
- return e("itemStatusNotStarted");
962
- case "in_progress":
963
- return e("itemStatusInProgress");
964
- case "complete":
965
- return e("itemStatusComplete");
966
- case "incomplete":
967
- return e("itemStatusIncomplete");
968
- case "missing":
969
- return e("itemStatusMissing");
970
- case "locked":
971
- return e("itemStatusLocked");
972
- }
973
- }
974
- function Qe(e, t, n, o) {
975
- var i;
976
- return /* @__PURE__ */ r(
977
- kn,
978
- {
979
- color: e.tone,
980
- renderIcon: e.icon,
981
- themeOverride: ((i = e.themes) == null ? void 0 : i[o]) ?? Ti[o][e.tone],
982
- "data-testid": n,
983
- children: t
984
- }
985
- );
986
- }
987
- function Ai({
988
- status: e,
989
- missingCount: t,
990
- incompleteCount: n
991
- }) {
992
- const { t: o } = P();
993
- return Qe(
994
- Te[e],
995
- io(o, e, t, n),
996
- "module-status-pill",
997
- "card"
998
- );
999
- }
1000
- function Li({ status: e }) {
1001
- const { t } = P();
1002
- return Qe(
1003
- wi[e],
1004
- Pi(t, e),
1005
- "item-status-pill",
1006
- "row"
1007
- );
1008
- }
1009
- function Ri() {
1010
- const { t: e } = P();
1011
- return Qe(xt, e("moduleStatusDueSoon"), "module-due-soon-pill", "card");
1012
- }
1013
- function ki() {
1014
- const { t: e } = P();
1015
- return Qe(xt, e("itemStatusDueSoon"), "item-due-soon-pill", "row");
1016
- }
1017
- function so() {
1018
- const e = xn();
1019
- return "key" in e && e.key === "canvas-high-contrast" ? "inline" : "standalone";
1020
- }
1021
- const lo = 2.75, Oi = `${lo}rem`, pn = "0.065em", he = "0.8em", xi = "0.28em", fn = "1px", Di = "0.57em", ao = {
1022
- display: "inline-block",
1023
- paddingLeft: he,
1024
- marginLeft: `-${he}`,
1025
- backgroundImage: `radial-gradient(circle, currentColor ${pn}, transparent ${pn})`,
1026
- backgroundRepeat: "no-repeat",
1027
- backgroundSize: `${he} 100%`,
1028
- backgroundPosition: "left center"
1029
- }, Ni = {
1030
- ...ao,
1031
- backgroundImage: "none",
1032
- borderLeft: `${fn} solid`,
1033
- paddingLeft: `calc(${he} / 2 - ${fn})`,
1034
- marginLeft: `calc(-${he} / 2)`
1035
- };
1036
- function hn() {
1037
- return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia("(forced-colors: active)");
1038
- }
1039
- function Dt() {
1040
- const [e, t] = j(() => {
1041
- var n;
1042
- return ((n = hn()) == null ? void 0 : n.matches) ?? !1;
1043
- });
1044
- return W(() => {
1045
- const n = hn();
1046
- if (n === null) return;
1047
- t(n.matches);
1048
- const o = (i) => t(i.matches);
1049
- return n.addEventListener("change", o), () => n.removeEventListener("change", o);
1050
- }, []), e ? Ni : ao;
1051
- }
1052
- const Nt = {
1053
- overflowX: "clip",
1054
- overflowWrap: "anywhere",
1055
- lineHeight: 0
1056
- }, zi = "#6A7883", Xe = 0.5, He = { display: "block" }, qi = { ...He, marginTop: `${Xe}rem` }, $i = {
1057
- ...He,
1058
- marginTop: `-${Xe}rem`
1059
- }, In = { marginTop: `${Xe}rem` }, _n = { display: "inline-block" }, Fi = {
1060
- display: "-webkit-box",
1061
- WebkitLineClamp: 2,
1062
- WebkitBoxOrient: "vertical",
1063
- overflow: "hidden"
1064
- }, zt = {
1065
- marginRight: `calc(${he} - ${xi})`
1066
- }, co = {
1067
- display: "inline-flex",
1068
- alignItems: "center",
1069
- height: "1lh",
1070
- verticalAlign: "top",
1071
- marginInlineEnd: Di
1072
- };
1073
- function pe(e) {
1074
- return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(pe) : wt(e) && e.type === Rn ? pe(e.props.children) : !1;
1075
- }
1076
- const uo = 1.5, mo = 0.25, go = 0.5, po = 1.125, fo = 1.3125, Ui = 1 + uo + mo + po + 1, Bi = 0.75 + 1.25 + go + fo + 0.75, Gi = 2;
1077
- function En(e, t, n, o) {
1078
- const i = Math.max(n - 1, 0) * (t + Xe);
1079
- return { contentVisibility: "auto", containIntrinsicSize: `auto ${e + i + (o ? Gi : 0)}rem` };
1080
- }
1081
- const Wi = "0.5rem", Et = { fontWeightBold: 700 };
1082
- function Hi(e, t) {
1083
- var o, i;
1084
- const n = xn();
1085
- return ("colors" in n ? (i = (o = n.colors) == null ? void 0 : o.contrasts) == null ? void 0 : i[e] : void 0) ?? t;
1086
- }
1087
- function Ki({
1088
- item: e,
1089
- today: t,
1090
- attachedAbove: n,
1091
- attachedBelow: o,
1092
- stackPill: i = !1,
1093
- moduleLabel: s,
1094
- itemNumber: l
1095
- }) {
1096
- var re;
1097
- const { t: a, locale: c, timezone: u } = P(), d = Ve(), m = so(), p = Hi("grey4570", zi), h = Dt(), _ = k(null), A = Ae(), v = _e(), { navigation: z } = v, U = F(() => je(v.itemMeta), [v.itemMeta]), M = e.title || a("itemUntitled");
1098
- if (e.type === "sub_header")
1099
- return /* @__PURE__ */ r(
1100
- E,
1101
- {
1102
- as: "div",
1103
- padding: i ? "x-small small" : "x-small mediumSmall",
1104
- margin: "x-small 0 0 0",
1105
- "data-testid": `module-item-${e.id}`,
1106
- children: /* @__PURE__ */ r(
1107
- S,
1108
- {
1109
- size: "small",
1110
- weight: "bold",
1111
- transform: "uppercase",
1112
- themeOverride: Et,
1113
- "data-testid": "module-item-title",
1114
- "data-sub-header": "true",
1115
- children: M
1116
- }
1117
- )
1118
- }
1119
- );
1120
- const L = Wo(s, l, c), J = L ? a("itemNameWithLabel", { label: L, name: M }) : M, X = ((re = z.getItemHref) == null ? void 0 : re.call(z, e)) ?? e.url ?? null, C = e.status === "locked", R = C ? null : X, B = e.status !== void 0 && e.status !== "complete" && !C && An(e.dueAt, t, u), D = z.onItemClick, ne = (y) => {
1121
- d(`item-click-${e.type}`), D == null || D(e, y);
1122
- }, G = (y) => {
1123
- var q;
1124
- const Y = _.current;
1125
- !Y || Y.contains(y.target) || (q = window.getSelection()) != null && q.toString().trim() || Y.dispatchEvent(
1126
- new window.MouseEvent("click", {
1127
- bubbles: !0,
1128
- cancelable: !0,
1129
- ctrlKey: y.ctrlKey,
1130
- metaKey: y.metaKey,
1131
- shiftKey: y.shiftKey,
1132
- altKey: y.altKey
1133
- })
1134
- );
1135
- }, Z = { item: e, t: a, today: t, locale: c, timezone: u, formatters: A, config: v }, N = U.map((y) => ({
1136
- key: y.key,
1137
- node: y.render(Z),
1138
- icon: y.renderIcon ? y.renderIcon(Z) : y.icon
1139
- })).filter((y) => !pe(y.node)), $ = [];
1140
- let ee;
1141
- const O = i ? N.find((y) => y.key === "dueAt" && !pe(y.icon)) : void 0, ce = O && N.find((y) => y.key === "estimatedDuration");
1142
- for (const y of N)
1143
- if (y !== ce)
1144
- if (!pe(y.icon) && (i || !ee)) {
1145
- const Y = y === O && ce ? [y, ce] : [y];
1146
- $.push(Y), ee ?? (ee = Y);
1147
- } else ee ? ee.push(y) : $.length === 0 ? $.push([y]) : $[0].push(y);
1148
- const Le = i ? { ..._n, ...In } : _n, Re = i ? { ...h, ...In } : h, oe = B || e.status ? /* @__PURE__ */ g(I, { alignItems: "center", gap: "x-small", wrap: i ? "wrap" : "no-wrap", children: [
1149
- B ? /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ r(ki, {}) }) : null,
1150
- e.status ? /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ r(Li, { status: e.status }) }) : null
1151
- ] }) : null, ke = i ? /* @__PURE__ */ r("span", { style: Fi, "data-title-clamp": "", children: J }) : J, Oe = {
1152
- weight: "bold",
1153
- size: i ? "medium" : "small",
1154
- lineHeight: "condensed",
1155
- themeOverride: Et,
1156
- "data-testid": "module-item-title"
1157
- }, Je = R ? /* @__PURE__ */ g(
1158
- Dn,
1159
- {
1160
- href: R,
1161
- elementRef: (y) => {
1162
- _.current = y;
1163
- },
1164
- onClick: ne,
1165
- forceButtonRole: !1,
1166
- variant: m,
1167
- display: i ? "block" : void 0,
1168
- target: e.newTab ? "_blank" : void 0,
1169
- rel: e.newTab ? "noopener noreferrer" : void 0,
1170
- children: [
1171
- /* @__PURE__ */ r(S, { ...Oe, color: "primary", children: ke }),
1172
- e.newTab ? /* @__PURE__ */ r(Ye, { children: ` ${a("opensInNewWindow")}` }) : null
1173
- ]
1174
- }
1175
- ) : /* @__PURE__ */ r(
1176
- S,
1177
- {
1178
- ...Oe,
1179
- color: C ? "secondary" : "primary",
1180
- "data-locked": C ? "true" : void 0,
1181
- children: ke
1182
- }
1183
- ), xe = n ? "none" : "large", ue = o ? "none" : "large";
1184
- return /* @__PURE__ */ r(
1185
- "div",
1186
- {
1187
- style: {
1188
- ...i ? En(Bi, fo, $.length, oe !== null) : En(Ui, po, $.length, !1),
1189
- marginTop: n ? void 0 : Wi
1190
- },
1191
- children: /* @__PURE__ */ r(
1192
- E,
1193
- {
1194
- as: "div",
1195
- background: "secondary",
1196
- borderRadius: `${xe} ${xe} ${ue} ${ue}`,
1197
- padding: i ? "small" : "mediumSmall",
1198
- cursor: R ? "pointer" : void 0,
1199
- onClick: R ? G : void 0,
1200
- "data-testid": `module-item-${e.id}`,
1201
- children: /* @__PURE__ */ r("div", { style: { paddingInlineStart: `${Math.max(e.indent - 1, 0) * lo}rem` }, children: /* @__PURE__ */ g(I, { alignItems: "start", gap: "mediumSmall", children: [
1202
- /* @__PURE__ */ r(I.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ g(I, { alignItems: "center", children: [
1203
- e.indent > 0 ? /* @__PURE__ */ r(
1204
- I.Item,
1205
- {
1206
- size: Oi,
1207
- textAlign: "center",
1208
- "data-testid": "item-nest-arrow",
1209
- children: /* @__PURE__ */ r("span", { style: { color: p }, children: /* @__PURE__ */ r(dr, { size: "md", color: "inherit" }) })
1210
- }
1211
- ) : null,
1212
- /* @__PURE__ */ g(I.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1213
- /* @__PURE__ */ r(
1214
- "div",
1215
- {
1216
- style: {
1217
- lineHeight: i ? 0 : `${uo}rem`,
1218
- marginBottom: N.length === 0 ? 0 : `${i ? go : mo}rem`
1219
- },
1220
- children: Je
1221
- }
1222
- ),
1223
- /* @__PURE__ */ r("div", { style: Nt, children: /* @__PURE__ */ r(
1224
- S,
1225
- {
1226
- size: i ? "small" : "x-small",
1227
- lineHeight: "default",
1228
- color: "secondary",
1229
- "data-testid": "module-item-meta",
1230
- children: $.map((y, Y) => /* @__PURE__ */ r(
1231
- "span",
1232
- {
1233
- style: i ? Y > 0 ? He : $i : $.length > 1 ? Y > 0 ? qi : He : void 0,
1234
- "data-testid": "meta-line",
1235
- children: y.map((q, T) => /* @__PURE__ */ g(Rn, { children: [
1236
- T > 0 ? /* @__PURE__ */ r("span", { style: zt, children: " " }) : null,
1237
- /* @__PURE__ */ g(
1238
- "span",
1239
- {
1240
- style: T > 0 ? Re : Le,
1241
- "data-testid": "meta-fact",
1242
- "data-fact-key": q.key,
1243
- children: [
1244
- pe(q.icon) ? null : /* @__PURE__ */ r(
1245
- "span",
1246
- {
1247
- style: co,
1248
- "aria-hidden": "true",
1249
- "data-testid": `meta-icon-${q.key}`,
1250
- children: i && wt(q.icon) && q.icon.props.size === "xs" ? ir(q.icon, { size: "sm" }) : q.icon
1251
- }
1252
- ),
1253
- q.node
1254
- ]
1255
- }
1256
- )
1257
- ] }, q.key))
1258
- },
1259
- y[0].key
1260
- ))
1261
- }
1262
- ) }),
1263
- i && oe ? /* @__PURE__ */ r(E, { as: "div", margin: "x-small 0 0 0", children: oe }) : null
1264
- ] })
1265
- ] }) }),
1266
- !i && oe ? /* @__PURE__ */ r(I.Item, { children: oe }) : null
1267
- ] }) })
1268
- }
1269
- )
1270
- }
1271
- );
1272
- }
1273
- const ji = Ln(Ki), Yi = {
1274
- not_started: Te.not_started,
1275
- in_progress: Te.in_progress,
1276
- complete: Te.complete,
1277
- missing: Te.missing,
1278
- due_this_week: xt
1279
- }, Vi = {
738
+ const Zi = {
739
+ not_started: _e.not_started,
740
+ in_progress: _e.in_progress,
741
+ complete: _e.complete,
742
+ missing: _e.missing,
743
+ due_this_week: kn
744
+ }, Xi = {
1280
745
  primary: "secondary",
1281
746
  info: "brand",
1282
747
  success: "success",
1283
748
  warning: "warning"
1284
749
  };
1285
- function Qi({
750
+ function Ji({
1286
751
  value: e,
1287
752
  onChange: t,
1288
753
  interaction: n = "enabled"
1289
754
  }) {
1290
- const { t: o } = P(), i = _e(), s = F(() => je(i.filters), [i.filters]), l = sr();
1291
- return s.length === 0 ? null : /* @__PURE__ */ r(
1292
- Qt,
755
+ const { t: r } = x(), o = Te(), i = F(() => Ze(o.filters), [o.filters]), l = ni();
756
+ return i.length === 0 ? null : /* @__PURE__ */ s(
757
+ _t,
1293
758
  {
1294
- renderLabel: /* @__PURE__ */ r(Ye, { children: o("filterGroupLabel") }),
1295
- renderBeforeInput: /* @__PURE__ */ r(S, { weight: "bold", themeOverride: Et, "aria-hidden": "true", children: o("filterGroupLabel") }),
759
+ renderLabel: /* @__PURE__ */ s(zt, { children: r("filterGroupLabel") }),
760
+ renderBeforeInput: /* @__PURE__ */ s(b, { weight: "bold", "aria-hidden": "true", children: r("filterGroupLabel") }),
1296
761
  value: e,
1297
- onChange: (a, c) => {
1298
- c.value !== void 0 && t(String(c.value));
762
+ onChange: (u, a) => {
763
+ a.value !== void 0 && t(String(a.value));
1299
764
  },
1300
765
  interaction: n,
1301
766
  "data-testid": "filter-select",
1302
- children: s.map((a) => {
1303
- const c = Yi[a.key];
1304
- return /* @__PURE__ */ r(
1305
- Qt.Option,
767
+ children: i.map((u) => {
768
+ const a = Zi[u.key];
769
+ return /* @__PURE__ */ s(
770
+ _t.Option,
1306
771
  {
1307
- id: `${l}-${a.key}`,
1308
- value: a.key,
1309
- renderBeforeLabel: c ? /* @__PURE__ */ r(S, { color: Vi[c.tone], children: c.icon }) : void 0,
1310
- "data-testid": `filter-option-${a.key}`,
1311
- children: o(a.label)
772
+ id: `${l}-${u.key}`,
773
+ value: u.key,
774
+ renderBeforeLabel: a ? /* @__PURE__ */ s(b, { color: Xi[a.tone], children: a.icon }) : void 0,
775
+ "data-testid": `filter-option-${u.key}`,
776
+ children: r(u.label)
1312
777
  },
1313
- a.key
778
+ u.key
1314
779
  );
1315
780
  })
1316
781
  }
1317
782
  );
1318
783
  }
1319
- const yn = "\0", Xi = { textDecoration: "underline dotted", cursor: "help" }, ho = { ...co, marginInlineEnd: "0.375rem" };
1320
- function Zi({ names: e }) {
1321
- const { t } = P();
1322
- if (e.length === 1) return /* @__PURE__ */ r(Q, { children: t("lockedByPrerequisiteByline", { name: e[0] }) });
784
+ const bt = "\0", er = { textDecoration: "underline dotted", cursor: "help" }, Jt = { ...On, marginInlineEnd: "0.375rem" };
785
+ function tr({ names: e }) {
786
+ const { t } = x();
787
+ if (e.length === 1) return /* @__PURE__ */ s(W, { children: t("lockedByPrerequisiteByline", { name: e[0] }) });
1323
788
  const n = t("lockedByPrerequisitesByline", {
1324
789
  count: e.length,
1325
- prerequisites: yn
1326
- }), [o, ...i] = n.split(yn), s = i.length > 0 ? i.join("") : null;
1327
- return /* @__PURE__ */ g(Q, { children: [
1328
- s === null ? null : o,
1329
- /* @__PURE__ */ r(qn, { renderTip: e.join(", "), children: /* @__PURE__ */ r(
790
+ prerequisites: bt
791
+ }), [r, ...o] = n.split(bt), i = o.length > 0 ? o.join("") : null;
792
+ return /* @__PURE__ */ m(W, { children: [
793
+ i === null ? null : r,
794
+ /* @__PURE__ */ s(pi, { renderTip: e.join(", "), children: /* @__PURE__ */ s(
1330
795
  "span",
1331
796
  {
1332
797
  tabIndex: 0,
1333
- style: Xi,
798
+ style: er,
1334
799
  onClick: (l) => l.stopPropagation(),
1335
800
  "data-testid": "module-byline-prerequisites",
1336
- children: s === null ? n : t("lockedByPrerequisitesCount", { count: e.length })
801
+ children: i === null ? n : t("lockedByPrerequisitesCount", { count: e.length })
1337
802
  }
1338
803
  ) }),
1339
- s
804
+ i
1340
805
  ] });
1341
806
  }
1342
- function Ji({ module: e, today: t }) {
1343
- var m;
1344
- const n = Ae(), o = Dt(), i = ((m = e.progress) == null ? void 0 : m.status) === "locked", s = e.unlockAt ?? null, l = e.prerequisiteModules.map((p) => p.name.trim()).filter((p) => p !== ""), a = s !== null && new Date(s) > t;
1345
- let c = null;
1346
- s !== null && a && (i || !e.progress) ? c = n.unlockByline(s, t) : s !== null && !a && !e.progress && (c = n.unlockedByline(s, t));
1347
- const u = i && l.length > 0;
1348
- let d = null;
1349
- if (c === null && !u && !i) {
1350
- const p = e.estimatedDurationMinutes ?? Ko(e.items);
1351
- d = p === null ? null : n.estimatedDurationByline(p);
807
+ function nr({ module: e, today: t }) {
808
+ var p;
809
+ const n = Je(), r = Ot(), o = ((p = e.progress) == null ? void 0 : p.status) === "locked", i = e.unlockAt ?? null, l = e.prerequisiteModules.map((h) => h.name.trim()).filter((h) => h !== ""), u = i !== null && new Date(i) > t;
810
+ let a = null;
811
+ i !== null && u && (o || !e.progress) ? a = n.unlockByline(i, t) : i !== null && !u && !e.progress && (a = n.unlockedByline(i, t));
812
+ const d = o && l.length > 0;
813
+ let g = null;
814
+ if (a === null && !d && !o) {
815
+ const h = e.estimatedDurationMinutes ?? xn(e.items);
816
+ g = h === null ? null : n.estimatedDurationByline(h);
1352
817
  }
1353
- return c === null && !u && d === null ? null : /* @__PURE__ */ r(E, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ r("div", { style: Nt, children: /* @__PURE__ */ r(S, { variant: "contentSmall", color: "secondary", "data-testid": "module-byline", children: d !== null ? /* @__PURE__ */ g(Q, { children: [
1354
- /* @__PURE__ */ r("span", { style: ho, children: /* @__PURE__ */ r(On, { width: "0.75rem", height: "0.75rem", color: "secondary" }) }),
1355
- d
1356
- ] }) : /* @__PURE__ */ g(Q, { children: [
1357
- c,
1358
- c !== null && u ? /* @__PURE__ */ r("span", { style: zt, children: " " }) : null,
1359
- u ? /* @__PURE__ */ r("span", { style: c !== null ? o : void 0, children: /* @__PURE__ */ r(Zi, { names: l }) }) : null
818
+ return a === null && !d && g === null ? null : /* @__PURE__ */ s(M, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ s("div", { style: Dt, children: /* @__PURE__ */ s(b, { variant: "contentSmall", color: "secondary", "data-testid": "module-byline", children: g !== null ? /* @__PURE__ */ m(W, { children: [
819
+ /* @__PURE__ */ s("span", { style: Jt, children: /* @__PURE__ */ s(Nt, { width: "0.75rem", height: "0.75rem", color: "secondary" }) }),
820
+ g
821
+ ] }) : /* @__PURE__ */ m(W, { children: [
822
+ a,
823
+ a !== null && d ? /* @__PURE__ */ s("span", { style: qt, children: " " }) : null,
824
+ d ? /* @__PURE__ */ s("span", { style: a !== null ? r : void 0, children: /* @__PURE__ */ s(tr, { names: l }) }) : null
1360
825
  ] }) }) }) });
1361
826
  }
1362
- const es = "#273540", ts = "#D7DADE", ns = "0.25rem", os = (e, t) => {
1363
- var n, o, i, s, l;
827
+ const ir = "#273540", rr = "#D7DADE", sr = "0.25rem", or = (e, t) => {
828
+ var n, r, o, i, l;
1364
829
  return {
1365
- meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ?? es,
1366
- borderRadius: String(((i = t.borders) == null ? void 0 : i.radiusMedium) ?? ns),
1367
- borderColor: ((l = (s = t.colors) == null ? void 0 : s.contrasts) == null ? void 0 : l.grey1424) ?? ts,
830
+ meterColorBrand: ((r = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : r.grey125125) ?? ir,
831
+ borderRadius: String(((o = t.borders) == null ? void 0 : o.radiusMedium) ?? sr),
832
+ borderColor: ((l = (i = t.colors) == null ? void 0 : i.contrasts) == null ? void 0 : l.grey1424) ?? rr,
1368
833
  trackBottomBorderColor: "transparent"
1369
834
  };
1370
- }, rs = "66.667%", is = "80px", ss = 2, ls = { components: { TruncateText: { fontFamily: "inherit" } } };
1371
- function as({
835
+ }, lr = "66.667%", ar = "80px", ur = 2, dr = { components: { TruncateText: { fontFamily: "inherit" } } };
836
+ function cr({
1372
837
  module: e,
1373
838
  breakpoints: t
1374
839
  }) {
1375
- const { t: n } = P(), o = Ae(), i = Dt(), s = e.progress;
1376
- if (!s || s.status === "locked" || s.requirementCount <= 0) return null;
1377
- const l = Object.keys(t).length === 0 || t.desktop === !0, a = jo(e.items);
1378
- return /* @__PURE__ */ g(
1379
- I,
840
+ const { t: n } = x(), r = Je(), o = Ot(), i = e.progress;
841
+ if (!i || i.status === "locked" || i.requirementCount <= 0) return null;
842
+ const l = Object.keys(t).length === 0 || t.desktop === !0, u = Un(e.items);
843
+ return /* @__PURE__ */ m(
844
+ _,
1380
845
  {
1381
- width: l ? rs : "100%",
846
+ width: l ? lr : "100%",
1382
847
  alignItems: "center",
1383
848
  gap: "x-small",
1384
849
  margin: "x-small 0 0 0",
1385
850
  "data-testid": "module-progress",
1386
851
  children: [
1387
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ r(E, { as: "div", width: is, "data-testid": "module-progress-bar", children: /* @__PURE__ */ r(
1388
- Cr,
852
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ s(M, { as: "div", width: ar, "data-testid": "module-progress-bar", children: /* @__PURE__ */ s(
853
+ gi,
1389
854
  {
1390
855
  size: "x-small",
1391
856
  meterColor: "brand",
1392
- valueNow: s.requirementsMet,
1393
- valueMax: s.requirementCount,
857
+ valueNow: i.requirementsMet,
858
+ valueMax: i.requirementCount,
1394
859
  shouldAnimate: !1,
1395
860
  screenReaderLabel: n("moduleProgressScreenReaderLabel", { name: e.name }),
1396
861
  formatScreenReaderValue: () => {
1397
- const c = Yo(
862
+ const a = Fn(
1398
863
  n,
1399
- s.requirementsMet,
1400
- s.requirementCount
864
+ i.requirementsMet,
865
+ i.requirementCount
1401
866
  );
1402
- return a === null ? c : `${c}, ${o.remainingDurationByline(a)}`;
867
+ return u === null ? a : `${a}, ${r.remainingDurationByline(u)}`;
1403
868
  },
1404
- themeOverride: os
869
+ themeOverride: or
1405
870
  }
1406
871
  ) }) }),
1407
- /* @__PURE__ */ r(I.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ r("div", { style: Nt, children: /* @__PURE__ */ g(S, { variant: "contentSmall", color: "secondary", children: [
1408
- o.progress(
1409
- s.percentComplete,
1410
- s.requirementsMet,
1411
- s.requirementCount
872
+ /* @__PURE__ */ s(_.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ s("div", { style: Dt, children: /* @__PURE__ */ m(b, { variant: "contentSmall", color: "secondary", children: [
873
+ r.progress(
874
+ i.percentComplete,
875
+ i.requirementsMet,
876
+ i.requirementCount
1412
877
  ),
1413
- a !== null ? /* @__PURE__ */ g(Q, { children: [
1414
- /* @__PURE__ */ r("span", { style: zt, children: " " }),
1415
- /* @__PURE__ */ g("span", { style: i, children: [
1416
- /* @__PURE__ */ r("span", { style: ho, children: /* @__PURE__ */ r(On, { width: "0.75rem", height: "0.75rem", color: "secondary" }) }),
1417
- o.remainingDurationByline(a)
878
+ u !== null ? /* @__PURE__ */ m(W, { children: [
879
+ /* @__PURE__ */ s("span", { style: qt, children: " " }),
880
+ /* @__PURE__ */ m("span", { style: o, children: [
881
+ /* @__PURE__ */ s("span", { style: Jt, children: /* @__PURE__ */ s(Nt, { width: "0.75rem", height: "0.75rem", color: "secondary" }) }),
882
+ r.remainingDurationByline(u)
1418
883
  ] })
1419
884
  ] }) : null
1420
885
  ] }) }) })
@@ -1422,32 +887,32 @@ function as({
1422
887
  }
1423
888
  );
1424
889
  }
1425
- const bn = (e) => `platform-modules-panel-${e}`;
1426
- function yt(e) {
890
+ const Pt = (e) => `platform-modules-panel-${e}`;
891
+ function He(e) {
1427
892
  return e !== void 0 && e.type !== "sub_header";
1428
893
  }
1429
- function Sn(e) {
1430
- return yt(e) && e.indent > 0;
894
+ function Ct(e) {
895
+ return He(e) && e.indent > 0;
1431
896
  }
1432
- function cs(e, t) {
897
+ function mr(e, t) {
1433
898
  let n = t;
1434
- return e.map((o) => o.type === "sub_header" ? void 0 : ++n);
899
+ return e.map((r) => r.type === "sub_header" ? void 0 : ++n);
1435
900
  }
1436
- function us({
901
+ function gr({
1437
902
  module: e,
1438
903
  state: t,
1439
904
  today: n,
1440
- showDiagnostics: o,
1441
- stackPill: i,
1442
- moduleLabel: s
905
+ showDiagnostics: r,
906
+ stackPill: o,
907
+ moduleLabel: i
1443
908
  }) {
1444
- const { t: l } = P(), a = Ve(), c = k(null), u = cs(t.items, t.itemOffset), d = t.items.length, m = !t.isLoading && !t.isRefreshing;
1445
- W(() => {
1446
- if (!m || d === 0 || c.current === t.page) return;
1447
- const h = c.current === null;
1448
- c.current = t.page, K(
1449
- h ? l("itemsLoadedAnnouncement", {
1450
- loaded: d,
909
+ const { t: l } = x(), u = Xe(), a = k(null), d = mr(t.items, t.itemOffset), g = t.items.length, p = !t.isLoading && !t.isRefreshing;
910
+ B(() => {
911
+ if (!p || g === 0 || a.current === t.page) return;
912
+ const f = a.current === null;
913
+ a.current = t.page, N(
914
+ f ? l("itemsLoadedAnnouncement", {
915
+ loaded: g,
1451
916
  count: e.itemCount,
1452
917
  name: e.name
1453
918
  }) : l("itemsPageChangedAnnouncement", {
@@ -1456,26 +921,26 @@ function us({
1456
921
  name: e.name
1457
922
  })
1458
923
  );
1459
- }, [m, d, t.page, t.pageCount, e.itemCount, e.name, l]);
1460
- const p = (h) => {
1461
- a("paginate-items"), h === 1 ? t.goToFirstPage() : h === t.page - 1 ? t.goToPreviousPage() : h === t.page + 1 ? t.goToNextPage() : h === t.pageCount && t.goToLastPage();
924
+ }, [p, g, t.page, t.pageCount, e.itemCount, e.name, l]);
925
+ const h = (f) => {
926
+ u("paginate-items"), f === 1 ? t.goToFirstPage() : f === t.page - 1 ? t.goToPreviousPage() : f === t.page + 1 ? t.goToNextPage() : f === t.pageCount && t.goToLastPage();
1462
927
  };
1463
- return t.error ? /* @__PURE__ */ r(E, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ r(
1464
- ae,
928
+ return t.error ? /* @__PURE__ */ s(M, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ s(
929
+ X,
1465
930
  {
1466
931
  variant: "error",
1467
932
  margin: "0",
1468
- liveRegion: We,
933
+ liveRegion: Se,
1469
934
  liveRegionPoliteness: "assertive",
1470
935
  "data-testid": "items-error",
1471
936
  children: l("itemsLoadErrorAlert", { message: t.error.message })
1472
937
  }
1473
- ) }) : t.isLoading ? /* @__PURE__ */ g(E, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
1474
- /* @__PURE__ */ r(kt, { size: "x-small", renderTitle: l("itemsLoadingSpinnerLabel") }),
938
+ ) }) : t.isLoading ? /* @__PURE__ */ m(M, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
939
+ /* @__PURE__ */ s(et, { size: "x-small", renderTitle: l("itemsLoadingSpinnerLabel") }),
1475
940
  " ",
1476
- /* @__PURE__ */ r(S, { size: "small", color: "secondary", children: l("itemsLoadingText") })
1477
- ] }) : /* @__PURE__ */ g(E, { as: "div", margin: "small 0 0 0", children: [
1478
- o ? /* @__PURE__ */ g(S, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
941
+ /* @__PURE__ */ s(b, { size: "small", color: "secondary", children: l("itemsLoadingText") })
942
+ ] }) : /* @__PURE__ */ m(M, { as: "div", margin: "small 0 0 0", children: [
943
+ r ? /* @__PURE__ */ m(b, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
1479
944
  "items source: ",
1480
945
  t.source,
1481
946
  " · page ",
@@ -1483,79 +948,79 @@ function us({
1483
948
  " of ",
1484
949
  t.pageCount
1485
950
  ] }) : null,
1486
- t.items.length === 0 ? /* @__PURE__ */ r(E, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ r(S, { size: "small", color: "secondary", children: l("noItemsEmptyState") }) }) : /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((h, _) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
1487
- ji,
951
+ t.items.length === 0 ? /* @__PURE__ */ s(M, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ s(b, { size: "small", color: "secondary", children: l("noItemsEmptyState") }) }) : /* @__PURE__ */ s(Ge, { isUnstyled: !0, margin: "none", "data-testid": "items-list", children: t.items.map((f, I) => /* @__PURE__ */ s(We, { children: /* @__PURE__ */ s(
952
+ Bn,
1488
953
  {
1489
- item: h,
954
+ item: f,
1490
955
  today: n,
1491
- attachedAbove: Sn(h) && yt(t.items[_ - 1]),
1492
- attachedBelow: yt(h) && Sn(t.items[_ + 1]),
1493
- stackPill: i,
1494
- moduleLabel: s,
1495
- itemNumber: u[_]
956
+ attachedAbove: Ct(f) && He(t.items[I - 1]),
957
+ attachedBelow: He(f) && Ct(t.items[I + 1]),
958
+ stackPill: o,
959
+ moduleLabel: i,
960
+ itemNumber: d[I]
1496
961
  }
1497
- ) }, h.id)) }),
1498
- t.pageCount > 1 ? /* @__PURE__ */ r(
1499
- zn,
962
+ ) }, f.id)) }),
963
+ t.pageCount > 1 ? /* @__PURE__ */ s(
964
+ xt,
1500
965
  {
1501
966
  as: "nav",
1502
967
  variant: "compact",
1503
968
  withFirstAndLastButton: !0,
1504
969
  margin: "small 0 0 0",
1505
- label: /* @__PURE__ */ r(Ye, { children: l("itemsPaginationLabel", { name: e.name }) }),
970
+ label: /* @__PURE__ */ s(zt, { children: l("itemsPaginationLabel", { name: e.name }) }),
1506
971
  labelFirst: l("paginationFirstPage"),
1507
972
  labelPrev: l("paginationPreviousPage"),
1508
973
  labelNext: l("paginationNextPage"),
1509
974
  labelLast: l("paginationLastPage"),
1510
- screenReaderLabelPageButton: (h) => l("paginationPageLabel", { page: h }),
975
+ screenReaderLabelPageButton: (f) => l("paginationPageLabel", { page: f }),
1511
976
  ellipsis: l("paginationEllipsis"),
1512
977
  totalPageNumber: t.pageCount,
1513
978
  currentPage: t.page,
1514
979
  disabled: t.isRefreshing,
1515
- onPageChange: p,
980
+ onPageChange: h,
1516
981
  "data-testid": "items-pagination"
1517
982
  }
1518
983
  ) : null
1519
984
  ] });
1520
985
  }
1521
- function ds({
986
+ function pr({
1522
987
  module: e,
1523
988
  expanded: t,
1524
989
  onToggle: n,
1525
- itemsState: o,
1526
- today: i,
1527
- showDiagnostics: s = !1,
990
+ itemsState: r,
991
+ today: o,
992
+ showDiagnostics: i = !1,
1528
993
  headingLevel: l = "h3",
1529
- moduleLabel: a,
1530
- breakpoints: c = {},
1531
- toggleRef: u
994
+ moduleLabel: u,
995
+ breakpoints: a = {},
996
+ toggleRef: d
1532
997
  }) {
1533
- var Z, N, $, ee;
1534
- const { t: d, timezone: m } = P(), p = Ve(), h = Ae(), { navigation: _ } = _e(), A = so(), v = ((Z = e.progress) == null ? void 0 : Z.status) === "locked", z = v ? null : ((N = _.getModuleHref) == null ? void 0 : N.call(_, e)) ?? null, U = a === void 0 ? h.moduleLabel(e.position, e) : a, M = (U == null ? void 0 : U.trim()) || null, L = M ? d("moduleNameWithLabel", { label: M, name: e.name }) : e.name, X = /* @__PURE__ */ r(
1535
- Ie,
998
+ var K, q, ee, ce;
999
+ const { t: g, timezone: p } = x(), h = Xe(), f = Je(), { navigation: I } = Te(), v = Dn(), L = ((K = e.progress) == null ? void 0 : K.status) === "locked", $ = L ? null : ((q = I.getModuleHref) == null ? void 0 : q.call(I, e)) ?? null, O = u === void 0 ? f.moduleLabel(e.position, e) : u, S = (O == null ? void 0 : O.trim()) || null, C = S ? g("moduleNameWithLabel", { label: S, name: e.name }) : e.name, j = /* @__PURE__ */ s(
1000
+ ue,
1536
1001
  {
1537
1002
  level: l,
1538
1003
  variant: "titleCardMini",
1539
- color: v ? "secondary" : "primary",
1540
- "aria-label": L,
1004
+ color: L ? "secondary" : "primary",
1005
+ "aria-label": C,
1541
1006
  "data-testid": "module-name",
1542
- children: /* @__PURE__ */ r(_r, { themeOverride: ls, children: /* @__PURE__ */ r(Mr, { linesAllowed: ss, children: L }) })
1007
+ children: /* @__PURE__ */ s(ui, { themeOverride: dr, children: /* @__PURE__ */ s(ai, { linesAllowed: ur, children: C }) })
1543
1008
  }
1544
- ), C = c.mobileOnly === !0, R = () => {
1545
- p(t ? "module-collapse" : "module-expand"), n(e.id);
1546
- }, B = () => {
1547
- var O;
1548
- (O = window.getSelection()) != null && O.toString().trim() || R();
1549
- }, D = ($ = e.progress) != null && $.status ? /* @__PURE__ */ r(
1550
- Ai,
1009
+ ), T = a.mobileOnly === !0, w = () => {
1010
+ h(t ? "module-collapse" : "module-expand"), n(e.id);
1011
+ }, H = () => {
1012
+ var R;
1013
+ (R = window.getSelection()) != null && R.toString().trim() || w();
1014
+ }, A = (ee = e.progress) != null && ee.status ? /* @__PURE__ */ s(
1015
+ qn,
1551
1016
  {
1552
1017
  status: e.progress.status,
1553
1018
  missingCount: e.progress.missingCount,
1554
1019
  incompleteCount: e.progress.incompleteCount
1555
1020
  }
1556
- ) : null, G = ((ee = e.progress) == null ? void 0 : ee.status) !== void 0 && e.progress.status !== "complete" && !v && An(e.progress.nextDueAt, i, m) ? /* @__PURE__ */ r(Ri, {}) : null;
1557
- return /* @__PURE__ */ g(
1558
- E,
1021
+ ) : null, D = ((ce = e.progress) == null ? void 0 : ce.status) !== void 0 && e.progress.status !== "complete" && !L && zn(e.progress.nextDueAt, o, p) ? /* @__PURE__ */ s($n, {}) : null;
1022
+ return /* @__PURE__ */ m(
1023
+ M,
1559
1024
  {
1560
1025
  as: "div",
1561
1026
  background: "primary",
@@ -1566,509 +1031,509 @@ function ds({
1566
1031
  margin: "0 0 small 0",
1567
1032
  "data-testid": `module-card-${e.id}`,
1568
1033
  children: [
1569
- /* @__PURE__ */ r(E, { as: "div", cursor: "pointer", children: /* @__PURE__ */ g(
1570
- I,
1034
+ /* @__PURE__ */ s(M, { as: "div", cursor: "pointer", children: /* @__PURE__ */ m(
1035
+ _,
1571
1036
  {
1572
1037
  alignItems: "start",
1573
1038
  gap: "mediumSmall",
1574
- onClick: B,
1039
+ onClick: H,
1575
1040
  "data-testid": "module-header",
1576
1041
  children: [
1577
- /* @__PURE__ */ g(I.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1578
- /* @__PURE__ */ g(E, { as: "div", children: [
1579
- /* @__PURE__ */ r(E, { as: "div", children: z ? /* @__PURE__ */ r(
1580
- Dn,
1042
+ /* @__PURE__ */ m(_.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1043
+ /* @__PURE__ */ m(M, { as: "div", children: [
1044
+ /* @__PURE__ */ s(M, { as: "div", children: $ ? /* @__PURE__ */ s(
1045
+ mi,
1581
1046
  {
1582
- href: z,
1047
+ href: $,
1583
1048
  display: "inline-block",
1584
1049
  forceButtonRole: !1,
1585
- variant: A,
1586
- "aria-label": L,
1587
- onClick: (O) => O.stopPropagation(),
1588
- children: X
1050
+ variant: v,
1051
+ "aria-label": C,
1052
+ onClick: (R) => R.stopPropagation(),
1053
+ children: j
1589
1054
  }
1590
- ) : X }),
1591
- e.published ? null : /* @__PURE__ */ g(S, { size: "x-small", color: "secondary", children: [
1055
+ ) : j }),
1056
+ e.published ? null : /* @__PURE__ */ m(b, { size: "x-small", color: "secondary", children: [
1592
1057
  " ",
1593
- d("moduleUnpublishedBadge")
1058
+ g("moduleUnpublishedBadge")
1594
1059
  ] })
1595
1060
  ] }),
1596
- /* @__PURE__ */ r(Ji, { module: e, today: i }),
1597
- C && (D || G) ? /* @__PURE__ */ r(E, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ g(I, { gap: "x-small", wrap: "wrap", children: [
1598
- G ? /* @__PURE__ */ r(I.Item, { children: G }) : null,
1599
- D ? /* @__PURE__ */ r(I.Item, { children: D }) : null
1061
+ /* @__PURE__ */ s(nr, { module: e, today: o }),
1062
+ T && (A || D) ? /* @__PURE__ */ s(M, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ m(_, { gap: "x-small", wrap: "wrap", children: [
1063
+ D ? /* @__PURE__ */ s(_.Item, { children: D }) : null,
1064
+ A ? /* @__PURE__ */ s(_.Item, { children: A }) : null
1600
1065
  ] }) }) : null,
1601
- /* @__PURE__ */ r(as, { module: e, breakpoints: c })
1066
+ /* @__PURE__ */ s(cr, { module: e, breakpoints: a })
1602
1067
  ] }),
1603
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ g(I, { alignItems: "center", gap: "mediumSmall", children: [
1604
- !C && (G || D) ? /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ g(I, { alignItems: "center", gap: "x-small", children: [
1605
- G ? /* @__PURE__ */ r(I.Item, { children: G }) : null,
1606
- D ? /* @__PURE__ */ r(I.Item, { children: D }) : null
1068
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(_, { alignItems: "center", gap: "mediumSmall", children: [
1069
+ !T && (D || A) ? /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(_, { alignItems: "center", gap: "x-small", children: [
1070
+ D ? /* @__PURE__ */ s(_.Item, { children: D }) : null,
1071
+ A ? /* @__PURE__ */ s(_.Item, { children: A }) : null
1607
1072
  ] }) }) : null,
1608
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ r(
1609
- _t,
1073
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ s(
1074
+ di,
1610
1075
  {
1611
- elementRef: (O) => u == null ? void 0 : u(e.id, O),
1076
+ elementRef: (R) => d == null ? void 0 : d(e.id, R),
1612
1077
  size: "medium",
1613
1078
  withBorder: !0,
1614
1079
  withBackground: !1,
1615
- screenReaderLabel: t ? d("collapseModule", { name: e.name }) : d("expandModule", { name: e.name }),
1080
+ screenReaderLabel: t ? g("collapseModule", { name: e.name }) : g("expandModule", { name: e.name }),
1616
1081
  "aria-expanded": t,
1617
- "aria-controls": bn(e.id),
1618
- onClick: (O) => {
1619
- O.stopPropagation(), R();
1082
+ "aria-controls": Pt(e.id),
1083
+ onClick: (R) => {
1084
+ R.stopPropagation(), w();
1620
1085
  },
1621
1086
  "data-testid": `toggle-module-${e.id}`,
1622
- children: t ? /* @__PURE__ */ r(mr, {}) : /* @__PURE__ */ r(gr, {})
1087
+ children: t ? /* @__PURE__ */ s(ri, {}) : /* @__PURE__ */ s(si, {})
1623
1088
  }
1624
1089
  ) })
1625
1090
  ] }) })
1626
1091
  ]
1627
1092
  }
1628
1093
  ) }),
1629
- /* @__PURE__ */ r("div", { id: bn(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ r(
1630
- us,
1094
+ /* @__PURE__ */ s("div", { id: Pt(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ s(
1095
+ gr,
1631
1096
  {
1632
1097
  module: e,
1633
- state: o,
1634
- today: i,
1635
- showDiagnostics: s,
1636
- stackPill: C,
1637
- moduleLabel: Ho(e) ? null : M
1098
+ state: r,
1099
+ today: o,
1100
+ showDiagnostics: i,
1101
+ stackPill: T,
1102
+ moduleLabel: Nn(e) ? null : S
1638
1103
  }
1639
1104
  ) : null })
1640
1105
  ]
1641
1106
  }
1642
1107
  );
1643
1108
  }
1644
- const ms = Ln(ds), na = ["place_new", "reorganize_all"], Io = ["assignment", "discussion", "quiz", "page", "file"], bt = 1e3, gs = () => ({
1109
+ const fr = ii(pr), js = ["place_new", "reorganize_all"], en = ["assignment", "discussion", "quiz", "page", "file"], Ye = 1e3, hr = () => ({
1645
1110
  mode: "place_new",
1646
- contentTypes: [...Io],
1111
+ contentTypes: [...en],
1647
1112
  setPrerequisites: !0,
1648
1113
  setRequirements: !0,
1649
1114
  direction: ""
1650
1115
  });
1651
- function ps(e, t) {
1116
+ function Mr(e, t) {
1652
1117
  return e(t === "assignment" ? "itemTypeAssignment" : t === "discussion" ? "itemTypeDiscussion" : t === "quiz" ? "itemTypeQuiz" : t === "page" ? "itemTypePage" : "itemTypeFile");
1653
1118
  }
1654
- const St = "prerequisites", Mt = "requirements", fs = (e) => [
1655
- ...e.setPrerequisites ? [St] : [],
1656
- ...e.setRequirements ? [Mt] : []
1119
+ const je = "prerequisites", Qe = "requirements", _r = (e) => [
1120
+ ...e.setPrerequisites ? [je] : [],
1121
+ ...e.setRequirements ? [Qe] : []
1657
1122
  ];
1658
- function hs({
1123
+ function Ir({
1659
1124
  input: e,
1660
1125
  errors: t,
1661
1126
  onChange: n,
1662
- disabled: o = !1
1127
+ disabled: r = !1
1663
1128
  }) {
1664
- const { t: i } = P();
1665
- return /* @__PURE__ */ g(E, { as: "div", "data-testid": "organize-form", children: [
1666
- /* @__PURE__ */ g(
1667
- Rr,
1129
+ const { t: o } = x();
1130
+ return /* @__PURE__ */ m(M, { as: "div", "data-testid": "organize-form", children: [
1131
+ /* @__PURE__ */ m(
1132
+ Ei,
1668
1133
  {
1669
1134
  name: "organize-mode",
1670
1135
  value: e.mode,
1671
- onChange: (s, l) => n({ mode: l }),
1672
- description: i("organizeModeLegend"),
1673
- disabled: o,
1136
+ onChange: (i, l) => n({ mode: l }),
1137
+ description: o("organizeModeLegend"),
1138
+ disabled: r,
1674
1139
  children: [
1675
- /* @__PURE__ */ r(
1676
- Zt,
1140
+ /* @__PURE__ */ s(
1141
+ Et,
1677
1142
  {
1678
1143
  value: "place_new",
1679
- label: i("organizeModePlaceNew"),
1144
+ label: o("organizeModePlaceNew"),
1680
1145
  "data-testid": "organize-mode-place-new"
1681
1146
  }
1682
1147
  ),
1683
- /* @__PURE__ */ r(
1684
- Zt,
1148
+ /* @__PURE__ */ s(
1149
+ Et,
1685
1150
  {
1686
1151
  value: "reorganize_all",
1687
- label: i("organizeModeReorganizeAll"),
1152
+ label: o("organizeModeReorganizeAll"),
1688
1153
  "data-testid": "organize-mode-reorganize-all"
1689
1154
  }
1690
1155
  )
1691
1156
  ]
1692
1157
  }
1693
1158
  ),
1694
- e.mode === "reorganize_all" ? /* @__PURE__ */ r(E, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ r(ae, { variant: "warning", margin: "0", "data-testid": "organize-reorganize-warning", children: i("organizeReorganizeWarning") }) }) : null,
1695
- /* @__PURE__ */ r(E, { as: "div", margin: "medium 0 0 0", children: /* @__PURE__ */ r(
1696
- Xt,
1159
+ e.mode === "reorganize_all" ? /* @__PURE__ */ s(M, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ s(X, { variant: "warning", margin: "0", "data-testid": "organize-reorganize-warning", children: o("organizeReorganizeWarning") }) }) : null,
1160
+ /* @__PURE__ */ s(M, { as: "div", margin: "medium 0 0 0", children: /* @__PURE__ */ s(
1161
+ It,
1697
1162
  {
1698
1163
  name: "organize-content-types",
1699
1164
  value: [...e.contentTypes],
1700
- onChange: (s) => n({ contentTypes: s }),
1701
- description: i("organizeContentTypesLegend"),
1702
- messages: t.contentTypes ? [{ type: "newError", text: i("organizeErrorPickAContentType") }] : void 0,
1165
+ onChange: (i) => n({ contentTypes: i }),
1166
+ description: o("organizeContentTypesLegend"),
1167
+ messages: t.contentTypes ? [{ type: "newError", text: o("organizeErrorPickAContentType") }] : void 0,
1703
1168
  layout: "columns",
1704
- children: Io.map((s) => /* @__PURE__ */ r(
1705
- pt,
1169
+ children: en.map((i) => /* @__PURE__ */ s(
1170
+ Fe,
1706
1171
  {
1707
- value: s,
1708
- label: ps(i, s),
1709
- disabled: o,
1710
- "data-testid": `organize-content-type-${s}`
1172
+ value: i,
1173
+ label: Mr(o, i),
1174
+ disabled: r,
1175
+ "data-testid": `organize-content-type-${i}`
1711
1176
  },
1712
- s
1177
+ i
1713
1178
  ))
1714
1179
  }
1715
1180
  ) }),
1716
- /* @__PURE__ */ r(E, { as: "div", margin: "medium 0 0 0", children: /* @__PURE__ */ g(
1717
- Xt,
1181
+ /* @__PURE__ */ s(M, { as: "div", margin: "medium 0 0 0", children: /* @__PURE__ */ m(
1182
+ It,
1718
1183
  {
1719
1184
  name: "organize-progression",
1720
- value: fs(e),
1721
- onChange: (s) => n({
1722
- setPrerequisites: s.includes(St),
1723
- setRequirements: s.includes(Mt)
1185
+ value: _r(e),
1186
+ onChange: (i) => n({
1187
+ setPrerequisites: i.includes(je),
1188
+ setRequirements: i.includes(Qe)
1724
1189
  }),
1725
- description: i("organizeProgressionLegend"),
1190
+ description: o("organizeProgressionLegend"),
1726
1191
  children: [
1727
- /* @__PURE__ */ r(
1728
- pt,
1192
+ /* @__PURE__ */ s(
1193
+ Fe,
1729
1194
  {
1730
- value: St,
1731
- label: i("organizeSetPrerequisites"),
1732
- disabled: o,
1195
+ value: je,
1196
+ label: o("organizeSetPrerequisites"),
1197
+ disabled: r,
1733
1198
  "data-testid": "organize-set-prerequisites"
1734
1199
  }
1735
1200
  ),
1736
- /* @__PURE__ */ r(
1737
- pt,
1201
+ /* @__PURE__ */ s(
1202
+ Fe,
1738
1203
  {
1739
- value: Mt,
1740
- label: i("organizeSetRequirements"),
1741
- disabled: o,
1204
+ value: Qe,
1205
+ label: o("organizeSetRequirements"),
1206
+ disabled: r,
1742
1207
  "data-testid": "organize-set-requirements"
1743
1208
  }
1744
1209
  )
1745
1210
  ]
1746
1211
  }
1747
1212
  ) }),
1748
- /* @__PURE__ */ g(E, { as: "div", margin: "medium 0 0 0", children: [
1749
- /* @__PURE__ */ r(
1750
- kr,
1213
+ /* @__PURE__ */ m(M, { as: "div", margin: "medium 0 0 0", children: [
1214
+ /* @__PURE__ */ s(
1215
+ Si,
1751
1216
  {
1752
- label: i("organizeDirectionLabel"),
1753
- placeholder: i("organizeDirectionPlaceholder"),
1217
+ label: o("organizeDirectionLabel"),
1218
+ placeholder: o("organizeDirectionPlaceholder"),
1754
1219
  value: e.direction,
1755
- onChange: (s) => n({ direction: s.target.value.slice(0, bt) }),
1756
- disabled: o,
1220
+ onChange: (i) => n({ direction: i.target.value.slice(0, Ye) }),
1221
+ disabled: r,
1757
1222
  height: "6rem",
1758
1223
  "data-testid": "organize-direction"
1759
1224
  }
1760
1225
  ),
1761
- /* @__PURE__ */ r(E, { as: "div", textAlign: "end", margin: "xx-small 0 0 0", children: /* @__PURE__ */ r(S, { size: "x-small", color: "secondary", "data-testid": "organize-direction-count", children: i("organizeDirectionCount", {
1226
+ /* @__PURE__ */ s(M, { as: "div", textAlign: "end", margin: "xx-small 0 0 0", children: /* @__PURE__ */ s(b, { size: "x-small", color: "secondary", "data-testid": "organize-direction-count", children: o("organizeDirectionCount", {
1762
1227
  used: e.direction.length,
1763
- max: bt
1228
+ max: Ye
1764
1229
  }) }) })
1765
1230
  ] })
1766
1231
  ] });
1767
1232
  }
1768
- const _o = "organize-preview", Eo = (e) => `proposed-module-${e + 1}`, Is = (e) => `${e.contentType}-${e.contentId}`;
1769
- function _s(e, t) {
1233
+ const tn = "organize-preview", nn = (e) => `proposed-module-${e + 1}`, Er = (e) => `${e.contentType}-${e.contentId}`;
1234
+ function Sr(e, t) {
1770
1235
  const n = e.completionRequirement;
1771
1236
  if (n)
1772
1237
  return { itemId: t, type: n.type, minScore: n.minScore ?? null };
1773
1238
  }
1774
- function Es(e, t, n) {
1775
- const o = Is(e);
1239
+ function yr(e, t, n) {
1240
+ const r = Er(e);
1776
1241
  return {
1777
- id: o,
1242
+ id: r,
1778
1243
  moduleId: t,
1779
1244
  title: e.title,
1780
1245
  type: e.contentType,
1781
1246
  position: n + 1,
1782
1247
  indent: 0,
1783
1248
  published: !0,
1784
- completionRequirement: _s(e, o) ?? null,
1785
- extensions: { [Zo]: e.isNew }
1249
+ completionRequirement: Sr(e, r) ?? null,
1250
+ extensions: { [Yn]: e.isNew }
1786
1251
  };
1787
1252
  }
1788
- function ys(e) {
1253
+ function Tr(e) {
1789
1254
  const t = /* @__PURE__ */ new Map();
1790
- return e.forEach((n, o) => {
1255
+ return e.forEach((n, r) => {
1791
1256
  t.set(
1792
1257
  n.position,
1793
- t.has(n.position) ? null : { id: Eo(o), name: n.name }
1258
+ t.has(n.position) ? null : { id: nn(r), name: n.name }
1794
1259
  );
1795
1260
  }), t;
1796
1261
  }
1797
- function bs(e, t, n) {
1798
- return e.prerequisitePositions.flatMap((o) => {
1799
- const i = n.get(o);
1800
- return !i || i.id === t ? [] : [i];
1262
+ function br(e, t, n) {
1263
+ return e.prerequisitePositions.flatMap((r) => {
1264
+ const o = n.get(r);
1265
+ return !o || o.id === t ? [] : [o];
1801
1266
  });
1802
1267
  }
1803
- function Ss(e) {
1804
- const t = ys(e.modules), n = [], o = {};
1805
- for (const [i, s] of e.modules.entries()) {
1806
- const l = Eo(i), a = s.items.map((c, u) => Es(c, l, u));
1807
- o[l] = a, n.push({
1268
+ function Pr(e) {
1269
+ const t = Tr(e.modules), n = [], r = {};
1270
+ for (const [o, i] of e.modules.entries()) {
1271
+ const l = nn(o), u = i.items.map((a, d) => yr(a, l, d));
1272
+ r[l] = u, n.push({
1808
1273
  id: l,
1809
- name: s.name,
1810
- position: s.position,
1274
+ name: i.name,
1275
+ position: i.position,
1811
1276
  published: !0,
1812
- itemCount: a.length,
1813
- items: a,
1814
- prerequisiteModules: bs(s, l, t),
1815
- requirementCount: s.requirementType === "one" ? 1 : null,
1277
+ itemCount: u.length,
1278
+ items: u,
1279
+ prerequisiteModules: br(i, l, t),
1280
+ requirementCount: i.requirementType === "one" ? 1 : null,
1816
1281
  requireSequentialProgress: !1,
1817
- completionRequirements: a.flatMap(
1818
- (c) => c.completionRequirement ? [c.completionRequirement] : []
1282
+ completionRequirements: u.flatMap(
1283
+ (a) => a.completionRequirement ? [a.completionRequirement] : []
1819
1284
  ),
1820
1285
  extensions: {
1821
- [Xo]: s.isNew,
1822
- [Qo]: s.items.filter((c) => c.isNew).length,
1823
- [Vo]: !0
1286
+ [Hn]: i.isNew,
1287
+ [Wn]: i.items.filter((a) => a.isNew).length,
1288
+ [Gn]: !0
1824
1289
  }
1825
1290
  });
1826
1291
  }
1827
- return { courseId: _o, modules: n, itemsByModuleId: o };
1292
+ return { courseId: tn, modules: n, itemsByModuleId: r };
1828
1293
  }
1829
- const Ms = {
1294
+ const Cr = {
1830
1295
  itemsLoadedAnnouncement: ""
1831
1296
  };
1832
- function Ts({ proposal: e }) {
1833
- const { t } = P(), n = F(() => Ss(e), [e]), o = F(() => tr(n), [n]), i = F(() => n.modules.map((l) => l.id), [n]), s = nr({
1834
- courseId: _o,
1835
- adapter: o,
1297
+ function vr({ proposal: e }) {
1298
+ const { t } = x(), n = F(() => Pr(e), [e]), r = F(() => Kn(n), [n]), o = F(() => n.modules.map((l) => l.id), [n]), i = Vn({
1299
+ courseId: tn,
1300
+ adapter: r,
1836
1301
  itemsMode: "inline",
1837
- initialExpandedModuleIds: i
1302
+ initialExpandedModuleIds: o
1838
1303
  });
1839
- return /* @__PURE__ */ g(Q, { children: [
1840
- /* @__PURE__ */ r(Ie, { level: "h3", margin: "0 0 medium 0", children: t("organizePreviewHeading") }),
1841
- /* @__PURE__ */ r(Ks, { data: s, headingLevel: "h3" })
1304
+ return /* @__PURE__ */ m(W, { children: [
1305
+ /* @__PURE__ */ s(ue, { level: "h3", margin: "0 0 medium 0", children: t("organizePreviewHeading") }),
1306
+ /* @__PURE__ */ s($r, { data: i, headingLevel: "h3" })
1842
1307
  ] });
1843
1308
  }
1844
- function Cs({ proposal: e }) {
1845
- const { t } = P(), n = _e(), o = F(() => pi(n), [n]), [i] = j(
1846
- () => new ar({ defaultOptions: { queries: { retry: !1 } } })
1309
+ function Lr({ proposal: e }) {
1310
+ const { t } = x(), n = Te(), r = F(() => Vi(n), [n]), [o] = G(
1311
+ () => new ei({ defaultOptions: { queries: { retry: !1 } } })
1847
1312
  );
1848
- return /* @__PURE__ */ g(E, { as: "div", "data-testid": "organize-proposal-preview", children: [
1849
- e.unplacedItems.length > 0 ? /* @__PURE__ */ g(ae, { variant: "warning", margin: "0 0 small 0", "data-testid": "organize-unplaced", children: [
1850
- /* @__PURE__ */ r(E, { as: "div", children: /* @__PURE__ */ r(S, { weight: "bold", children: t("organizeUnplacedHeading", { count: e.unplacedItems.length }) }) }),
1851
- /* @__PURE__ */ r(E, { as: "div", children: /* @__PURE__ */ r(S, { children: t("organizeUnplacedExplanation") }) }),
1852
- /* @__PURE__ */ r(Jt, { margin: "x-small 0 0 0", children: e.unplacedItems.map((s) => /* @__PURE__ */ r(en, { children: s.title }, `${s.contentType}-${s.contentId}`)) })
1313
+ return /* @__PURE__ */ m(M, { as: "div", "data-testid": "organize-proposal-preview", children: [
1314
+ e.unplacedItems.length > 0 ? /* @__PURE__ */ m(X, { variant: "warning", margin: "0 0 small 0", "data-testid": "organize-unplaced", children: [
1315
+ /* @__PURE__ */ s(M, { as: "div", children: /* @__PURE__ */ s(b, { weight: "bold", children: t("organizeUnplacedHeading", { count: e.unplacedItems.length }) }) }),
1316
+ /* @__PURE__ */ s(M, { as: "div", children: /* @__PURE__ */ s(b, { children: t("organizeUnplacedExplanation") }) }),
1317
+ /* @__PURE__ */ s(Ge, { margin: "x-small 0 0 0", children: e.unplacedItems.map((i) => /* @__PURE__ */ s(We, { children: i.title }, `${i.contentType}-${i.contentId}`)) })
1853
1318
  ] }) : null,
1854
- e.warnings.length > 0 ? /* @__PURE__ */ g(ae, { variant: "info", margin: "0 0 small 0", "data-testid": "organize-warnings", children: [
1855
- /* @__PURE__ */ r(E, { as: "div", children: /* @__PURE__ */ r(S, { weight: "bold", children: t("organizeWarningsHeading", { count: e.warnings.length }) }) }),
1856
- /* @__PURE__ */ r(Jt, { margin: "x-small 0 0 0", children: e.warnings.map((s) => /* @__PURE__ */ r(en, { children: s }, s)) })
1319
+ e.warnings.length > 0 ? /* @__PURE__ */ m(X, { variant: "info", margin: "0 0 small 0", "data-testid": "organize-warnings", children: [
1320
+ /* @__PURE__ */ s(M, { as: "div", children: /* @__PURE__ */ s(b, { weight: "bold", children: t("organizeWarningsHeading", { count: e.warnings.length }) }) }),
1321
+ /* @__PURE__ */ s(Ge, { margin: "x-small 0 0 0", children: e.warnings.map((i) => /* @__PURE__ */ s(We, { children: i }, i)) })
1857
1322
  ] }) : null,
1858
- /* @__PURE__ */ r(cr, { client: i, children: /* @__PURE__ */ r(Jo, { translations: Ms, children: /* @__PURE__ */ r(er, { value: o, children: /* @__PURE__ */ r(Ts, { proposal: e }) }) }) })
1323
+ /* @__PURE__ */ s(ti, { client: o, children: /* @__PURE__ */ s(jn, { translations: Cr, children: /* @__PURE__ */ s(Qn, { value: r, children: /* @__PURE__ */ s(vr, { proposal: e }) }) }) })
1859
1324
  ] });
1860
1325
  }
1861
- function Mn(e) {
1326
+ function vt(e) {
1862
1327
  const t = {};
1863
- return e.contentTypes.length === 0 && (t.contentTypes = "none_selected"), e.direction.length > bt && (t.direction = "too_long"), t;
1328
+ return e.contentTypes.length === 0 && (t.contentTypes = "none_selected"), e.direction.length > Ye && (t.direction = "too_long"), t;
1864
1329
  }
1865
- const Tn = (e) => Object.keys(e).length > 0, vs = 1e4, ws = (e) => e instanceof DOMException && e.name === "AbortError", Ps = (e) => e instanceof Error ? e : new Error(String(e)), As = { loading: "read", applying: "write" }, Cn = (e) => {
1330
+ const Lt = (e) => Object.keys(e).length > 0, wr = 1e4, Ar = (e) => e instanceof DOMException && e.name === "AbortError", Rr = (e) => e instanceof Error ? e : new Error(String(e)), kr = { loading: "read", applying: "write" }, wt = (e) => {
1866
1331
  (e == null ? void 0 : e.kind) === "read" && e.controller.abort();
1867
1332
  };
1868
- function Ls({
1333
+ function Or({
1869
1334
  actions: e,
1870
1335
  onApplied: t
1871
1336
  }) {
1872
- const [n, o] = j("form"), [i, s] = j(gs), [l, a] = j(null), [c, u] = j(null), [d, m] = j(!1), p = k(null), h = k(0), _ = k(!0);
1873
- W(() => (_.current = !0, () => {
1874
- _.current = !1, Cn(p.current), p.current = null;
1337
+ const [n, r] = G("form"), [o, i] = G(hr), [l, u] = G(null), [a, d] = G(null), [g, p] = G(!1), h = k(null), f = k(0), I = k(!0);
1338
+ B(() => (I.current = !0, () => {
1339
+ I.current = !1, wt(h.current), h.current = null;
1875
1340
  }), []);
1876
- const A = F(() => Mn(i), [i]), v = !Tn(A), z = V(() => {
1877
- Cn(p.current), p.current = null, h.current += 1, m(!1);
1878
- }, []), U = V((C) => {
1879
- s((R) => ({ ...R, ...C }));
1880
- }, []), M = V(
1881
- (C, R, B) => {
1882
- z();
1883
- const D = new AbortController(), ne = h.current;
1884
- p.current = { kind: As[C], controller: D }, u(null), o(C);
1885
- const G = () => _.current && h.current === ne;
1886
- B({ signal: D.signal, current: G }).catch((Z) => {
1887
- D.signal.aborted || ws(Z) || !G() || (u(Ps(Z)), o(R));
1341
+ const v = F(() => vt(o), [o]), L = !Lt(v), $ = U(() => {
1342
+ wt(h.current), h.current = null, f.current += 1, p(!1);
1343
+ }, []), O = U((T) => {
1344
+ i((w) => ({ ...w, ...T }));
1345
+ }, []), S = U(
1346
+ (T, w, H) => {
1347
+ $();
1348
+ const A = new AbortController(), re = f.current;
1349
+ h.current = { kind: kr[T], controller: A }, d(null), r(T);
1350
+ const D = () => I.current && f.current === re;
1351
+ H({ signal: A.signal, current: D }).catch((K) => {
1352
+ A.signal.aborted || Ar(K) || !D() || (d(Rr(K)), r(w));
1888
1353
  });
1889
1354
  },
1890
- [z]
1891
- ), L = V(() => {
1892
- Tn(Mn(i)) || M("loading", "error", async ({ signal: C, current: R }) => {
1893
- const B = await e.organize(i, C);
1894
- C.aborted || !R() || (a(B), o("preview"));
1355
+ [$]
1356
+ ), C = U(() => {
1357
+ Lt(vt(o)) || S("loading", "error", async ({ signal: T, current: w }) => {
1358
+ const H = await e.organize(o, T);
1359
+ T.aborted || !w() || (u(H), r("preview"));
1895
1360
  });
1896
- }, [e, i, M]), J = V(() => {
1897
- l !== null && M("applying", "preview", async ({ signal: C }) => {
1898
- await e.apply(l, i, C), t == null || t();
1361
+ }, [e, o, S]), Y = U(() => {
1362
+ l !== null && S("applying", "preview", async ({ signal: T }) => {
1363
+ await e.apply(l, o, T), t == null || t();
1899
1364
  });
1900
- }, [e, i, t, l, M]), X = V(() => {
1901
- z(), a(null), u(null), o("form");
1902
- }, [z]);
1903
- return W(() => {
1365
+ }, [e, o, t, l, S]), j = U(() => {
1366
+ $(), u(null), d(null), r("form");
1367
+ }, [$]);
1368
+ return B(() => {
1904
1369
  if (n !== "loading" && n !== "applying") return;
1905
- const C = setTimeout(() => m(!0), vs);
1906
- return () => clearTimeout(C);
1370
+ const T = setTimeout(() => p(!0), wr);
1371
+ return () => clearTimeout(T);
1907
1372
  }, [n]), {
1908
1373
  status: n,
1909
- input: i,
1910
- setInput: U,
1911
- errors: A,
1912
- canSubmit: v,
1374
+ input: o,
1375
+ setInput: O,
1376
+ errors: v,
1377
+ canSubmit: L,
1913
1378
  proposal: l,
1914
- error: c,
1915
- takingLong: d && (n === "loading" || n === "applying"),
1916
- submit: L,
1917
- regenerate: L,
1918
- apply: J,
1919
- cancel: X
1379
+ error: a,
1380
+ takingLong: g && (n === "loading" || n === "applying"),
1381
+ submit: C,
1382
+ regenerate: C,
1383
+ apply: Y,
1384
+ cancel: j
1920
1385
  };
1921
1386
  }
1922
- function vn({ label: e, takingLong: t }) {
1923
- const { t: n } = P();
1924
- return /* @__PURE__ */ g(E, { as: "div", padding: "x-large", textAlign: "center", "data-testid": "organize-working", children: [
1925
- /* @__PURE__ */ r(kt, { renderTitle: e }),
1926
- /* @__PURE__ */ r(E, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ r(S, { color: "secondary", children: e }) }),
1927
- t ? /* @__PURE__ */ r(E, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ r(S, { size: "small", color: "secondary", "data-testid": "organize-taking-long", children: n("organizeStillWorking") }) }) : null
1387
+ function At({ label: e, takingLong: t }) {
1388
+ const { t: n } = x();
1389
+ return /* @__PURE__ */ m(M, { as: "div", padding: "x-large", textAlign: "center", "data-testid": "organize-working", children: [
1390
+ /* @__PURE__ */ s(et, { renderTitle: e }),
1391
+ /* @__PURE__ */ s(M, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ s(b, { color: "secondary", children: e }) }),
1392
+ t ? /* @__PURE__ */ s(M, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ s(b, { size: "small", color: "secondary", "data-testid": "organize-taking-long", children: n("organizeStillWorking") }) }) : null
1928
1393
  ] });
1929
1394
  }
1930
- function Rs({
1395
+ function Dr({
1931
1396
  actions: e,
1932
1397
  open: t,
1933
1398
  onDismiss: n,
1934
- onApplied: o,
1935
- aiDisclosure: i
1399
+ onApplied: r,
1400
+ aiDisclosure: o
1936
1401
  }) {
1937
- const { t: s } = P(), l = k(!0);
1938
- W(() => (l.current = !0, () => {
1402
+ const { t: i } = x(), l = k(!0);
1403
+ B(() => (l.current = !0, () => {
1939
1404
  l.current = !1;
1940
1405
  }), []);
1941
- const a = Ls({
1406
+ const u = Or({
1942
1407
  actions: e,
1943
1408
  onApplied: () => {
1944
- K(s("organizeAppliedAnnouncement")), o == null || o(), l.current && n();
1409
+ N(i("organizeAppliedAnnouncement")), r == null || r(), l.current && n();
1945
1410
  }
1946
- }), { status: c, proposal: u, error: d, takingLong: m } = a;
1947
- return W(() => {
1948
- t && (c === "loading" && K(s("organizeLoadingLabel")), c === "applying" && K(s("organizeApplyingLabel")), c === "preview" && d === null && K(s("organizeProposalReadyAnnouncement")));
1949
- }, [t, c, d, s]), W(() => {
1950
- m && K(s("organizeStillWorking"));
1951
- }, [m, s]), /* @__PURE__ */ g(
1952
- wr,
1411
+ }), { status: a, proposal: d, error: g, takingLong: p } = u;
1412
+ return B(() => {
1413
+ t && (a === "loading" && N(i("organizeLoadingLabel")), a === "applying" && N(i("organizeApplyingLabel")), a === "preview" && g === null && N(i("organizeProposalReadyAnnouncement")));
1414
+ }, [t, a, g, i]), B(() => {
1415
+ p && N(i("organizeStillWorking"));
1416
+ }, [p, i]), /* @__PURE__ */ m(
1417
+ hi,
1953
1418
  {
1954
1419
  open: t,
1955
1420
  onDismiss: n,
1956
1421
  size: "large",
1957
- label: s("organizeModalLabel"),
1422
+ label: i("organizeModalLabel"),
1958
1423
  shouldCloseOnDocumentClick: !1,
1959
1424
  children: [
1960
- /* @__PURE__ */ g(Pr, { children: [
1961
- /* @__PURE__ */ r(
1962
- Tr,
1425
+ /* @__PURE__ */ m(Mi, { children: [
1426
+ /* @__PURE__ */ s(
1427
+ ci,
1963
1428
  {
1964
1429
  placement: "end",
1965
1430
  offset: "small",
1966
1431
  onClick: n,
1967
- screenReaderLabel: s("organizeCloseModal"),
1432
+ screenReaderLabel: i("organizeCloseModal"),
1968
1433
  "data-testid": "organize-close-modal"
1969
1434
  }
1970
1435
  ),
1971
- /* @__PURE__ */ g(I, { alignItems: "center", gap: "small", children: [
1972
- /* @__PURE__ */ r(I.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ r(Ie, { level: "h2", "data-testid": "organize-modal-title", children: s("organizeModalLabel") }) }),
1973
- i ? /* @__PURE__ */ r(I.Item, { "data-testid": "organize-ai-disclosure", children: i }) : null
1436
+ /* @__PURE__ */ m(_, { alignItems: "center", gap: "small", children: [
1437
+ /* @__PURE__ */ s(_.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ s(ue, { level: "h2", "data-testid": "organize-modal-title", children: i("organizeModalLabel") }) }),
1438
+ o ? /* @__PURE__ */ s(_.Item, { "data-testid": "organize-ai-disclosure", children: o }) : null
1974
1439
  ] })
1975
1440
  ] }),
1976
- /* @__PURE__ */ g(Ar, { children: [
1977
- c === "form" ? /* @__PURE__ */ r(
1978
- hs,
1441
+ /* @__PURE__ */ m(_i, { children: [
1442
+ a === "form" ? /* @__PURE__ */ s(
1443
+ Ir,
1979
1444
  {
1980
- input: a.input,
1981
- errors: a.errors,
1982
- onChange: a.setInput
1445
+ input: u.input,
1446
+ errors: u.errors,
1447
+ onChange: u.setInput
1983
1448
  }
1984
1449
  ) : null,
1985
- c === "loading" ? /* @__PURE__ */ r(vn, { label: s("organizeLoadingLabel"), takingLong: m }) : null,
1986
- c === "applying" ? /* @__PURE__ */ r(vn, { label: s("organizeApplyingLabel"), takingLong: m }) : null,
1987
- c === "preview" && u ? /* @__PURE__ */ g(Q, { children: [
1988
- d ? /* @__PURE__ */ r(
1989
- ae,
1450
+ a === "loading" ? /* @__PURE__ */ s(At, { label: i("organizeLoadingLabel"), takingLong: p }) : null,
1451
+ a === "applying" ? /* @__PURE__ */ s(At, { label: i("organizeApplyingLabel"), takingLong: p }) : null,
1452
+ a === "preview" && d ? /* @__PURE__ */ m(W, { children: [
1453
+ g ? /* @__PURE__ */ s(
1454
+ X,
1990
1455
  {
1991
1456
  variant: "error",
1992
1457
  margin: "0 0 small 0",
1993
- liveRegion: We,
1458
+ liveRegion: Se,
1994
1459
  liveRegionPoliteness: "assertive",
1995
1460
  "data-testid": "organize-apply-error",
1996
- children: s("organizeApplyFailed", { message: d.message })
1461
+ children: i("organizeApplyFailed", { message: g.message })
1997
1462
  }
1998
1463
  ) : null,
1999
- /* @__PURE__ */ r(Cs, { proposal: u })
1464
+ /* @__PURE__ */ s(Lr, { proposal: d })
2000
1465
  ] }) : null,
2001
- c === "error" ? /* @__PURE__ */ r(
2002
- ae,
1466
+ a === "error" ? /* @__PURE__ */ s(
1467
+ X,
2003
1468
  {
2004
1469
  variant: "error",
2005
1470
  margin: "0",
2006
- liveRegion: We,
1471
+ liveRegion: Se,
2007
1472
  liveRegionPoliteness: "assertive",
2008
1473
  "data-testid": "organize-error",
2009
- children: s("organizeFailed", { message: (d == null ? void 0 : d.message) ?? "" })
1474
+ children: i("organizeFailed", { message: (g == null ? void 0 : g.message) ?? "" })
2010
1475
  }
2011
1476
  ) : null
2012
1477
  ] }),
2013
- /* @__PURE__ */ g(Lr, { children: [
2014
- c === "form" ? /* @__PURE__ */ g(Q, { children: [
2015
- /* @__PURE__ */ r(H, { onClick: n, margin: "0 x-small 0 0", "data-testid": "organize-close", children: s("organizeCancel") }),
2016
- /* @__PURE__ */ r(
2017
- H,
1478
+ /* @__PURE__ */ m(Ii, { children: [
1479
+ a === "form" ? /* @__PURE__ */ m(W, { children: [
1480
+ /* @__PURE__ */ s(z, { onClick: n, margin: "0 x-small 0 0", "data-testid": "organize-close", children: i("organizeCancel") }),
1481
+ /* @__PURE__ */ s(
1482
+ z,
2018
1483
  {
2019
1484
  color: "ai-primary",
2020
- onClick: a.submit,
2021
- interaction: a.canSubmit ? "enabled" : "disabled",
1485
+ onClick: u.submit,
1486
+ interaction: u.canSubmit ? "enabled" : "disabled",
2022
1487
  "data-testid": "organize-submit",
2023
- children: s("organizeSubmit")
1488
+ children: i("organizeSubmit")
2024
1489
  }
2025
1490
  )
2026
1491
  ] }) : null,
2027
- c === "loading" ? /* @__PURE__ */ r(H, { onClick: a.cancel, "data-testid": "organize-cancel-loading", children: s("organizeCancel") }) : null,
2028
- c === "preview" ? /* @__PURE__ */ g(Q, { children: [
2029
- /* @__PURE__ */ r(H, { onClick: a.cancel, margin: "0 x-small 0 0", "data-testid": "organize-back", children: s("organizeStartOver") }),
2030
- /* @__PURE__ */ r(
2031
- H,
1492
+ a === "loading" ? /* @__PURE__ */ s(z, { onClick: u.cancel, "data-testid": "organize-cancel-loading", children: i("organizeCancel") }) : null,
1493
+ a === "preview" ? /* @__PURE__ */ m(W, { children: [
1494
+ /* @__PURE__ */ s(z, { onClick: u.cancel, margin: "0 x-small 0 0", "data-testid": "organize-back", children: i("organizeStartOver") }),
1495
+ /* @__PURE__ */ s(
1496
+ z,
2032
1497
  {
2033
- onClick: a.regenerate,
1498
+ onClick: u.regenerate,
2034
1499
  margin: "0 x-small 0 0",
2035
1500
  "data-testid": "organize-regenerate",
2036
- children: s("organizeRegenerate")
1501
+ children: i("organizeRegenerate")
2037
1502
  }
2038
1503
  ),
2039
- /* @__PURE__ */ r(H, { color: "primary", onClick: a.apply, "data-testid": "organize-apply", children: s("organizeApply") })
1504
+ /* @__PURE__ */ s(z, { color: "primary", onClick: u.apply, "data-testid": "organize-apply", children: i("organizeApply") })
2040
1505
  ] }) : null,
2041
- c === "error" ? /* @__PURE__ */ g(Q, { children: [
2042
- /* @__PURE__ */ r(H, { onClick: a.cancel, margin: "0 x-small 0 0", "data-testid": "organize-back", children: s("organizeStartOver") }),
2043
- /* @__PURE__ */ r(H, { color: "primary", onClick: a.submit, "data-testid": "organize-retry", children: s("organizeTryAgain") })
1506
+ a === "error" ? /* @__PURE__ */ m(W, { children: [
1507
+ /* @__PURE__ */ s(z, { onClick: u.cancel, margin: "0 x-small 0 0", "data-testid": "organize-back", children: i("organizeStartOver") }),
1508
+ /* @__PURE__ */ s(z, { color: "primary", onClick: u.submit, "data-testid": "organize-retry", children: i("organizeTryAgain") })
2044
1509
  ] }) : null,
2045
- c === "applying" ? /* @__PURE__ */ r(H, { interaction: "disabled", "data-testid": "organize-applying", children: s("organizeApply") }) : null
1510
+ a === "applying" ? /* @__PURE__ */ s(z, { interaction: "disabled", "data-testid": "organize-applying", children: i("organizeApply") }) : null
2046
1511
  ] })
2047
1512
  ]
2048
1513
  }
2049
1514
  );
2050
1515
  }
2051
- function ks({
1516
+ function qr({
2052
1517
  actions: e,
2053
1518
  onApplied: t,
2054
1519
  aiDisclosure: n,
2055
- display: o = "inline-block"
1520
+ display: r = "inline-block"
2056
1521
  }) {
2057
- const { t: i } = P(), [s, l] = j(!1);
2058
- return /* @__PURE__ */ g(Q, { children: [
2059
- /* @__PURE__ */ r(
2060
- H,
1522
+ const { t: o } = x(), [i, l] = G(!1);
1523
+ return /* @__PURE__ */ m(W, { children: [
1524
+ /* @__PURE__ */ s(
1525
+ z,
2061
1526
  {
2062
1527
  color: "ai-primary",
2063
- display: o,
1528
+ display: r,
2064
1529
  onClick: () => l(!0),
2065
- renderIcon: s ? /* @__PURE__ */ r(pr, {}) : /* @__PURE__ */ r(fr, {}),
1530
+ renderIcon: i ? /* @__PURE__ */ s(oi, {}) : /* @__PURE__ */ s(li, {}),
2066
1531
  "data-testid": "organize-modules-trigger",
2067
- children: i("organizeModulesTrigger")
1532
+ children: o("organizeModulesTrigger")
2068
1533
  }
2069
1534
  ),
2070
- s ? /* @__PURE__ */ r(
2071
- Rs,
1535
+ i ? /* @__PURE__ */ s(
1536
+ Dr,
2072
1537
  {
2073
1538
  actions: e,
2074
1539
  open: !0,
@@ -2079,247 +1544,14 @@ function ks({
2079
1544
  ) : null
2080
1545
  ] });
2081
1546
  }
2082
- function Os(e) {
2083
- switch (e) {
2084
- case "complete":
2085
- return "complete";
2086
- case "locked":
2087
- return "locked";
2088
- case void 0:
2089
- case "not_started":
2090
- return "notStarted";
2091
- case "in_progress":
2092
- return "inProgress";
2093
- case "missing":
2094
- case "incomplete":
2095
- case "missing_and_incomplete":
2096
- return "missing";
2097
- }
2098
- }
2099
- function ft(e) {
2100
- return (t, n) => {
2101
- const { newTheme: o } = n;
2102
- return {
2103
- backgroundPrimaryInverse: o.semantics(o.primitives).color.background.accent[e]
2104
- };
2105
- };
2106
- }
2107
- const xs = {
2108
- missing: {
2109
- background: "primary-inverse",
2110
- borderWidth: "none",
2111
- themeOverride: ft("honey"),
2112
- icon: /* @__PURE__ */ r(fe, { size: "sm", color: "onColor" })
2113
- },
2114
- complete: {
2115
- background: "primary-inverse",
2116
- borderWidth: "none",
2117
- themeOverride: ft("aurora"),
2118
- icon: /* @__PURE__ */ r(At, { size: "sm", color: "onColor" })
2119
- },
2120
- inProgress: {
2121
- background: "primary-inverse",
2122
- borderWidth: "none",
2123
- themeOverride: ft("sky"),
2124
- icon: /* @__PURE__ */ r(Lt, { size: "sm", color: "onColor" })
2125
- },
2126
- notStarted: {
2127
- background: "primary",
2128
- borderWidth: "medium",
2129
- icon: /* @__PURE__ */ r(Rt, { size: "sm", color: "baseColor" })
2130
- },
2131
- locked: {
2132
- background: "secondary",
2133
- borderWidth: "small",
2134
- icon: /* @__PURE__ */ r(Pt, { size: "sm", color: "baseColor" })
2135
- }
2136
- };
2137
- function Ds(e) {
2138
- var l, a, c;
2139
- let t = 0, n = 0, o = 0;
2140
- for (const u of e)
2141
- ((l = u.progress) == null ? void 0 : l.status) === "complete" && (t += 1), n += ((a = u.progress) == null ? void 0 : a.requirementCount) ?? 0, o += ((c = u.progress) == null ? void 0 : c.requirementsMet) ?? 0;
2142
- const i = e.length, s = i === 0 ? 0 : t === i ? 100 : Math.floor(t / i * 100);
2143
- return {
2144
- totalModules: i,
2145
- completedModules: t,
2146
- totalItems: n,
2147
- completedItems: o,
2148
- percent: s
2149
- };
2150
- }
2151
- const Tt = 32, Ns = "4px", zs = 4, qs = { none: 0, small: 1, medium: 2 };
2152
- function $s(e, t, n) {
2153
- const o = zs + n / 2, i = e ? Tt / 2 : o, s = t ? Tt / 2 : o;
2154
- return `${i}px ${s}px ${s}px ${i}px`;
2155
- }
2156
- function Fs({
2157
- module: e,
2158
- isFirst: t,
2159
- isLast: n,
2160
- onClick: o
2161
- }) {
2162
- var p, h, _;
2163
- const { t: i } = P(), l = Ae().moduleLabel(e.position, e), a = l ? i("moduleNameWithLabel", { label: l, name: e.name }) : e.name, c = ((p = e.progress) == null ? void 0 : p.status) ?? "not_started", u = Os(c), d = i("moduleProgressSegmentLabel", {
2164
- name: a,
2165
- status: io(
2166
- i,
2167
- c,
2168
- ((h = e.progress) == null ? void 0 : h.missingCount) ?? 0,
2169
- ((_ = e.progress) == null ? void 0 : _.incompleteCount) ?? 0
2170
- )
2171
- }), m = xs[u];
2172
- return /* @__PURE__ */ r(I.Item, { shouldGrow: !0, shouldShrink: !0, size: "0", children: /* @__PURE__ */ r(qn, { renderTip: a, children: () => /* @__PURE__ */ g(
2173
- E,
2174
- {
2175
- as: "button",
2176
- type: "button",
2177
- display: "block",
2178
- width: "100%",
2179
- height: `${Tt}px`,
2180
- padding: "0",
2181
- borderRadius: $s(t, n, qs[m.borderWidth]),
2182
- borderWidth: m.borderWidth,
2183
- borderColor: "secondary",
2184
- background: m.background,
2185
- themeOverride: m.themeOverride,
2186
- cursor: o ? "pointer" : void 0,
2187
- onClick: o ? () => o(e.id) : void 0,
2188
- "data-testid": `modules-progress-segment-${e.id}`,
2189
- children: [
2190
- /* @__PURE__ */ r(I, { as: "span", height: "100%", justifyItems: "center", alignItems: "center", children: m.icon }),
2191
- /* @__PURE__ */ r(Ye, { children: d })
2192
- ]
2193
- }
2194
- ) }) });
2195
- }
2196
- function Us({
2197
- modules: e,
2198
- onModuleClick: t,
2199
- hasMoreModules: n = !1,
2200
- continuesBefore: o = !1,
2201
- continuesAfter: i = !1,
2202
- pagination: s
2203
- }) {
2204
- const { t: l } = P(), a = F(() => Ds(e), [e]);
2205
- if (!e.some((m) => m.progress !== void 0) || a.totalModules === 0) return null;
2206
- const u = l("moduleProgressOverviewSummary", {
2207
- count: a.totalModules,
2208
- completedModules: a.completedModules,
2209
- totalModules: a.totalModules
2210
- }), d = a.totalItems > 0 ? l("moduleProgressOverviewDetail", {
2211
- itemsSummary: l("moduleProgressOverviewItemsSummary", {
2212
- count: a.totalItems,
2213
- completedItems: a.completedItems,
2214
- totalItems: a.totalItems
2215
- })
2216
- }) : null;
2217
- return /* @__PURE__ */ g(E, { as: "div", margin: "0 0 small 0", "data-testid": "modules-progress-overview", children: [
2218
- n ? null : /* @__PURE__ */ r(I, { wrap: "wrap", children: /* @__PURE__ */ g(I.Item, { children: [
2219
- /* @__PURE__ */ r(E, { as: "span", margin: "0 x-small 0 0", children: /* @__PURE__ */ r(
2220
- Ie,
2221
- {
2222
- level: "reset",
2223
- variant: "titleSection",
2224
- "data-testid": "modules-progress-overview-percent",
2225
- children: l("moduleProgressOverviewPercentLabel", { percent: a.percent })
2226
- }
2227
- ) }),
2228
- /* @__PURE__ */ r(S, { variant: "content", "data-testid": "modules-progress-overview-summary", children: d ? `${u} ${d}` : u })
2229
- ] }) }),
2230
- /* @__PURE__ */ r(E, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ r(
2231
- I,
2232
- {
2233
- gap: Ns,
2234
- role: "group",
2235
- "aria-label": l("moduleProgressOverviewGroupLabel"),
2236
- "data-testid": "modules-progress-overview-segments",
2237
- children: e.map((m, p) => /* @__PURE__ */ r(
2238
- Fs,
2239
- {
2240
- module: m,
2241
- isFirst: p === 0 && !o,
2242
- isLast: p === e.length - 1 && !i,
2243
- onClick: t
2244
- },
2245
- m.id
2246
- ))
2247
- }
2248
- ) }),
2249
- s ? /* @__PURE__ */ r(Bs, { pagination: s, shownCount: e.length }) : null
2250
- ] });
2251
- }
2252
- function Bs({
2253
- pagination: e,
2254
- shownCount: t
2255
- }) {
2256
- const { t: n } = P(), { rangeStart: o, totalCount: i, hasPreviousPage: s, hasNextPage: l, disabled: a = !1 } = e, c = k(null), u = k(null), d = k(null);
2257
- W(() => {
2258
- var h, _;
2259
- if (a) return;
2260
- const p = d.current;
2261
- d.current = null, p === "next" && !l && ((h = c.current) == null || h.focus()), p === "previous" && !s && ((_ = u.current) == null || _.focus());
2262
- }, [a, l, s]);
2263
- const m = (p) => {
2264
- a || (d.current = p, p === "next" ? e.onNextPage() : e.onPreviousPage());
2265
- };
2266
- return /* @__PURE__ */ r(E, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ g(
2267
- I,
2268
- {
2269
- as: "nav",
2270
- justifyItems: "space-between",
2271
- alignItems: "center",
2272
- gap: "x-small",
2273
- "aria-label": n("moduleProgressOverviewPaginationLabel"),
2274
- "data-testid": "modules-progress-overview-pagination",
2275
- children: [
2276
- /* @__PURE__ */ r(
2277
- _t,
2278
- {
2279
- size: "small",
2280
- withBackground: !1,
2281
- withBorder: !1,
2282
- renderIcon: /* @__PURE__ */ r(hr, {}),
2283
- screenReaderLabel: n("paginationPreviousPage"),
2284
- interaction: s ? "enabled" : "disabled",
2285
- elementRef: (p) => {
2286
- c.current = p;
2287
- },
2288
- onClick: () => m("previous")
2289
- }
2290
- ),
2291
- i === null ? null : /* @__PURE__ */ r(S, { size: "small", color: "secondary", "data-testid": "modules-progress-overview-range", children: n("moduleProgressOverviewPageRange", {
2292
- start: o,
2293
- end: o + t - 1,
2294
- total: i
2295
- }) }),
2296
- /* @__PURE__ */ r(
2297
- _t,
2298
- {
2299
- size: "small",
2300
- withBackground: !1,
2301
- withBorder: !1,
2302
- renderIcon: /* @__PURE__ */ r(Ir, {}),
2303
- screenReaderLabel: n("paginationNextPage"),
2304
- interaction: l ? "enabled" : "disabled",
2305
- elementRef: (p) => {
2306
- u.current = p;
2307
- },
2308
- onClick: () => m("next")
2309
- }
2310
- )
2311
- ]
2312
- }
2313
- ) });
2314
- }
2315
- function Gs({
1547
+ function zr({
2316
1548
  counts: e,
2317
1549
  itemsMode: t,
2318
1550
  loadedModules: n
2319
1551
  }) {
2320
- const o = e.listModules + e.listModuleItems;
2321
- return /* @__PURE__ */ r(
2322
- E,
1552
+ const r = e.listModules + e.listModuleItems;
1553
+ return /* @__PURE__ */ s(
1554
+ M,
2323
1555
  {
2324
1556
  as: "div",
2325
1557
  background: "secondary",
@@ -2328,25 +1560,25 @@ function Gs({
2328
1560
  padding: "x-small small",
2329
1561
  margin: "0 0 small 0",
2330
1562
  "data-testid": "dev-diagnostics",
2331
- children: /* @__PURE__ */ g(I, { gap: "medium", wrap: "wrap", children: [
2332
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ r(S, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
2333
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ g(S, { size: "x-small", "data-testid": "request-count-list-modules", children: [
1563
+ children: /* @__PURE__ */ m(_, { gap: "medium", wrap: "wrap", children: [
1564
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ s(b, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
1565
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(b, { size: "x-small", "data-testid": "request-count-list-modules", children: [
2334
1566
  "listModules: ",
2335
1567
  e.listModules
2336
1568
  ] }) }),
2337
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ g(S, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
1569
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(b, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
2338
1570
  "listModuleItems: ",
2339
1571
  e.listModuleItems
2340
1572
  ] }) }),
2341
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ g(S, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
1573
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(b, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
2342
1574
  "total: ",
2343
- o
1575
+ r
2344
1576
  ] }) }),
2345
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ g(S, { size: "x-small", "data-testid": "resolved-items-mode", children: [
1577
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(b, { size: "x-small", "data-testid": "resolved-items-mode", children: [
2346
1578
  "itemsMode: ",
2347
1579
  t ?? "probing…"
2348
1580
  ] }) }),
2349
- /* @__PURE__ */ r(I.Item, { children: /* @__PURE__ */ g(S, { size: "x-small", "data-testid": "modules-loaded-count", children: [
1581
+ /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(b, { size: "x-small", "data-testid": "modules-loaded-count", children: [
2350
1582
  "modules loaded: ",
2351
1583
  n
2352
1584
  ] }) })
@@ -2354,172 +1586,172 @@ function Gs({
2354
1586
  }
2355
1587
  );
2356
1588
  }
2357
- const Ws = 200;
2358
- function Hs({
1589
+ const Nr = 200;
1590
+ function xr({
2359
1591
  data: e,
2360
1592
  today: t,
2361
1593
  requestCounts: n,
2362
- showDiagnostics: o = n !== void 0,
2363
- as: i = "div",
2364
- headingLevel: s = "h2",
1594
+ showDiagnostics: r = n !== void 0,
1595
+ as: o = "div",
1596
+ headingLevel: i = "h2",
2365
1597
  organizationActions: l,
2366
- onOrganizationApplied: a,
2367
- organizationAiDisclosure: c,
2368
- breakpoints: u = {}
1598
+ onOrganizationApplied: u,
1599
+ organizationAiDisclosure: a,
1600
+ breakpoints: d = {}
2369
1601
  }) {
2370
- const { miniTablet: d, tablet: m, desktop: p, desktopNavOpen: h, desktopOnly: _, mobileOnly: A, ICEDesktop: v } = u, z = F(
2371
- () => ({ miniTablet: d, tablet: m, desktop: p, desktopNavOpen: h, desktopOnly: _, mobileOnly: A, ICEDesktop: v }),
2372
- [d, m, p, h, _, A, v]
1602
+ const { miniTablet: g, tablet: p, desktop: h, desktopNavOpen: f, desktopOnly: I, mobileOnly: v, ICEDesktop: L } = d, $ = F(
1603
+ () => ({ miniTablet: g, tablet: p, desktop: h, desktopNavOpen: f, desktopOnly: I, mobileOnly: v, ICEDesktop: L }),
1604
+ [g, p, h, f, I, v, L]
2373
1605
  ), {
2374
- modules: U,
2375
- page: M,
2376
- pageCount: L,
2377
- pageSize: J,
2378
- pageInfo: X,
2379
- hasNextPage: C,
2380
- hasPreviousPage: R,
2381
- goToFirstPage: B,
2382
- goToPreviousPage: D,
2383
- goToNextPage: ne,
2384
- goToLastPage: G,
2385
- isLoading: Z,
2386
- isRefreshing: N,
2387
- error: $,
2388
- itemsMode: ee,
2389
- expandedModuleIds: O,
2390
- expandModule: ce,
2391
- collapseModule: Le,
2392
- toggleModule: Re,
2393
- expandModules: oe,
2394
- collapseModules: ke,
2395
- expandAllModules: Oe,
2396
- collapseAllModules: Je,
2397
- isPersistingCollapsed: xe,
2398
- getItems: ue,
2399
- filter: re,
2400
- setFilter: y,
2401
- filterEntry: Y,
2402
- filterPredicate: q
2403
- } = e, { t: T, timezone: $t } = P(), De = Ve(), { filters: Ft } = _e(), So = F(() => je(Ft).length > 0, [Ft]), Ut = k(null), et = k(/* @__PURE__ */ new Map()), tt = k(/* @__PURE__ */ new Map()), te = A === !0, ye = k(null), Mo = V((f) => {
2404
- var w, se;
2405
- (w = et.current.get(f)) == null || w.scrollIntoView({ behavior: "smooth", block: "start" }), (se = tt.current.get(f)) == null || se.focus({ preventScroll: !0 });
2406
- }, []), To = V((f, w) => {
2407
- w ? tt.current.set(f, w) : tt.current.delete(f);
2408
- }, []), [Co] = j(() => /* @__PURE__ */ new Date()), nt = t ?? Co;
2409
- W(() => {
2410
- var w;
2411
- if (ye.current === null || N) return;
2412
- const f = ye.current === "focusList";
2413
- ye.current = null, K(T("pageChangedAnnouncement", { page: M, pageCount: L })), f && ((w = Ut.current) == null || w.focus());
2414
- }, [N, M, L, T]);
2415
- const ot = V(
2416
- (f, w = "focusList") => {
2417
- ye.current = w, De("paginate-modules"), f === 1 ? B() : f === M - 1 ? D() : f === M + 1 ? ne() : f === L && G();
1606
+ modules: O,
1607
+ page: S,
1608
+ pageCount: C,
1609
+ pageSize: Y,
1610
+ pageInfo: j,
1611
+ hasNextPage: T,
1612
+ hasPreviousPage: w,
1613
+ goToFirstPage: H,
1614
+ goToPreviousPage: A,
1615
+ goToNextPage: re,
1616
+ goToLastPage: D,
1617
+ isLoading: K,
1618
+ isRefreshing: q,
1619
+ error: ee,
1620
+ itemsMode: ce,
1621
+ expandedModuleIds: R,
1622
+ expandModule: nt,
1623
+ collapseModule: it,
1624
+ toggleModule: rt,
1625
+ expandModules: on,
1626
+ collapseModules: ln,
1627
+ expandAllModules: an,
1628
+ collapseAllModules: un,
1629
+ isPersistingCollapsed: dn,
1630
+ getItems: Pe,
1631
+ filter: me,
1632
+ setFilter: st,
1633
+ filterEntry: cn,
1634
+ filterPredicate: Ce
1635
+ } = e, { t: E, timezone: ot } = x(), ge = Xe(), { filters: lt } = Te(), mn = F(() => Ze(lt).length > 0, [lt]), at = k(null), ve = k(/* @__PURE__ */ new Map()), Le = k(/* @__PURE__ */ new Map()), Q = v === !0, se = k(null), gn = U((c) => {
1636
+ var y, Z;
1637
+ (y = ve.current.get(c)) == null || y.scrollIntoView({ behavior: "smooth", block: "start" }), (Z = Le.current.get(c)) == null || Z.focus({ preventScroll: !0 });
1638
+ }, []), pn = U((c, y) => {
1639
+ y ? Le.current.set(c, y) : Le.current.delete(c);
1640
+ }, []), [fn] = G(() => /* @__PURE__ */ new Date()), we = t ?? fn;
1641
+ B(() => {
1642
+ var y;
1643
+ if (se.current === null || q) return;
1644
+ const c = se.current === "focusList";
1645
+ se.current = null, N(E("pageChangedAnnouncement", { page: S, pageCount: C })), c && ((y = at.current) == null || y.focus());
1646
+ }, [q, S, C, E]);
1647
+ const Ae = U(
1648
+ (c, y = "focusList") => {
1649
+ se.current = y, ge("paginate-modules"), c === 1 ? H() : c === S - 1 ? A() : c === S + 1 ? re() : c === C && D();
2418
1650
  },
2419
- [M, L, B, D, ne, G, De]
2420
- ), rt = F(
2421
- () => U.filter(
2422
- (f) => q === void 0 || q(f, { today: nt, timezone: $t })
1651
+ [S, C, H, A, re, D, ge]
1652
+ ), Re = F(
1653
+ () => O.filter(
1654
+ (c) => Ce === void 0 || Ce(c, { today: we, timezone: ot })
2423
1655
  ),
2424
- [U, q, nt, $t]
2425
- ), Bt = k({
2426
- rows: rt,
2427
- expanded: O,
1656
+ [O, Ce, we, ot]
1657
+ ), ut = k({
1658
+ rows: Re,
1659
+ expanded: R,
2428
1660
  items: /* @__PURE__ */ new Map()
2429
- }), [x, be] = j(null);
2430
- N ? x === null && be(Bt.current) : (Bt.current = {
2431
- rows: rt,
2432
- expanded: O,
2433
- items: new Map(O.map((f) => [f, ue(f)]))
2434
- }, x !== null && be(null));
2435
- const ie = (x == null ? void 0 : x.rows) ?? rt, it = (x == null ? void 0 : x.expanded) ?? O, Gt = F(() => new Set(it), [it]), Se = F(
2436
- () => ie.filter((f) => Gt.has(f.id)).map((f) => f.id),
2437
- [ie, Gt]
2438
- ), Wt = Se.length > 0, [st, lt] = j(!1), Ne = Se.filter((f) => ue(f).isLoading).length, de = k(!1);
2439
- W(() => {
2440
- if (st) {
2441
- if (Ne > 0 && !de.current) {
2442
- de.current = !0, K(T("expandAllLoadingItems", { count: Ne }));
1661
+ }), [P, oe] = G(null);
1662
+ q ? P === null && oe(ut.current) : (ut.current = {
1663
+ rows: Re,
1664
+ expanded: R,
1665
+ items: new Map(R.map((c) => [c, Pe(c)]))
1666
+ }, P !== null && oe(null));
1667
+ const V = (P == null ? void 0 : P.rows) ?? Re, ke = (P == null ? void 0 : P.expanded) ?? R, dt = F(() => new Set(ke), [ke]), le = F(
1668
+ () => V.filter((c) => dt.has(c.id)).map((c) => c.id),
1669
+ [V, dt]
1670
+ ), ct = le.length > 0, [Oe, De] = G(!1), pe = le.filter((c) => Pe(c).isLoading).length, te = k(!1);
1671
+ B(() => {
1672
+ if (Oe) {
1673
+ if (pe > 0 && !te.current) {
1674
+ te.current = !0, N(E("expandAllLoadingItems", { count: pe }));
2443
1675
  return;
2444
1676
  }
2445
- Ne === 0 && (de.current && O.length > 0 && K(T("expandAllItemsLoaded")), de.current = !1, lt(!1));
1677
+ pe === 0 && (te.current && R.length > 0 && N(E("expandAllItemsLoaded")), te.current = !1, De(!1));
2446
1678
  }
2447
- }, [st, Ne, O.length, T]);
2448
- const at = st || xe, ct = k(null), ut = k(!1);
2449
- W(() => {
2450
- var f;
2451
- at || !ut.current || (ut.current = !1, (f = ct.current) == null || f.focus());
2452
- }, [at]);
2453
- const vo = () => {
2454
- if (ut.current = document.activeElement === ct.current, Wt) {
2455
- De("collapse-all");
2456
- const w = new Set(Se);
2457
- lt(!1), de.current = !1, re === Fe ? Je() : ke(Se), x !== null && be({ ...x, expanded: x.expanded.filter((se) => !w.has(se)) }), K(T("modulesCollapsedAnnouncement", { count: Se.length }));
1679
+ }, [Oe, pe, R.length, E]);
1680
+ const qe = Oe || dn, ze = k(null), Ne = k(!1);
1681
+ B(() => {
1682
+ var c;
1683
+ qe || !Ne.current || (Ne.current = !1, (c = ze.current) == null || c.focus());
1684
+ }, [qe]);
1685
+ const hn = () => {
1686
+ if (Ne.current = document.activeElement === ze.current, ct) {
1687
+ ge("collapse-all");
1688
+ const y = new Set(le);
1689
+ De(!1), te.current = !1, me === Ie ? un() : ln(le), P !== null && oe({ ...P, expanded: P.expanded.filter((Z) => !y.has(Z)) }), N(E("modulesCollapsedAnnouncement", { count: le.length }));
2458
1690
  return;
2459
1691
  }
2460
- De("expand-all");
2461
- const f = ie.map((w) => w.id);
2462
- lt(!0), de.current = !1, re === Fe ? Oe() : oe(f), x !== null && be({ ...x, expanded: f }), K(T("modulesExpandedAnnouncement", { count: f.length }));
2463
- }, Ht = k(x);
2464
- Ht.current = x;
2465
- const wo = V(
2466
- (f) => {
2467
- const w = Ht.current;
2468
- if (w === null) {
2469
- Re(f);
1692
+ ge("expand-all");
1693
+ const c = V.map((y) => y.id);
1694
+ De(!0), te.current = !1, me === Ie ? an() : on(c), P !== null && oe({ ...P, expanded: c }), N(E("modulesExpandedAnnouncement", { count: c.length }));
1695
+ }, mt = k(P);
1696
+ mt.current = P;
1697
+ const Mn = U(
1698
+ (c) => {
1699
+ const y = mt.current;
1700
+ if (y === null) {
1701
+ rt(c);
2470
1702
  return;
2471
1703
  }
2472
- const se = w.expanded.includes(f);
2473
- be({
2474
- ...w,
2475
- expanded: se ? w.expanded.filter((Lo) => Lo !== f) : [...w.expanded, f]
2476
- }), se ? Le(f) : ce(f);
1704
+ const Z = y.expanded.includes(c);
1705
+ oe({
1706
+ ...y,
1707
+ expanded: Z ? y.expanded.filter((En) => En !== c) : [...y.expanded, c]
1708
+ }), Z ? it(c) : nt(c);
2477
1709
  },
2478
- [Re, Le, ce]
2479
- ), [Po, Kt] = j(!1);
2480
- W(() => {
2481
- if (!N) {
2482
- Kt(!1);
1710
+ [rt, it, nt]
1711
+ ), [_n, gt] = G(!1);
1712
+ B(() => {
1713
+ if (!q) {
1714
+ gt(!1);
2483
1715
  return;
2484
1716
  }
2485
- const f = setTimeout(() => Kt(!0), Ws);
2486
- return () => clearTimeout(f);
2487
- }, [N]);
2488
- const ze = Y !== void 0 && re !== Fe, dt = Z || N && ie.length === 0, qe = ie.length === 0 && !dt && !$, $e = qe && ze, mt = s === "h1" ? "h2" : "h3";
2489
- W(() => {
2490
- $e && K(T("filteredEmptyStateTitle"));
2491
- }, [$e, T]);
2492
- const jt = L > 1 || C || R, Ao = L > 1 && !dt && !qe && !$e;
2493
- return /* @__PURE__ */ g(E, { as: i, display: "block", "data-testid": "modules-list", children: [
2494
- /* @__PURE__ */ r(
2495
- Us,
1717
+ const c = setTimeout(() => gt(!0), Nr);
1718
+ return () => clearTimeout(c);
1719
+ }, [q]);
1720
+ const fe = cn !== void 0 && me !== Ie, xe = K || q && V.length === 0, he = V.length === 0 && !xe && !ee, Me = he && fe, $e = i === "h1" ? "h2" : "h3";
1721
+ B(() => {
1722
+ Me && N(E("filteredEmptyStateTitle"));
1723
+ }, [Me, E]);
1724
+ const pt = C > 1 || T || w, In = C > 1 && !xe && !he && !Me;
1725
+ return /* @__PURE__ */ m(M, { as: o, display: "block", "data-testid": "modules-list", children: [
1726
+ /* @__PURE__ */ s(
1727
+ Zn,
2496
1728
  {
2497
- modules: U,
2498
- hasMoreModules: jt || ze,
2499
- continuesBefore: R,
2500
- continuesAfter: C,
2501
- onModuleClick: Mo,
2502
- pagination: jt ? {
2503
- rangeStart: (M - 1) * J + 1,
2504
- totalCount: X.totalCount,
2505
- hasPreviousPage: R,
2506
- hasNextPage: C,
2507
- onPreviousPage: () => ot(M - 1, "keepFocus"),
2508
- onNextPage: () => ot(M + 1, "keepFocus"),
2509
- disabled: N
1729
+ modules: O,
1730
+ hasMoreModules: pt || fe,
1731
+ continuesBefore: w,
1732
+ continuesAfter: T,
1733
+ onModuleClick: gn,
1734
+ pagination: pt ? {
1735
+ rangeStart: (S - 1) * Y + 1,
1736
+ totalCount: j.totalCount,
1737
+ hasPreviousPage: w,
1738
+ hasNextPage: T,
1739
+ onPreviousPage: () => Ae(S - 1, "keepFocus"),
1740
+ onNextPage: () => Ae(S + 1, "keepFocus"),
1741
+ disabled: q
2510
1742
  } : void 0
2511
1743
  }
2512
1744
  ),
2513
- o && n ? /* @__PURE__ */ r(
2514
- Gs,
1745
+ r && n ? /* @__PURE__ */ s(
1746
+ zr,
2515
1747
  {
2516
1748
  counts: n,
2517
- itemsMode: ee,
2518
- loadedModules: U.length
1749
+ itemsMode: ce,
1750
+ loadedModules: O.length
2519
1751
  }
2520
1752
  ) : null,
2521
- /* @__PURE__ */ g(
2522
- I,
1753
+ /* @__PURE__ */ m(
1754
+ _,
2523
1755
  {
2524
1756
  justifyItems: "end",
2525
1757
  gap: "x-small",
@@ -2527,54 +1759,54 @@ function Hs({
2527
1759
  margin: "medium 0 0 0",
2528
1760
  "data-testid": "modules-controls",
2529
1761
  children: [
2530
- l ? /* @__PURE__ */ r(I.Item, { shouldGrow: te, children: /* @__PURE__ */ r(
2531
- ks,
1762
+ l ? /* @__PURE__ */ s(_.Item, { shouldGrow: Q, children: /* @__PURE__ */ s(
1763
+ qr,
2532
1764
  {
2533
1765
  actions: l,
2534
- onApplied: a,
2535
- aiDisclosure: c,
2536
- display: te ? "block" : "inline-block"
1766
+ onApplied: u,
1767
+ aiDisclosure: a,
1768
+ display: Q ? "block" : "inline-block"
2537
1769
  }
2538
1770
  ) }) : null,
2539
- So ? /* @__PURE__ */ r(I.Item, { shouldGrow: te, children: /* @__PURE__ */ r(
2540
- Qi,
1771
+ mn ? /* @__PURE__ */ s(_.Item, { shouldGrow: Q, children: /* @__PURE__ */ s(
1772
+ Ji,
2541
1773
  {
2542
- value: re,
2543
- onChange: y,
2544
- interaction: qe && !ze ? "disabled" : "enabled"
1774
+ value: me,
1775
+ onChange: st,
1776
+ interaction: he && !fe ? "disabled" : "enabled"
2545
1777
  }
2546
1778
  ) }) : null,
2547
- /* @__PURE__ */ r(I.Item, { shouldGrow: te, children: /* @__PURE__ */ r(
2548
- H,
1779
+ /* @__PURE__ */ s(_.Item, { shouldGrow: Q, children: /* @__PURE__ */ s(
1780
+ z,
2549
1781
  {
2550
- elementRef: (f) => {
2551
- ct.current = f;
1782
+ elementRef: (c) => {
1783
+ ze.current = c;
2552
1784
  },
2553
- display: te ? "block" : "inline-block",
2554
- onClick: vo,
2555
- interaction: ie.length === 0 || at ? "disabled" : "enabled",
1785
+ display: Q ? "block" : "inline-block",
1786
+ onClick: hn,
1787
+ interaction: V.length === 0 || qe ? "disabled" : "enabled",
2556
1788
  "data-testid": "expand-collapse-all",
2557
- children: T(Wt ? "collapseAllModules" : "expandAllModules")
1789
+ children: E(ct ? "collapseAllModules" : "expandAllModules")
2558
1790
  }
2559
1791
  ) })
2560
1792
  ]
2561
1793
  }
2562
1794
  ),
2563
- /* @__PURE__ */ g(E, { as: "div", margin: "medium 0 0 0", children: [
2564
- $ ? /* @__PURE__ */ r(
2565
- ae,
1795
+ /* @__PURE__ */ m(M, { as: "div", margin: "medium 0 0 0", children: [
1796
+ ee ? /* @__PURE__ */ s(
1797
+ X,
2566
1798
  {
2567
1799
  variant: "error",
2568
1800
  margin: "0 0 small 0",
2569
- liveRegion: We,
1801
+ liveRegion: Se,
2570
1802
  liveRegionPoliteness: "assertive",
2571
1803
  "data-testid": "modules-error",
2572
- children: T("modulesLoadErrorAlert", { message: $.message })
1804
+ children: E("modulesLoadErrorAlert", { message: ee.message })
2573
1805
  }
2574
1806
  ) : null,
2575
- dt ? /* @__PURE__ */ r(E, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ r(kt, { renderTitle: T("modulesLoadingSpinnerLabel") }) }) : null,
2576
- qe && !ze ? /* @__PURE__ */ g(
2577
- E,
1807
+ xe ? /* @__PURE__ */ s(M, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ s(et, { renderTitle: E("modulesLoadingSpinnerLabel") }) }) : null,
1808
+ he && !fe ? /* @__PURE__ */ m(
1809
+ M,
2578
1810
  {
2579
1811
  as: "div",
2580
1812
  background: "primary",
@@ -2585,108 +1817,108 @@ function Hs({
2585
1817
  textAlign: "center",
2586
1818
  "data-testid": "modules-empty",
2587
1819
  children: [
2588
- /* @__PURE__ */ r(Ie, { level: mt, variant: "titleCardLarge", margin: "0 0 x-small 0", children: T("noModulesEmptyStateTitle") }),
2589
- /* @__PURE__ */ r(S, { color: "secondary", children: T("noModulesEmptyStateDescription") })
1820
+ /* @__PURE__ */ s(ue, { level: $e, variant: "titleCardLarge", margin: "0 0 x-small 0", children: E("noModulesEmptyStateTitle") }),
1821
+ /* @__PURE__ */ s(b, { color: "secondary", children: E("noModulesEmptyStateDescription") })
2590
1822
  ]
2591
1823
  }
2592
1824
  ) : null,
2593
- $e ? /* @__PURE__ */ g(
2594
- E,
1825
+ Me ? /* @__PURE__ */ m(
1826
+ M,
2595
1827
  {
2596
1828
  as: "div",
2597
1829
  background: "primary",
2598
1830
  borderRadius: "card.lg",
2599
1831
  borderWidth: "small",
2600
1832
  shadow: "resting",
2601
- padding: te ? "general.spaceLg general.spaceMd" : "general.space2xl general.spaceXl",
1833
+ padding: Q ? "general.spaceLg general.spaceMd" : "general.space2xl general.spaceXl",
2602
1834
  textAlign: "center",
2603
1835
  "data-testid": "modules-filtered-empty",
2604
1836
  children: [
2605
- /* @__PURE__ */ r(
2606
- Ie,
1837
+ /* @__PURE__ */ s(
1838
+ ue,
2607
1839
  {
2608
- level: mt,
2609
- variant: te ? "titleCardMini" : "titleCardLarge",
1840
+ level: $e,
1841
+ variant: Q ? "titleCardMini" : "titleCardLarge",
2610
1842
  margin: "0 0 general.spaceXs 0",
2611
- children: T("filteredEmptyStateTitle")
1843
+ children: E("filteredEmptyStateTitle")
2612
1844
  }
2613
1845
  ),
2614
- /* @__PURE__ */ r(S, { as: "div", color: "secondary", size: te ? "small" : void 0, children: T("filteredEmptyStateDescription") }),
2615
- /* @__PURE__ */ r(
2616
- H,
1846
+ /* @__PURE__ */ s(b, { as: "div", color: "secondary", size: Q ? "small" : void 0, children: E("filteredEmptyStateDescription") }),
1847
+ /* @__PURE__ */ s(
1848
+ z,
2617
1849
  {
2618
1850
  color: "primary",
2619
1851
  margin: "general.spaceLg 0 0 0",
2620
1852
  onClick: () => {
2621
- y(Fe), ye.current = "focusList";
1853
+ st(Ie), se.current = "focusList";
2622
1854
  },
2623
1855
  "data-testid": "clear-filters",
2624
- children: T("clearFilters")
1856
+ children: E("clearFilters")
2625
1857
  }
2626
1858
  )
2627
1859
  ]
2628
1860
  }
2629
1861
  ) : null,
2630
- /* @__PURE__ */ r(
1862
+ /* @__PURE__ */ s(
2631
1863
  "ul",
2632
1864
  {
2633
- ref: Ut,
2634
- style: { listStyle: "none", margin: 0, padding: 0, opacity: Po ? 0.5 : 1 },
2635
- "aria-busy": N,
1865
+ ref: at,
1866
+ style: { listStyle: "none", margin: 0, padding: 0, opacity: _n ? 0.5 : 1 },
1867
+ "aria-busy": q,
2636
1868
  tabIndex: -1,
2637
1869
  "data-testid": "modules-stack",
2638
- children: ie.map((f) => /* @__PURE__ */ r(
1870
+ children: V.map((c) => /* @__PURE__ */ s(
2639
1871
  "li",
2640
1872
  {
2641
- ref: (w) => {
2642
- w ? et.current.set(f.id, w) : et.current.delete(f.id);
1873
+ ref: (y) => {
1874
+ y ? ve.current.set(c.id, y) : ve.current.delete(c.id);
2643
1875
  },
2644
- children: /* @__PURE__ */ r(
2645
- ms,
1876
+ children: /* @__PURE__ */ s(
1877
+ fr,
2646
1878
  {
2647
- module: f,
2648
- expanded: it.includes(f.id),
2649
- onToggle: wo,
2650
- itemsState: (x == null ? void 0 : x.items.get(f.id)) ?? ue(f.id),
2651
- today: nt,
2652
- showDiagnostics: o,
2653
- headingLevel: mt,
2654
- breakpoints: z,
2655
- toggleRef: To
1879
+ module: c,
1880
+ expanded: ke.includes(c.id),
1881
+ onToggle: Mn,
1882
+ itemsState: (P == null ? void 0 : P.items.get(c.id)) ?? Pe(c.id),
1883
+ today: we,
1884
+ showDiagnostics: r,
1885
+ headingLevel: $e,
1886
+ breakpoints: $,
1887
+ toggleRef: pn
2656
1888
  }
2657
1889
  )
2658
1890
  },
2659
- f.id
1891
+ c.id
2660
1892
  ))
2661
1893
  }
2662
1894
  )
2663
1895
  ] }),
2664
- Ao ? /* @__PURE__ */ r(
2665
- zn,
1896
+ In ? /* @__PURE__ */ s(
1897
+ xt,
2666
1898
  {
2667
1899
  as: "nav",
2668
1900
  variant: "compact",
2669
1901
  withFirstAndLastButton: !0,
2670
1902
  margin: "small 0 0 0",
2671
- labelFirst: T("paginationFirstPage"),
2672
- labelPrev: T("paginationPreviousPage"),
2673
- labelNext: T("paginationNextPage"),
2674
- labelLast: T("paginationLastPage"),
2675
- screenReaderLabelPageButton: (f) => T("paginationPageLabel", { page: f }),
2676
- ellipsis: T("paginationEllipsis"),
2677
- totalPageNumber: L,
2678
- currentPage: M,
2679
- disabled: N,
2680
- onPageChange: (f) => ot(f),
1903
+ labelFirst: E("paginationFirstPage"),
1904
+ labelPrev: E("paginationPreviousPage"),
1905
+ labelNext: E("paginationNextPage"),
1906
+ labelLast: E("paginationLastPage"),
1907
+ screenReaderLabelPageButton: (c) => E("paginationPageLabel", { page: c }),
1908
+ ellipsis: E("paginationEllipsis"),
1909
+ totalPageNumber: C,
1910
+ currentPage: S,
1911
+ disabled: q,
1912
+ onPageChange: (c) => Ae(c),
2681
1913
  "data-testid": "modules-pagination"
2682
1914
  },
2683
- M
1915
+ S
2684
1916
  ) : null
2685
1917
  ] });
2686
1918
  }
2687
- const Ks = vr(
2688
- Hs
2689
- ), ve = [
1919
+ const $r = fi(
1920
+ xr
1921
+ ), de = [
2690
1922
  "assignment",
2691
1923
  "quiz",
2692
1924
  "discussion",
@@ -2695,7 +1927,7 @@ const Ks = vr(
2695
1927
  "external_url",
2696
1928
  "external_tool",
2697
1929
  "sub_header"
2698
- ], Ct = [
1930
+ ], Ke = [
2699
1931
  "not_started",
2700
1932
  "in_progress",
2701
1933
  "complete",
@@ -2703,30 +1935,30 @@ const Ks = vr(
2703
1935
  "incomplete",
2704
1936
  "missing_and_incomplete",
2705
1937
  "locked"
2706
- ], yo = [
1938
+ ], rn = [
2707
1939
  "must_view",
2708
1940
  "must_submit",
2709
1941
  "must_contribute",
2710
1942
  "must_mark_done",
2711
1943
  "min_score",
2712
1944
  "min_percentage"
2713
- ], js = ["assignment", "quiz", "discussion"], Ys = ["external_url", "external_tool"], Vs = ["assignment", "quiz", "discussion"], Qs = Date.UTC(2025, 0, 6), Xs = 864e5, Ee = "1", bo = (e) => new Date(Qs + e * Xs).toISOString(), Ke = [
1945
+ ], Ur = ["assignment", "quiz", "discussion"], Fr = ["external_url", "external_tool"], Br = ["assignment", "quiz", "discussion"], Gr = Date.UTC(2025, 0, 6), Wr = 864e5, ie = "1", sn = (e) => new Date(Gr + e * Wr).toISOString(), ye = [
2714
1946
  "min_score",
2715
1947
  "min_percentage"
2716
- ], Zs = yo.filter(
2717
- (e) => !Ke.includes(e)
2718
- ), Js = [
1948
+ ], Hr = rn.filter(
1949
+ (e) => !ye.includes(e)
1950
+ ), Yr = [
2719
1951
  "in_progress",
2720
1952
  "incomplete",
2721
1953
  "missing_and_incomplete"
2722
- ], el = (e, t, n, o) => {
2723
- const i = n ? yo : Zs, s = n && o ? Ke[t % Ke.length] : i[Math.floor(t / 3) % i.length];
2724
- return s === "min_score" ? { itemId: e, type: s, minScore: 10 } : s === "min_percentage" ? { itemId: e, type: s, minPercentage: 80 } : { itemId: e, type: s };
2725
- }, tl = (e, t, n, o) => e === "sub_header" ? !1 : n && o || t % 3 === 0, qt = (e) => Ct[(e - 1) % Ct.length], nl = (e, t) => !Vs.includes(e) || e === "discussion" && Math.floor(t / ve.length) % 2 === 1 ? null : 5 + t % 4 * 5, ol = (e, t, n, o) => t ? e === "missing" ? n != null || o % 2 === 0 : e === "missing_and_incomplete" ? o % 2 === 1 : !1 : !1, rl = (e, t, n, o) => {
1954
+ ], jr = (e, t, n, r) => {
1955
+ const o = n ? rn : Hr, i = n && r ? ye[t % ye.length] : o[Math.floor(t / 3) % o.length];
1956
+ return i === "min_score" ? { itemId: e, type: i, minScore: 10 } : i === "min_percentage" ? { itemId: e, type: i, minPercentage: 80 } : { itemId: e, type: i };
1957
+ }, Qr = (e, t, n, r) => e === "sub_header" ? !1 : n && r || t % 3 === 0, tt = (e) => Ke[(e - 1) % Ke.length], Kr = (e, t) => !Br.includes(e) || e === "discussion" && Math.floor(t / de.length) % 2 === 1 ? null : 5 + t % 4 * 5, Vr = (e, t, n, r) => t ? e === "missing" ? n != null || r % 2 === 0 : e === "missing_and_incomplete" ? r % 2 === 1 : !1 : !1, Zr = (e, t, n, r) => {
2726
1958
  if (e === "locked") return "locked";
2727
- if (ol(e, t, n, o)) return "missing";
1959
+ if (Vr(e, t, n, r)) return "missing";
2728
1960
  if (!n) return;
2729
- const i = t && Ke.includes(n.type);
1961
+ const o = t && ye.includes(n.type);
2730
1962
  switch (e) {
2731
1963
  case "not_started":
2732
1964
  case "missing":
@@ -2735,122 +1967,122 @@ const Ks = vr(
2735
1967
  return "complete";
2736
1968
  case "incomplete":
2737
1969
  case "missing_and_incomplete":
2738
- return i && o % 2 === 0 ? "incomplete" : "complete";
1970
+ return o && r % 2 === 0 ? "incomplete" : "complete";
2739
1971
  case "in_progress":
2740
- return i ? o % 3 === 0 ? "complete" : o % 3 === 1 ? "in_progress" : "not_started" : o % 2 === 0 ? "complete" : "not_started";
1972
+ return o ? r % 3 === 0 ? "complete" : r % 3 === 1 ? "in_progress" : "not_started" : r % 2 === 0 ? "complete" : "not_started";
2741
1973
  default:
2742
1974
  return e;
2743
1975
  }
2744
- }, il = (e) => e.status === "complete", sl = (e, t, n, o, i, s, l, a) => {
2745
- const c = String(e), u = ve[o % ve.length], d = u === "sub_header", m = js.includes(u) && (o % 4 === 0 || i === "missing");
1976
+ }, Xr = (e) => e.status === "complete", Jr = (e, t, n, r, o, i, l, u) => {
1977
+ const a = String(e), d = de[r % de.length], g = d === "sub_header", p = Ur.includes(d) && (r % 4 === 0 || o === "missing");
2746
1978
  return {
2747
1979
  id: n,
2748
- moduleId: c,
2749
- title: `${u} ${t + 1}`,
2750
- type: u,
1980
+ moduleId: a,
1981
+ title: `${d} ${t + 1}`,
1982
+ type: d,
2751
1983
  position: t + 1,
2752
1984
  indent: t % 5 === 4 ? 1 : 0,
2753
- published: a === "teacher" ? o % 7 !== 0 : !0,
2754
- url: d ? null : `/courses/${Ee}/modules/items/${n}`,
2755
- newTab: Ys.includes(u) && o % 2 === 0,
1985
+ published: u === "teacher" ? r % 7 !== 0 : !0,
1986
+ url: g ? null : `/courses/${ie}/modules/items/${n}`,
1987
+ newTab: Fr.includes(d) && r % 2 === 0,
2756
1988
  completionRequirement: l,
2757
- dueAt: m ? bo(o % 90) : null,
2758
- status: i,
2759
- pointsPossible: s,
2760
- extensions: vt(
1989
+ dueAt: p ? sn(r % 90) : null,
1990
+ status: o,
1991
+ pointsPossible: i,
1992
+ extensions: Ve(
2761
1993
  void 0,
2762
- o % 37 === 0 ? 5 + o % 4 * 10 : null
1994
+ r % 37 === 0 ? 5 + r % 4 * 10 : null
2763
1995
  )
2764
1996
  };
2765
- }, ll = (e, t, n, o) => {
2766
- const i = qt(e), s = Js.includes(i), l = [];
2767
- let a = 0;
2768
- for (let c = 0; c < t; c += 1) {
2769
- const u = n + c, d = ve[u % ve.length], m = nl(d, u), p = m !== null, h = p ? a++ : c, _ = String(e * 1e3 + c + 1), A = tl(d, u, p, s) ? el(_, u, p, s) : null, v = rl(i, p, A, h);
2770
- l.push(sl(e, c, _, u, v, m, A, o));
1997
+ }, es = (e, t, n, r) => {
1998
+ const o = tt(e), i = Yr.includes(o), l = [];
1999
+ let u = 0;
2000
+ for (let a = 0; a < t; a += 1) {
2001
+ const d = n + a, g = de[d % de.length], p = Kr(g, d), h = p !== null, f = h ? u++ : a, I = String(e * 1e3 + a + 1), v = Qr(g, d, h, i) ? jr(I, d, h, i) : null, L = Zr(o, h, v, f);
2002
+ l.push(Jr(e, a, I, d, L, p, v, r));
2771
2003
  }
2772
2004
  return l;
2773
- }, al = (e, t, n, o) => {
2774
- const i = qt(e);
2775
- if (i === "locked" || i === "not_started") return i;
2005
+ }, ts = (e, t, n, r) => {
2006
+ const o = tt(e);
2007
+ if (o === "locked" || o === "not_started") return o;
2776
2008
  if (t.length === 0) return "not_started";
2777
- if (!t.some((s) => s.pointsPossible != null) || i === "missing" && n === 0 || i === "incomplete" && o === 0) return "in_progress";
2778
- if (i === "missing_and_incomplete") {
2779
- if (n === 0 && o === 0) return "in_progress";
2009
+ if (!t.some((i) => i.pointsPossible != null) || o === "missing" && n === 0 || o === "incomplete" && r === 0) return "in_progress";
2010
+ if (o === "missing_and_incomplete") {
2011
+ if (n === 0 && r === 0) return "in_progress";
2780
2012
  if (n === 0) return "incomplete";
2781
- if (o === 0) return "missing";
2013
+ if (r === 0) return "missing";
2782
2014
  }
2783
- return i;
2784
- }, cl = (e) => e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort()[0] ?? null, ul = (e, t, n) => {
2785
- const o = t.filter((u) => u.completionRequirement), i = n ?? o.length, s = Math.min(o.filter(il).length, i), l = t.filter((u) => u.status === "missing").length, a = t.filter((u) => u.status === "incomplete").length;
2015
+ return o;
2016
+ }, ns = (e) => e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort()[0] ?? null, is = (e, t, n) => {
2017
+ const r = t.filter((d) => d.completionRequirement), o = n ?? r.length, i = Math.min(r.filter(Xr).length, o), l = t.filter((d) => d.status === "missing").length, u = t.filter((d) => d.status === "incomplete").length;
2786
2018
  return {
2787
- status: al(e, t, l, a),
2788
- requirementsMet: s,
2789
- requirementCount: i,
2790
- percentComplete: i > 0 ? Math.round(s / i * 100) : 0,
2791
- nextDueAt: cl(t),
2019
+ status: ts(e, t, l, u),
2020
+ requirementsMet: i,
2021
+ requirementCount: o,
2022
+ percentComplete: o > 0 ? Math.round(i / o * 100) : 0,
2023
+ nextDueAt: ns(t),
2792
2024
  missingCount: l,
2793
- incompleteCount: a
2025
+ incompleteCount: u
2794
2026
  };
2795
- }, dl = (e, t, n) => {
2796
- const o = qt(e), i = e % 2 !== 0 && o !== "incomplete" && o !== "missing_and_incomplete" ? 1 : null;
2027
+ }, rs = (e, t, n) => {
2028
+ const r = tt(e), o = e % 2 !== 0 && r !== "incomplete" && r !== "missing_and_incomplete" ? 1 : null;
2797
2029
  return {
2798
2030
  id: String(e),
2799
2031
  name: `Module ${e}`,
2800
2032
  position: e,
2801
2033
  published: n === "teacher" ? e % 4 !== 0 : !0,
2802
2034
  itemCount: t.length,
2803
- unlockAt: e % 5 === 0 ? bo(e) : null,
2035
+ unlockAt: e % 5 === 0 ? sn(e) : null,
2804
2036
  prerequisiteModules: e > 1 && e % 3 === 0 ? [{ id: String(e - 1), name: `Module ${e - 1}` }] : [],
2805
- requirementCount: i,
2037
+ requirementCount: o,
2806
2038
  requireSequentialProgress: e % 6 === 0,
2807
2039
  completionRequirements: t.flatMap(
2808
- (s) => s.completionRequirement ? [s.completionRequirement] : []
2040
+ (i) => i.completionRequirement ? [i.completionRequirement] : []
2809
2041
  ),
2810
- progress: ul(e, t, i)
2042
+ progress: is(e, t, o)
2811
2043
  };
2812
2044
  };
2813
- function ml(e) {
2045
+ function ss(e) {
2814
2046
  return {
2815
2047
  courseId: e.courseId,
2816
2048
  modules: e.modules.map(({ progress: t, ...n }) => n),
2817
2049
  itemsByModuleId: Object.fromEntries(
2818
2050
  Object.entries(e.itemsByModuleId).map(([t, n]) => [
2819
2051
  t,
2820
- n.map(({ status: o, ...i }) => i)
2052
+ n.map(({ status: r, ...o }) => o)
2821
2053
  ])
2822
2054
  )
2823
2055
  };
2824
2056
  }
2825
- function Ze(e, t = {}) {
2826
- const n = t.view ?? "student", o = t.courseId ?? Ee, i = [], s = {};
2057
+ function be(e, t = {}) {
2058
+ const n = t.view ?? "student", r = t.courseId ?? ie, o = [], i = {};
2827
2059
  let l = 0;
2828
- e.forEach((c, u) => {
2829
- const d = u + 1, m = ll(d, c, l, n);
2830
- l += c, i.push(dl(d, m, n)), s[String(d)] = m;
2060
+ e.forEach((a, d) => {
2061
+ const g = d + 1, p = es(g, a, l, n);
2062
+ l += a, o.push(rs(g, p, n)), i[String(g)] = p;
2831
2063
  });
2832
- const a = { courseId: o, modules: i, itemsByModuleId: s };
2833
- return n === "teacher" ? ml(a) : a;
2064
+ const u = { courseId: r, modules: o, itemsByModuleId: i };
2065
+ return n === "teacher" ? ss(u) : u;
2834
2066
  }
2835
- const Ce = (e) => `/courses/${Ee}/modules/items/${e}`, wn = "2099-08-31T06:59:00Z", gl = "2020-01-06T07:00:00Z", pl = Ct.length, fl = 8, hl = 120, Il = 25, _l = 250, Pn = 8;
2836
- function oa() {
2837
- return Ze(Array.from({ length: pl }, () => fl));
2067
+ const ae = (e) => `/courses/${ie}/modules/items/${e}`, Rt = "2099-08-31T06:59:00Z", os = "2020-01-06T07:00:00Z", ls = Ke.length, as = 8, us = 120, ds = 25, cs = 250, kt = 8;
2068
+ function Qs() {
2069
+ return be(Array.from({ length: ls }, () => as));
2838
2070
  }
2839
- function ra() {
2840
- return Ze(Array.from({ length: hl }, () => Il));
2071
+ function Ks() {
2072
+ return be(Array.from({ length: us }, () => ds));
2841
2073
  }
2842
- function ia() {
2843
- return Ze([
2844
- Pn,
2845
- _l,
2846
- Pn
2074
+ function Vs() {
2075
+ return be([
2076
+ kt,
2077
+ cs,
2078
+ kt
2847
2079
  ]);
2848
2080
  }
2849
- function sa() {
2850
- const e = (s, l, a) => ({
2851
- id: String(s),
2081
+ function Zs() {
2082
+ const e = (i, l, u) => ({
2083
+ id: String(i),
2852
2084
  name: l,
2853
- position: s,
2085
+ position: i,
2854
2086
  published: !0,
2855
2087
  itemCount: 0,
2856
2088
  prerequisiteModules: [],
@@ -2863,29 +2095,29 @@ function sa() {
2863
2095
  missingCount: 0,
2864
2096
  incompleteCount: 0
2865
2097
  },
2866
- ...a
2867
- }), t = { id: "101", name: "Week 1: Foundations" }, n = { id: "102", name: "Week 2: Derivatives" }, o = { id: "103", name: "Trigonometry_Unit_One_Foundations_Of_Indirect_Measurement" }, i = [
2868
- e(1, "Locked by a future date", { unlockAt: wn }),
2098
+ ...u
2099
+ }), t = { id: "101", name: "Week 1: Foundations" }, n = { id: "102", name: "Week 2: Derivatives" }, r = { id: "103", name: "Trigonometry_Unit_One_Foundations_Of_Indirect_Measurement" }, o = [
2100
+ e(1, "Locked by a future date", { unlockAt: Rt }),
2869
2101
  e(2, "Locked by one prerequisite", { prerequisiteModules: [t] }),
2870
2102
  e(3, "Locked by several prerequisites", {
2871
2103
  prerequisiteModules: [t, n]
2872
2104
  }),
2873
2105
  e(4, "Locked by a date and a prerequisite", {
2874
- unlockAt: wn,
2875
- prerequisiteModules: [o]
2106
+ unlockAt: Rt,
2107
+ prerequisiteModules: [r]
2876
2108
  }),
2877
- e(5, "Locked, and the unlock date has passed", { unlockAt: gl })
2109
+ e(5, "Locked, and the unlock date has passed", { unlockAt: os })
2878
2110
  ];
2879
2111
  return {
2880
- courseId: Ee,
2881
- modules: i,
2882
- itemsByModuleId: Object.fromEntries(i.map((s) => [s.id, []]))
2112
+ courseId: ie,
2113
+ modules: o,
2114
+ itemsByModuleId: Object.fromEntries(o.map((i) => [i.id, []]))
2883
2115
  };
2884
2116
  }
2885
- function la() {
2886
- return Ze([]);
2117
+ function Xs() {
2118
+ return be([]);
2887
2119
  }
2888
- function aa() {
2120
+ function Js() {
2889
2121
  const t = [
2890
2122
  {
2891
2123
  title: "Every fact: type, due date, points, requirement",
@@ -2914,7 +2146,7 @@ function aa() {
2914
2146
  title: "Career item carrying an estimated duration",
2915
2147
  type: "external_tool",
2916
2148
  completionRequirement: { itemId: "5", type: "must_view" },
2917
- extensions: vt(void 0, 45)
2149
+ extensions: Ve(void 0, 45)
2918
2150
  },
2919
2151
  { title: "A file, ungradeable, so no points at all", type: "file" },
2920
2152
  { title: "External link, opens in a new tab", type: "external_url", newTab: !0 },
@@ -2930,19 +2162,19 @@ function aa() {
2930
2162
  { title: "Indented three levels", type: "quiz", indent: 3 },
2931
2163
  { title: "Indented four levels", type: "discussion", indent: 4 },
2932
2164
  { title: "Indented five levels, the deepest Canvas allows", type: "page", indent: 5 }
2933
- ].map((n, o) => ({
2934
- id: String(o + 1),
2165
+ ].map((n, r) => ({
2166
+ id: String(r + 1),
2935
2167
  moduleId: "1",
2936
- position: o + 1,
2168
+ position: r + 1,
2937
2169
  indent: 0,
2938
2170
  published: !0,
2939
2171
  newTab: !1,
2940
- url: Ce(o + 1),
2172
+ url: ae(r + 1),
2941
2173
  status: "not_started",
2942
2174
  ...n
2943
2175
  }));
2944
2176
  return {
2945
- courseId: Ee,
2177
+ courseId: ie,
2946
2178
  modules: [
2947
2179
  {
2948
2180
  id: "1",
@@ -2957,13 +2189,13 @@ function aa() {
2957
2189
  itemsByModuleId: { 1: t }
2958
2190
  };
2959
2191
  }
2960
- function ca() {
2192
+ function eo() {
2961
2193
  const t = [
2962
- { title: "Reading: limits from the left and the right", type: "page", url: Ce(1) },
2194
+ { title: "Reading: limits from the left and the right", type: "page", url: ae(1) },
2963
2195
  {
2964
2196
  title: "Desmos: interactive limit explorer",
2965
2197
  type: "external_url",
2966
- url: Ce(2),
2198
+ url: ae(2),
2967
2199
  newTab: !0
2968
2200
  },
2969
2201
  { title: "Practice", type: "sub_header", url: null },
@@ -2971,13 +2203,13 @@ function ca() {
2971
2203
  {
2972
2204
  title: "Utilizing Triangle Characteristics: Measuring Distances Through Angles, Elevation and the Practical Limits of Indirect Measurement in the Field",
2973
2205
  type: "assignment",
2974
- url: Ce(5)
2206
+ url: ae(5)
2975
2207
  },
2976
- { title: "Unit test", type: "quiz", url: Ce(6), status: "locked" }
2977
- ].map((n, o) => ({
2978
- id: String(o + 1),
2208
+ { title: "Unit test", type: "quiz", url: ae(6), status: "locked" }
2209
+ ].map((n, r) => ({
2210
+ id: String(r + 1),
2979
2211
  moduleId: "1",
2980
- position: o + 1,
2212
+ position: r + 1,
2981
2213
  indent: 0,
2982
2214
  published: !0,
2983
2215
  newTab: !1,
@@ -2985,7 +2217,7 @@ function ca() {
2985
2217
  ...n
2986
2218
  }));
2987
2219
  return {
2988
- courseId: Ee,
2220
+ courseId: ie,
2989
2221
  modules: [
2990
2222
  {
2991
2223
  id: "1",
@@ -3001,126 +2233,126 @@ function ca() {
3001
2233
  };
3002
2234
  }
3003
2235
  export {
3004
- Zl as ACTION_ORDER_LTI_FLOOR,
3005
- Fe as ALL_FILTER,
3006
- ln as ActionEntrySchema,
3007
- ma as CompletionRequirementSchema,
3008
- ga as CompletionRequirementTypeSchema,
3009
- pa as DEFAULT_INLINE_THRESHOLD,
3010
- fa as DEFAULT_ITEM_CONCURRENCY,
3011
- ha as DEFAULT_ITEM_PAGE_SIZE,
3012
- Ia as DEFAULT_LOCALE,
3013
- _a as DEFAULT_MOBILE_PAGE_SIZE,
3014
- Ea as DEFAULT_PAGE_SIZE,
3015
- ya as DEFAULT_RETAIN_COLLAPSED_LIMIT,
3016
- ba as DEFAULT_STALE_TIME_MS,
3017
- Sa as DUE_THIS_WEEK_DAYS,
3018
- Ma as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
3019
- Qo as EXT_ORGANIZE_ADDED_ITEM_COUNT,
3020
- Xo as EXT_ORGANIZE_NEW_MODULE,
3021
- Zo as EXT_ORGANIZE_NEW_PLACEMENT,
3022
- Vo as EXT_SUPPRESS_ITEM_NUMBERING,
3023
- Ee as FIXTURE_COURSE_ID,
3024
- No as FilterClauseSchema,
3025
- li as FilterEntrySchema,
3026
- Qi as FilterSelect,
3027
- Jr as GET_MODULES,
3028
- ei as GET_MODULE_ITEMS,
3029
- xo as INLINE_ITEM_LIMIT,
3030
- Ro as INLINE_QUERY_NODE_BUDGET,
3031
- Ta as InMemoryCourseMismatchError,
3032
- ki as ItemDueSoonPill,
3033
- ii as ItemTypeEntrySchema,
3034
- bt as MAX_DIRECTION_CHARS,
3035
- si as MetaFieldEntrySchema,
3036
- ms as ModuleCard,
3037
- Ri as ModuleDueSoonPill,
3038
- ji as ModuleItemRow,
3039
- Ca as ModuleItemSchema,
3040
- Li as ModuleItemStatusPill,
3041
- va as ModuleItemStatusSchema,
3042
- wa as ModuleItemTypeSchema,
3043
- ko as ModuleItemsPageSchema,
3044
- Pa as ModuleProgressSchema,
3045
- Aa as ModuleSchema,
3046
- Ai as ModuleStatusPill,
3047
- La as ModuleStatusSchema,
3048
- Ql as ModulesAnalyticsProvider,
3049
- er as ModulesConfigProvider,
3050
- ui as ModulesConfigSchema,
3051
- Jo as ModulesI18nProvider,
3052
- Ks as ModulesList,
3053
- Ra as ModulesPageInfoSchema,
3054
- Oo as ModulesPageSchema,
3055
- Us as ModulesProgressBar,
3056
- di as NEW_PLACEMENT_FIELD,
3057
- Io as ORGANIZE_CONTENT_TYPES,
3058
- na as ORGANIZE_MODES,
3059
- vs as ORGANIZE_SLOW_AFTER_MS,
3060
- hs as OrganizeForm,
3061
- ks as OrganizeModulesButton,
3062
- Rs as OrganizeModulesModal,
3063
- _o as PROPOSAL_PREVIEW_COURSE_ID,
3064
- ka as PageInfoSchema,
3065
- Un as PartialCanvasResponseError,
3066
- Oa as PrerequisiteModuleSchema,
3067
- Cs as ProposalPreview,
3068
- Pe as RegistryEntrySchema,
3069
- xa as TYPE_FIELD,
3070
- Da as baseFilters,
3071
- Uo as baseModulesConfig,
3072
- Ze as buildFixture,
3073
- la as courseEmpty,
3074
- ia as courseFatModule,
3075
- ca as courseItemLinks,
3076
- aa as courseItemRowVariants,
3077
- ra as courseLarge,
3078
- sa as courseLockReasons,
3079
- oa as courseSmall,
3080
- oi as createActionContext,
3081
- Xl as createCanvasGraphqlAdapter,
3082
- tr as createInMemoryAdapter,
3083
- Na as createTranslate,
3084
- za as defaultFormatters,
3085
- gs as defaultOrganizeInput,
3086
- qa as defaultTranslate,
3087
- $a as filterClauseOf,
3088
- $o as getAddedItemCount,
3089
- Fa as getEstimatedDurationMinutes,
3090
- Tn as hasOrganizeInputErrors,
3091
- Ua as hideUnservableFilters,
3092
- Ba as invalidateCourse,
3093
- Do as invalidateModuleItems,
3094
- Yt as invalidateModuleList,
3095
- Fo as isNewPlacement,
3096
- Ga as isPredicateServed,
3097
- qo as isProposedNewModule,
3098
- me as mergeRegistry,
3099
- Pi as moduleItemStatusLabel,
3100
- Wa as moduleItemsPrefix,
3101
- io as moduleStatusLabel,
3102
- Ha as modulesKeys,
3103
- Ka as modulesListPrefix,
3104
- pi as organizePreviewConfig,
3105
- ea as partialModulesConfig,
3106
- Ss as proposalToFixture,
3107
- ge as registrySchema,
3108
- eo as resolveModulesConfig,
3109
- ja as servesClause,
3110
- Ho as suppressesItemNumbering,
3111
- Ya as unservableFilters,
3112
- ta as useActionContext,
3113
- Va as useFieldVisible,
3114
- Ae as useFormatters,
3115
- Qa as useModules,
3116
- Ve as useModulesAnalytics,
3117
- _e as useModulesConfig,
3118
- P as useModulesI18n,
3119
- nr as useModulesPageData,
3120
- Ls as useOrganizeModules,
3121
- Mn as validateOrganizeInput,
3122
- Jl as visibleActions,
3123
- je as visibleEntries,
3124
- Xa as visibleEntry,
3125
- vt as withEstimatedDurationMinutes
2236
+ Gs as ACTION_ORDER_LTI_FLOOR,
2237
+ Ie as ALL_FILTER,
2238
+ io as ActionEntrySchema,
2239
+ ro as CompletionRequirementSchema,
2240
+ so as CompletionRequirementTypeSchema,
2241
+ oo as DEFAULT_INLINE_THRESHOLD,
2242
+ lo as DEFAULT_ITEM_CONCURRENCY,
2243
+ ao as DEFAULT_ITEM_PAGE_SIZE,
2244
+ uo as DEFAULT_LOCALE,
2245
+ co as DEFAULT_MOBILE_PAGE_SIZE,
2246
+ mo as DEFAULT_PAGE_SIZE,
2247
+ go as DEFAULT_RETAIN_COLLAPSED_LIMIT,
2248
+ po as DEFAULT_STALE_TIME_MS,
2249
+ fo as DUE_THIS_WEEK_DAYS,
2250
+ ho as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
2251
+ Wn as EXT_ORGANIZE_ADDED_ITEM_COUNT,
2252
+ Hn as EXT_ORGANIZE_NEW_MODULE,
2253
+ Yn as EXT_ORGANIZE_NEW_PLACEMENT,
2254
+ Gn as EXT_SUPPRESS_ITEM_NUMBERING,
2255
+ ie as FIXTURE_COURSE_ID,
2256
+ Mo as FilterClauseSchema,
2257
+ _o as FilterEntrySchema,
2258
+ Ji as FilterSelect,
2259
+ Fi as GET_MODULES,
2260
+ Gi as GET_MODULE_ITEMS,
2261
+ bn as INLINE_ITEM_LIMIT,
2262
+ Sn as INLINE_QUERY_NODE_BUDGET,
2263
+ Io as InMemoryCourseMismatchError,
2264
+ Eo as ItemDueSoonPill,
2265
+ So as ItemTypeEntrySchema,
2266
+ Ye as MAX_DIRECTION_CHARS,
2267
+ yo as MetaFieldEntrySchema,
2268
+ fr as ModuleCard,
2269
+ $n as ModuleDueSoonPill,
2270
+ Bn as ModuleItemRow,
2271
+ To as ModuleItemSchema,
2272
+ bo as ModuleItemStatusPill,
2273
+ Po as ModuleItemStatusSchema,
2274
+ Co as ModuleItemTypeSchema,
2275
+ yn as ModuleItemsPageSchema,
2276
+ vo as ModuleProgressSchema,
2277
+ Lo as ModuleSchema,
2278
+ qn as ModuleStatusPill,
2279
+ wo as ModuleStatusSchema,
2280
+ Ao as ModulesAnalyticsProvider,
2281
+ Qn as ModulesConfigProvider,
2282
+ vn as ModulesConfigSchema,
2283
+ jn as ModulesI18nProvider,
2284
+ $r as ModulesList,
2285
+ Ro as ModulesPageInfoSchema,
2286
+ Tn as ModulesPageSchema,
2287
+ Zn as ModulesProgressBar,
2288
+ ji as NEW_PLACEMENT_FIELD,
2289
+ en as ORGANIZE_CONTENT_TYPES,
2290
+ js as ORGANIZE_MODES,
2291
+ wr as ORGANIZE_SLOW_AFTER_MS,
2292
+ Ir as OrganizeForm,
2293
+ qr as OrganizeModulesButton,
2294
+ Dr as OrganizeModulesModal,
2295
+ tn as PROPOSAL_PREVIEW_COURSE_ID,
2296
+ ko as PageInfoSchema,
2297
+ Ut as PartialCanvasResponseError,
2298
+ Oo as PrerequisiteModuleSchema,
2299
+ Lr as ProposalPreview,
2300
+ Do as RegistryEntrySchema,
2301
+ qo as TYPE_FIELD,
2302
+ zo as baseFilters,
2303
+ Rn as baseModulesConfig,
2304
+ be as buildFixture,
2305
+ Xs as courseEmpty,
2306
+ Vs as courseFatModule,
2307
+ eo as courseItemLinks,
2308
+ Js as courseItemRowVariants,
2309
+ Ks as courseLarge,
2310
+ Zs as courseLockReasons,
2311
+ Qs as courseSmall,
2312
+ Yi as createActionContext,
2313
+ Bs as createCanvasGraphqlAdapter,
2314
+ Kn as createInMemoryAdapter,
2315
+ No as createTranslate,
2316
+ xo as defaultFormatters,
2317
+ hr as defaultOrganizeInput,
2318
+ $o as defaultTranslate,
2319
+ Uo as filterClauseOf,
2320
+ wn as getAddedItemCount,
2321
+ Fo as getEstimatedDurationMinutes,
2322
+ Lt as hasOrganizeInputErrors,
2323
+ Bo as hideUnservableFilters,
2324
+ Go as invalidateCourse,
2325
+ Pn as invalidateModuleItems,
2326
+ ft as invalidateModuleList,
2327
+ An as isNewPlacement,
2328
+ Wo as isPredicateServed,
2329
+ Ln as isProposedNewModule,
2330
+ ne as mergeRegistry,
2331
+ Ho as moduleItemStatusLabel,
2332
+ Yo as moduleItemsPrefix,
2333
+ jo as moduleStatusLabel,
2334
+ Qo as modulesKeys,
2335
+ Ko as modulesListPrefix,
2336
+ Vi as organizePreviewConfig,
2337
+ Hs as partialModulesConfig,
2338
+ Pr as proposalToFixture,
2339
+ Vo as registrySchema,
2340
+ Xt as resolveModulesConfig,
2341
+ Zo as servesClause,
2342
+ Nn as suppressesItemNumbering,
2343
+ Xo as unservableFilters,
2344
+ Ys as useActionContext,
2345
+ Jo as useFieldVisible,
2346
+ Je as useFormatters,
2347
+ el as useModules,
2348
+ Xe as useModulesAnalytics,
2349
+ Te as useModulesConfig,
2350
+ x as useModulesI18n,
2351
+ Vn as useModulesPageData,
2352
+ Or as useOrganizeModules,
2353
+ vt as validateOrganizeInput,
2354
+ Ws as visibleActions,
2355
+ Ze as visibleEntries,
2356
+ tl as visibleEntry,
2357
+ Ve as withEstimatedDurationMinutes
3126
2358
  };