@instructure/platform-modules 1.15.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ModulesProgressBar-DOUI1JeK.js → ModulesProgressBar-B7Lo3-k0.js} +1016 -998
- package/dist/components/FilterSelect.d.ts.map +1 -1
- package/dist/components/ModuleCard.d.ts.map +1 -1
- package/dist/components/ModuleCard.stories.d.ts +2 -0
- package/dist/components/ModuleCard.stories.d.ts.map +1 -1
- package/dist/components/ModuleItemRow.d.ts.map +1 -1
- package/dist/components/ModulesList.d.ts.map +1 -1
- package/dist/components/ModulesProgressBar.d.ts +12 -2
- package/dist/components/ModulesProgressBar.d.ts.map +1 -1
- package/dist/components/StatusPill.d.ts +2 -0
- package/dist/components/StatusPill.d.ts.map +1 -1
- package/dist/edit.js +35 -35
- package/dist/hooks/useItemsMode.d.ts.map +1 -1
- package/dist/index.js +846 -819
- package/locales/en.json +2 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { w as
|
|
2
|
-
import {
|
|
3
|
-
import { canvasFetch as
|
|
4
|
-
import { z as
|
|
1
|
+
import { w as tt, I as yn, M as Tn, a as Pn, b as bn, i as Mt, c as Cn, v as nt, h as vn, o as He, m as re, d as wn, e as Ln, g as An, f as Rn, j as kn, u as $, k as ve, D as On, l as ye, n as qn, p as it, q as rt, r as Dn, s as zn, t as Nn, x as xn, y as $n, z as Dt, A as Un, B as zt, C as Nt, E as Fn, F as Bn, G as Gn, H as Wn, J as Hn, K as Yn, L as jn, N as Qn, O as Kn, P as Vn, Q as Zn, R as Xn, S as Jn, T as Te } from "./chunks/ModulesProgressBar-B7Lo3-k0.js";
|
|
2
|
+
import { a9 as lo, U as ao, V as uo, ap as co, aq as mo, ar as go, aG as po, as as fo, at as ho, au as Mo, av as _o, ac as Eo, a5 as Io, W as So, ae as yo, a8 as To, aB as Po, ah as bo, ai as Co, Y as vo, aD as wo, Z as Lo, _ as Ao, $ as Ro, a0 as ko, a2 as Oo, a7 as qo, a1 as Do, a3 as zo, a4 as No, aj as xo, al as $o, aa as Uo, aF as Fo, ab as Bo, aH as Go, ad as Wo, a6 as Ho, af as Yo, ax as jo, ag as Qo, aC as Ko, ay as Vo, aE as Zo, az as Xo, aA as Jo, ak as el, X as tl, am as nl, an as il, aw as rl, ao as sl } from "./chunks/ModulesProgressBar-B7Lo3-k0.js";
|
|
3
|
+
import { canvasFetch as _t } from "@instructure/platform-canvas-fetch";
|
|
4
|
+
import { z as Et } from "zod";
|
|
5
5
|
import { gql as J } from "graphql-tag";
|
|
6
|
-
import { jsx as s, jsxs as m, Fragment as
|
|
7
|
-
import { Pill as
|
|
8
|
-
import { useQueryClient as
|
|
9
|
-
import { useCallback as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { InstUISettingsProvider as ui } from "@instructure/emotion";
|
|
6
|
+
import { jsx as s, jsxs as m, Fragment as Y } from "react/jsx-runtime";
|
|
7
|
+
import { Pill as ei } from "@instructure/ui-pill/v11_7";
|
|
8
|
+
import { useQueryClient as ti, QueryClient as ni, QueryClientProvider as ii } from "@tanstack/react-query";
|
|
9
|
+
import { useCallback as N, useMemo as G, useId as ri, memo as si, useRef as R, useEffect as W, useState as H, useLayoutEffect as oi } from "react";
|
|
10
|
+
import { SimpleSelect as It } from "@instructure/ui-simple-select/v11_7";
|
|
11
|
+
import { Text as P } from "@instructure/ui-text/v11_7";
|
|
12
|
+
import { IconArrowOpenUpLine as li, IconArrowOpenDownLine as ai, IconClockLine as xt, IconAiColoredSolid as ui, IconAiSolid as di } from "@instructure/ui-icons";
|
|
13
|
+
import { politeAnnounce as x, getLiveRegion as be, TruncateWithTooltip as ci } from "@instructure/platform-instui-bindings";
|
|
14
|
+
import { InstUISettingsProvider as mi } from "@instructure/emotion";
|
|
16
15
|
import { Alert as X } from "@instructure/ui-alerts/v11_7";
|
|
17
|
-
import {
|
|
16
|
+
import { ScreenReaderContent as gi } from "@instructure/ui-a11y-content";
|
|
17
|
+
import { IconButton as pi, CloseButton as fi, Button as z } from "@instructure/ui-buttons/v11_7";
|
|
18
18
|
import { Flex as _ } from "@instructure/ui-flex/v11_7";
|
|
19
|
-
import { Heading as
|
|
20
|
-
import { Link as
|
|
21
|
-
import { List as
|
|
22
|
-
import { Pagination as
|
|
23
|
-
import { ProgressBar as
|
|
24
|
-
import { Spinner as
|
|
25
|
-
import { Tooltip as
|
|
26
|
-
import { View as
|
|
27
|
-
import { WithBreakpoints as
|
|
28
|
-
import { Modal as
|
|
29
|
-
import { CheckboxGroup as
|
|
30
|
-
import { RadioInputGroup as
|
|
31
|
-
import { TextArea as
|
|
32
|
-
function
|
|
19
|
+
import { Heading as me } from "@instructure/ui-heading/v11_7";
|
|
20
|
+
import { Link as hi } from "@instructure/ui-link/v11_7";
|
|
21
|
+
import { List as Qe, ListItem as Ke } from "@instructure/ui-list/v11_7";
|
|
22
|
+
import { Pagination as $t } from "@instructure/ui-pagination/v11_7";
|
|
23
|
+
import { ProgressBar as Mi } from "@instructure/ui-progress/v11_7";
|
|
24
|
+
import { Spinner as st } from "@instructure/ui-spinner/v11_7";
|
|
25
|
+
import { Tooltip as _i } from "@instructure/ui-tooltip/v11_7";
|
|
26
|
+
import { View as E } from "@instructure/ui-view/v11_7";
|
|
27
|
+
import { WithBreakpoints as Ei } from "@instructure/platform-with-breakpoints";
|
|
28
|
+
import { Modal as Ii, ModalHeader as Si, ModalBody as yi, ModalFooter as Ti } from "@instructure/ui-modal/v11_7";
|
|
29
|
+
import { CheckboxGroup as St, Checkbox as Ye } from "@instructure/ui-checkbox/v11_7";
|
|
30
|
+
import { RadioInputGroup as Pi, RadioInput as yt } from "@instructure/ui-radio-input/v11_7";
|
|
31
|
+
import { TextArea as bi } from "@instructure/ui-text-area/v11_7";
|
|
32
|
+
function Ut(e) {
|
|
33
33
|
return e === "module" ? "module" : "module item";
|
|
34
34
|
}
|
|
35
|
-
class
|
|
35
|
+
class Ft extends Error {
|
|
36
36
|
constructor(t, n, r) {
|
|
37
37
|
super(
|
|
38
|
-
`Canvas returned ${
|
|
38
|
+
`Canvas returned ${Ut(t)} ${n} without a usable ${r}. This is a partial response; refusing to guess a value for it.`
|
|
39
39
|
), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = r;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Bt(e, t, n) {
|
|
43
43
|
if (e != null) return e;
|
|
44
|
-
throw new
|
|
44
|
+
throw new Ft(t, n, "published");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Ci(e, t) {
|
|
47
47
|
if (e.onUnsupportedItem) {
|
|
48
48
|
e.onUnsupportedItem(t);
|
|
49
49
|
return;
|
|
@@ -52,16 +52,16 @@ function yi(e, t) {
|
|
|
52
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.`
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Gt(e, t) {
|
|
56
56
|
if (e.onUnsupportedStatus) {
|
|
57
57
|
e.onUnsupportedStatus(t);
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
console.warn(
|
|
61
|
-
`[platform-modules] ${
|
|
61
|
+
`[platform-modules] ${Ut(t.subject)} ${t.id}: status "${t.value}" is outside the closed status enum and was ignored. Pass \`onUnsupportedStatus\` to handle these yourself.`
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const vi = /* @__PURE__ */ new Map([
|
|
65
65
|
["Assignment", "assignment"],
|
|
66
66
|
["Quiz", "quiz"],
|
|
67
67
|
["Discussion", "discussion"],
|
|
@@ -73,21 +73,21 @@ const Ti = /* @__PURE__ */ new Map([
|
|
|
73
73
|
["SubHeader", "sub_header"],
|
|
74
74
|
["PeerReviewSubAssignment", "assignment"]
|
|
75
75
|
]);
|
|
76
|
-
function
|
|
76
|
+
function wi(e) {
|
|
77
77
|
const t = e == null ? void 0 : e.__typename;
|
|
78
78
|
if (!t) return null;
|
|
79
|
-
const n =
|
|
79
|
+
const n = vi.get(t);
|
|
80
80
|
return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
function
|
|
82
|
+
const Li = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
|
|
83
|
+
function Wt(e) {
|
|
84
84
|
if (!e) return null;
|
|
85
|
-
const t =
|
|
85
|
+
const t = Li.exec(e);
|
|
86
86
|
if (!t) return null;
|
|
87
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
88
|
return Math.round(u);
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const Ai = /* @__PURE__ */ new Set([
|
|
91
91
|
"must_view",
|
|
92
92
|
"must_mark_done",
|
|
93
93
|
"must_contribute",
|
|
@@ -95,18 +95,18 @@ const Ci = /* @__PURE__ */ new Set([
|
|
|
95
95
|
"min_score",
|
|
96
96
|
"min_percentage"
|
|
97
97
|
]);
|
|
98
|
-
function
|
|
99
|
-
return
|
|
98
|
+
function Ri(e) {
|
|
99
|
+
return Ai.has(e) ? e : "unknown";
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function ki(e) {
|
|
102
102
|
return {
|
|
103
103
|
itemId: String(e.id),
|
|
104
|
-
type:
|
|
104
|
+
type: Ri(e.type),
|
|
105
105
|
minScore: e.minScore ?? null,
|
|
106
106
|
minPercentage: e.minPercentage ?? null
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function Ht(e) {
|
|
110
110
|
return {
|
|
111
111
|
hasNextPage: (e == null ? void 0 : e.hasNextPage) ?? !1,
|
|
112
112
|
endCursor: (e == null ? void 0 : e.endCursor) ?? null,
|
|
@@ -116,14 +116,14 @@ function Wt(e) {
|
|
|
116
116
|
totalNrOfPages: (e == null ? void 0 : e.totalNrOfPages) ?? null
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
const
|
|
120
|
-
function
|
|
119
|
+
const Oi = /* @__PURE__ */ new Set(["min_score", "min_percentage"]);
|
|
120
|
+
function qi(e) {
|
|
121
121
|
var t;
|
|
122
122
|
for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
|
|
123
123
|
if (n) return n;
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Yt(e, t) {
|
|
127
127
|
if (!e) return;
|
|
128
128
|
const n = new Map(t.map((i) => [i.itemId, i.type])), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
129
129
|
for (const i of e.requirementsMet ?? []) {
|
|
@@ -134,7 +134,7 @@ function Ht(e, t) {
|
|
|
134
134
|
for (const i of e.incompleteRequirements ?? []) {
|
|
135
135
|
if (!i) continue;
|
|
136
136
|
const l = String(i.id);
|
|
137
|
-
n.get(l) === i.type &&
|
|
137
|
+
n.get(l) === i.type && Oi.has(i.type) && o.set(l, i.score ?? null);
|
|
138
138
|
}
|
|
139
139
|
return {
|
|
140
140
|
locked: e.locked === !0 || e.workflowState === "locked",
|
|
@@ -145,7 +145,7 @@ function Ht(e, t) {
|
|
|
145
145
|
incompleteRequirementScores: o
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
const
|
|
148
|
+
const Di = /* @__PURE__ */ new Map([
|
|
149
149
|
["LOCKED", "locked"],
|
|
150
150
|
["MISSING", "missing"],
|
|
151
151
|
["INCOMPLETE", "incomplete"],
|
|
@@ -153,16 +153,16 @@ const Ri = /* @__PURE__ */ new Map([
|
|
|
153
153
|
["IN_PROGRESS", "in_progress"],
|
|
154
154
|
["NOT_STARTED", "not_started"]
|
|
155
155
|
]);
|
|
156
|
-
function
|
|
156
|
+
function zi(e, t, n) {
|
|
157
157
|
if (e == null) return;
|
|
158
|
-
const r =
|
|
159
|
-
return r ||
|
|
158
|
+
const r = Di.get(e);
|
|
159
|
+
return r || Gt(n, {
|
|
160
160
|
subject: "moduleItem",
|
|
161
161
|
id: String(t),
|
|
162
162
|
value: e
|
|
163
163
|
}), r;
|
|
164
164
|
}
|
|
165
|
-
const
|
|
165
|
+
const Ni = /* @__PURE__ */ new Map([
|
|
166
166
|
["LOCKED", "locked"],
|
|
167
167
|
["MISSING", "missing"],
|
|
168
168
|
["MISSING_AND_INCOMPLETE", "missing_and_incomplete"],
|
|
@@ -171,33 +171,33 @@ const Oi = /* @__PURE__ */ new Map([
|
|
|
171
171
|
["IN_PROGRESS", "in_progress"],
|
|
172
172
|
["NOT_STARTED", "not_started"]
|
|
173
173
|
]);
|
|
174
|
-
function
|
|
174
|
+
function xi(e, t, n) {
|
|
175
175
|
if (e == null) return;
|
|
176
|
-
const r =
|
|
177
|
-
return r ||
|
|
176
|
+
const r = Ni.get(e);
|
|
177
|
+
return r || Gt(n, { subject: "module", id: String(t), value: e }), r;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
var a,
|
|
179
|
+
function $i(e, t, n, r = {}) {
|
|
180
|
+
var a, c;
|
|
181
181
|
if (!n) return;
|
|
182
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
183
|
(g) => g != null
|
|
184
184
|
).length;
|
|
185
185
|
return {
|
|
186
|
-
status:
|
|
186
|
+
status: xi(e.moduleStatus, e._id, r) ?? (n.locked ? "locked" : void 0),
|
|
187
187
|
requirementsMet: i,
|
|
188
188
|
requirementCount: o,
|
|
189
189
|
percentComplete: o > 0 ? Math.round(i / o * 100) : 0,
|
|
190
|
-
nextDueAt: ((
|
|
190
|
+
nextDueAt: ((c = e.submissionStatistics) == null ? void 0 : c.nextDueAt) ?? null,
|
|
191
191
|
missingCount: l,
|
|
192
192
|
incompleteCount: u
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
var
|
|
197
|
-
const i = String(e._id), l =
|
|
195
|
+
function Ui(e, t, n, r = {}, o) {
|
|
196
|
+
var c, g, p;
|
|
197
|
+
const i = String(e._id), l = wi(e.content);
|
|
198
198
|
if (!l)
|
|
199
|
-
return
|
|
200
|
-
const u =
|
|
199
|
+
return Ci(r, { id: i, typename: ((c = e.content) == null ? void 0 : c.__typename) ?? null }), null;
|
|
200
|
+
const u = qi(e.content), a = n.get(i) ?? null;
|
|
201
201
|
return {
|
|
202
202
|
id: i,
|
|
203
203
|
moduleId: t,
|
|
@@ -206,24 +206,24 @@ function zi(e, t, n, r = {}, o) {
|
|
|
206
206
|
position: e.position ?? 0,
|
|
207
207
|
itemNumber: e.itemNumber ?? void 0,
|
|
208
208
|
indent: e.indent ?? 0,
|
|
209
|
-
published:
|
|
209
|
+
published: Bt(e.published, "moduleItem", i),
|
|
210
210
|
url: e.url ?? null,
|
|
211
211
|
newTab: e.newTab ?? !1,
|
|
212
212
|
completionRequirement: a,
|
|
213
213
|
dueAt: (u == null ? void 0 : u.cachedDueDate) ?? ((g = e.content) == null ? void 0 : g.dueAt) ?? null,
|
|
214
|
-
status: o ?
|
|
214
|
+
status: o ? zi(e.moduleItemStatus, i, r) ?? (o.locked ? "locked" : void 0) : void 0,
|
|
215
215
|
pointsPossible: ((p = e.content) == null ? void 0 : p.pointsPossible) ?? null,
|
|
216
|
-
extensions:
|
|
216
|
+
extensions: tt(
|
|
217
217
|
void 0,
|
|
218
|
-
|
|
218
|
+
Wt(e.estimatedDuration)
|
|
219
219
|
)
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function jt(e, t, n, r, o) {
|
|
223
223
|
const i = [];
|
|
224
224
|
for (const l of e ?? []) {
|
|
225
225
|
if (!l) continue;
|
|
226
|
-
const u =
|
|
226
|
+
const u = Ui(
|
|
227
227
|
l,
|
|
228
228
|
t,
|
|
229
229
|
n,
|
|
@@ -234,29 +234,29 @@ function Yt(e, t, n, r, o) {
|
|
|
234
234
|
}
|
|
235
235
|
return i;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Qt(e) {
|
|
238
238
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
239
239
|
for (const r of e ?? []) {
|
|
240
240
|
if (!r) continue;
|
|
241
|
-
const o =
|
|
241
|
+
const o = ki(r);
|
|
242
242
|
t.push(o), n.set(o.itemId, o);
|
|
243
243
|
}
|
|
244
244
|
return { list: t, byItemId: n };
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
var
|
|
246
|
+
function Fi(e, t = {}) {
|
|
247
|
+
var c, g;
|
|
248
248
|
const n = String(e._id);
|
|
249
249
|
if (e.moduleItemsTotalCount == null)
|
|
250
|
-
throw new
|
|
251
|
-
const { list: r, byItemId: o } =
|
|
250
|
+
throw new Ft("module", n, "moduleItemsTotalCount");
|
|
251
|
+
const { list: r, byItemId: o } = Qt(e.completionRequirements), i = e.moduleItemsConnection, l = i != null && !((c = i.pageInfo) != null && c.hasNextPage), u = Yt(e.progression, r), a = l ? jt(i.nodes, n, o, t, u) : void 0;
|
|
252
252
|
return {
|
|
253
253
|
id: n,
|
|
254
254
|
name: e.name ?? "",
|
|
255
255
|
position: e.position ?? 0,
|
|
256
|
-
published:
|
|
256
|
+
published: Bt(e.published, "module", n),
|
|
257
257
|
itemCount: e.moduleItemsTotalCount,
|
|
258
258
|
items: a,
|
|
259
|
-
estimatedDurationMinutes:
|
|
259
|
+
estimatedDurationMinutes: Wt(e.estimatedDuration) || void 0,
|
|
260
260
|
unlockAt: e.unlockAt ?? null,
|
|
261
261
|
prerequisiteModules: (e.prerequisites ?? []).filter(
|
|
262
262
|
(p) => p != null
|
|
@@ -264,30 +264,30 @@ function Ni(e, t = {}) {
|
|
|
264
264
|
requirementCount: e.requirementCount ?? null,
|
|
265
265
|
requireSequentialProgress: e.requireSequentialProgress ?? !1,
|
|
266
266
|
completionRequirements: r,
|
|
267
|
-
progress:
|
|
267
|
+
progress: $i(e, r, u, t),
|
|
268
268
|
collapsed: ((g = e.progression) == null ? void 0 : g.collapsed) ?? null
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Bi(e, t = {}) {
|
|
272
272
|
var o;
|
|
273
273
|
const n = (o = e == null ? void 0 : e.legacyNode) == null ? void 0 : o.modulesConnection, r = [];
|
|
274
274
|
for (const i of (n == null ? void 0 : n.nodes) ?? [])
|
|
275
|
-
i && r.push(
|
|
276
|
-
return { modules: r, pageInfo:
|
|
275
|
+
i && r.push(Fi(i, t));
|
|
276
|
+
return { modules: r, pageInfo: Ht(n == null ? void 0 : n.pageInfo) };
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
const r = e == null ? void 0 : e.legacyNode, { list: o, byItemId: i } =
|
|
278
|
+
function Gi(e, t, n = {}) {
|
|
279
|
+
const r = e == null ? void 0 : e.legacyNode, { list: o, byItemId: i } = Qt(r == null ? void 0 : r.completionRequirements), l = r == null ? void 0 : r.moduleItemsConnection, u = Yt(r == null ? void 0 : r.progression, o);
|
|
280
280
|
return {
|
|
281
|
-
items:
|
|
282
|
-
pageInfo:
|
|
281
|
+
items: jt(l == null ? void 0 : l.nodes, t, i, n, u),
|
|
282
|
+
pageInfo: Ht(l == null ? void 0 : l.pageInfo)
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
|
-
const
|
|
285
|
+
const Wi = J`
|
|
286
286
|
fragment PlatformModulesSubmissionFields on Submission {
|
|
287
287
|
_id
|
|
288
288
|
cachedDueDate
|
|
289
289
|
}
|
|
290
|
-
`,
|
|
290
|
+
`, Kt = J`
|
|
291
291
|
fragment PlatformModulesItemFields on ModuleItem {
|
|
292
292
|
_id
|
|
293
293
|
title
|
|
@@ -336,8 +336,8 @@ const Ui = J`
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
${
|
|
340
|
-
`,
|
|
339
|
+
${Wi}
|
|
340
|
+
`, Vt = J`
|
|
341
341
|
fragment PlatformModulesProgressionFields on ModuleProgression {
|
|
342
342
|
workflowState
|
|
343
343
|
completed
|
|
@@ -357,7 +357,7 @@ const Ui = J`
|
|
|
357
357
|
score
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
`,
|
|
360
|
+
`, Zt = J`
|
|
361
361
|
fragment PlatformModulesModuleFields on Module {
|
|
362
362
|
_id
|
|
363
363
|
name
|
|
@@ -388,8 +388,8 @@ const Ui = J`
|
|
|
388
388
|
missingAssignmentCount
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
${
|
|
392
|
-
`,
|
|
391
|
+
${Vt}
|
|
392
|
+
`, Hi = J`
|
|
393
393
|
query PlatformModulesGetModules(
|
|
394
394
|
$courseId: ID!
|
|
395
395
|
$first: Int
|
|
@@ -417,8 +417,8 @@ const Ui = J`
|
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
${
|
|
421
|
-
`,
|
|
420
|
+
${Zt}
|
|
421
|
+
`, Yi = J`
|
|
422
422
|
query PlatformModulesGetModulesWithItems(
|
|
423
423
|
$courseId: ID!
|
|
424
424
|
$first: Int
|
|
@@ -458,9 +458,9 @@ const Ui = J`
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
${
|
|
462
|
-
${
|
|
463
|
-
`,
|
|
461
|
+
${Zt}
|
|
462
|
+
${Kt}
|
|
463
|
+
`, ji = J`
|
|
464
464
|
query PlatformModulesGetModuleItems(
|
|
465
465
|
$moduleId: ID!
|
|
466
466
|
$first: Int
|
|
@@ -498,27 +498,27 @@ const Ui = J`
|
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
${Qt}
|
|
502
501
|
${Kt}
|
|
502
|
+
${Vt}
|
|
503
503
|
`;
|
|
504
|
-
function
|
|
504
|
+
function Xt() {
|
|
505
505
|
return new DOMException("The operation was aborted.", "AbortError");
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
if (e != null && e.aborted) throw
|
|
507
|
+
function Pe(e) {
|
|
508
|
+
if (e != null && e.aborted) throw Xt();
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Tt(e, t) {
|
|
511
511
|
return t ? new Promise((n, r) => {
|
|
512
|
-
const o = () => r(
|
|
512
|
+
const o = () => r(Xt());
|
|
513
513
|
t.addEventListener("abort", o, { once: !0 }), e.then(n, r).finally(() => t.removeEventListener("abort", o));
|
|
514
514
|
}) : e;
|
|
515
515
|
}
|
|
516
|
-
const
|
|
516
|
+
const Pt = [
|
|
517
517
|
"COMPLETED",
|
|
518
518
|
"INCOMPLETE",
|
|
519
519
|
"IN_PROGRESS",
|
|
520
520
|
"NOT_STARTED"
|
|
521
|
-
],
|
|
521
|
+
], bt = /* @__PURE__ */ new Map([
|
|
522
522
|
["locked", ["LOCKED"]],
|
|
523
523
|
["missing", ["MISSING"]],
|
|
524
524
|
["missing_and_incomplete", ["MISSING_AND_INCOMPLETE"]],
|
|
@@ -526,24 +526,24 @@ const yt = [
|
|
|
526
526
|
["complete", ["COMPLETE"]],
|
|
527
527
|
["in_progress", ["IN_PROGRESS"]],
|
|
528
528
|
["not_started", ["NOT_STARTED"]]
|
|
529
|
-
]),
|
|
529
|
+
]), Qi = {
|
|
530
530
|
module: { completionStatus: ["eq"], moduleStatus: ["eq"], dueWithinDays: ["within"] }
|
|
531
531
|
};
|
|
532
|
-
function
|
|
532
|
+
function Ki(e, t) {
|
|
533
533
|
if (!e) return null;
|
|
534
534
|
if (e.target === "module" && e.field === "completionStatus" && e.op === "eq") {
|
|
535
535
|
const n = e.value;
|
|
536
|
-
if (!
|
|
536
|
+
if (!Pt.includes(n))
|
|
537
537
|
throw new Error(
|
|
538
|
-
`"${e.value}" is not a ModuleCompletionStatus (${
|
|
538
|
+
`"${e.value}" is not a ModuleCompletionStatus (${Pt.join(", ")}).`
|
|
539
539
|
);
|
|
540
540
|
return { completionStatus: n };
|
|
541
541
|
}
|
|
542
542
|
if (e.target === "module" && e.field === "moduleStatus" && e.op === "eq") {
|
|
543
|
-
const n = typeof e.value == "string" ?
|
|
543
|
+
const n = typeof e.value == "string" ? bt.get(e.value) : void 0;
|
|
544
544
|
if (!n)
|
|
545
545
|
throw new Error(
|
|
546
|
-
`"${String(e.value)}" is not a ModuleStatus (${[...
|
|
546
|
+
`"${String(e.value)}" is not a ModuleStatus (${[...bt.keys()].join(", ")}).`
|
|
547
547
|
);
|
|
548
548
|
return { moduleStatus: n };
|
|
549
549
|
}
|
|
@@ -556,21 +556,21 @@ function Hi(e, t) {
|
|
|
556
556
|
`Canvas GraphQL cannot serve ${e.target}.${e.field} "${e.op}". It compiles module.completionStatus eq, module.moduleStatus eq and module.dueWithinDays within.`
|
|
557
557
|
);
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function je(e, t, n) {
|
|
560
560
|
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 };
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Ys({
|
|
563
563
|
executeQuery: e,
|
|
564
564
|
inlineItemLimit: t = bn,
|
|
565
|
-
nodeBudget: n =
|
|
565
|
+
nodeBudget: n = yn,
|
|
566
566
|
onUnsupportedItem: r,
|
|
567
567
|
onUnsupportedStatus: o,
|
|
568
568
|
studentId: i,
|
|
569
569
|
validate: l = !0,
|
|
570
|
-
capabilities: u =
|
|
570
|
+
capabilities: u = Qi,
|
|
571
571
|
includeEstimatedDuration: a = !1
|
|
572
572
|
}) {
|
|
573
|
-
const
|
|
573
|
+
const c = i != null, g = { onUnsupportedItem: r, onUnsupportedStatus: o };
|
|
574
574
|
return {
|
|
575
575
|
inlineNodeBudget: n,
|
|
576
576
|
capabilities: u,
|
|
@@ -579,40 +579,40 @@ function Bs({
|
|
|
579
579
|
page: h = { kind: "first" },
|
|
580
580
|
pageSize: f,
|
|
581
581
|
includeItems: I,
|
|
582
|
-
filter:
|
|
582
|
+
filter: w,
|
|
583
583
|
dueRange: L,
|
|
584
|
-
inlineItemsFirst:
|
|
584
|
+
inlineItemsFirst: U,
|
|
585
585
|
inlineFirst: O,
|
|
586
586
|
signal: S
|
|
587
587
|
}) {
|
|
588
|
-
|
|
589
|
-
const C =
|
|
590
|
-
let
|
|
588
|
+
Pe(S);
|
|
589
|
+
const C = Ki(w, L);
|
|
590
|
+
let Q;
|
|
591
591
|
if (I) {
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
|
|
592
|
+
const A = Math.min(O ?? f, f), q = Math.min(U ?? t, t), F = Math.max(1, Math.min(q, Math.floor(n / A)));
|
|
593
|
+
Q = e(
|
|
594
|
+
Yi,
|
|
595
595
|
{
|
|
596
596
|
courseId: p,
|
|
597
|
-
...
|
|
598
|
-
itemsFirst:
|
|
599
|
-
includeSubmissions:
|
|
597
|
+
...je(h, A, f),
|
|
598
|
+
itemsFirst: F,
|
|
599
|
+
includeSubmissions: c,
|
|
600
600
|
includeEstimatedDuration: a,
|
|
601
601
|
studentId: i ?? null,
|
|
602
602
|
filter: C
|
|
603
603
|
}
|
|
604
604
|
);
|
|
605
605
|
} else
|
|
606
|
-
|
|
606
|
+
Q = e(Hi, {
|
|
607
607
|
courseId: p,
|
|
608
|
-
...
|
|
608
|
+
...je(h, f, f),
|
|
609
609
|
includeEstimatedDuration: a,
|
|
610
610
|
filter: C
|
|
611
611
|
});
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
const T =
|
|
615
|
-
return l ?
|
|
612
|
+
const K = await Tt(Q, S);
|
|
613
|
+
Pe(S);
|
|
614
|
+
const T = Bi(K, g);
|
|
615
|
+
return l ? Pn.parse(T) : T;
|
|
616
616
|
},
|
|
617
617
|
async listModuleItems({
|
|
618
618
|
moduleId: p,
|
|
@@ -620,20 +620,20 @@ function Bs({
|
|
|
620
620
|
pageSize: f,
|
|
621
621
|
signal: I
|
|
622
622
|
}) {
|
|
623
|
-
|
|
624
|
-
const
|
|
625
|
-
e(
|
|
623
|
+
Pe(I);
|
|
624
|
+
const w = await Tt(
|
|
625
|
+
e(ji, {
|
|
626
626
|
moduleId: p,
|
|
627
|
-
...
|
|
628
|
-
includeSubmissions:
|
|
627
|
+
...je(h, f, f),
|
|
628
|
+
includeSubmissions: c,
|
|
629
629
|
includeEstimatedDuration: a,
|
|
630
630
|
studentId: i ?? null
|
|
631
631
|
}),
|
|
632
632
|
I
|
|
633
633
|
);
|
|
634
|
-
|
|
635
|
-
const L =
|
|
636
|
-
return l ?
|
|
634
|
+
Pe(I);
|
|
635
|
+
const L = Gi(w, p, g);
|
|
636
|
+
return l ? Tn.parse(L) : L;
|
|
637
637
|
},
|
|
638
638
|
async setModuleCollapsed({
|
|
639
639
|
courseId: p,
|
|
@@ -641,14 +641,14 @@ function Bs({
|
|
|
641
641
|
collapsed: f,
|
|
642
642
|
signal: I
|
|
643
643
|
}) {
|
|
644
|
-
await
|
|
644
|
+
await _t(
|
|
645
645
|
{
|
|
646
646
|
path: `/courses/${p}/modules/${h}/collapse`,
|
|
647
647
|
method: "POST",
|
|
648
648
|
body: { collapse: f },
|
|
649
649
|
signal: I
|
|
650
650
|
},
|
|
651
|
-
|
|
651
|
+
Et.unknown()
|
|
652
652
|
);
|
|
653
653
|
},
|
|
654
654
|
async setAllModulesCollapsed({
|
|
@@ -656,20 +656,20 @@ function Bs({
|
|
|
656
656
|
collapsed: h,
|
|
657
657
|
signal: f
|
|
658
658
|
}) {
|
|
659
|
-
await
|
|
659
|
+
await _t(
|
|
660
660
|
{
|
|
661
661
|
path: `/courses/${p}/collapse_all_modules`,
|
|
662
662
|
method: "POST",
|
|
663
663
|
params: { collapse: h ? 1 : 0 },
|
|
664
664
|
signal: f
|
|
665
665
|
},
|
|
666
|
-
|
|
666
|
+
Et.unknown()
|
|
667
667
|
);
|
|
668
668
|
}
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
const
|
|
672
|
-
function
|
|
671
|
+
const js = 1e3;
|
|
672
|
+
function Vi({
|
|
673
673
|
queryClient: e,
|
|
674
674
|
courseId: t,
|
|
675
675
|
module: n,
|
|
@@ -680,86 +680,85 @@ function Yi({
|
|
|
680
680
|
item: r,
|
|
681
681
|
invalidateModuleItems: async (o) => {
|
|
682
682
|
await Promise.all([
|
|
683
|
-
|
|
684
|
-
|
|
683
|
+
Cn(e, t, o),
|
|
684
|
+
Mt(e, t)
|
|
685
685
|
]);
|
|
686
686
|
},
|
|
687
|
-
invalidateModuleList: () =>
|
|
687
|
+
invalidateModuleList: () => Mt(e, t)
|
|
688
688
|
};
|
|
689
689
|
}
|
|
690
|
-
function
|
|
691
|
-
return
|
|
690
|
+
function Qs(e, t) {
|
|
691
|
+
return nt(e).filter(
|
|
692
692
|
(n) => n.visible == null || n.visible(t) === !0
|
|
693
693
|
);
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
const n = Object.keys(t).filter((o) => !
|
|
695
|
+
function Jt(e, t = {}) {
|
|
696
|
+
const n = Object.keys(t).filter((o) => !vn(e, o));
|
|
697
697
|
if (n.length > 0)
|
|
698
698
|
throw new Error(
|
|
699
699
|
`Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
|
|
700
700
|
);
|
|
701
701
|
const r = {
|
|
702
|
-
formatters:
|
|
703
|
-
itemTypes:
|
|
704
|
-
itemStatuses:
|
|
705
|
-
itemMeta:
|
|
706
|
-
filters:
|
|
707
|
-
moduleActions:
|
|
708
|
-
itemActions:
|
|
709
|
-
navigation:
|
|
710
|
-
permissions:
|
|
702
|
+
formatters: He(e.formatters, t.formatters),
|
|
703
|
+
itemTypes: re(e.itemTypes, t.itemTypes),
|
|
704
|
+
itemStatuses: re(e.itemStatuses, t.itemStatuses),
|
|
705
|
+
itemMeta: re(e.itemMeta, t.itemMeta),
|
|
706
|
+
filters: re(e.filters, t.filters),
|
|
707
|
+
moduleActions: re(e.moduleActions, t.moduleActions),
|
|
708
|
+
itemActions: re(e.itemActions, t.itemActions),
|
|
709
|
+
navigation: He(e.navigation, t.navigation),
|
|
710
|
+
permissions: He(e.permissions, t.permissions),
|
|
711
711
|
notify: t.notify ?? e.notify
|
|
712
712
|
};
|
|
713
|
-
return
|
|
713
|
+
return wn.parse(r), r;
|
|
714
714
|
}
|
|
715
|
-
const
|
|
715
|
+
const Zi = "organizeNewPlacement", Xi = {
|
|
716
716
|
label: "metaFieldNewPlacementLabel",
|
|
717
717
|
order: 5,
|
|
718
|
-
render: ({ item: e, t }) =>
|
|
719
|
-
},
|
|
720
|
-
itemMeta: { [
|
|
721
|
-
filters:
|
|
718
|
+
render: ({ item: e, t }) => Rn(e) ? /* @__PURE__ */ s(ei, { color: "success", children: t("organizeNewItemPill") }) : null
|
|
719
|
+
}, Ji = (e) => Object.fromEntries(Object.keys(e).map((t) => [t, { hidden: !0 }])), er = (e) => Jt(e, {
|
|
720
|
+
itemMeta: { [Zi]: Xi },
|
|
721
|
+
filters: Ji(e.filters),
|
|
722
722
|
formatters: {
|
|
723
723
|
moduleLabel: (t, n, { t: r }) => {
|
|
724
724
|
if (Ln(n)) return r("organizeNewModuleLabel");
|
|
725
|
-
const o =
|
|
725
|
+
const o = An(n);
|
|
726
726
|
return o === 0 ? null : r("organizeItemsAddedLabel", { count: o });
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
});
|
|
730
|
-
function
|
|
731
|
-
return
|
|
730
|
+
function Ks(e = {}) {
|
|
731
|
+
return Jt(kn, e);
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
const t =
|
|
735
|
-
return
|
|
736
|
-
(n, r) =>
|
|
733
|
+
function Vs(e) {
|
|
734
|
+
const t = ti();
|
|
735
|
+
return N(
|
|
736
|
+
(n, r) => Vi({ queryClient: t, courseId: e, module: n, item: r }),
|
|
737
737
|
[t, e]
|
|
738
738
|
);
|
|
739
739
|
}
|
|
740
|
-
const
|
|
741
|
-
not_started:
|
|
742
|
-
in_progress:
|
|
743
|
-
complete:
|
|
744
|
-
missing:
|
|
745
|
-
due_this_week:
|
|
746
|
-
},
|
|
740
|
+
const tr = {
|
|
741
|
+
not_started: ye.not_started,
|
|
742
|
+
in_progress: ye.in_progress,
|
|
743
|
+
complete: ye.complete,
|
|
744
|
+
missing: ye.missing,
|
|
745
|
+
due_this_week: On
|
|
746
|
+
}, nr = {
|
|
747
747
|
primary: "secondary",
|
|
748
748
|
info: "brand",
|
|
749
749
|
success: "success",
|
|
750
750
|
warning: "warning"
|
|
751
751
|
};
|
|
752
|
-
function
|
|
752
|
+
function ir({
|
|
753
753
|
value: e,
|
|
754
754
|
onChange: t,
|
|
755
755
|
interaction: n = "enabled"
|
|
756
756
|
}) {
|
|
757
|
-
const { t: r } =
|
|
757
|
+
const { t: r } = $(), o = ve(), i = G(() => nt(o.filters), [o.filters]), l = ri();
|
|
758
758
|
return i.length === 0 ? null : /* @__PURE__ */ s(
|
|
759
|
-
|
|
759
|
+
It,
|
|
760
760
|
{
|
|
761
|
-
renderLabel:
|
|
762
|
-
renderBeforeInput: /* @__PURE__ */ s(b, { weight: "bold", "aria-hidden": "true", children: r("filterGroupLabel") }),
|
|
761
|
+
renderLabel: r("filterGroupLabel"),
|
|
763
762
|
value: e,
|
|
764
763
|
onChange: (u, a) => {
|
|
765
764
|
a.value !== void 0 && t(String(a.value));
|
|
@@ -767,13 +766,13 @@ function Ji({
|
|
|
767
766
|
interaction: n,
|
|
768
767
|
"data-testid": "filter-select",
|
|
769
768
|
children: i.map((u) => {
|
|
770
|
-
const a =
|
|
769
|
+
const a = tr[u.key];
|
|
771
770
|
return /* @__PURE__ */ s(
|
|
772
|
-
|
|
771
|
+
It.Option,
|
|
773
772
|
{
|
|
774
773
|
id: `${l}-${u.key}`,
|
|
775
774
|
value: u.key,
|
|
776
|
-
renderBeforeLabel: a ? /* @__PURE__ */ s(
|
|
775
|
+
renderBeforeLabel: a ? /* @__PURE__ */ s(P, { color: nr[a.tone], children: a.icon }) : void 0,
|
|
777
776
|
"data-testid": `filter-option-${u.key}`,
|
|
778
777
|
children: r(u.label)
|
|
779
778
|
},
|
|
@@ -783,21 +782,21 @@ function Ji({
|
|
|
783
782
|
}
|
|
784
783
|
);
|
|
785
784
|
}
|
|
786
|
-
const
|
|
787
|
-
function
|
|
788
|
-
const { t } =
|
|
789
|
-
if (e.length === 1) return /* @__PURE__ */ s(
|
|
785
|
+
const Ct = "\0", rr = { textDecoration: "underline dotted", cursor: "help" }, en = { ...qn, marginInlineEnd: "0.375rem" };
|
|
786
|
+
function sr({ names: e }) {
|
|
787
|
+
const { t } = $();
|
|
788
|
+
if (e.length === 1) return /* @__PURE__ */ s(Y, { children: t("lockedByPrerequisiteByline", { name: e[0] }) });
|
|
790
789
|
const n = t("lockedByPrerequisitesByline", {
|
|
791
790
|
count: e.length,
|
|
792
|
-
prerequisites:
|
|
793
|
-
}), [r, ...o] = n.split(
|
|
794
|
-
return /* @__PURE__ */ m(
|
|
791
|
+
prerequisites: Ct
|
|
792
|
+
}), [r, ...o] = n.split(Ct), i = o.length > 0 ? o.join("") : null;
|
|
793
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
795
794
|
i === null ? null : r,
|
|
796
|
-
/* @__PURE__ */ s(
|
|
795
|
+
/* @__PURE__ */ s(_i, { renderTip: e.join(", "), children: /* @__PURE__ */ s(
|
|
797
796
|
"span",
|
|
798
797
|
{
|
|
799
798
|
tabIndex: 0,
|
|
800
|
-
style:
|
|
799
|
+
style: rr,
|
|
801
800
|
onClick: (l) => l.stopPropagation(),
|
|
802
801
|
"data-testid": "module-byline-prerequisites",
|
|
803
802
|
children: i === null ? n : t("lockedByPrerequisitesCount", { count: e.length })
|
|
@@ -806,53 +805,53 @@ function tr({ names: e }) {
|
|
|
806
805
|
i
|
|
807
806
|
] });
|
|
808
807
|
}
|
|
809
|
-
function
|
|
808
|
+
function or({ module: e, today: t }) {
|
|
810
809
|
var p;
|
|
811
|
-
const n =
|
|
810
|
+
const n = rt(), r = Dt(), 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;
|
|
812
811
|
let a = null;
|
|
813
812
|
i !== null && u && (o || !e.progress) ? a = n.unlockByline(i, t) : i !== null && !u && !e.progress && (a = n.unlockedByline(i, t));
|
|
814
|
-
const
|
|
813
|
+
const c = o && l.length > 0;
|
|
815
814
|
let g = null;
|
|
816
|
-
if (a === null && !
|
|
817
|
-
const h = e.estimatedDurationMinutes ??
|
|
815
|
+
if (a === null && !c && !o) {
|
|
816
|
+
const h = e.estimatedDurationMinutes ?? Un(e.items);
|
|
818
817
|
g = h === null ? null : n.estimatedDurationByline(h);
|
|
819
818
|
}
|
|
820
|
-
return a === null && !
|
|
821
|
-
/* @__PURE__ */ s("span", { style:
|
|
819
|
+
return a === null && !c && g === null ? null : /* @__PURE__ */ s(E, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ s("div", { style: zt, children: /* @__PURE__ */ s(P, { variant: "contentSmall", color: "secondary", "data-testid": "module-byline", children: g !== null ? /* @__PURE__ */ m(Y, { children: [
|
|
820
|
+
/* @__PURE__ */ s("span", { style: en, children: /* @__PURE__ */ s(xt, { width: "0.75rem", height: "0.75rem", color: "secondary" }) }),
|
|
822
821
|
g
|
|
823
|
-
] }) : /* @__PURE__ */ m(
|
|
822
|
+
] }) : /* @__PURE__ */ m(Y, { children: [
|
|
824
823
|
a,
|
|
825
|
-
a !== null &&
|
|
826
|
-
|
|
824
|
+
a !== null && c ? /* @__PURE__ */ s("span", { style: Nt, children: " " }) : null,
|
|
825
|
+
c ? /* @__PURE__ */ s("span", { style: a !== null ? r : void 0, children: /* @__PURE__ */ s(sr, { names: l }) }) : null
|
|
827
826
|
] }) }) }) });
|
|
828
827
|
}
|
|
829
|
-
const
|
|
828
|
+
const lr = "#273540", ar = "#D7DADE", ur = "0.25rem", dr = (e, t) => {
|
|
830
829
|
var n, r, o, i, l;
|
|
831
830
|
return {
|
|
832
|
-
meterColorBrand: ((r = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : r.grey125125) ??
|
|
833
|
-
borderRadius: String(((o = t.borders) == null ? void 0 : o.radiusMedium) ??
|
|
834
|
-
borderColor: ((l = (i = t.colors) == null ? void 0 : i.contrasts) == null ? void 0 : l.grey1424) ??
|
|
831
|
+
meterColorBrand: ((r = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : r.grey125125) ?? lr,
|
|
832
|
+
borderRadius: String(((o = t.borders) == null ? void 0 : o.radiusMedium) ?? ur),
|
|
833
|
+
borderColor: ((l = (i = t.colors) == null ? void 0 : i.contrasts) == null ? void 0 : l.grey1424) ?? ar,
|
|
835
834
|
trackBottomBorderColor: "transparent"
|
|
836
835
|
};
|
|
837
|
-
},
|
|
838
|
-
function
|
|
836
|
+
}, cr = "66.667%", mr = "80px", gr = 2, pr = { components: { TruncateText: { fontFamily: "inherit" } } };
|
|
837
|
+
function fr({
|
|
839
838
|
module: e,
|
|
840
839
|
breakpoints: t
|
|
841
840
|
}) {
|
|
842
|
-
const { t: n } =
|
|
841
|
+
const { t: n } = $(), r = rt(), o = Dt(), i = e.progress;
|
|
843
842
|
if (!i || i.status === "locked" || i.requirementCount <= 0) return null;
|
|
844
|
-
const l = Object.keys(t).length === 0 || t.desktop === !0, u =
|
|
843
|
+
const l = Object.keys(t).length === 0 || t.desktop === !0, u = Bn(e.items);
|
|
845
844
|
return /* @__PURE__ */ m(
|
|
846
845
|
_,
|
|
847
846
|
{
|
|
848
|
-
width: l ?
|
|
847
|
+
width: l ? cr : "100%",
|
|
849
848
|
alignItems: "center",
|
|
850
849
|
gap: "x-small",
|
|
851
850
|
margin: "x-small 0 0 0",
|
|
852
851
|
"data-testid": "module-progress",
|
|
853
852
|
children: [
|
|
854
|
-
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ s(
|
|
855
|
-
|
|
853
|
+
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ s(E, { as: "div", width: mr, "data-testid": "module-progress-bar", children: /* @__PURE__ */ s(
|
|
854
|
+
Mi,
|
|
856
855
|
{
|
|
857
856
|
size: "x-small",
|
|
858
857
|
meterColor: "brand",
|
|
@@ -861,26 +860,26 @@ function cr({
|
|
|
861
860
|
shouldAnimate: !1,
|
|
862
861
|
screenReaderLabel: n("moduleProgressScreenReaderLabel", { name: e.name }),
|
|
863
862
|
formatScreenReaderValue: () => {
|
|
864
|
-
const a =
|
|
863
|
+
const a = Gn(
|
|
865
864
|
n,
|
|
866
865
|
i.requirementsMet,
|
|
867
866
|
i.requirementCount
|
|
868
867
|
);
|
|
869
868
|
return u === null ? a : `${a}, ${r.remainingDurationByline(u)}`;
|
|
870
869
|
},
|
|
871
|
-
themeOverride:
|
|
870
|
+
themeOverride: dr
|
|
872
871
|
}
|
|
873
872
|
) }) }),
|
|
874
|
-
/* @__PURE__ */ s(_.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ s("div", { style:
|
|
873
|
+
/* @__PURE__ */ s(_.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ s("div", { style: zt, children: /* @__PURE__ */ m(P, { variant: "contentSmall", color: "secondary", children: [
|
|
875
874
|
r.progress(
|
|
876
875
|
i.percentComplete,
|
|
877
876
|
i.requirementsMet,
|
|
878
877
|
i.requirementCount
|
|
879
878
|
),
|
|
880
|
-
u !== null ? /* @__PURE__ */ m(
|
|
881
|
-
/* @__PURE__ */ s("span", { style:
|
|
879
|
+
u !== null ? /* @__PURE__ */ m(Y, { children: [
|
|
880
|
+
/* @__PURE__ */ s("span", { style: Nt, children: " " }),
|
|
882
881
|
/* @__PURE__ */ m("span", { style: o, children: [
|
|
883
|
-
/* @__PURE__ */ s("span", { style:
|
|
882
|
+
/* @__PURE__ */ s("span", { style: en, children: /* @__PURE__ */ s(xt, { width: "0.75rem", height: "0.75rem", color: "secondary" }) }),
|
|
884
883
|
r.remainingDurationByline(u)
|
|
885
884
|
] })
|
|
886
885
|
] }) : null
|
|
@@ -889,21 +888,21 @@ function cr({
|
|
|
889
888
|
}
|
|
890
889
|
);
|
|
891
890
|
}
|
|
892
|
-
const
|
|
893
|
-
function
|
|
891
|
+
const vt = (e) => `platform-modules-panel-${e}`;
|
|
892
|
+
function Ve(e) {
|
|
894
893
|
return e !== void 0 && e.type !== "sub_header";
|
|
895
894
|
}
|
|
896
|
-
function
|
|
897
|
-
return
|
|
895
|
+
function wt(e) {
|
|
896
|
+
return Ve(e) && e.indent > 0;
|
|
898
897
|
}
|
|
899
|
-
function
|
|
898
|
+
function hr(e, t) {
|
|
900
899
|
let n = t;
|
|
901
900
|
return e.map((r) => {
|
|
902
901
|
if (r.type !== "sub_header")
|
|
903
902
|
return n = r.itemNumber ?? n + 1, n;
|
|
904
903
|
});
|
|
905
904
|
}
|
|
906
|
-
function
|
|
905
|
+
function Mr({
|
|
907
906
|
module: e,
|
|
908
907
|
state: t,
|
|
909
908
|
today: n,
|
|
@@ -911,11 +910,11 @@ function gr({
|
|
|
911
910
|
stackPill: o,
|
|
912
911
|
moduleLabel: i
|
|
913
912
|
}) {
|
|
914
|
-
const { t: l } =
|
|
915
|
-
|
|
913
|
+
const { t: l } = $(), u = it(), a = R(null), c = hr(t.items, t.itemOffset), g = t.items.length, p = !t.isLoading && !t.isRefreshing;
|
|
914
|
+
W(() => {
|
|
916
915
|
if (!p || g === 0 || a.current === t.page) return;
|
|
917
916
|
const f = a.current === null;
|
|
918
|
-
a.current = t.page,
|
|
917
|
+
a.current = t.page, x(
|
|
919
918
|
f ? l("itemsLoadedAnnouncement", {
|
|
920
919
|
loaded: g,
|
|
921
920
|
count: e.itemCount,
|
|
@@ -930,22 +929,22 @@ function gr({
|
|
|
930
929
|
const h = (f) => {
|
|
931
930
|
u("paginate-items"), f === 1 ? t.goToFirstPage() : f === t.page - 1 ? t.goToPreviousPage() : f === t.page + 1 ? t.goToNextPage() : f === t.pageCount && t.goToLastPage();
|
|
932
931
|
};
|
|
933
|
-
return t.error ? /* @__PURE__ */ s(
|
|
932
|
+
return t.error ? /* @__PURE__ */ s(E, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ s(
|
|
934
933
|
X,
|
|
935
934
|
{
|
|
936
935
|
variant: "error",
|
|
937
936
|
margin: "0",
|
|
938
|
-
liveRegion:
|
|
937
|
+
liveRegion: be,
|
|
939
938
|
liveRegionPoliteness: "assertive",
|
|
940
939
|
"data-testid": "items-error",
|
|
941
940
|
children: l("itemsLoadErrorAlert", { message: t.error.message })
|
|
942
941
|
}
|
|
943
|
-
) }) : t.isLoading ? /* @__PURE__ */ m(
|
|
944
|
-
/* @__PURE__ */ s(
|
|
942
|
+
) }) : t.isLoading ? /* @__PURE__ */ m(E, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
|
|
943
|
+
/* @__PURE__ */ s(st, { size: "x-small", renderTitle: l("itemsLoadingSpinnerLabel") }),
|
|
945
944
|
" ",
|
|
946
|
-
/* @__PURE__ */ s(
|
|
947
|
-
] }) : /* @__PURE__ */ m(
|
|
948
|
-
r ? /* @__PURE__ */ m(
|
|
945
|
+
/* @__PURE__ */ s(P, { size: "small", color: "secondary", children: l("itemsLoadingText") })
|
|
946
|
+
] }) : /* @__PURE__ */ m(E, { as: "div", margin: "small 0 0 0", children: [
|
|
947
|
+
r ? /* @__PURE__ */ m(P, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
|
|
949
948
|
"items source: ",
|
|
950
949
|
t.source,
|
|
951
950
|
" · page ",
|
|
@@ -953,26 +952,26 @@ function gr({
|
|
|
953
952
|
" of ",
|
|
954
953
|
t.pageCount
|
|
955
954
|
] }) : null,
|
|
956
|
-
t.items.length === 0 ? /* @__PURE__ */ s(
|
|
957
|
-
|
|
955
|
+
t.items.length === 0 ? /* @__PURE__ */ s(E, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ s(P, { size: "small", color: "secondary", children: l("noItemsEmptyState") }) }) : /* @__PURE__ */ s(Qe, { isUnstyled: !0, margin: "none", "data-testid": "items-list", children: t.items.map((f, I) => /* @__PURE__ */ s(Ke, { children: /* @__PURE__ */ s(
|
|
956
|
+
Wn,
|
|
958
957
|
{
|
|
959
958
|
item: f,
|
|
960
959
|
today: n,
|
|
961
|
-
attachedAbove:
|
|
962
|
-
attachedBelow:
|
|
960
|
+
attachedAbove: wt(f) && Ve(t.items[I - 1]),
|
|
961
|
+
attachedBelow: Ve(f) && wt(t.items[I + 1]),
|
|
963
962
|
stackPill: o,
|
|
964
963
|
moduleLabel: i,
|
|
965
|
-
itemNumber:
|
|
964
|
+
itemNumber: c[I]
|
|
966
965
|
}
|
|
967
966
|
) }, f.id)) }),
|
|
968
967
|
t.pageCount > 1 ? /* @__PURE__ */ s(
|
|
969
|
-
|
|
968
|
+
$t,
|
|
970
969
|
{
|
|
971
970
|
as: "nav",
|
|
972
971
|
variant: "compact",
|
|
973
972
|
withFirstAndLastButton: !0,
|
|
974
973
|
margin: "small 0 0 0",
|
|
975
|
-
label: /* @__PURE__ */ s(
|
|
974
|
+
label: /* @__PURE__ */ s(gi, { children: l("itemsPaginationLabel", { name: e.name }) }),
|
|
976
975
|
labelFirst: l("paginationFirstPage"),
|
|
977
976
|
labelPrev: l("paginationPreviousPage"),
|
|
978
977
|
labelNext: l("paginationNextPage"),
|
|
@@ -988,7 +987,7 @@ function gr({
|
|
|
988
987
|
) : null
|
|
989
988
|
] });
|
|
990
989
|
}
|
|
991
|
-
function
|
|
990
|
+
function _r({
|
|
992
991
|
module: e,
|
|
993
992
|
expanded: t,
|
|
994
993
|
onToggle: n,
|
|
@@ -998,34 +997,45 @@ function pr({
|
|
|
998
997
|
headingLevel: l = "h3",
|
|
999
998
|
moduleLabel: u,
|
|
1000
999
|
breakpoints: a = {},
|
|
1001
|
-
toggleRef:
|
|
1000
|
+
toggleRef: c
|
|
1002
1001
|
}) {
|
|
1003
|
-
var
|
|
1004
|
-
const { t: g, timezone: p } =
|
|
1005
|
-
|
|
1002
|
+
var te, pe, j, le, ae;
|
|
1003
|
+
const { t: g, timezone: p } = $(), h = it(), f = rt(), { navigation: I } = ve(), w = Dn(), L = ((te = e.progress) == null ? void 0 : te.status) === "locked", U = L ? null : ((pe = I.getModuleHref) == null ? void 0 : pe.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, K = /* @__PURE__ */ s(
|
|
1004
|
+
me,
|
|
1006
1005
|
{
|
|
1007
1006
|
level: l,
|
|
1008
1007
|
variant: "titleCardMini",
|
|
1009
1008
|
color: L ? "secondary" : "primary",
|
|
1010
1009
|
"aria-label": C,
|
|
1011
1010
|
"data-testid": "module-name",
|
|
1012
|
-
children: /* @__PURE__ */ s(
|
|
1011
|
+
children: /* @__PURE__ */ s(mi, { themeOverride: pr, children: /* @__PURE__ */ s(ci, { linesAllowed: gr, children: C }) })
|
|
1012
|
+
}
|
|
1013
|
+
), T = U ? /* @__PURE__ */ s(
|
|
1014
|
+
hi,
|
|
1015
|
+
{
|
|
1016
|
+
href: U,
|
|
1017
|
+
display: "inline-block",
|
|
1018
|
+
forceButtonRole: !1,
|
|
1019
|
+
variant: w,
|
|
1020
|
+
"aria-label": C,
|
|
1021
|
+
onClick: (B) => B.stopPropagation(),
|
|
1022
|
+
children: K
|
|
1013
1023
|
}
|
|
1014
|
-
),
|
|
1024
|
+
) : K, A = (((j = e.completionRequirements) == null ? void 0 : j.length) ?? 0) > 0 ? /* @__PURE__ */ s(zn, {}) : null, q = a.mobileOnly === !0, F = () => {
|
|
1015
1025
|
h(t ? "module-collapse" : "module-expand"), n(e.id);
|
|
1016
|
-
},
|
|
1017
|
-
var
|
|
1018
|
-
(
|
|
1019
|
-
},
|
|
1020
|
-
|
|
1026
|
+
}, ee = () => {
|
|
1027
|
+
var B;
|
|
1028
|
+
(B = window.getSelection()) != null && B.toString().trim() || F();
|
|
1029
|
+
}, D = (le = e.progress) != null && le.status ? /* @__PURE__ */ s(
|
|
1030
|
+
Nn,
|
|
1021
1031
|
{
|
|
1022
1032
|
status: e.progress.status,
|
|
1023
1033
|
missingCount: e.progress.missingCount,
|
|
1024
1034
|
incompleteCount: e.progress.incompleteCount
|
|
1025
1035
|
}
|
|
1026
|
-
) : null,
|
|
1036
|
+
) : null, v = ((ae = e.progress) == null ? void 0 : ae.status) !== void 0 && e.progress.status !== "complete" && !L && xn(e.progress.nextDueAt, o, p) ? /* @__PURE__ */ s(Fn, {}) : null;
|
|
1027
1037
|
return /* @__PURE__ */ m(
|
|
1028
|
-
|
|
1038
|
+
E,
|
|
1029
1039
|
{
|
|
1030
1040
|
as: "div",
|
|
1031
1041
|
background: "primary",
|
|
@@ -1036,105 +1046,97 @@ function pr({
|
|
|
1036
1046
|
margin: "0 0 small 0",
|
|
1037
1047
|
"data-testid": `module-card-${e.id}`,
|
|
1038
1048
|
children: [
|
|
1039
|
-
/* @__PURE__ */ s(
|
|
1049
|
+
/* @__PURE__ */ s(E, { as: "div", cursor: "pointer", children: /* @__PURE__ */ m(
|
|
1040
1050
|
_,
|
|
1041
1051
|
{
|
|
1042
1052
|
alignItems: "start",
|
|
1043
1053
|
gap: "mediumSmall",
|
|
1044
|
-
onClick:
|
|
1054
|
+
onClick: ee,
|
|
1045
1055
|
"data-testid": "module-header",
|
|
1046
1056
|
children: [
|
|
1047
1057
|
/* @__PURE__ */ m(_.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
1048
|
-
/* @__PURE__ */ m(
|
|
1049
|
-
/* @__PURE__ */ s(
|
|
1050
|
-
|
|
1051
|
-
{
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
forceButtonRole: !1,
|
|
1055
|
-
variant: v,
|
|
1056
|
-
"aria-label": C,
|
|
1057
|
-
onClick: (R) => R.stopPropagation(),
|
|
1058
|
-
children: j
|
|
1059
|
-
}
|
|
1060
|
-
) : j }),
|
|
1061
|
-
e.published ? null : /* @__PURE__ */ m(b, { size: "x-small", color: "secondary", children: [
|
|
1058
|
+
/* @__PURE__ */ m(E, { as: "div", children: [
|
|
1059
|
+
/* @__PURE__ */ s(E, { as: "div", children: A ? /* @__PURE__ */ m(_, { alignItems: "center", gap: "x-small", wrap: "wrap", children: [
|
|
1060
|
+
/* @__PURE__ */ s(_.Item, { shouldShrink: !0, children: T }),
|
|
1061
|
+
/* @__PURE__ */ s(_.Item, { children: A })
|
|
1062
|
+
] }) : T }),
|
|
1063
|
+
e.published ? null : /* @__PURE__ */ m(P, { size: "x-small", color: "secondary", children: [
|
|
1062
1064
|
" ",
|
|
1063
1065
|
g("moduleUnpublishedBadge")
|
|
1064
1066
|
] })
|
|
1065
1067
|
] }),
|
|
1066
|
-
/* @__PURE__ */ s(
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1068
|
+
/* @__PURE__ */ s(or, { module: e, today: o }),
|
|
1069
|
+
q && (D || v) ? /* @__PURE__ */ s(E, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ m(_, { gap: "x-small", wrap: "wrap", children: [
|
|
1070
|
+
v ? /* @__PURE__ */ s(_.Item, { children: v }) : null,
|
|
1071
|
+
D ? /* @__PURE__ */ s(_.Item, { children: D }) : null
|
|
1070
1072
|
] }) }) : null,
|
|
1071
|
-
/* @__PURE__ */ s(
|
|
1073
|
+
/* @__PURE__ */ s(fr, { module: e, breakpoints: a })
|
|
1072
1074
|
] }),
|
|
1073
1075
|
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(_, { alignItems: "center", gap: "mediumSmall", children: [
|
|
1074
|
-
!
|
|
1075
|
-
|
|
1076
|
-
|
|
1076
|
+
!q && (v || D) ? /* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(_, { alignItems: "center", gap: "x-small", children: [
|
|
1077
|
+
v ? /* @__PURE__ */ s(_.Item, { children: v }) : null,
|
|
1078
|
+
D ? /* @__PURE__ */ s(_.Item, { children: D }) : null
|
|
1077
1079
|
] }) }) : null,
|
|
1078
1080
|
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ s(
|
|
1079
|
-
|
|
1081
|
+
pi,
|
|
1080
1082
|
{
|
|
1081
|
-
elementRef: (
|
|
1083
|
+
elementRef: (B) => c == null ? void 0 : c(e.id, B),
|
|
1082
1084
|
size: "medium",
|
|
1083
1085
|
withBorder: !0,
|
|
1084
1086
|
withBackground: !1,
|
|
1085
1087
|
screenReaderLabel: t ? g("collapseModule", { name: e.name }) : g("expandModule", { name: e.name }),
|
|
1086
1088
|
"aria-expanded": t,
|
|
1087
|
-
"aria-controls":
|
|
1088
|
-
onClick: (
|
|
1089
|
-
|
|
1089
|
+
"aria-controls": vt(e.id),
|
|
1090
|
+
onClick: (B) => {
|
|
1091
|
+
B.stopPropagation(), F();
|
|
1090
1092
|
},
|
|
1091
1093
|
"data-testid": `toggle-module-${e.id}`,
|
|
1092
|
-
children: t ? /* @__PURE__ */ s(
|
|
1094
|
+
children: t ? /* @__PURE__ */ s(li, {}) : /* @__PURE__ */ s(ai, {})
|
|
1093
1095
|
}
|
|
1094
1096
|
) })
|
|
1095
1097
|
] }) })
|
|
1096
1098
|
]
|
|
1097
1099
|
}
|
|
1098
1100
|
) }),
|
|
1099
|
-
/* @__PURE__ */ s("div", { id:
|
|
1100
|
-
|
|
1101
|
+
/* @__PURE__ */ s("div", { id: vt(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ s(
|
|
1102
|
+
Mr,
|
|
1101
1103
|
{
|
|
1102
1104
|
module: e,
|
|
1103
1105
|
state: r,
|
|
1104
1106
|
today: o,
|
|
1105
1107
|
showDiagnostics: i,
|
|
1106
|
-
stackPill:
|
|
1107
|
-
moduleLabel:
|
|
1108
|
+
stackPill: q,
|
|
1109
|
+
moduleLabel: $n(e) ? null : S
|
|
1108
1110
|
}
|
|
1109
1111
|
) : null })
|
|
1110
1112
|
]
|
|
1111
1113
|
}
|
|
1112
1114
|
);
|
|
1113
1115
|
}
|
|
1114
|
-
const
|
|
1116
|
+
const Er = si(_r), Zs = ["place_new", "reorganize_all"], tn = ["assignment", "discussion", "quiz", "page", "file"], Ze = 1e3, Ir = () => ({
|
|
1115
1117
|
mode: "place_new",
|
|
1116
|
-
contentTypes: [...
|
|
1118
|
+
contentTypes: [...tn],
|
|
1117
1119
|
setPrerequisites: !0,
|
|
1118
1120
|
setRequirements: !0,
|
|
1119
1121
|
direction: ""
|
|
1120
1122
|
});
|
|
1121
|
-
function
|
|
1123
|
+
function Sr(e, t) {
|
|
1122
1124
|
return e(t === "assignment" ? "itemTypeAssignment" : t === "discussion" ? "itemTypeDiscussion" : t === "quiz" ? "itemTypeQuiz" : t === "page" ? "itemTypePage" : "itemTypeFile");
|
|
1123
1125
|
}
|
|
1124
|
-
const
|
|
1125
|
-
...e.setPrerequisites ? [
|
|
1126
|
-
...e.setRequirements ? [
|
|
1126
|
+
const Xe = "prerequisites", Je = "requirements", yr = (e) => [
|
|
1127
|
+
...e.setPrerequisites ? [Xe] : [],
|
|
1128
|
+
...e.setRequirements ? [Je] : []
|
|
1127
1129
|
];
|
|
1128
|
-
function
|
|
1130
|
+
function Tr({
|
|
1129
1131
|
input: e,
|
|
1130
1132
|
errors: t,
|
|
1131
1133
|
onChange: n,
|
|
1132
1134
|
disabled: r = !1
|
|
1133
1135
|
}) {
|
|
1134
|
-
const { t: o } =
|
|
1135
|
-
return /* @__PURE__ */ m(
|
|
1136
|
+
const { t: o } = $();
|
|
1137
|
+
return /* @__PURE__ */ m(E, { as: "div", "data-testid": "organize-form", children: [
|
|
1136
1138
|
/* @__PURE__ */ m(
|
|
1137
|
-
|
|
1139
|
+
Pi,
|
|
1138
1140
|
{
|
|
1139
1141
|
name: "organize-mode",
|
|
1140
1142
|
value: e.mode,
|
|
@@ -1143,7 +1145,7 @@ function Ir({
|
|
|
1143
1145
|
disabled: r,
|
|
1144
1146
|
children: [
|
|
1145
1147
|
/* @__PURE__ */ s(
|
|
1146
|
-
|
|
1148
|
+
yt,
|
|
1147
1149
|
{
|
|
1148
1150
|
value: "place_new",
|
|
1149
1151
|
label: o("organizeModePlaceNew"),
|
|
@@ -1151,7 +1153,7 @@ function Ir({
|
|
|
1151
1153
|
}
|
|
1152
1154
|
),
|
|
1153
1155
|
/* @__PURE__ */ s(
|
|
1154
|
-
|
|
1156
|
+
yt,
|
|
1155
1157
|
{
|
|
1156
1158
|
value: "reorganize_all",
|
|
1157
1159
|
label: o("organizeModeReorganizeAll"),
|
|
@@ -1161,9 +1163,9 @@ function Ir({
|
|
|
1161
1163
|
]
|
|
1162
1164
|
}
|
|
1163
1165
|
),
|
|
1164
|
-
e.mode === "reorganize_all" ? /* @__PURE__ */ s(
|
|
1165
|
-
/* @__PURE__ */ s(
|
|
1166
|
-
|
|
1166
|
+
e.mode === "reorganize_all" ? /* @__PURE__ */ s(E, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ s(X, { variant: "warning", margin: "0", "data-testid": "organize-reorganize-warning", children: o("organizeReorganizeWarning") }) }) : null,
|
|
1167
|
+
/* @__PURE__ */ s(E, { as: "div", margin: "medium 0 0 0", children: /* @__PURE__ */ s(
|
|
1168
|
+
St,
|
|
1167
1169
|
{
|
|
1168
1170
|
name: "organize-content-types",
|
|
1169
1171
|
value: [...e.contentTypes],
|
|
@@ -1171,11 +1173,11 @@ function Ir({
|
|
|
1171
1173
|
description: o("organizeContentTypesLegend"),
|
|
1172
1174
|
messages: t.contentTypes ? [{ type: "newError", text: o("organizeErrorPickAContentType") }] : void 0,
|
|
1173
1175
|
layout: "columns",
|
|
1174
|
-
children:
|
|
1175
|
-
|
|
1176
|
+
children: tn.map((i) => /* @__PURE__ */ s(
|
|
1177
|
+
Ye,
|
|
1176
1178
|
{
|
|
1177
1179
|
value: i,
|
|
1178
|
-
label:
|
|
1180
|
+
label: Sr(o, i),
|
|
1179
1181
|
disabled: r,
|
|
1180
1182
|
"data-testid": `organize-content-type-${i}`
|
|
1181
1183
|
},
|
|
@@ -1183,30 +1185,30 @@ function Ir({
|
|
|
1183
1185
|
))
|
|
1184
1186
|
}
|
|
1185
1187
|
) }),
|
|
1186
|
-
/* @__PURE__ */ s(
|
|
1187
|
-
|
|
1188
|
+
/* @__PURE__ */ s(E, { as: "div", margin: "medium 0 0 0", children: /* @__PURE__ */ m(
|
|
1189
|
+
St,
|
|
1188
1190
|
{
|
|
1189
1191
|
name: "organize-progression",
|
|
1190
|
-
value:
|
|
1192
|
+
value: yr(e),
|
|
1191
1193
|
onChange: (i) => n({
|
|
1192
|
-
setPrerequisites: i.includes(
|
|
1193
|
-
setRequirements: i.includes(
|
|
1194
|
+
setPrerequisites: i.includes(Xe),
|
|
1195
|
+
setRequirements: i.includes(Je)
|
|
1194
1196
|
}),
|
|
1195
1197
|
description: o("organizeProgressionLegend"),
|
|
1196
1198
|
children: [
|
|
1197
1199
|
/* @__PURE__ */ s(
|
|
1198
|
-
|
|
1200
|
+
Ye,
|
|
1199
1201
|
{
|
|
1200
|
-
value:
|
|
1202
|
+
value: Xe,
|
|
1201
1203
|
label: o("organizeSetPrerequisites"),
|
|
1202
1204
|
disabled: r,
|
|
1203
1205
|
"data-testid": "organize-set-prerequisites"
|
|
1204
1206
|
}
|
|
1205
1207
|
),
|
|
1206
1208
|
/* @__PURE__ */ s(
|
|
1207
|
-
|
|
1209
|
+
Ye,
|
|
1208
1210
|
{
|
|
1209
|
-
value:
|
|
1211
|
+
value: Je,
|
|
1210
1212
|
label: o("organizeSetRequirements"),
|
|
1211
1213
|
disabled: r,
|
|
1212
1214
|
"data-testid": "organize-set-requirements"
|
|
@@ -1215,34 +1217,34 @@ function Ir({
|
|
|
1215
1217
|
]
|
|
1216
1218
|
}
|
|
1217
1219
|
) }),
|
|
1218
|
-
/* @__PURE__ */ m(
|
|
1220
|
+
/* @__PURE__ */ m(E, { as: "div", margin: "medium 0 0 0", children: [
|
|
1219
1221
|
/* @__PURE__ */ s(
|
|
1220
|
-
|
|
1222
|
+
bi,
|
|
1221
1223
|
{
|
|
1222
1224
|
label: o("organizeDirectionLabel"),
|
|
1223
1225
|
placeholder: o("organizeDirectionPlaceholder"),
|
|
1224
1226
|
value: e.direction,
|
|
1225
|
-
onChange: (i) => n({ direction: i.target.value.slice(0,
|
|
1227
|
+
onChange: (i) => n({ direction: i.target.value.slice(0, Ze) }),
|
|
1226
1228
|
disabled: r,
|
|
1227
1229
|
height: "6rem",
|
|
1228
1230
|
"data-testid": "organize-direction"
|
|
1229
1231
|
}
|
|
1230
1232
|
),
|
|
1231
|
-
/* @__PURE__ */ s(
|
|
1233
|
+
/* @__PURE__ */ s(E, { as: "div", textAlign: "end", margin: "xx-small 0 0 0", children: /* @__PURE__ */ s(P, { size: "x-small", color: "secondary", "data-testid": "organize-direction-count", children: o("organizeDirectionCount", {
|
|
1232
1234
|
used: e.direction.length,
|
|
1233
|
-
max:
|
|
1235
|
+
max: Ze
|
|
1234
1236
|
}) }) })
|
|
1235
1237
|
] })
|
|
1236
1238
|
] });
|
|
1237
1239
|
}
|
|
1238
|
-
const
|
|
1239
|
-
function
|
|
1240
|
+
const nn = "organize-preview", rn = (e) => `proposed-module-${e + 1}`, Pr = (e) => `${e.contentType}-${e.contentId}`;
|
|
1241
|
+
function br(e, t) {
|
|
1240
1242
|
const n = e.completionRequirement;
|
|
1241
1243
|
if (n)
|
|
1242
1244
|
return { itemId: t, type: n.type, minScore: n.minScore ?? null };
|
|
1243
1245
|
}
|
|
1244
|
-
function
|
|
1245
|
-
const r =
|
|
1246
|
+
function Cr(e, t, n) {
|
|
1247
|
+
const r = Pr(e);
|
|
1246
1248
|
return {
|
|
1247
1249
|
id: r,
|
|
1248
1250
|
moduleId: t,
|
|
@@ -1251,29 +1253,29 @@ function yr(e, t, n) {
|
|
|
1251
1253
|
position: n + 1,
|
|
1252
1254
|
indent: 0,
|
|
1253
1255
|
published: !0,
|
|
1254
|
-
completionRequirement:
|
|
1255
|
-
extensions: { [
|
|
1256
|
+
completionRequirement: br(e, r) ?? null,
|
|
1257
|
+
extensions: { [Qn]: e.isNew }
|
|
1256
1258
|
};
|
|
1257
1259
|
}
|
|
1258
|
-
function
|
|
1260
|
+
function vr(e) {
|
|
1259
1261
|
const t = /* @__PURE__ */ new Map();
|
|
1260
1262
|
return e.forEach((n, r) => {
|
|
1261
1263
|
t.set(
|
|
1262
1264
|
n.position,
|
|
1263
|
-
t.has(n.position) ? null : { id:
|
|
1265
|
+
t.has(n.position) ? null : { id: rn(r), name: n.name }
|
|
1264
1266
|
);
|
|
1265
1267
|
}), t;
|
|
1266
1268
|
}
|
|
1267
|
-
function
|
|
1269
|
+
function wr(e, t, n) {
|
|
1268
1270
|
return e.prerequisitePositions.flatMap((r) => {
|
|
1269
1271
|
const o = n.get(r);
|
|
1270
1272
|
return !o || o.id === t ? [] : [o];
|
|
1271
1273
|
});
|
|
1272
1274
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const t =
|
|
1275
|
+
function Lr(e) {
|
|
1276
|
+
const t = vr(e.modules), n = [], r = {};
|
|
1275
1277
|
for (const [o, i] of e.modules.entries()) {
|
|
1276
|
-
const l =
|
|
1278
|
+
const l = rn(o), u = i.items.map((a, c) => Cr(a, l, c));
|
|
1277
1279
|
r[l] = u, n.push({
|
|
1278
1280
|
id: l,
|
|
1279
1281
|
name: i.name,
|
|
@@ -1281,145 +1283,145 @@ function Pr(e) {
|
|
|
1281
1283
|
published: !0,
|
|
1282
1284
|
itemCount: u.length,
|
|
1283
1285
|
items: u,
|
|
1284
|
-
prerequisiteModules:
|
|
1286
|
+
prerequisiteModules: wr(i, l, t),
|
|
1285
1287
|
requirementCount: i.requirementType === "one" ? 1 : null,
|
|
1286
1288
|
requireSequentialProgress: !1,
|
|
1287
1289
|
completionRequirements: u.flatMap(
|
|
1288
1290
|
(a) => a.completionRequirement ? [a.completionRequirement] : []
|
|
1289
1291
|
),
|
|
1290
1292
|
extensions: {
|
|
1291
|
-
[
|
|
1292
|
-
[
|
|
1293
|
-
[
|
|
1293
|
+
[jn]: i.isNew,
|
|
1294
|
+
[Yn]: i.items.filter((a) => a.isNew).length,
|
|
1295
|
+
[Hn]: !0
|
|
1294
1296
|
}
|
|
1295
1297
|
});
|
|
1296
1298
|
}
|
|
1297
|
-
return { courseId:
|
|
1299
|
+
return { courseId: nn, modules: n, itemsByModuleId: r };
|
|
1298
1300
|
}
|
|
1299
|
-
const
|
|
1301
|
+
const Ar = {
|
|
1300
1302
|
itemsLoadedAnnouncement: ""
|
|
1301
1303
|
};
|
|
1302
|
-
function
|
|
1303
|
-
const { t } =
|
|
1304
|
-
courseId:
|
|
1304
|
+
function Rr({ proposal: e }) {
|
|
1305
|
+
const { t } = $(), n = G(() => Lr(e), [e]), r = G(() => Zn(n), [n]), o = G(() => n.modules.map((l) => l.id), [n]), i = Xn({
|
|
1306
|
+
courseId: nn,
|
|
1305
1307
|
adapter: r,
|
|
1306
1308
|
itemsMode: "inline",
|
|
1307
1309
|
initialExpandedModuleIds: o
|
|
1308
1310
|
});
|
|
1309
|
-
return /* @__PURE__ */ m(
|
|
1310
|
-
/* @__PURE__ */ s(
|
|
1311
|
-
/* @__PURE__ */ s(
|
|
1311
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
1312
|
+
/* @__PURE__ */ s(me, { level: "h3", margin: "0 0 medium 0", children: t("organizePreviewHeading") }),
|
|
1313
|
+
/* @__PURE__ */ s(Gr, { data: i, headingLevel: "h3" })
|
|
1312
1314
|
] });
|
|
1313
1315
|
}
|
|
1314
|
-
function
|
|
1315
|
-
const { t } =
|
|
1316
|
-
() => new
|
|
1316
|
+
function kr({ proposal: e }) {
|
|
1317
|
+
const { t } = $(), n = ve(), r = G(() => er(n), [n]), [o] = H(
|
|
1318
|
+
() => new ni({ defaultOptions: { queries: { retry: !1 } } })
|
|
1317
1319
|
);
|
|
1318
|
-
return /* @__PURE__ */ m(
|
|
1320
|
+
return /* @__PURE__ */ m(E, { as: "div", "data-testid": "organize-proposal-preview", children: [
|
|
1319
1321
|
e.unplacedItems.length > 0 ? /* @__PURE__ */ m(X, { variant: "warning", margin: "0 0 small 0", "data-testid": "organize-unplaced", children: [
|
|
1320
|
-
/* @__PURE__ */ s(
|
|
1321
|
-
/* @__PURE__ */ s(
|
|
1322
|
-
/* @__PURE__ */ s(
|
|
1322
|
+
/* @__PURE__ */ s(E, { as: "div", children: /* @__PURE__ */ s(P, { weight: "bold", children: t("organizeUnplacedHeading", { count: e.unplacedItems.length }) }) }),
|
|
1323
|
+
/* @__PURE__ */ s(E, { as: "div", children: /* @__PURE__ */ s(P, { children: t("organizeUnplacedExplanation") }) }),
|
|
1324
|
+
/* @__PURE__ */ s(Qe, { margin: "x-small 0 0 0", children: e.unplacedItems.map((i) => /* @__PURE__ */ s(Ke, { children: i.title }, `${i.contentType}-${i.contentId}`)) })
|
|
1323
1325
|
] }) : null,
|
|
1324
1326
|
e.warnings.length > 0 ? /* @__PURE__ */ m(X, { variant: "info", margin: "0 0 small 0", "data-testid": "organize-warnings", children: [
|
|
1325
|
-
/* @__PURE__ */ s(
|
|
1326
|
-
/* @__PURE__ */ s(
|
|
1327
|
+
/* @__PURE__ */ s(E, { as: "div", children: /* @__PURE__ */ s(P, { weight: "bold", children: t("organizeWarningsHeading", { count: e.warnings.length }) }) }),
|
|
1328
|
+
/* @__PURE__ */ s(Qe, { margin: "x-small 0 0 0", children: e.warnings.map((i) => /* @__PURE__ */ s(Ke, { children: i }, i)) })
|
|
1327
1329
|
] }) : null,
|
|
1328
|
-
/* @__PURE__ */ s(
|
|
1330
|
+
/* @__PURE__ */ s(ii, { client: o, children: /* @__PURE__ */ s(Kn, { translations: Ar, children: /* @__PURE__ */ s(Vn, { value: r, children: /* @__PURE__ */ s(Rr, { proposal: e }) }) }) })
|
|
1329
1331
|
] });
|
|
1330
1332
|
}
|
|
1331
|
-
function
|
|
1333
|
+
function Lt(e) {
|
|
1332
1334
|
const t = {};
|
|
1333
|
-
return e.contentTypes.length === 0 && (t.contentTypes = "none_selected"), e.direction.length >
|
|
1335
|
+
return e.contentTypes.length === 0 && (t.contentTypes = "none_selected"), e.direction.length > Ze && (t.direction = "too_long"), t;
|
|
1334
1336
|
}
|
|
1335
|
-
const
|
|
1337
|
+
const At = (e) => Object.keys(e).length > 0, Or = 1e4, qr = (e) => e instanceof DOMException && e.name === "AbortError", Dr = (e) => e instanceof Error ? e : new Error(String(e)), zr = { loading: "read", applying: "write" }, Rt = (e) => {
|
|
1336
1338
|
(e == null ? void 0 : e.kind) === "read" && e.controller.abort();
|
|
1337
1339
|
};
|
|
1338
|
-
function
|
|
1340
|
+
function Nr({
|
|
1339
1341
|
actions: e,
|
|
1340
1342
|
onApplied: t
|
|
1341
1343
|
}) {
|
|
1342
|
-
const [n, r] =
|
|
1343
|
-
|
|
1344
|
-
I.current = !1,
|
|
1344
|
+
const [n, r] = H("form"), [o, i] = H(Ir), [l, u] = H(null), [a, c] = H(null), [g, p] = H(!1), h = R(null), f = R(0), I = R(!0);
|
|
1345
|
+
W(() => (I.current = !0, () => {
|
|
1346
|
+
I.current = !1, Rt(h.current), h.current = null;
|
|
1345
1347
|
}), []);
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1348
|
-
}, []), O =
|
|
1349
|
-
i((
|
|
1350
|
-
}, []), S =
|
|
1351
|
-
(T,
|
|
1352
|
-
|
|
1353
|
-
const
|
|
1354
|
-
h.current = { kind:
|
|
1355
|
-
const D = () => I.current && f.current ===
|
|
1356
|
-
|
|
1357
|
-
|
|
1348
|
+
const w = G(() => Lt(o), [o]), L = !At(w), U = N(() => {
|
|
1349
|
+
Rt(h.current), h.current = null, f.current += 1, p(!1);
|
|
1350
|
+
}, []), O = N((T) => {
|
|
1351
|
+
i((A) => ({ ...A, ...T }));
|
|
1352
|
+
}, []), S = N(
|
|
1353
|
+
(T, A, q) => {
|
|
1354
|
+
U();
|
|
1355
|
+
const F = new AbortController(), ee = f.current;
|
|
1356
|
+
h.current = { kind: zr[T], controller: F }, c(null), r(T);
|
|
1357
|
+
const D = () => I.current && f.current === ee;
|
|
1358
|
+
q({ signal: F.signal, current: D }).catch((oe) => {
|
|
1359
|
+
F.signal.aborted || qr(oe) || !D() || (c(Dr(oe)), r(A));
|
|
1358
1360
|
});
|
|
1359
1361
|
},
|
|
1360
|
-
[
|
|
1361
|
-
), C =
|
|
1362
|
-
Lt(
|
|
1363
|
-
const
|
|
1364
|
-
T.aborted || !
|
|
1362
|
+
[U]
|
|
1363
|
+
), C = N(() => {
|
|
1364
|
+
At(Lt(o)) || S("loading", "error", async ({ signal: T, current: A }) => {
|
|
1365
|
+
const q = await e.organize(o, T);
|
|
1366
|
+
T.aborted || !A() || (u(q), r("preview"));
|
|
1365
1367
|
});
|
|
1366
|
-
}, [e, o, S]),
|
|
1368
|
+
}, [e, o, S]), Q = N(() => {
|
|
1367
1369
|
l !== null && S("applying", "preview", async ({ signal: T }) => {
|
|
1368
1370
|
await e.apply(l, o, T), t == null || t();
|
|
1369
1371
|
});
|
|
1370
|
-
}, [e, o, t, l, S]),
|
|
1371
|
-
|
|
1372
|
-
}, [
|
|
1373
|
-
return
|
|
1372
|
+
}, [e, o, t, l, S]), K = N(() => {
|
|
1373
|
+
U(), u(null), c(null), r("form");
|
|
1374
|
+
}, [U]);
|
|
1375
|
+
return W(() => {
|
|
1374
1376
|
if (n !== "loading" && n !== "applying") return;
|
|
1375
|
-
const T = setTimeout(() => p(!0),
|
|
1377
|
+
const T = setTimeout(() => p(!0), Or);
|
|
1376
1378
|
return () => clearTimeout(T);
|
|
1377
1379
|
}, [n]), {
|
|
1378
1380
|
status: n,
|
|
1379
1381
|
input: o,
|
|
1380
1382
|
setInput: O,
|
|
1381
|
-
errors:
|
|
1383
|
+
errors: w,
|
|
1382
1384
|
canSubmit: L,
|
|
1383
1385
|
proposal: l,
|
|
1384
1386
|
error: a,
|
|
1385
1387
|
takingLong: g && (n === "loading" || n === "applying"),
|
|
1386
1388
|
submit: C,
|
|
1387
1389
|
regenerate: C,
|
|
1388
|
-
apply:
|
|
1389
|
-
cancel:
|
|
1390
|
+
apply: Q,
|
|
1391
|
+
cancel: K
|
|
1390
1392
|
};
|
|
1391
1393
|
}
|
|
1392
|
-
function
|
|
1393
|
-
const { t: n } =
|
|
1394
|
-
return /* @__PURE__ */ m(
|
|
1395
|
-
/* @__PURE__ */ s(
|
|
1396
|
-
/* @__PURE__ */ s(
|
|
1397
|
-
t ? /* @__PURE__ */ s(
|
|
1394
|
+
function kt({ label: e, takingLong: t }) {
|
|
1395
|
+
const { t: n } = $();
|
|
1396
|
+
return /* @__PURE__ */ m(E, { as: "div", padding: "x-large", textAlign: "center", "data-testid": "organize-working", children: [
|
|
1397
|
+
/* @__PURE__ */ s(st, { renderTitle: e }),
|
|
1398
|
+
/* @__PURE__ */ s(E, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ s(P, { color: "secondary", children: e }) }),
|
|
1399
|
+
t ? /* @__PURE__ */ s(E, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ s(P, { size: "small", color: "secondary", "data-testid": "organize-taking-long", children: n("organizeStillWorking") }) }) : null
|
|
1398
1400
|
] });
|
|
1399
1401
|
}
|
|
1400
|
-
function
|
|
1402
|
+
function xr({
|
|
1401
1403
|
actions: e,
|
|
1402
1404
|
open: t,
|
|
1403
1405
|
onDismiss: n,
|
|
1404
1406
|
onApplied: r,
|
|
1405
1407
|
aiDisclosure: o
|
|
1406
1408
|
}) {
|
|
1407
|
-
const { t: i } =
|
|
1408
|
-
|
|
1409
|
+
const { t: i } = $(), l = R(!0);
|
|
1410
|
+
W(() => (l.current = !0, () => {
|
|
1409
1411
|
l.current = !1;
|
|
1410
1412
|
}), []);
|
|
1411
|
-
const u =
|
|
1413
|
+
const u = Nr({
|
|
1412
1414
|
actions: e,
|
|
1413
1415
|
onApplied: () => {
|
|
1414
|
-
|
|
1416
|
+
x(i("organizeAppliedAnnouncement")), r == null || r(), l.current && n();
|
|
1415
1417
|
}
|
|
1416
|
-
}), { status: a, proposal:
|
|
1417
|
-
return
|
|
1418
|
-
t && (a === "loading" &&
|
|
1419
|
-
}, [t, a, g, i]),
|
|
1420
|
-
p &&
|
|
1418
|
+
}), { status: a, proposal: c, error: g, takingLong: p } = u;
|
|
1419
|
+
return W(() => {
|
|
1420
|
+
t && (a === "loading" && x(i("organizeLoadingLabel")), a === "applying" && x(i("organizeApplyingLabel")), a === "preview" && g === null && x(i("organizeProposalReadyAnnouncement")));
|
|
1421
|
+
}, [t, a, g, i]), W(() => {
|
|
1422
|
+
p && x(i("organizeStillWorking"));
|
|
1421
1423
|
}, [p, i]), /* @__PURE__ */ m(
|
|
1422
|
-
|
|
1424
|
+
Ii,
|
|
1423
1425
|
{
|
|
1424
1426
|
open: t,
|
|
1425
1427
|
onDismiss: n,
|
|
@@ -1427,9 +1429,9 @@ function Dr({
|
|
|
1427
1429
|
label: i("organizeModalLabel"),
|
|
1428
1430
|
shouldCloseOnDocumentClick: !1,
|
|
1429
1431
|
children: [
|
|
1430
|
-
/* @__PURE__ */ m(
|
|
1432
|
+
/* @__PURE__ */ m(Si, { children: [
|
|
1431
1433
|
/* @__PURE__ */ s(
|
|
1432
|
-
|
|
1434
|
+
fi,
|
|
1433
1435
|
{
|
|
1434
1436
|
placement: "end",
|
|
1435
1437
|
offset: "small",
|
|
@@ -1439,49 +1441,49 @@ function Dr({
|
|
|
1439
1441
|
}
|
|
1440
1442
|
),
|
|
1441
1443
|
/* @__PURE__ */ m(_, { alignItems: "center", gap: "small", children: [
|
|
1442
|
-
/* @__PURE__ */ s(_.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ s(
|
|
1444
|
+
/* @__PURE__ */ s(_.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ s(me, { level: "h2", "data-testid": "organize-modal-title", children: i("organizeModalLabel") }) }),
|
|
1443
1445
|
o ? /* @__PURE__ */ s(_.Item, { "data-testid": "organize-ai-disclosure", children: o }) : null
|
|
1444
1446
|
] })
|
|
1445
1447
|
] }),
|
|
1446
|
-
/* @__PURE__ */ m(
|
|
1448
|
+
/* @__PURE__ */ m(yi, { children: [
|
|
1447
1449
|
a === "form" ? /* @__PURE__ */ s(
|
|
1448
|
-
|
|
1450
|
+
Tr,
|
|
1449
1451
|
{
|
|
1450
1452
|
input: u.input,
|
|
1451
1453
|
errors: u.errors,
|
|
1452
1454
|
onChange: u.setInput
|
|
1453
1455
|
}
|
|
1454
1456
|
) : null,
|
|
1455
|
-
a === "loading" ? /* @__PURE__ */ s(
|
|
1456
|
-
a === "applying" ? /* @__PURE__ */ s(
|
|
1457
|
-
a === "preview" &&
|
|
1457
|
+
a === "loading" ? /* @__PURE__ */ s(kt, { label: i("organizeLoadingLabel"), takingLong: p }) : null,
|
|
1458
|
+
a === "applying" ? /* @__PURE__ */ s(kt, { label: i("organizeApplyingLabel"), takingLong: p }) : null,
|
|
1459
|
+
a === "preview" && c ? /* @__PURE__ */ m(Y, { children: [
|
|
1458
1460
|
g ? /* @__PURE__ */ s(
|
|
1459
1461
|
X,
|
|
1460
1462
|
{
|
|
1461
1463
|
variant: "error",
|
|
1462
1464
|
margin: "0 0 small 0",
|
|
1463
|
-
liveRegion:
|
|
1465
|
+
liveRegion: be,
|
|
1464
1466
|
liveRegionPoliteness: "assertive",
|
|
1465
1467
|
"data-testid": "organize-apply-error",
|
|
1466
1468
|
children: i("organizeApplyFailed", { message: g.message })
|
|
1467
1469
|
}
|
|
1468
1470
|
) : null,
|
|
1469
|
-
/* @__PURE__ */ s(
|
|
1471
|
+
/* @__PURE__ */ s(kr, { proposal: c })
|
|
1470
1472
|
] }) : null,
|
|
1471
1473
|
a === "error" ? /* @__PURE__ */ s(
|
|
1472
1474
|
X,
|
|
1473
1475
|
{
|
|
1474
1476
|
variant: "error",
|
|
1475
1477
|
margin: "0",
|
|
1476
|
-
liveRegion:
|
|
1478
|
+
liveRegion: be,
|
|
1477
1479
|
liveRegionPoliteness: "assertive",
|
|
1478
1480
|
"data-testid": "organize-error",
|
|
1479
1481
|
children: i("organizeFailed", { message: (g == null ? void 0 : g.message) ?? "" })
|
|
1480
1482
|
}
|
|
1481
1483
|
) : null
|
|
1482
1484
|
] }),
|
|
1483
|
-
/* @__PURE__ */ m(
|
|
1484
|
-
a === "form" ? /* @__PURE__ */ m(
|
|
1485
|
+
/* @__PURE__ */ m(Ti, { children: [
|
|
1486
|
+
a === "form" ? /* @__PURE__ */ m(Y, { children: [
|
|
1485
1487
|
/* @__PURE__ */ s(z, { onClick: n, margin: "0 x-small 0 0", "data-testid": "organize-close", children: i("organizeCancel") }),
|
|
1486
1488
|
/* @__PURE__ */ s(
|
|
1487
1489
|
z,
|
|
@@ -1495,7 +1497,7 @@ function Dr({
|
|
|
1495
1497
|
)
|
|
1496
1498
|
] }) : null,
|
|
1497
1499
|
a === "loading" ? /* @__PURE__ */ s(z, { onClick: u.cancel, "data-testid": "organize-cancel-loading", children: i("organizeCancel") }) : null,
|
|
1498
|
-
a === "preview" ? /* @__PURE__ */ m(
|
|
1500
|
+
a === "preview" ? /* @__PURE__ */ m(Y, { children: [
|
|
1499
1501
|
/* @__PURE__ */ s(z, { onClick: u.cancel, margin: "0 x-small 0 0", "data-testid": "organize-back", children: i("organizeStartOver") }),
|
|
1500
1502
|
/* @__PURE__ */ s(
|
|
1501
1503
|
z,
|
|
@@ -1508,7 +1510,7 @@ function Dr({
|
|
|
1508
1510
|
),
|
|
1509
1511
|
/* @__PURE__ */ s(z, { color: "primary", onClick: u.apply, "data-testid": "organize-apply", children: i("organizeApply") })
|
|
1510
1512
|
] }) : null,
|
|
1511
|
-
a === "error" ? /* @__PURE__ */ m(
|
|
1513
|
+
a === "error" ? /* @__PURE__ */ m(Y, { children: [
|
|
1512
1514
|
/* @__PURE__ */ s(z, { onClick: u.cancel, margin: "0 x-small 0 0", "data-testid": "organize-back", children: i("organizeStartOver") }),
|
|
1513
1515
|
/* @__PURE__ */ s(z, { color: "primary", onClick: u.submit, "data-testid": "organize-retry", children: i("organizeTryAgain") })
|
|
1514
1516
|
] }) : null,
|
|
@@ -1518,27 +1520,27 @@ function Dr({
|
|
|
1518
1520
|
}
|
|
1519
1521
|
);
|
|
1520
1522
|
}
|
|
1521
|
-
function
|
|
1523
|
+
function $r({
|
|
1522
1524
|
actions: e,
|
|
1523
1525
|
onApplied: t,
|
|
1524
1526
|
aiDisclosure: n,
|
|
1525
1527
|
display: r = "inline-block"
|
|
1526
1528
|
}) {
|
|
1527
|
-
const { t: o } =
|
|
1528
|
-
return /* @__PURE__ */ m(
|
|
1529
|
+
const { t: o } = $(), [i, l] = H(!1);
|
|
1530
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
1529
1531
|
/* @__PURE__ */ s(
|
|
1530
1532
|
z,
|
|
1531
1533
|
{
|
|
1532
1534
|
color: "ai-primary",
|
|
1533
1535
|
display: r,
|
|
1534
1536
|
onClick: () => l(!0),
|
|
1535
|
-
renderIcon: i ? /* @__PURE__ */ s(
|
|
1537
|
+
renderIcon: i ? /* @__PURE__ */ s(ui, {}) : /* @__PURE__ */ s(di, {}),
|
|
1536
1538
|
"data-testid": "organize-modules-trigger",
|
|
1537
1539
|
children: o("organizeModulesTrigger")
|
|
1538
1540
|
}
|
|
1539
1541
|
),
|
|
1540
1542
|
i ? /* @__PURE__ */ s(
|
|
1541
|
-
|
|
1543
|
+
xr,
|
|
1542
1544
|
{
|
|
1543
1545
|
actions: e,
|
|
1544
1546
|
open: !0,
|
|
@@ -1549,14 +1551,14 @@ function qr({
|
|
|
1549
1551
|
) : null
|
|
1550
1552
|
] });
|
|
1551
1553
|
}
|
|
1552
|
-
function
|
|
1554
|
+
function Ur({
|
|
1553
1555
|
counts: e,
|
|
1554
1556
|
itemsMode: t,
|
|
1555
1557
|
loadedModules: n
|
|
1556
1558
|
}) {
|
|
1557
1559
|
const r = e.listModules + e.listModuleItems;
|
|
1558
1560
|
return /* @__PURE__ */ s(
|
|
1559
|
-
|
|
1561
|
+
E,
|
|
1560
1562
|
{
|
|
1561
1563
|
as: "div",
|
|
1562
1564
|
background: "secondary",
|
|
@@ -1566,24 +1568,24 @@ function zr({
|
|
|
1566
1568
|
margin: "0 0 small 0",
|
|
1567
1569
|
"data-testid": "dev-diagnostics",
|
|
1568
1570
|
children: /* @__PURE__ */ m(_, { gap: "medium", wrap: "wrap", children: [
|
|
1569
|
-
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ s(
|
|
1570
|
-
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(
|
|
1571
|
+
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ s(P, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
|
|
1572
|
+
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(P, { size: "x-small", "data-testid": "request-count-list-modules", children: [
|
|
1571
1573
|
"listModules: ",
|
|
1572
1574
|
e.listModules
|
|
1573
1575
|
] }) }),
|
|
1574
|
-
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(
|
|
1576
|
+
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(P, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
|
|
1575
1577
|
"listModuleItems: ",
|
|
1576
1578
|
e.listModuleItems
|
|
1577
1579
|
] }) }),
|
|
1578
|
-
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(
|
|
1580
|
+
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(P, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
|
|
1579
1581
|
"total: ",
|
|
1580
1582
|
r
|
|
1581
1583
|
] }) }),
|
|
1582
|
-
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(
|
|
1584
|
+
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(P, { size: "x-small", "data-testid": "resolved-items-mode", children: [
|
|
1583
1585
|
"itemsMode: ",
|
|
1584
1586
|
t ?? "probing…"
|
|
1585
1587
|
] }) }),
|
|
1586
|
-
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(
|
|
1588
|
+
/* @__PURE__ */ s(_.Item, { children: /* @__PURE__ */ m(P, { size: "x-small", "data-testid": "modules-loaded-count", children: [
|
|
1587
1589
|
"modules loaded: ",
|
|
1588
1590
|
n
|
|
1589
1591
|
] }) })
|
|
@@ -1591,8 +1593,8 @@ function zr({
|
|
|
1591
1593
|
}
|
|
1592
1594
|
);
|
|
1593
1595
|
}
|
|
1594
|
-
const
|
|
1595
|
-
function
|
|
1596
|
+
const Fr = 200;
|
|
1597
|
+
function Br({
|
|
1596
1598
|
data: e,
|
|
1597
1599
|
today: t,
|
|
1598
1600
|
requestCounts: n,
|
|
@@ -1602,156 +1604,179 @@ function xr({
|
|
|
1602
1604
|
organizationActions: l,
|
|
1603
1605
|
onOrganizationApplied: u,
|
|
1604
1606
|
organizationAiDisclosure: a,
|
|
1605
|
-
breakpoints:
|
|
1607
|
+
breakpoints: c = {}
|
|
1606
1608
|
}) {
|
|
1607
|
-
const { miniTablet: g, tablet: p, desktop: h, desktopNavOpen: f, desktopOnly: I, mobileOnly:
|
|
1608
|
-
() => ({ miniTablet: g, tablet: p, desktop: h, desktopNavOpen: f, desktopOnly: I, mobileOnly:
|
|
1609
|
-
[g, p, h, f, I,
|
|
1609
|
+
const { miniTablet: g, tablet: p, desktop: h, desktopNavOpen: f, desktopOnly: I, mobileOnly: w, ICEDesktop: L } = c, U = G(
|
|
1610
|
+
() => ({ miniTablet: g, tablet: p, desktop: h, desktopNavOpen: f, desktopOnly: I, mobileOnly: w, ICEDesktop: L }),
|
|
1611
|
+
[g, p, h, f, I, w, L]
|
|
1610
1612
|
), {
|
|
1611
1613
|
modules: O,
|
|
1612
1614
|
page: S,
|
|
1613
1615
|
pageCount: C,
|
|
1614
|
-
pageSize:
|
|
1615
|
-
pageInfo:
|
|
1616
|
+
pageSize: Q,
|
|
1617
|
+
pageInfo: K,
|
|
1616
1618
|
hasNextPage: T,
|
|
1617
|
-
hasPreviousPage:
|
|
1618
|
-
goToFirstPage:
|
|
1619
|
-
goToPreviousPage:
|
|
1620
|
-
goToNextPage:
|
|
1619
|
+
hasPreviousPage: A,
|
|
1620
|
+
goToFirstPage: q,
|
|
1621
|
+
goToPreviousPage: F,
|
|
1622
|
+
goToNextPage: ee,
|
|
1621
1623
|
goToLastPage: D,
|
|
1622
|
-
isLoading:
|
|
1623
|
-
isRefreshing:
|
|
1624
|
-
error:
|
|
1625
|
-
itemsMode:
|
|
1626
|
-
expandedModuleIds:
|
|
1627
|
-
expandModule:
|
|
1628
|
-
collapseModule:
|
|
1629
|
-
toggleModule:
|
|
1630
|
-
expandModules:
|
|
1631
|
-
collapseModules:
|
|
1632
|
-
expandAllModules:
|
|
1633
|
-
collapseAllModules:
|
|
1634
|
-
isPersistingCollapsed:
|
|
1635
|
-
getItems:
|
|
1636
|
-
filter:
|
|
1637
|
-
setFilter:
|
|
1638
|
-
filterEntry:
|
|
1639
|
-
filterPredicate:
|
|
1640
|
-
} = e, { t:
|
|
1641
|
-
var
|
|
1642
|
-
(
|
|
1643
|
-
}, []),
|
|
1644
|
-
|
|
1645
|
-
}, []), [
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1624
|
+
isLoading: oe,
|
|
1625
|
+
isRefreshing: v,
|
|
1626
|
+
error: te,
|
|
1627
|
+
itemsMode: pe,
|
|
1628
|
+
expandedModuleIds: j,
|
|
1629
|
+
expandModule: le,
|
|
1630
|
+
collapseModule: ae,
|
|
1631
|
+
toggleModule: B,
|
|
1632
|
+
expandModules: ln,
|
|
1633
|
+
collapseModules: an,
|
|
1634
|
+
expandAllModules: un,
|
|
1635
|
+
collapseAllModules: dn,
|
|
1636
|
+
isPersistingCollapsed: cn,
|
|
1637
|
+
getItems: Le,
|
|
1638
|
+
filter: fe,
|
|
1639
|
+
setFilter: lt,
|
|
1640
|
+
filterEntry: mn,
|
|
1641
|
+
filterPredicate: Ae
|
|
1642
|
+
} = e, { t: y, timezone: at } = $(), he = it(), { filters: ut } = ve(), gn = G(() => nt(ut).length > 0, [ut]), dt = R(null), Re = R(/* @__PURE__ */ new Map()), ke = R(/* @__PURE__ */ new Map()), V = w === !0, ne = R(null), Me = R(null), pn = N((d) => {
|
|
1643
|
+
var M, k;
|
|
1644
|
+
(M = Re.current.get(d)) == null || M.scrollIntoView({ behavior: "smooth", block: "start" }), (k = ke.current.get(d)) == null || k.focus({ preventScroll: !0 });
|
|
1645
|
+
}, []), fn = N((d, M) => {
|
|
1646
|
+
M ? ke.current.set(d, M) : ke.current.delete(d);
|
|
1647
|
+
}, []), [hn] = H(() => /* @__PURE__ */ new Date()), Oe = t ?? hn;
|
|
1648
|
+
oi(() => {
|
|
1649
|
+
if (ne.current !== "keepFocus" || !Me.current) return;
|
|
1650
|
+
const { control: d, fallback: M, scrollY: k } = Me.current;
|
|
1651
|
+
Me.current = null, d == null || d.focus({ preventScroll: !0 }), document.activeElement !== d && (M == null || M.focus({ preventScroll: !0 })), window.scrollTo({ top: k });
|
|
1652
|
+
}, [S]), W(() => {
|
|
1653
|
+
var M;
|
|
1654
|
+
if (ne.current === null || v) return;
|
|
1655
|
+
const d = ne.current === "focusList";
|
|
1656
|
+
ne.current = null, x(y("pageChangedAnnouncement", { page: S, pageCount: C })), d && ((M = dt.current) == null || M.focus({ preventScroll: !0 }));
|
|
1657
|
+
}, [v, S, C, y]);
|
|
1658
|
+
const qe = N(
|
|
1659
|
+
(d = null, M = null) => {
|
|
1660
|
+
const k = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
1661
|
+
ne.current = "keepFocus", Me.current = {
|
|
1662
|
+
control: d ?? k,
|
|
1663
|
+
fallback: M,
|
|
1664
|
+
scrollY: window.scrollY
|
|
1665
|
+
};
|
|
1666
|
+
},
|
|
1667
|
+
[]
|
|
1668
|
+
), De = N(
|
|
1669
|
+
(d, M = null, k = null) => {
|
|
1670
|
+
qe(M, k), he("paginate-modules"), d === 1 ? q() : d === S - 1 ? F() : d === S + 1 ? ee() : d === C && D();
|
|
1655
1671
|
},
|
|
1656
|
-
[
|
|
1657
|
-
|
|
1672
|
+
[
|
|
1673
|
+
S,
|
|
1674
|
+
C,
|
|
1675
|
+
q,
|
|
1676
|
+
F,
|
|
1677
|
+
ee,
|
|
1678
|
+
D,
|
|
1679
|
+
he,
|
|
1680
|
+
qe
|
|
1681
|
+
]
|
|
1682
|
+
), ze = G(
|
|
1658
1683
|
() => O.filter(
|
|
1659
|
-
(
|
|
1684
|
+
(d) => Ae === void 0 || Ae(d, { today: Oe, timezone: at })
|
|
1660
1685
|
),
|
|
1661
|
-
[O,
|
|
1662
|
-
),
|
|
1663
|
-
rows:
|
|
1664
|
-
expanded:
|
|
1686
|
+
[O, Ae, Oe, at]
|
|
1687
|
+
), ct = R({
|
|
1688
|
+
rows: ze,
|
|
1689
|
+
expanded: j,
|
|
1665
1690
|
items: /* @__PURE__ */ new Map()
|
|
1666
|
-
}), [
|
|
1667
|
-
|
|
1668
|
-
rows:
|
|
1669
|
-
expanded:
|
|
1670
|
-
items: new Map(
|
|
1671
|
-
},
|
|
1672
|
-
const
|
|
1673
|
-
() =>
|
|
1674
|
-
[
|
|
1675
|
-
),
|
|
1676
|
-
|
|
1677
|
-
if (
|
|
1678
|
-
if (
|
|
1679
|
-
|
|
1691
|
+
}), [b, ue] = H(null);
|
|
1692
|
+
v ? b === null && ue(ct.current) : (ct.current = {
|
|
1693
|
+
rows: ze,
|
|
1694
|
+
expanded: j,
|
|
1695
|
+
items: new Map(j.map((d) => [d, Le(d)]))
|
|
1696
|
+
}, b !== null && ue(null));
|
|
1697
|
+
const Z = (b == null ? void 0 : b.rows) ?? ze, Ne = (b == null ? void 0 : b.expanded) ?? j, mt = G(() => new Set(Ne), [Ne]), de = G(
|
|
1698
|
+
() => Z.filter((d) => mt.has(d.id)).map((d) => d.id),
|
|
1699
|
+
[Z, mt]
|
|
1700
|
+
), gt = de.length > 0, [xe, $e] = H(!1), _e = de.filter((d) => Le(d).isLoading).length, ie = R(!1);
|
|
1701
|
+
W(() => {
|
|
1702
|
+
if (xe) {
|
|
1703
|
+
if (_e > 0 && !ie.current) {
|
|
1704
|
+
ie.current = !0, x(y("expandAllLoadingItems", { count: _e }));
|
|
1680
1705
|
return;
|
|
1681
1706
|
}
|
|
1682
|
-
|
|
1707
|
+
_e === 0 && (ie.current && j.length > 0 && x(y("expandAllItemsLoaded")), ie.current = !1, $e(!1));
|
|
1683
1708
|
}
|
|
1684
|
-
}, [
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1687
|
-
var
|
|
1688
|
-
|
|
1689
|
-
}, [
|
|
1690
|
-
const
|
|
1691
|
-
if (
|
|
1692
|
-
|
|
1693
|
-
const
|
|
1694
|
-
|
|
1709
|
+
}, [xe, _e, j.length, y]);
|
|
1710
|
+
const Ue = xe || cn, Fe = R(null), Be = R(!1);
|
|
1711
|
+
W(() => {
|
|
1712
|
+
var d;
|
|
1713
|
+
Ue || !Be.current || (Be.current = !1, (d = Fe.current) == null || d.focus());
|
|
1714
|
+
}, [Ue]);
|
|
1715
|
+
const Mn = () => {
|
|
1716
|
+
if (Be.current = document.activeElement === Fe.current, gt) {
|
|
1717
|
+
he("collapse-all");
|
|
1718
|
+
const M = new Set(de);
|
|
1719
|
+
$e(!1), ie.current = !1, fe === Te ? dn() : an(de), b !== null && ue({ ...b, expanded: b.expanded.filter((k) => !M.has(k)) }), x(y("modulesCollapsedAnnouncement", { count: de.length }));
|
|
1695
1720
|
return;
|
|
1696
1721
|
}
|
|
1697
|
-
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1700
|
-
},
|
|
1701
|
-
|
|
1702
|
-
const
|
|
1703
|
-
(
|
|
1704
|
-
const
|
|
1705
|
-
if (
|
|
1706
|
-
|
|
1722
|
+
he("expand-all");
|
|
1723
|
+
const d = Z.map((M) => M.id);
|
|
1724
|
+
$e(!0), ie.current = !1, fe === Te ? un() : ln(d), b !== null && ue({ ...b, expanded: d }), x(y("modulesExpandedAnnouncement", { count: d.length }));
|
|
1725
|
+
}, pt = R(b);
|
|
1726
|
+
pt.current = b;
|
|
1727
|
+
const _n = N(
|
|
1728
|
+
(d) => {
|
|
1729
|
+
const M = pt.current;
|
|
1730
|
+
if (M === null) {
|
|
1731
|
+
B(d);
|
|
1707
1732
|
return;
|
|
1708
1733
|
}
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1711
|
-
...
|
|
1712
|
-
expanded:
|
|
1713
|
-
}),
|
|
1734
|
+
const k = M.expanded.includes(d);
|
|
1735
|
+
ue({
|
|
1736
|
+
...M,
|
|
1737
|
+
expanded: k ? M.expanded.filter((Sn) => Sn !== d) : [...M.expanded, d]
|
|
1738
|
+
}), k ? ae(d) : le(d);
|
|
1714
1739
|
},
|
|
1715
|
-
[
|
|
1716
|
-
), [
|
|
1717
|
-
|
|
1718
|
-
if (!
|
|
1719
|
-
|
|
1740
|
+
[B, ae, le]
|
|
1741
|
+
), [En, ft] = H(!1);
|
|
1742
|
+
W(() => {
|
|
1743
|
+
if (!v) {
|
|
1744
|
+
ft(!1);
|
|
1720
1745
|
return;
|
|
1721
1746
|
}
|
|
1722
|
-
const
|
|
1723
|
-
return () => clearTimeout(
|
|
1724
|
-
}, [
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
}, [
|
|
1729
|
-
const
|
|
1730
|
-
return /* @__PURE__ */ m(
|
|
1747
|
+
const d = setTimeout(() => ft(!0), Fr);
|
|
1748
|
+
return () => clearTimeout(d);
|
|
1749
|
+
}, [v]);
|
|
1750
|
+
const Ee = mn !== void 0 && fe !== Te, Ge = oe || v && Z.length === 0, Ie = Z.length === 0 && !Ge && !te, Se = Ie && Ee, We = i === "h1" ? "h2" : "h3";
|
|
1751
|
+
W(() => {
|
|
1752
|
+
Se && x(y("filteredEmptyStateTitle"));
|
|
1753
|
+
}, [Se, y]);
|
|
1754
|
+
const ht = C > 1 || T || A, In = C > 1 && !Ge && !Ie && !Se;
|
|
1755
|
+
return /* @__PURE__ */ m(E, { as: o, display: "block", "data-testid": "modules-list", children: [
|
|
1731
1756
|
/* @__PURE__ */ s(
|
|
1732
|
-
|
|
1757
|
+
Jn,
|
|
1733
1758
|
{
|
|
1734
1759
|
modules: O,
|
|
1735
|
-
hasMoreModules:
|
|
1736
|
-
continuesBefore:
|
|
1760
|
+
hasMoreModules: ht || Ee,
|
|
1761
|
+
continuesBefore: A,
|
|
1737
1762
|
continuesAfter: T,
|
|
1738
|
-
onModuleClick:
|
|
1739
|
-
pagination:
|
|
1740
|
-
rangeStart: (S - 1) *
|
|
1741
|
-
totalCount:
|
|
1742
|
-
hasPreviousPage:
|
|
1763
|
+
onModuleClick: pn,
|
|
1764
|
+
pagination: ht ? {
|
|
1765
|
+
rangeStart: (S - 1) * Q + 1,
|
|
1766
|
+
totalCount: K.totalCount,
|
|
1767
|
+
hasPreviousPage: A,
|
|
1743
1768
|
hasNextPage: T,
|
|
1744
|
-
onPreviousPage: () =>
|
|
1745
|
-
onNextPage: () =>
|
|
1746
|
-
disabled:
|
|
1769
|
+
onPreviousPage: (d, M) => De(S - 1, d, M),
|
|
1770
|
+
onNextPage: (d, M) => De(S + 1, d, M),
|
|
1771
|
+
disabled: v
|
|
1747
1772
|
} : void 0
|
|
1748
1773
|
}
|
|
1749
1774
|
),
|
|
1750
1775
|
r && n ? /* @__PURE__ */ s(
|
|
1751
|
-
|
|
1776
|
+
Ur,
|
|
1752
1777
|
{
|
|
1753
1778
|
counts: n,
|
|
1754
|
-
itemsMode:
|
|
1779
|
+
itemsMode: pe,
|
|
1755
1780
|
loadedModules: O.length
|
|
1756
1781
|
}
|
|
1757
1782
|
) : null,
|
|
@@ -1759,59 +1784,62 @@ function xr({
|
|
|
1759
1784
|
_,
|
|
1760
1785
|
{
|
|
1761
1786
|
justifyItems: "end",
|
|
1787
|
+
alignItems: "end",
|
|
1762
1788
|
gap: "x-small",
|
|
1763
1789
|
wrap: "wrap",
|
|
1764
1790
|
margin: "medium 0 0 0",
|
|
1765
1791
|
"data-testid": "modules-controls",
|
|
1766
1792
|
children: [
|
|
1767
|
-
l ? /* @__PURE__ */ s(_.Item, { shouldGrow:
|
|
1768
|
-
|
|
1793
|
+
l ? /* @__PURE__ */ s(_.Item, { shouldGrow: V, children: /* @__PURE__ */ s(
|
|
1794
|
+
$r,
|
|
1769
1795
|
{
|
|
1770
1796
|
actions: l,
|
|
1771
1797
|
onApplied: u,
|
|
1772
1798
|
aiDisclosure: a,
|
|
1773
|
-
display:
|
|
1799
|
+
display: V ? "block" : "inline-block"
|
|
1774
1800
|
}
|
|
1775
1801
|
) }) : null,
|
|
1776
|
-
|
|
1777
|
-
|
|
1802
|
+
gn ? /* @__PURE__ */ s(_.Item, { shouldGrow: V, children: /* @__PURE__ */ s(
|
|
1803
|
+
ir,
|
|
1778
1804
|
{
|
|
1779
|
-
value:
|
|
1780
|
-
onChange:
|
|
1781
|
-
|
|
1805
|
+
value: fe,
|
|
1806
|
+
onChange: (d) => {
|
|
1807
|
+
S !== 1 && qe(), lt(d);
|
|
1808
|
+
},
|
|
1809
|
+
interaction: Ie && !Ee ? "disabled" : "enabled"
|
|
1782
1810
|
}
|
|
1783
1811
|
) }) : null,
|
|
1784
|
-
/* @__PURE__ */ s(_.Item, { shouldGrow:
|
|
1812
|
+
/* @__PURE__ */ s(_.Item, { shouldGrow: V, children: /* @__PURE__ */ s(
|
|
1785
1813
|
z,
|
|
1786
1814
|
{
|
|
1787
|
-
elementRef: (
|
|
1788
|
-
|
|
1815
|
+
elementRef: (d) => {
|
|
1816
|
+
Fe.current = d;
|
|
1789
1817
|
},
|
|
1790
|
-
display:
|
|
1791
|
-
onClick:
|
|
1792
|
-
interaction:
|
|
1818
|
+
display: V ? "block" : "inline-block",
|
|
1819
|
+
onClick: Mn,
|
|
1820
|
+
interaction: Z.length === 0 || Ue ? "disabled" : "enabled",
|
|
1793
1821
|
"data-testid": "expand-collapse-all",
|
|
1794
|
-
children:
|
|
1822
|
+
children: y(gt ? "collapseAllModules" : "expandAllModules")
|
|
1795
1823
|
}
|
|
1796
1824
|
) })
|
|
1797
1825
|
]
|
|
1798
1826
|
}
|
|
1799
1827
|
),
|
|
1800
|
-
/* @__PURE__ */ m(
|
|
1801
|
-
|
|
1828
|
+
/* @__PURE__ */ m(E, { as: "div", margin: "medium 0 0 0", children: [
|
|
1829
|
+
te ? /* @__PURE__ */ s(
|
|
1802
1830
|
X,
|
|
1803
1831
|
{
|
|
1804
1832
|
variant: "error",
|
|
1805
1833
|
margin: "0 0 small 0",
|
|
1806
|
-
liveRegion:
|
|
1834
|
+
liveRegion: be,
|
|
1807
1835
|
liveRegionPoliteness: "assertive",
|
|
1808
1836
|
"data-testid": "modules-error",
|
|
1809
|
-
children:
|
|
1837
|
+
children: y("modulesLoadErrorAlert", { message: te.message })
|
|
1810
1838
|
}
|
|
1811
1839
|
) : null,
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1840
|
+
Ge ? /* @__PURE__ */ s(E, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ s(st, { renderTitle: y("modulesLoadingSpinnerLabel") }) }) : null,
|
|
1841
|
+
Ie && !Ee ? /* @__PURE__ */ m(
|
|
1842
|
+
E,
|
|
1815
1843
|
{
|
|
1816
1844
|
as: "div",
|
|
1817
1845
|
background: "primary",
|
|
@@ -1822,43 +1850,43 @@ function xr({
|
|
|
1822
1850
|
textAlign: "center",
|
|
1823
1851
|
"data-testid": "modules-empty",
|
|
1824
1852
|
children: [
|
|
1825
|
-
/* @__PURE__ */ s(
|
|
1826
|
-
/* @__PURE__ */ s(
|
|
1853
|
+
/* @__PURE__ */ s(me, { level: We, variant: "titleCardLarge", margin: "0 0 x-small 0", children: y("noModulesEmptyStateTitle") }),
|
|
1854
|
+
/* @__PURE__ */ s(P, { color: "secondary", children: y("noModulesEmptyStateDescription") })
|
|
1827
1855
|
]
|
|
1828
1856
|
}
|
|
1829
1857
|
) : null,
|
|
1830
|
-
|
|
1831
|
-
|
|
1858
|
+
Se ? /* @__PURE__ */ m(
|
|
1859
|
+
E,
|
|
1832
1860
|
{
|
|
1833
1861
|
as: "div",
|
|
1834
1862
|
background: "primary",
|
|
1835
1863
|
borderRadius: "card.lg",
|
|
1836
1864
|
borderWidth: "small",
|
|
1837
1865
|
shadow: "resting",
|
|
1838
|
-
padding:
|
|
1866
|
+
padding: V ? "general.spaceLg general.spaceMd" : "general.space2xl general.spaceXl",
|
|
1839
1867
|
textAlign: "center",
|
|
1840
1868
|
"data-testid": "modules-filtered-empty",
|
|
1841
1869
|
children: [
|
|
1842
1870
|
/* @__PURE__ */ s(
|
|
1843
|
-
|
|
1871
|
+
me,
|
|
1844
1872
|
{
|
|
1845
|
-
level:
|
|
1846
|
-
variant:
|
|
1873
|
+
level: We,
|
|
1874
|
+
variant: V ? "titleCardMini" : "titleCardLarge",
|
|
1847
1875
|
margin: "0 0 general.spaceXs 0",
|
|
1848
|
-
children:
|
|
1876
|
+
children: y("filteredEmptyStateTitle")
|
|
1849
1877
|
}
|
|
1850
1878
|
),
|
|
1851
|
-
/* @__PURE__ */ s(
|
|
1879
|
+
/* @__PURE__ */ s(P, { as: "div", color: "secondary", size: V ? "small" : void 0, children: y("filteredEmptyStateDescription") }),
|
|
1852
1880
|
/* @__PURE__ */ s(
|
|
1853
1881
|
z,
|
|
1854
1882
|
{
|
|
1855
1883
|
color: "primary",
|
|
1856
1884
|
margin: "general.spaceLg 0 0 0",
|
|
1857
1885
|
onClick: () => {
|
|
1858
|
-
|
|
1886
|
+
lt(Te), ne.current = "focusList";
|
|
1859
1887
|
},
|
|
1860
1888
|
"data-testid": "clear-filters",
|
|
1861
|
-
children:
|
|
1889
|
+
children: y("clearFilters")
|
|
1862
1890
|
}
|
|
1863
1891
|
)
|
|
1864
1892
|
]
|
|
@@ -1867,63 +1895,62 @@ function xr({
|
|
|
1867
1895
|
/* @__PURE__ */ s(
|
|
1868
1896
|
"ul",
|
|
1869
1897
|
{
|
|
1870
|
-
ref:
|
|
1871
|
-
style: { listStyle: "none", margin: 0, padding: 0, opacity:
|
|
1872
|
-
"aria-busy":
|
|
1898
|
+
ref: dt,
|
|
1899
|
+
style: { listStyle: "none", margin: 0, padding: 0, opacity: En ? 0.5 : 1 },
|
|
1900
|
+
"aria-busy": v,
|
|
1873
1901
|
tabIndex: -1,
|
|
1874
1902
|
"data-testid": "modules-stack",
|
|
1875
|
-
children:
|
|
1903
|
+
children: Z.map((d) => /* @__PURE__ */ s(
|
|
1876
1904
|
"li",
|
|
1877
1905
|
{
|
|
1878
|
-
ref: (
|
|
1879
|
-
|
|
1906
|
+
ref: (M) => {
|
|
1907
|
+
M ? Re.current.set(d.id, M) : Re.current.delete(d.id);
|
|
1880
1908
|
},
|
|
1881
1909
|
children: /* @__PURE__ */ s(
|
|
1882
|
-
|
|
1910
|
+
Er,
|
|
1883
1911
|
{
|
|
1884
|
-
module:
|
|
1885
|
-
expanded:
|
|
1886
|
-
onToggle:
|
|
1887
|
-
itemsState: (
|
|
1888
|
-
today:
|
|
1912
|
+
module: d,
|
|
1913
|
+
expanded: Ne.includes(d.id),
|
|
1914
|
+
onToggle: _n,
|
|
1915
|
+
itemsState: (b == null ? void 0 : b.items.get(d.id)) ?? Le(d.id),
|
|
1916
|
+
today: Oe,
|
|
1889
1917
|
showDiagnostics: r,
|
|
1890
|
-
headingLevel:
|
|
1891
|
-
breakpoints:
|
|
1892
|
-
toggleRef:
|
|
1918
|
+
headingLevel: We,
|
|
1919
|
+
breakpoints: U,
|
|
1920
|
+
toggleRef: fn
|
|
1893
1921
|
}
|
|
1894
1922
|
)
|
|
1895
1923
|
},
|
|
1896
|
-
|
|
1924
|
+
d.id
|
|
1897
1925
|
))
|
|
1898
1926
|
}
|
|
1899
1927
|
)
|
|
1900
1928
|
] }),
|
|
1901
1929
|
In ? /* @__PURE__ */ s(
|
|
1902
|
-
|
|
1930
|
+
$t,
|
|
1903
1931
|
{
|
|
1904
1932
|
as: "nav",
|
|
1905
1933
|
variant: "compact",
|
|
1906
1934
|
withFirstAndLastButton: !0,
|
|
1907
1935
|
margin: "small 0 0 0",
|
|
1908
|
-
labelFirst:
|
|
1909
|
-
labelPrev:
|
|
1910
|
-
labelNext:
|
|
1911
|
-
labelLast:
|
|
1912
|
-
screenReaderLabelPageButton: (
|
|
1913
|
-
ellipsis:
|
|
1936
|
+
labelFirst: y("paginationFirstPage"),
|
|
1937
|
+
labelPrev: y("paginationPreviousPage"),
|
|
1938
|
+
labelNext: y("paginationNextPage"),
|
|
1939
|
+
labelLast: y("paginationLastPage"),
|
|
1940
|
+
screenReaderLabelPageButton: (d) => y("paginationPageLabel", { page: d }),
|
|
1941
|
+
ellipsis: y("paginationEllipsis"),
|
|
1914
1942
|
totalPageNumber: C,
|
|
1915
1943
|
currentPage: S,
|
|
1916
|
-
disabled:
|
|
1917
|
-
onPageChange: (
|
|
1944
|
+
disabled: v,
|
|
1945
|
+
onPageChange: (d) => De(d),
|
|
1918
1946
|
"data-testid": "modules-pagination"
|
|
1919
|
-
}
|
|
1920
|
-
S
|
|
1947
|
+
}
|
|
1921
1948
|
) : null
|
|
1922
1949
|
] });
|
|
1923
1950
|
}
|
|
1924
|
-
const
|
|
1925
|
-
|
|
1926
|
-
),
|
|
1951
|
+
const Gr = Ei(
|
|
1952
|
+
Br
|
|
1953
|
+
), ge = [
|
|
1927
1954
|
"assignment",
|
|
1928
1955
|
"quiz",
|
|
1929
1956
|
"discussion",
|
|
@@ -1932,7 +1959,7 @@ const $r = fi(
|
|
|
1932
1959
|
"external_url",
|
|
1933
1960
|
"external_tool",
|
|
1934
1961
|
"sub_header"
|
|
1935
|
-
],
|
|
1962
|
+
], et = [
|
|
1936
1963
|
"not_started",
|
|
1937
1964
|
"in_progress",
|
|
1938
1965
|
"complete",
|
|
@@ -1940,30 +1967,30 @@ const $r = fi(
|
|
|
1940
1967
|
"incomplete",
|
|
1941
1968
|
"missing_and_incomplete",
|
|
1942
1969
|
"locked"
|
|
1943
|
-
],
|
|
1970
|
+
], sn = [
|
|
1944
1971
|
"must_view",
|
|
1945
1972
|
"must_submit",
|
|
1946
1973
|
"must_contribute",
|
|
1947
1974
|
"must_mark_done",
|
|
1948
1975
|
"min_score",
|
|
1949
1976
|
"min_percentage"
|
|
1950
|
-
],
|
|
1977
|
+
], Wr = ["assignment", "quiz", "discussion"], Hr = ["external_url", "external_tool"], Yr = ["assignment", "quiz", "discussion"], jr = Date.UTC(2025, 0, 6), Qr = 864e5, se = "1", on = (e) => new Date(jr + e * Qr).toISOString(), Ce = [
|
|
1951
1978
|
"min_score",
|
|
1952
1979
|
"min_percentage"
|
|
1953
|
-
],
|
|
1954
|
-
(e) => !
|
|
1955
|
-
),
|
|
1980
|
+
], Kr = sn.filter(
|
|
1981
|
+
(e) => !Ce.includes(e)
|
|
1982
|
+
), Vr = [
|
|
1956
1983
|
"in_progress",
|
|
1957
1984
|
"incomplete",
|
|
1958
1985
|
"missing_and_incomplete"
|
|
1959
|
-
],
|
|
1960
|
-
const o = n ?
|
|
1986
|
+
], Zr = (e, t, n, r) => {
|
|
1987
|
+
const o = n ? sn : Kr, i = n && r ? Ce[t % Ce.length] : o[Math.floor(t / 3) % o.length];
|
|
1961
1988
|
return i === "min_score" ? { itemId: e, type: i, minScore: 10 } : i === "min_percentage" ? { itemId: e, type: i, minPercentage: 80 } : { itemId: e, type: i };
|
|
1962
|
-
},
|
|
1989
|
+
}, Xr = (e, t, n, r) => e === "sub_header" ? !1 : n && r || t % 3 === 0, ot = (e) => et[(e - 1) % et.length], Jr = (e, t) => !Yr.includes(e) || e === "discussion" && Math.floor(t / ge.length) % 2 === 1 ? null : 5 + t % 4 * 5, es = (e, t, n, r) => t ? e === "missing" ? n != null || r % 2 === 0 : e === "missing_and_incomplete" ? r % 2 === 1 : !1 : !1, ts = (e, t, n, r) => {
|
|
1963
1990
|
if (e === "locked") return "locked";
|
|
1964
|
-
if (
|
|
1991
|
+
if (es(e, t, n, r)) return "missing";
|
|
1965
1992
|
if (!n) return;
|
|
1966
|
-
const o = t &&
|
|
1993
|
+
const o = t && Ce.includes(n.type);
|
|
1967
1994
|
switch (e) {
|
|
1968
1995
|
case "not_started":
|
|
1969
1996
|
case "missing":
|
|
@@ -1978,37 +2005,37 @@ const $r = fi(
|
|
|
1978
2005
|
default:
|
|
1979
2006
|
return e;
|
|
1980
2007
|
}
|
|
1981
|
-
},
|
|
1982
|
-
const a = String(e),
|
|
2008
|
+
}, ns = (e) => e.status === "complete", is = (e, t, n, r, o, i, l, u) => {
|
|
2009
|
+
const a = String(e), c = ge[r % ge.length], g = c === "sub_header", p = Wr.includes(c) && (r % 4 === 0 || o === "missing");
|
|
1983
2010
|
return {
|
|
1984
2011
|
id: n,
|
|
1985
2012
|
moduleId: a,
|
|
1986
|
-
title: `${
|
|
1987
|
-
type:
|
|
2013
|
+
title: `${c} ${t + 1}`,
|
|
2014
|
+
type: c,
|
|
1988
2015
|
position: t + 1,
|
|
1989
2016
|
indent: t % 5 === 4 ? 1 : 0,
|
|
1990
2017
|
published: u === "teacher" ? r % 7 !== 0 : !0,
|
|
1991
|
-
url: g ? null : `/courses/${
|
|
1992
|
-
newTab:
|
|
2018
|
+
url: g ? null : `/courses/${se}/modules/items/${n}`,
|
|
2019
|
+
newTab: Hr.includes(c) && r % 2 === 0,
|
|
1993
2020
|
completionRequirement: l,
|
|
1994
|
-
dueAt: p ?
|
|
2021
|
+
dueAt: p ? on(r % 90) : null,
|
|
1995
2022
|
status: o,
|
|
1996
2023
|
pointsPossible: i,
|
|
1997
|
-
extensions:
|
|
2024
|
+
extensions: tt(
|
|
1998
2025
|
void 0,
|
|
1999
2026
|
r % 37 === 0 ? 5 + r % 4 * 10 : null
|
|
2000
2027
|
)
|
|
2001
2028
|
};
|
|
2002
|
-
},
|
|
2003
|
-
const o =
|
|
2029
|
+
}, rs = (e, t, n, r) => {
|
|
2030
|
+
const o = ot(e), i = Vr.includes(o), l = [];
|
|
2004
2031
|
let u = 0;
|
|
2005
2032
|
for (let a = 0; a < t; a += 1) {
|
|
2006
|
-
const
|
|
2007
|
-
l.push(
|
|
2033
|
+
const c = n + a, g = ge[c % ge.length], p = Jr(g, c), h = p !== null, f = h ? u++ : a, I = String(e * 1e3 + a + 1), w = Xr(g, c, h, i) ? Zr(I, c, h, i) : null, L = ts(o, h, w, f);
|
|
2034
|
+
l.push(is(e, a, I, c, L, p, w, r));
|
|
2008
2035
|
}
|
|
2009
2036
|
return l;
|
|
2010
|
-
},
|
|
2011
|
-
const o =
|
|
2037
|
+
}, ss = (e, t, n, r) => {
|
|
2038
|
+
const o = ot(e);
|
|
2012
2039
|
if (o === "locked" || o === "not_started") return o;
|
|
2013
2040
|
if (t.length === 0) return "not_started";
|
|
2014
2041
|
if (!t.some((i) => i.pointsPossible != null) || o === "missing" && n === 0 || o === "incomplete" && r === 0) return "in_progress";
|
|
@@ -2018,36 +2045,36 @@ const $r = fi(
|
|
|
2018
2045
|
if (r === 0) return "missing";
|
|
2019
2046
|
}
|
|
2020
2047
|
return o;
|
|
2021
|
-
},
|
|
2022
|
-
const r = t.filter((
|
|
2048
|
+
}, os = (e) => e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort()[0] ?? null, ls = (e, t, n) => {
|
|
2049
|
+
const r = t.filter((c) => c.completionRequirement), o = n ?? r.length, i = Math.min(r.filter(ns).length, o), l = t.filter((c) => c.status === "missing").length, u = t.filter((c) => c.status === "incomplete").length;
|
|
2023
2050
|
return {
|
|
2024
|
-
status:
|
|
2051
|
+
status: ss(e, t, l, u),
|
|
2025
2052
|
requirementsMet: i,
|
|
2026
2053
|
requirementCount: o,
|
|
2027
2054
|
percentComplete: o > 0 ? Math.round(i / o * 100) : 0,
|
|
2028
|
-
nextDueAt:
|
|
2055
|
+
nextDueAt: os(t),
|
|
2029
2056
|
missingCount: l,
|
|
2030
2057
|
incompleteCount: u
|
|
2031
2058
|
};
|
|
2032
|
-
},
|
|
2033
|
-
const r =
|
|
2059
|
+
}, as = (e, t, n) => {
|
|
2060
|
+
const r = ot(e), o = e % 2 !== 0 && r !== "incomplete" && r !== "missing_and_incomplete" ? 1 : null;
|
|
2034
2061
|
return {
|
|
2035
2062
|
id: String(e),
|
|
2036
2063
|
name: `Module ${e}`,
|
|
2037
2064
|
position: e,
|
|
2038
2065
|
published: n === "teacher" ? e % 4 !== 0 : !0,
|
|
2039
2066
|
itemCount: t.length,
|
|
2040
|
-
unlockAt: e % 5 === 0 ?
|
|
2067
|
+
unlockAt: e % 5 === 0 ? on(e) : null,
|
|
2041
2068
|
prerequisiteModules: e > 1 && e % 3 === 0 ? [{ id: String(e - 1), name: `Module ${e - 1}` }] : [],
|
|
2042
2069
|
requirementCount: o,
|
|
2043
2070
|
requireSequentialProgress: e % 6 === 0,
|
|
2044
2071
|
completionRequirements: t.flatMap(
|
|
2045
2072
|
(i) => i.completionRequirement ? [i.completionRequirement] : []
|
|
2046
2073
|
),
|
|
2047
|
-
progress:
|
|
2074
|
+
progress: ls(e, t, o)
|
|
2048
2075
|
};
|
|
2049
2076
|
};
|
|
2050
|
-
function
|
|
2077
|
+
function us(e) {
|
|
2051
2078
|
return {
|
|
2052
2079
|
courseId: e.courseId,
|
|
2053
2080
|
modules: e.modules.map(({ progress: t, ...n }) => n),
|
|
@@ -2059,31 +2086,31 @@ function ss(e) {
|
|
|
2059
2086
|
)
|
|
2060
2087
|
};
|
|
2061
2088
|
}
|
|
2062
|
-
function
|
|
2063
|
-
const n = t.view ?? "student", r = t.courseId ??
|
|
2089
|
+
function we(e, t = {}) {
|
|
2090
|
+
const n = t.view ?? "student", r = t.courseId ?? se, o = [], i = {};
|
|
2064
2091
|
let l = 0;
|
|
2065
|
-
e.forEach((a,
|
|
2066
|
-
const g =
|
|
2067
|
-
l += a, o.push(
|
|
2092
|
+
e.forEach((a, c) => {
|
|
2093
|
+
const g = c + 1, p = rs(g, a, l, n);
|
|
2094
|
+
l += a, o.push(as(g, p, n)), i[String(g)] = p;
|
|
2068
2095
|
});
|
|
2069
2096
|
const u = { courseId: r, modules: o, itemsByModuleId: i };
|
|
2070
|
-
return n === "teacher" ?
|
|
2097
|
+
return n === "teacher" ? us(u) : u;
|
|
2071
2098
|
}
|
|
2072
|
-
const
|
|
2073
|
-
function
|
|
2074
|
-
return
|
|
2099
|
+
const ce = (e) => `/courses/${se}/modules/items/${e}`, Ot = "2099-08-31T06:59:00Z", ds = "2020-01-06T07:00:00Z", cs = et.length, ms = 8, gs = 120, ps = 25, fs = 250, qt = 8;
|
|
2100
|
+
function Xs() {
|
|
2101
|
+
return we(Array.from({ length: cs }, () => ms));
|
|
2075
2102
|
}
|
|
2076
|
-
function
|
|
2077
|
-
return
|
|
2103
|
+
function Js() {
|
|
2104
|
+
return we(Array.from({ length: gs }, () => ps));
|
|
2078
2105
|
}
|
|
2079
|
-
function
|
|
2080
|
-
return
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2106
|
+
function eo() {
|
|
2107
|
+
return we([
|
|
2108
|
+
qt,
|
|
2109
|
+
fs,
|
|
2110
|
+
qt
|
|
2084
2111
|
]);
|
|
2085
2112
|
}
|
|
2086
|
-
function
|
|
2113
|
+
function to() {
|
|
2087
2114
|
const e = (i, l, u) => ({
|
|
2088
2115
|
id: String(i),
|
|
2089
2116
|
name: l,
|
|
@@ -2102,27 +2129,27 @@ function Zs() {
|
|
|
2102
2129
|
},
|
|
2103
2130
|
...u
|
|
2104
2131
|
}), 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 = [
|
|
2105
|
-
e(1, "Locked by a future date", { unlockAt:
|
|
2132
|
+
e(1, "Locked by a future date", { unlockAt: Ot }),
|
|
2106
2133
|
e(2, "Locked by one prerequisite", { prerequisiteModules: [t] }),
|
|
2107
2134
|
e(3, "Locked by several prerequisites", {
|
|
2108
2135
|
prerequisiteModules: [t, n]
|
|
2109
2136
|
}),
|
|
2110
2137
|
e(4, "Locked by a date and a prerequisite", {
|
|
2111
|
-
unlockAt:
|
|
2138
|
+
unlockAt: Ot,
|
|
2112
2139
|
prerequisiteModules: [r]
|
|
2113
2140
|
}),
|
|
2114
|
-
e(5, "Locked, and the unlock date has passed", { unlockAt:
|
|
2141
|
+
e(5, "Locked, and the unlock date has passed", { unlockAt: ds })
|
|
2115
2142
|
];
|
|
2116
2143
|
return {
|
|
2117
|
-
courseId:
|
|
2144
|
+
courseId: se,
|
|
2118
2145
|
modules: o,
|
|
2119
2146
|
itemsByModuleId: Object.fromEntries(o.map((i) => [i.id, []]))
|
|
2120
2147
|
};
|
|
2121
2148
|
}
|
|
2122
|
-
function
|
|
2123
|
-
return
|
|
2149
|
+
function no() {
|
|
2150
|
+
return we([]);
|
|
2124
2151
|
}
|
|
2125
|
-
function
|
|
2152
|
+
function io() {
|
|
2126
2153
|
const t = [
|
|
2127
2154
|
{
|
|
2128
2155
|
title: "Every fact: type, due date, points, requirement",
|
|
@@ -2151,7 +2178,7 @@ function Js() {
|
|
|
2151
2178
|
title: "Career item carrying an estimated duration",
|
|
2152
2179
|
type: "external_tool",
|
|
2153
2180
|
completionRequirement: { itemId: "5", type: "must_view" },
|
|
2154
|
-
extensions:
|
|
2181
|
+
extensions: tt(void 0, 45)
|
|
2155
2182
|
},
|
|
2156
2183
|
{ title: "A file, ungradeable, so no points at all", type: "file" },
|
|
2157
2184
|
{ title: "External link, opens in a new tab", type: "external_url", newTab: !0 },
|
|
@@ -2174,12 +2201,12 @@ function Js() {
|
|
|
2174
2201
|
indent: 0,
|
|
2175
2202
|
published: !0,
|
|
2176
2203
|
newTab: !1,
|
|
2177
|
-
url:
|
|
2204
|
+
url: ce(r + 1),
|
|
2178
2205
|
status: "not_started",
|
|
2179
2206
|
...n
|
|
2180
2207
|
}));
|
|
2181
2208
|
return {
|
|
2182
|
-
courseId:
|
|
2209
|
+
courseId: se,
|
|
2183
2210
|
modules: [
|
|
2184
2211
|
{
|
|
2185
2212
|
id: "1",
|
|
@@ -2194,13 +2221,13 @@ function Js() {
|
|
|
2194
2221
|
itemsByModuleId: { 1: t }
|
|
2195
2222
|
};
|
|
2196
2223
|
}
|
|
2197
|
-
function
|
|
2224
|
+
function ro() {
|
|
2198
2225
|
const t = [
|
|
2199
|
-
{ title: "Reading: limits from the left and the right", type: "page", url:
|
|
2226
|
+
{ title: "Reading: limits from the left and the right", type: "page", url: ce(1) },
|
|
2200
2227
|
{
|
|
2201
2228
|
title: "Desmos: interactive limit explorer",
|
|
2202
2229
|
type: "external_url",
|
|
2203
|
-
url:
|
|
2230
|
+
url: ce(2),
|
|
2204
2231
|
newTab: !0
|
|
2205
2232
|
},
|
|
2206
2233
|
{ title: "Practice", type: "sub_header", url: null },
|
|
@@ -2208,9 +2235,9 @@ function eo() {
|
|
|
2208
2235
|
{
|
|
2209
2236
|
title: "Utilizing Triangle Characteristics: Measuring Distances Through Angles, Elevation and the Practical Limits of Indirect Measurement in the Field",
|
|
2210
2237
|
type: "assignment",
|
|
2211
|
-
url:
|
|
2238
|
+
url: ce(5)
|
|
2212
2239
|
},
|
|
2213
|
-
{ title: "Unit test", type: "quiz", url:
|
|
2240
|
+
{ title: "Unit test", type: "quiz", url: ce(6), status: "locked" }
|
|
2214
2241
|
].map((n, r) => ({
|
|
2215
2242
|
id: String(r + 1),
|
|
2216
2243
|
moduleId: "1",
|
|
@@ -2222,7 +2249,7 @@ function eo() {
|
|
|
2222
2249
|
...n
|
|
2223
2250
|
}));
|
|
2224
2251
|
return {
|
|
2225
|
-
courseId:
|
|
2252
|
+
courseId: se,
|
|
2226
2253
|
modules: [
|
|
2227
2254
|
{
|
|
2228
2255
|
id: "1",
|
|
@@ -2238,126 +2265,126 @@ function eo() {
|
|
|
2238
2265
|
};
|
|
2239
2266
|
}
|
|
2240
2267
|
export {
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2268
|
+
js as ACTION_ORDER_LTI_FLOOR,
|
|
2269
|
+
Te as ALL_FILTER,
|
|
2270
|
+
lo as ActionEntrySchema,
|
|
2271
|
+
ao as CompletionRequirementSchema,
|
|
2272
|
+
uo as CompletionRequirementTypeSchema,
|
|
2273
|
+
co as DEFAULT_INLINE_THRESHOLD,
|
|
2274
|
+
mo as DEFAULT_ITEM_CONCURRENCY,
|
|
2275
|
+
go as DEFAULT_ITEM_PAGE_SIZE,
|
|
2276
|
+
po as DEFAULT_LOCALE,
|
|
2277
|
+
fo as DEFAULT_MOBILE_PAGE_SIZE,
|
|
2278
|
+
ho as DEFAULT_PAGE_SIZE,
|
|
2279
|
+
Mo as DEFAULT_RETAIN_COLLAPSED_LIMIT,
|
|
2280
|
+
_o as DEFAULT_STALE_TIME_MS,
|
|
2281
|
+
Eo as DUE_THIS_WEEK_DAYS,
|
|
2282
|
+
Io as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
|
|
2283
|
+
Yn as EXT_ORGANIZE_ADDED_ITEM_COUNT,
|
|
2284
|
+
jn as EXT_ORGANIZE_NEW_MODULE,
|
|
2285
|
+
Qn as EXT_ORGANIZE_NEW_PLACEMENT,
|
|
2286
|
+
Hn as EXT_SUPPRESS_ITEM_NUMBERING,
|
|
2287
|
+
se as FIXTURE_COURSE_ID,
|
|
2288
|
+
So as FilterClauseSchema,
|
|
2289
|
+
yo as FilterEntrySchema,
|
|
2290
|
+
ir as FilterSelect,
|
|
2291
|
+
Hi as GET_MODULES,
|
|
2292
|
+
ji as GET_MODULE_ITEMS,
|
|
2266
2293
|
bn as INLINE_ITEM_LIMIT,
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2294
|
+
yn as INLINE_QUERY_NODE_BUDGET,
|
|
2295
|
+
To as InMemoryCourseMismatchError,
|
|
2296
|
+
Po as ItemDueSoonPill,
|
|
2297
|
+
bo as ItemTypeEntrySchema,
|
|
2298
|
+
Ze as MAX_DIRECTION_CHARS,
|
|
2299
|
+
Co as MetaFieldEntrySchema,
|
|
2300
|
+
Er as ModuleCard,
|
|
2301
|
+
Fn as ModuleDueSoonPill,
|
|
2302
|
+
Wn as ModuleItemRow,
|
|
2303
|
+
vo as ModuleItemSchema,
|
|
2304
|
+
wo as ModuleItemStatusPill,
|
|
2305
|
+
Lo as ModuleItemStatusSchema,
|
|
2306
|
+
Ao as ModuleItemTypeSchema,
|
|
2307
|
+
Tn as ModuleItemsPageSchema,
|
|
2308
|
+
Ro as ModuleProgressSchema,
|
|
2309
|
+
ko as ModuleSchema,
|
|
2310
|
+
Nn as ModuleStatusPill,
|
|
2311
|
+
Oo as ModuleStatusSchema,
|
|
2312
|
+
qo as ModulesAnalyticsProvider,
|
|
2313
|
+
Vn as ModulesConfigProvider,
|
|
2314
|
+
wn as ModulesConfigSchema,
|
|
2315
|
+
Kn as ModulesI18nProvider,
|
|
2316
|
+
Gr as ModulesList,
|
|
2317
|
+
Do as ModulesPageInfoSchema,
|
|
2318
|
+
Pn as ModulesPageSchema,
|
|
2319
|
+
Jn as ModulesProgressBar,
|
|
2320
|
+
Zi as NEW_PLACEMENT_FIELD,
|
|
2321
|
+
tn as ORGANIZE_CONTENT_TYPES,
|
|
2322
|
+
Zs as ORGANIZE_MODES,
|
|
2323
|
+
Or as ORGANIZE_SLOW_AFTER_MS,
|
|
2324
|
+
Tr as OrganizeForm,
|
|
2325
|
+
$r as OrganizeModulesButton,
|
|
2326
|
+
xr as OrganizeModulesModal,
|
|
2327
|
+
nn as PROPOSAL_PREVIEW_COURSE_ID,
|
|
2328
|
+
zo as PageInfoSchema,
|
|
2329
|
+
Ft as PartialCanvasResponseError,
|
|
2330
|
+
No as PrerequisiteModuleSchema,
|
|
2331
|
+
kr as ProposalPreview,
|
|
2332
|
+
xo as RegistryEntrySchema,
|
|
2333
|
+
$o as TYPE_FIELD,
|
|
2334
|
+
Uo as baseFilters,
|
|
2335
|
+
kn as baseModulesConfig,
|
|
2336
|
+
we as buildFixture,
|
|
2337
|
+
no as courseEmpty,
|
|
2338
|
+
eo as courseFatModule,
|
|
2339
|
+
ro as courseItemLinks,
|
|
2340
|
+
io as courseItemRowVariants,
|
|
2341
|
+
Js as courseLarge,
|
|
2342
|
+
to as courseLockReasons,
|
|
2343
|
+
Xs as courseSmall,
|
|
2344
|
+
Vi as createActionContext,
|
|
2345
|
+
Ys as createCanvasGraphqlAdapter,
|
|
2346
|
+
Zn as createInMemoryAdapter,
|
|
2347
|
+
Fo as createTranslate,
|
|
2348
|
+
Bo as defaultFormatters,
|
|
2349
|
+
Ir as defaultOrganizeInput,
|
|
2350
|
+
Go as defaultTranslate,
|
|
2351
|
+
Wo as filterClauseOf,
|
|
2352
|
+
An as getAddedItemCount,
|
|
2353
|
+
Ho as getEstimatedDurationMinutes,
|
|
2354
|
+
At as hasOrganizeInputErrors,
|
|
2355
|
+
Yo as hideUnservableFilters,
|
|
2356
|
+
jo as invalidateCourse,
|
|
2357
|
+
Cn as invalidateModuleItems,
|
|
2358
|
+
Mt as invalidateModuleList,
|
|
2359
|
+
Rn as isNewPlacement,
|
|
2360
|
+
Qo as isPredicateServed,
|
|
2334
2361
|
Ln as isProposedNewModule,
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2362
|
+
re as mergeRegistry,
|
|
2363
|
+
Ko as moduleItemStatusLabel,
|
|
2364
|
+
Vo as moduleItemsPrefix,
|
|
2365
|
+
Zo as moduleStatusLabel,
|
|
2366
|
+
Xo as modulesKeys,
|
|
2367
|
+
Jo as modulesListPrefix,
|
|
2368
|
+
er as organizePreviewConfig,
|
|
2369
|
+
Ks as partialModulesConfig,
|
|
2370
|
+
Lr as proposalToFixture,
|
|
2371
|
+
el as registrySchema,
|
|
2372
|
+
Jt as resolveModulesConfig,
|
|
2373
|
+
tl as servesClause,
|
|
2374
|
+
$n as suppressesItemNumbering,
|
|
2375
|
+
nl as unservableFilters,
|
|
2376
|
+
Vs as useActionContext,
|
|
2377
|
+
il as useFieldVisible,
|
|
2378
|
+
rt as useFormatters,
|
|
2379
|
+
rl as useModules,
|
|
2380
|
+
it as useModulesAnalytics,
|
|
2381
|
+
ve as useModulesConfig,
|
|
2382
|
+
$ as useModulesI18n,
|
|
2383
|
+
Xn as useModulesPageData,
|
|
2384
|
+
Nr as useOrganizeModules,
|
|
2385
|
+
Lt as validateOrganizeInput,
|
|
2386
|
+
Qs as visibleActions,
|
|
2387
|
+
nt as visibleEntries,
|
|
2388
|
+
sl as visibleEntry,
|
|
2389
|
+
tt as withEstimatedDurationMinutes
|
|
2363
2390
|
};
|