@instructure/platform-modules 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/canvasGraphql/normalize.d.ts +1 -0
- package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
- package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
- package/dist/adapters/inMemory.d.ts.map +1 -1
- package/dist/chunks/{ModulesProgressBar-B4fXbi-4.js → ModulesProgressBar-DOUI1JeK.js} +785 -769
- package/dist/components/ModuleCard.d.ts.map +1 -1
- package/dist/components/ModulesList.stories.d.ts +1 -1
- package/dist/components/ModulesList.stories.d.ts.map +1 -1
- package/dist/edit/EditModuleCard.d.ts +5 -3
- package/dist/edit/EditModuleCard.d.ts.map +1 -1
- package/dist/edit/EditModuleItemRow.d.ts +2 -1
- package/dist/edit/EditModuleItemRow.d.ts.map +1 -1
- package/dist/edit/ModulesEditView.d.ts.map +1 -1
- package/dist/edit/ModulesEditView.stories.d.ts +3 -2
- package/dist/edit/ModulesEditView.stories.d.ts.map +1 -1
- package/dist/edit/controls/DragHandle.d.ts +12 -0
- package/dist/edit/controls/DragHandle.d.ts.map +1 -0
- package/dist/edit/dnd/EditDndProvider.d.ts +18 -0
- package/dist/edit/dnd/EditDndProvider.d.ts.map +1 -0
- package/dist/edit/dnd/announcements.d.ts +24 -0
- package/dist/edit/dnd/announcements.d.ts.map +1 -0
- package/dist/edit/dnd/ids.d.ts +41 -0
- package/dist/edit/dnd/ids.d.ts.map +1 -0
- package/dist/edit/index.d.ts +2 -0
- package/dist/edit/index.d.ts.map +1 -1
- package/dist/edit.js +610 -328
- package/dist/hooks/useModulesPageData.d.ts.map +1 -1
- package/dist/index.js +8 -3
- package/dist/types/domain.d.ts +2 -0
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/schemas.d.ts.map +1 -1
- package/locales/en.json +12 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { keepPreviousData as
|
|
1
|
+
import { keepPreviousData as Mn, useQuery as Tn, useQueryClient as Sn, QueryObserver as yo } from "@tanstack/react-query";
|
|
2
2
|
import kt from "p-limit";
|
|
3
|
-
import { createContext as dt, useContext as Ke, useRef as _, useMemo as W, isValidElement as mt, useState as ne, useEffect as me, useCallback as R, memo as
|
|
3
|
+
import { createContext as dt, useContext as Ke, useRef as _, useMemo as W, isValidElement as mt, useState as ne, useEffect as me, useCallback as R, memo as Io, Fragment as vn, cloneElement as Mo } from "react";
|
|
4
4
|
import { BREAKPOINTS as To } from "@instructure/platform-with-breakpoints";
|
|
5
5
|
import { jsx as l, jsxs as J } from "react/jsx-runtime";
|
|
6
|
-
import { useTheme as
|
|
7
|
-
import { ScreenReaderContent as
|
|
6
|
+
import { useTheme as wn } from "@instructure/emotion";
|
|
7
|
+
import { ScreenReaderContent as En } from "@instructure/ui-a11y-content";
|
|
8
8
|
import { Flex as U } from "@instructure/ui-flex/v11_7";
|
|
9
|
-
import { PlugInstUIIcon as So, ExternalLinkInstUIIcon as
|
|
9
|
+
import { PlugInstUIIcon as So, ExternalLinkInstUIIcon as vo, FileInstUIIcon as wo, FileTextInstUIIcon as Eo, MessagesSquareInstUIIcon as Po, RocketInstUIIcon as Co, FilePenLineInstUIIcon as _o, ClockInstUIIcon as Ao, CalendarInstUIIcon as pt, LockInstUIIcon as gt, CircleAlertInstUIIcon as Te, CircleCheckInstUIIcon as ft, ClockFadingInstUIIcon as ht, CircleDashedInstUIIcon as bt, CornerDownRightInstUIIcon as Do, IconArrowOpenStartLine as Lo, IconArrowOpenEndLine as xo } from "@instructure/ui-icons";
|
|
10
10
|
import { Link as No } from "@instructure/ui-link/v11_7";
|
|
11
11
|
import { Text as ue } from "@instructure/ui-text/v11_7";
|
|
12
12
|
import { View as ie } from "@instructure/ui-view/v11_7";
|
|
@@ -14,19 +14,19 @@ import { Pill as Ro } from "@instructure/ui-pill/v11_7";
|
|
|
14
14
|
import { IconButton as Ft } from "@instructure/ui-buttons/v11_7";
|
|
15
15
|
import { Heading as Oo } from "@instructure/ui-heading/v11_7";
|
|
16
16
|
import { Tooltip as ko } from "@instructure/ui-tooltip/v11_7";
|
|
17
|
-
import { z as
|
|
18
|
-
import { isValid as rt, colorToRGB as st, overlayColors as Fo, alpha as qo, color2hex as
|
|
19
|
-
const $o =
|
|
20
|
-
target:
|
|
21
|
-
field:
|
|
22
|
-
op:
|
|
23
|
-
value:
|
|
17
|
+
import { z as a } from "zod";
|
|
18
|
+
import { isValid as rt, colorToRGB as st, overlayColors as Fo, alpha as qo, color2hex as Pn, contrast as de, darken as zo, lighten as Uo } from "@instructure/ui-color-utils";
|
|
19
|
+
const $o = a.object({
|
|
20
|
+
target: a.enum(["module", "item"]),
|
|
21
|
+
field: a.string(),
|
|
22
|
+
op: a.enum(["eq", "contains", "within"]),
|
|
23
|
+
value: a.union([a.string(), a.boolean(), a.number()])
|
|
24
24
|
}).strict();
|
|
25
25
|
function Bo(e, t) {
|
|
26
26
|
const n = e == null ? void 0 : e[t.target];
|
|
27
27
|
return !n || !Object.prototype.hasOwnProperty.call(n, t.field) ? !1 : n[t.field].includes(t.op);
|
|
28
28
|
}
|
|
29
|
-
const Wo =
|
|
29
|
+
const Wo = a.enum([
|
|
30
30
|
"assignment",
|
|
31
31
|
"quiz",
|
|
32
32
|
"discussion",
|
|
@@ -35,7 +35,7 @@ const Wo = i.enum([
|
|
|
35
35
|
"external_url",
|
|
36
36
|
"external_tool",
|
|
37
37
|
"sub_header"
|
|
38
|
-
]), Go =
|
|
38
|
+
]), Go = a.enum(["not_started", "in_progress", "complete", "incomplete", "missing", "locked"]), jo = a.enum([
|
|
39
39
|
"not_started",
|
|
40
40
|
"in_progress",
|
|
41
41
|
"complete",
|
|
@@ -43,7 +43,7 @@ const Wo = i.enum([
|
|
|
43
43
|
"incomplete",
|
|
44
44
|
"missing_and_incomplete",
|
|
45
45
|
"locked"
|
|
46
|
-
]), Ho =
|
|
46
|
+
]), Ho = a.enum([
|
|
47
47
|
"must_view",
|
|
48
48
|
"must_mark_done",
|
|
49
49
|
"must_contribute",
|
|
@@ -51,74 +51,75 @@ const Wo = i.enum([
|
|
|
51
51
|
"min_score",
|
|
52
52
|
"min_percentage",
|
|
53
53
|
"unknown"
|
|
54
|
-
]), Ko =
|
|
54
|
+
]), Ko = a.object({
|
|
55
55
|
status: jo.optional(),
|
|
56
|
-
requirementsMet:
|
|
57
|
-
requirementCount:
|
|
58
|
-
percentComplete:
|
|
59
|
-
nextDueAt:
|
|
60
|
-
missingCount:
|
|
61
|
-
incompleteCount:
|
|
62
|
-
}),
|
|
63
|
-
itemId:
|
|
56
|
+
requirementsMet: a.number(),
|
|
57
|
+
requirementCount: a.number(),
|
|
58
|
+
percentComplete: a.number().min(0).max(100),
|
|
59
|
+
nextDueAt: a.string().nullish(),
|
|
60
|
+
missingCount: a.number(),
|
|
61
|
+
incompleteCount: a.number()
|
|
62
|
+
}), Cn = a.object({
|
|
63
|
+
itemId: a.string(),
|
|
64
64
|
type: Ho,
|
|
65
|
-
minScore:
|
|
66
|
-
minPercentage:
|
|
67
|
-
}), _n =
|
|
68
|
-
id:
|
|
69
|
-
moduleId:
|
|
70
|
-
title:
|
|
65
|
+
minScore: a.number().nullish(),
|
|
66
|
+
minPercentage: a.number().nullish()
|
|
67
|
+
}), _n = a.object({
|
|
68
|
+
id: a.string(),
|
|
69
|
+
moduleId: a.string(),
|
|
70
|
+
title: a.string(),
|
|
71
71
|
type: Wo,
|
|
72
|
-
position:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
position: a.number(),
|
|
73
|
+
itemNumber: a.number().optional(),
|
|
74
|
+
indent: a.number(),
|
|
75
|
+
published: a.boolean(),
|
|
76
|
+
url: a.string().nullish(),
|
|
77
|
+
newTab: a.boolean().nullish(),
|
|
78
|
+
completionRequirement: Cn.nullish(),
|
|
79
|
+
dueAt: a.string().nullish(),
|
|
79
80
|
status: Go.optional(),
|
|
80
|
-
pointsPossible:
|
|
81
|
-
extensions:
|
|
82
|
-
}), Yo =
|
|
83
|
-
id:
|
|
84
|
-
name:
|
|
85
|
-
}), Qo =
|
|
86
|
-
id:
|
|
87
|
-
name:
|
|
88
|
-
position:
|
|
89
|
-
published:
|
|
90
|
-
itemCount:
|
|
91
|
-
estimatedDurationMinutes:
|
|
92
|
-
items:
|
|
93
|
-
unlockAt:
|
|
94
|
-
prerequisiteModules:
|
|
95
|
-
requirementCount:
|
|
96
|
-
requireSequentialProgress:
|
|
97
|
-
completionRequirements:
|
|
81
|
+
pointsPossible: a.number().nullish(),
|
|
82
|
+
extensions: a.record(a.unknown()).optional()
|
|
83
|
+
}), Yo = a.object({
|
|
84
|
+
id: a.string(),
|
|
85
|
+
name: a.string()
|
|
86
|
+
}), Qo = a.object({
|
|
87
|
+
id: a.string(),
|
|
88
|
+
name: a.string(),
|
|
89
|
+
position: a.number(),
|
|
90
|
+
published: a.boolean(),
|
|
91
|
+
itemCount: a.number(),
|
|
92
|
+
estimatedDurationMinutes: a.number().optional(),
|
|
93
|
+
items: a.array(_n).optional(),
|
|
94
|
+
unlockAt: a.string().nullish(),
|
|
95
|
+
prerequisiteModules: a.array(Yo),
|
|
96
|
+
requirementCount: a.number().nullish(),
|
|
97
|
+
requireSequentialProgress: a.boolean(),
|
|
98
|
+
completionRequirements: a.array(Cn).optional(),
|
|
98
99
|
progress: Ko.optional(),
|
|
99
|
-
collapsed:
|
|
100
|
-
extensions:
|
|
101
|
-
}),
|
|
102
|
-
hasNextPage:
|
|
103
|
-
endCursor:
|
|
100
|
+
collapsed: a.boolean().nullish(),
|
|
101
|
+
extensions: a.record(a.unknown()).optional()
|
|
102
|
+
}), Cl = a.object({
|
|
103
|
+
hasNextPage: a.boolean(),
|
|
104
|
+
endCursor: a.string().nullable()
|
|
104
105
|
}).refine((e) => !e.hasNextPage || e.endCursor !== null, {
|
|
105
106
|
message: 'hasNextPage is true but endCursor is null: there is another page and no cursor to ask for it with, which renders a "Load more" that can never load.',
|
|
106
107
|
path: ["endCursor"]
|
|
107
|
-
}), An =
|
|
108
|
-
hasNextPage:
|
|
109
|
-
endCursor:
|
|
110
|
-
hasPreviousPage:
|
|
111
|
-
startCursor:
|
|
112
|
-
totalCount:
|
|
113
|
-
totalNrOfPages:
|
|
108
|
+
}), An = a.object({
|
|
109
|
+
hasNextPage: a.boolean(),
|
|
110
|
+
endCursor: a.string().nullable(),
|
|
111
|
+
hasPreviousPage: a.boolean(),
|
|
112
|
+
startCursor: a.string().nullable(),
|
|
113
|
+
totalCount: a.number().nullable(),
|
|
114
|
+
totalNrOfPages: a.number().nullable()
|
|
114
115
|
}).refine((e) => !e.hasNextPage || e.endCursor !== null, {
|
|
115
116
|
message: 'hasNextPage is true but endCursor is null: there is another page and no cursor to ask for it with, which renders a "Load more" that can never load.',
|
|
116
117
|
path: ["endCursor"]
|
|
117
|
-
}),
|
|
118
|
-
modules:
|
|
118
|
+
}), _l = a.object({
|
|
119
|
+
modules: a.array(Qo),
|
|
119
120
|
pageInfo: An
|
|
120
|
-
}),
|
|
121
|
-
items:
|
|
121
|
+
}), Al = a.object({
|
|
122
|
+
items: a.array(_n),
|
|
122
123
|
pageInfo: An
|
|
123
124
|
}), Dn = "career.estimatedDurationMinutes";
|
|
124
125
|
function Ln(e) {
|
|
@@ -126,31 +127,31 @@ function Ln(e) {
|
|
|
126
127
|
const t = (n = e.extensions) == null ? void 0 : n[Dn];
|
|
127
128
|
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : t;
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function Dl(e, t) {
|
|
130
131
|
return t == null ? e : { ...e, [Dn]: t };
|
|
131
132
|
}
|
|
132
133
|
const Vo = "modules.suppressItemNumbering";
|
|
133
|
-
function
|
|
134
|
+
function Ll(e) {
|
|
134
135
|
var t;
|
|
135
136
|
return ((t = e.extensions) == null ? void 0 : t[Vo]) === !0;
|
|
136
137
|
}
|
|
137
138
|
const Zo = "organize.newPlacement", Xo = "organize.newModule", Jo = "organize.addedItemCount";
|
|
138
|
-
function
|
|
139
|
+
function xl(e) {
|
|
139
140
|
var t;
|
|
140
141
|
return ((t = e.extensions) == null ? void 0 : t[Zo]) === !0;
|
|
141
142
|
}
|
|
142
|
-
function
|
|
143
|
+
function Nl(e) {
|
|
143
144
|
var t;
|
|
144
145
|
return ((t = e.extensions) == null ? void 0 : t[Xo]) === !0;
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function Rl(e) {
|
|
147
148
|
var n;
|
|
148
149
|
const t = (n = e.extensions) == null ? void 0 : n[Jo];
|
|
149
150
|
return typeof t != "number" || !Number.isInteger(t) || t < 0 ? 0 : t;
|
|
150
151
|
}
|
|
151
152
|
const xn = dt(null), er = () => {
|
|
152
153
|
};
|
|
153
|
-
function
|
|
154
|
+
function Ol({
|
|
154
155
|
host: e,
|
|
155
156
|
onEvent: t,
|
|
156
157
|
children: n
|
|
@@ -183,14 +184,14 @@ const zt = (e) => `offset:${e}`, Ut = (e) => {
|
|
|
183
184
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
184
185
|
};
|
|
185
186
|
function $t(e, t, n) {
|
|
186
|
-
const o = e.length, r = Math.ceil(o / n), s = t.kind === "first" ? 0 : t.kind === "after" ? Ut(t.cursor) : t.kind === "before" ? Math.max(0, Ut(t.cursor) - n) : Math.max(0, o - t.count),
|
|
187
|
+
const o = e.length, r = Math.ceil(o / n), s = t.kind === "first" ? 0 : t.kind === "after" ? Ut(t.cursor) : t.kind === "before" ? Math.max(0, Ut(t.cursor) - n) : Math.max(0, o - t.count), i = e.slice(s, s + n), c = s + i.length, d = c < o, p = s > 0;
|
|
187
188
|
return {
|
|
188
|
-
slice:
|
|
189
|
+
slice: i,
|
|
189
190
|
pageInfo: {
|
|
190
191
|
hasNextPage: d,
|
|
191
192
|
endCursor: d ? zt(c) : null,
|
|
192
|
-
hasPreviousPage:
|
|
193
|
-
startCursor:
|
|
193
|
+
hasPreviousPage: p,
|
|
194
|
+
startCursor: p ? zt(s) : null,
|
|
194
195
|
totalCount: o,
|
|
195
196
|
totalNrOfPages: r
|
|
196
197
|
}
|
|
@@ -251,8 +252,8 @@ const or = /* @__PURE__ */ new Map([
|
|
|
251
252
|
function ir(e) {
|
|
252
253
|
const t = Date.parse(e.start), n = Date.parse(e.end);
|
|
253
254
|
return (o) => {
|
|
254
|
-
var
|
|
255
|
-
const r = (
|
|
255
|
+
var i;
|
|
256
|
+
const r = (i = o.progress) == null ? void 0 : i.nextDueAt;
|
|
256
257
|
if (!r) return !1;
|
|
257
258
|
const s = Date.parse(r);
|
|
258
259
|
return s >= t && s <= n;
|
|
@@ -275,94 +276,99 @@ function ar(e, t) {
|
|
|
275
276
|
}
|
|
276
277
|
throw new Error(`in-memory adapter cannot compile ${e.target}.${e.field} ${e.op}`);
|
|
277
278
|
}
|
|
278
|
-
function
|
|
279
|
-
const n = (
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
function kl(e, t = {}) {
|
|
280
|
+
const n = (s) => e.itemsByModuleId[s] ?? [], o = (s) => {
|
|
281
|
+
let i = 0;
|
|
282
|
+
return n(s).map(
|
|
283
|
+
(c) => c.type === "sub_header" ? c : { ...c, itemNumber: ++i }
|
|
284
|
+
);
|
|
285
|
+
}, r = (s) => {
|
|
286
|
+
if (s !== e.courseId)
|
|
287
|
+
throw new nr(e.courseId, s);
|
|
282
288
|
};
|
|
283
289
|
return {
|
|
284
290
|
capabilities: sr,
|
|
285
291
|
async listModules({
|
|
286
|
-
courseId:
|
|
287
|
-
page:
|
|
288
|
-
pageSize:
|
|
289
|
-
includeItems:
|
|
290
|
-
filter:
|
|
291
|
-
dueRange:
|
|
292
|
-
inlineItemsFirst:
|
|
293
|
-
signal:
|
|
292
|
+
courseId: s,
|
|
293
|
+
page: i = { kind: "first" },
|
|
294
|
+
pageSize: c,
|
|
295
|
+
includeItems: d,
|
|
296
|
+
filter: p,
|
|
297
|
+
dueRange: h,
|
|
298
|
+
inlineItemsFirst: g,
|
|
299
|
+
signal: f
|
|
294
300
|
}) {
|
|
295
|
-
var
|
|
296
|
-
ze(
|
|
297
|
-
const
|
|
298
|
-
return { modules:
|
|
299
|
-
const D = n(
|
|
300
|
-
return { ...
|
|
301
|
-
}), pageInfo:
|
|
301
|
+
var w;
|
|
302
|
+
ze(f), r(s), (w = t.onRequest) == null || w.call(t, "listModules", { operation: "listModules", courseId: s });
|
|
303
|
+
const M = p ? e.modules.filter(ar(p, h)) : e.modules, { slice: x, pageInfo: O } = $t(M, i, c), A = Math.min(g ?? qt, qt);
|
|
304
|
+
return { modules: x.map((N) => {
|
|
305
|
+
const D = n(N.id), E = d && D.length <= A;
|
|
306
|
+
return { ...N, itemCount: D.length, items: E ? D : void 0 };
|
|
307
|
+
}), pageInfo: O };
|
|
302
308
|
},
|
|
303
309
|
async listModuleItems({
|
|
304
|
-
courseId:
|
|
305
|
-
moduleId:
|
|
306
|
-
page:
|
|
307
|
-
pageSize:
|
|
308
|
-
signal:
|
|
310
|
+
courseId: s,
|
|
311
|
+
moduleId: i,
|
|
312
|
+
page: c = { kind: "first" },
|
|
313
|
+
pageSize: d,
|
|
314
|
+
signal: p
|
|
309
315
|
}) {
|
|
310
|
-
var
|
|
311
|
-
ze(
|
|
312
|
-
const { slice:
|
|
313
|
-
return { items:
|
|
316
|
+
var f;
|
|
317
|
+
ze(p), r(s), (f = t.onRequest) == null || f.call(t, "listModuleItems", { operation: "listModuleItems", courseId: s, moduleId: i });
|
|
318
|
+
const { slice: h, pageInfo: g } = $t(o(i), c, d);
|
|
319
|
+
return { items: h, pageInfo: g };
|
|
314
320
|
},
|
|
315
321
|
async setModuleCollapsed({
|
|
316
|
-
courseId:
|
|
317
|
-
moduleId:
|
|
318
|
-
collapsed:
|
|
319
|
-
signal:
|
|
322
|
+
courseId: s,
|
|
323
|
+
moduleId: i,
|
|
324
|
+
collapsed: c,
|
|
325
|
+
signal: d
|
|
320
326
|
}) {
|
|
321
|
-
var
|
|
322
|
-
ze(
|
|
327
|
+
var h;
|
|
328
|
+
ze(d), r(s), (h = t.onRequest) == null || h.call(t, "setModuleCollapsed", {
|
|
323
329
|
operation: "setModuleCollapsed",
|
|
324
|
-
courseId:
|
|
325
|
-
moduleId:
|
|
326
|
-
collapsed:
|
|
330
|
+
courseId: s,
|
|
331
|
+
moduleId: i,
|
|
332
|
+
collapsed: c
|
|
327
333
|
});
|
|
328
|
-
const
|
|
329
|
-
|
|
334
|
+
const p = e.modules.findIndex((g) => g.id === i);
|
|
335
|
+
p !== -1 && (e.modules[p] = { ...e.modules[p], collapsed: c });
|
|
330
336
|
},
|
|
331
337
|
async setAllModulesCollapsed({
|
|
332
|
-
courseId:
|
|
333
|
-
collapsed:
|
|
334
|
-
signal:
|
|
338
|
+
courseId: s,
|
|
339
|
+
collapsed: i,
|
|
340
|
+
signal: c
|
|
335
341
|
}) {
|
|
336
|
-
var
|
|
337
|
-
ze(
|
|
342
|
+
var d;
|
|
343
|
+
ze(c), r(s), (d = t.onRequest) == null || d.call(t, "setAllModulesCollapsed", {
|
|
338
344
|
operation: "setAllModulesCollapsed",
|
|
339
|
-
courseId:
|
|
340
|
-
collapsed:
|
|
341
|
-
}), e.modules = e.modules.map((
|
|
345
|
+
courseId: s,
|
|
346
|
+
collapsed: i
|
|
347
|
+
}), e.modules = e.modules.map((p) => ({ ...p, collapsed: i }));
|
|
342
348
|
}
|
|
343
349
|
};
|
|
344
350
|
}
|
|
345
|
-
const
|
|
346
|
-
all:
|
|
347
|
-
course: (e) => [...
|
|
348
|
-
list: (e, t = {}) => [...
|
|
349
|
-
items: (e, t, n = {}) => [...
|
|
351
|
+
const Ie = ["platform-modules"], Ne = {
|
|
352
|
+
all: Ie,
|
|
353
|
+
course: (e) => [...Ie, e],
|
|
354
|
+
list: (e, t = {}) => [...Ie, e, "list", t],
|
|
355
|
+
items: (e, t, n = {}) => [...Ie, e, "module", t, "items", n]
|
|
350
356
|
};
|
|
351
357
|
function cr(e) {
|
|
352
|
-
return [...
|
|
358
|
+
return [...Ie, e, "list"];
|
|
353
359
|
}
|
|
354
360
|
function We(e, t) {
|
|
355
|
-
return [...
|
|
361
|
+
return [...Ie, e, "module", t, "items"];
|
|
356
362
|
}
|
|
357
|
-
function
|
|
363
|
+
function Fl(e, t, n, o) {
|
|
358
364
|
const r = o ? Ne.items(t, n, o) : We(t, n);
|
|
359
365
|
return e.invalidateQueries({ queryKey: r });
|
|
360
366
|
}
|
|
361
|
-
function
|
|
367
|
+
function ql(e, t, n) {
|
|
362
368
|
const o = n ? Ne.list(t, n) : cr(t);
|
|
363
369
|
return e.invalidateQueries({ queryKey: o });
|
|
364
370
|
}
|
|
365
|
-
function
|
|
371
|
+
function zl(e, t) {
|
|
366
372
|
return e.invalidateQueries({ queryKey: Ne.course(t) });
|
|
367
373
|
}
|
|
368
374
|
const it = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
@@ -370,40 +376,40 @@ function Bt(e, t) {
|
|
|
370
376
|
const n = Object.entries(t ?? {}).filter(([, o]) => o !== void 0);
|
|
371
377
|
return { ...e, ...Object.fromEntries(n) };
|
|
372
378
|
}
|
|
373
|
-
function
|
|
379
|
+
function Ul(e, t = {}) {
|
|
374
380
|
const n = Object.keys(e).map((r) => [
|
|
375
381
|
r,
|
|
376
382
|
Bt(e[r], it(t, r) ? t[r] : void 0)
|
|
377
383
|
]), o = Object.keys(t).filter((r) => !it(e, r)).sort().map((r) => [r, Bt({}, t[r])]);
|
|
378
384
|
return Object.fromEntries([...n, ...o]);
|
|
379
385
|
}
|
|
380
|
-
function
|
|
386
|
+
function ve(e, t) {
|
|
381
387
|
if (!(!it(e, t) || e[t].hidden))
|
|
382
388
|
return e[t];
|
|
383
389
|
}
|
|
384
390
|
function Rn(e) {
|
|
385
|
-
return Object.keys(e).filter((t) =>
|
|
391
|
+
return Object.keys(e).filter((t) => ve(e, t) !== void 0).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
|
|
386
392
|
}
|
|
387
|
-
const lr = "Page %{page} of %{pageCount}", ur = "First page", dr = "Previous page", mr = "Next page",
|
|
393
|
+
const lr = "Page %{page} of %{pageCount}", ur = "First page", dr = "Previous page", mr = "Next page", pr = "Last page", gr = "Page %{page}", fr = "…", hr = "Expand all modules", br = "Collapse all modules", yr = { one: "Loading items in %{count} module…", other: "Loading items in %{count} modules…" }, Ir = "All items loaded", Mr = { one: "%{count} module expanded", other: "%{count} modules expanded" }, Tr = { one: "%{count} module collapsed", other: "%{count} modules collapsed" }, Sr = "Modules failed to load: %{message}", vr = "Loading modules", wr = "No modules available yet", Er = "Modules will appear here once your instructor publishes them. Check back soon or reach out to your instructor for more information.", Pr = "No matching results", Cr = "Adjust or clear your filters to see more items.", _r = "Clear filters", Ar = "Show:", Dr = "All", Lr = "Not started", xr = "In progress", Nr = "Complete", Rr = "Due soon", Or = "Missing", kr = "Locked until %{name} is completed.", Fr = "Locked until %{prerequisites} are completed.", qr = "%{count} prerequisites", zr = "%{label}. %{name}", Ur = "%{label} %{name}", $r = "%{name} progress", Br = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, Wr = "Items failed to load: %{message}", Gr = "Loading items", jr = "Loading…", Hr = "No items.", Kr = "%{name} items pages", Yr = "Page %{page} of %{pageCount} in %{name}", Qr = "(unpublished)", Vr = "Collapse %{name}", Zr = "Expand %{name}", Xr = "Not started", Jr = "In progress", es = "All completed", ts = "%{count} Missing", ns = "%{count} Incomplete", os = "%{missing} & %{incomplete}", rs = "Locked", ss = "Due soon", is = "Not started", as = "In progress", cs = "Completed", ls = "Incomplete", us = "Missing", ds = "Locked", ms = "Due soon", ps = "Assignment", gs = "Quiz", fs = "Discussion", hs = "Page", bs = "File", ys = "External URL", Is = "External tool", Ms = "Text header", Ts = "Item type", Ss = "Due date", vs = "Points", ws = "Requirement", Es = "Estimated duration", Ps = "Publish state", Cs = "View the item", _s = "Submit the assignment", As = "Contribute to the page", Ds = "Mark as done", Ls = "Score at least the minimum", xs = "Score at least %{count}", Ns = "Score at least the minimum percentage", Rs = "Score at least %{count}%", Os = "Complete the requirement", ks = "today, %{time}", Fs = "yesterday, %{time}", qs = "tomorrow, %{time}", zs = "%{date}, %{time}", Us = "%{time} (%{zone})", $s = "Due %{when}", Bs = "Past due %{when}", Ws = "Will unlock on %{when}", Gs = "Unlocked on %{when}", js = "%{duration} to complete", Hs = "%{duration} remaining", Ks = "%{hours}h %{minutes}m", Ys = "%{count}h", Qs = "%{count}m", Vs = { one: "%{count} pt", other: "%{count} pts" }, Zs = "%{met} of %{count}", Xs = { one: "%{met} of %{count} requirement met", other: "%{met} of %{count} requirements met" }, Js = "%{percent}%", ei = { one: "%{completedModules} of %{totalModules} module complete", other: "%{completedModules} of %{totalModules} modules complete" }, ti = "(%{itemsSummary})", ni = { one: "%{completedItems} of %{totalItems} item", other: "%{completedItems} of %{totalItems} items" }, oi = "Module progress", ri = "Module progress pages", si = "Modules %{start}–%{end} of %{total}", ii = "%{name}: %{status}", ai = "%{count}min", ci = "%{count}hr", li = "%{hours}hr %{minutes}min", ui = "Unpublished", di = "Untitled item", mi = "opens in a new window", pi = "Organize with AI", gi = "Organize content into modules", fi = "Module progression", hi = "Set module prerequisites", bi = "Set item requirements per module", yi = "Close", Ii = "What should this do?", Mi = "Place new content only", Ti = "Reorganize the whole course", Si = "This rebuilds every module in the course. Existing modules can be renamed, refilled, or removed.", vi = "Content to organize", wi = "Anything else it should know? (optional)", Ei = "For example: keep the lab work together and put it last.", Pi = "%{used}/%{max}", Ci = "Choose at least one kind of content.", _i = "Organize", Ai = "Cancel", Di = "Start over", Li = "Regenerate", xi = "Apply", Ni = "Try again", Ri = "Organizing your content…", Oi = "Creating your modules…", ki = "Still working. Large courses take longer.", Fi = "Your proposal is ready to review.", qi = "Your modules were created.", zi = "Your content could not be organized: %{message}", Ui = "Your modules could not be created: %{message}", $i = "Proposed modules", Bi = "New module", Wi = { one: "%{count} item added", other: "%{count} items added" }, Gi = "New", ji = "New placement", Hi = { one: "%{count} item was not placed", other: "%{count} items were not placed" }, Ki = "You can still apply this. Anything left out stays where it is.", Yi = { one: "%{count} thing to know", other: "%{count} things to know" }, Qi = "No modules yet", Vi = "Modules you add to this course appear here.", Zi = { one: "%{count} item", other: "%{count} items" }, Xi = "Complete all required items in any order", Ji = "Complete all required items in order", ea = "Complete one required item", ta = "Required", na = "Optional", oa = "Move %{name}", ra = "draggable", sa = "To pick up a module or item, press Space or Enter. Use the arrow keys to move it. Press Space or Enter again to drop it, or press Escape to cancel.", ia = "Picked up %{name}.", aa = "%{name} is at position %{position} of %{count}.", ca = "%{name} is at position %{position} of %{count} in %{module}.", la = "%{name} is not over a drop position.", ua = "%{name} was dropped at position %{position} of %{count}.", da = "%{name} was dropped at position %{position} of %{count} in %{module}.", ma = "%{name} was dropped. It did not move.", pa = "Moving %{name} was canceled.", ga = {
|
|
388
394
|
pageChangedAnnouncement: lr,
|
|
389
395
|
paginationFirstPage: ur,
|
|
390
396
|
paginationPreviousPage: dr,
|
|
391
397
|
paginationNextPage: mr,
|
|
392
|
-
paginationLastPage:
|
|
393
|
-
paginationPageLabel:
|
|
398
|
+
paginationLastPage: pr,
|
|
399
|
+
paginationPageLabel: gr,
|
|
394
400
|
paginationEllipsis: fr,
|
|
395
401
|
expandAllModules: hr,
|
|
396
402
|
collapseAllModules: br,
|
|
397
403
|
expandAllLoadingItems: yr,
|
|
398
|
-
expandAllItemsLoaded:
|
|
399
|
-
modulesExpandedAnnouncement:
|
|
404
|
+
expandAllItemsLoaded: Ir,
|
|
405
|
+
modulesExpandedAnnouncement: Mr,
|
|
400
406
|
modulesCollapsedAnnouncement: Tr,
|
|
401
407
|
modulesLoadErrorAlert: Sr,
|
|
402
|
-
modulesLoadingSpinnerLabel:
|
|
403
|
-
noModulesEmptyStateTitle:
|
|
404
|
-
noModulesEmptyStateDescription:
|
|
405
|
-
filteredEmptyStateTitle:
|
|
406
|
-
filteredEmptyStateDescription:
|
|
408
|
+
modulesLoadingSpinnerLabel: vr,
|
|
409
|
+
noModulesEmptyStateTitle: wr,
|
|
410
|
+
noModulesEmptyStateDescription: Er,
|
|
411
|
+
filteredEmptyStateTitle: Pr,
|
|
412
|
+
filteredEmptyStateDescription: Cr,
|
|
407
413
|
clearFilters: _r,
|
|
408
414
|
filterGroupLabel: Ar,
|
|
409
415
|
filterAll: Dr,
|
|
@@ -443,21 +449,21 @@ const lr = "Page %{page} of %{pageCount}", ur = "First page", dr = "Previous pag
|
|
|
443
449
|
itemStatusMissing: us,
|
|
444
450
|
itemStatusLocked: ds,
|
|
445
451
|
itemStatusDueSoon: ms,
|
|
446
|
-
itemTypeAssignment:
|
|
447
|
-
itemTypeQuiz:
|
|
452
|
+
itemTypeAssignment: ps,
|
|
453
|
+
itemTypeQuiz: gs,
|
|
448
454
|
itemTypeDiscussion: fs,
|
|
449
455
|
itemTypePage: hs,
|
|
450
456
|
itemTypeFile: bs,
|
|
451
457
|
itemTypeExternalUrl: ys,
|
|
452
|
-
itemTypeExternalTool:
|
|
453
|
-
itemTypeSubHeader:
|
|
458
|
+
itemTypeExternalTool: Is,
|
|
459
|
+
itemTypeSubHeader: Ms,
|
|
454
460
|
metaFieldTypeLabel: Ts,
|
|
455
461
|
metaFieldDueAtLabel: Ss,
|
|
456
|
-
metaFieldPointsLabel:
|
|
457
|
-
metaFieldRequirementLabel:
|
|
458
|
-
metaFieldDurationLabel:
|
|
459
|
-
metaFieldPublishStateLabel:
|
|
460
|
-
requirementMustView:
|
|
462
|
+
metaFieldPointsLabel: vs,
|
|
463
|
+
metaFieldRequirementLabel: ws,
|
|
464
|
+
metaFieldDurationLabel: Es,
|
|
465
|
+
metaFieldPublishStateLabel: Ps,
|
|
466
|
+
requirementMustView: Cs,
|
|
461
467
|
requirementMustSubmit: _s,
|
|
462
468
|
requirementMustContribute: As,
|
|
463
469
|
requirementMustMarkDone: Ds,
|
|
@@ -497,21 +503,21 @@ const lr = "Page %{page} of %{pageCount}", ur = "First page", dr = "Previous pag
|
|
|
497
503
|
itemUnpublishedLabel: ui,
|
|
498
504
|
itemUntitled: di,
|
|
499
505
|
opensInNewWindow: mi,
|
|
500
|
-
organizeModulesTrigger:
|
|
501
|
-
organizeModalLabel:
|
|
506
|
+
organizeModulesTrigger: pi,
|
|
507
|
+
organizeModalLabel: gi,
|
|
502
508
|
organizeProgressionLegend: fi,
|
|
503
509
|
organizeSetPrerequisites: hi,
|
|
504
510
|
organizeSetRequirements: bi,
|
|
505
511
|
organizeCloseModal: yi,
|
|
506
|
-
organizeModeLegend:
|
|
507
|
-
organizeModePlaceNew:
|
|
512
|
+
organizeModeLegend: Ii,
|
|
513
|
+
organizeModePlaceNew: Mi,
|
|
508
514
|
organizeModeReorganizeAll: Ti,
|
|
509
515
|
organizeReorganizeWarning: Si,
|
|
510
|
-
organizeContentTypesLegend:
|
|
511
|
-
organizeDirectionLabel:
|
|
512
|
-
organizeDirectionPlaceholder:
|
|
513
|
-
organizeDirectionCount:
|
|
514
|
-
organizeErrorPickAContentType:
|
|
516
|
+
organizeContentTypesLegend: vi,
|
|
517
|
+
organizeDirectionLabel: wi,
|
|
518
|
+
organizeDirectionPlaceholder: Ei,
|
|
519
|
+
organizeDirectionCount: Pi,
|
|
520
|
+
organizeErrorPickAContentType: Ci,
|
|
515
521
|
organizeSubmit: _i,
|
|
516
522
|
organizeCancel: Ai,
|
|
517
523
|
organizeStartOver: Di,
|
|
@@ -540,25 +546,36 @@ const lr = "Page %{page} of %{pageCount}", ur = "First page", dr = "Previous pag
|
|
|
540
546
|
moduleRequirementAllInOrder: Ji,
|
|
541
547
|
moduleRequirementOne: ea,
|
|
542
548
|
itemRequiredTag: ta,
|
|
543
|
-
itemOptionalTag: na
|
|
544
|
-
|
|
549
|
+
itemOptionalTag: na,
|
|
550
|
+
dragHandleLabel: oa,
|
|
551
|
+
dragRoleDescription: ra,
|
|
552
|
+
dragInstructions: sa,
|
|
553
|
+
dragPickedUp: ia,
|
|
554
|
+
dragOverPosition: aa,
|
|
555
|
+
dragOverPositionInModule: ca,
|
|
556
|
+
dragOverNothing: la,
|
|
557
|
+
dragDroppedPosition: ua,
|
|
558
|
+
dragDroppedPositionInModule: da,
|
|
559
|
+
dragDroppedNowhere: ma,
|
|
560
|
+
dragCanceled: pa
|
|
561
|
+
}, fa = /%\{(\w+)\}/g, ha = ga, ae = "en-US", ba = /* @__PURE__ */ new Map(), ya = /* @__PURE__ */ new Map();
|
|
545
562
|
function On(e, t, n) {
|
|
546
563
|
const o = e.get(t);
|
|
547
564
|
if (o) return o;
|
|
548
565
|
const r = n();
|
|
549
566
|
return e.set(t, r), r;
|
|
550
567
|
}
|
|
551
|
-
function
|
|
552
|
-
return n ? e.replace(
|
|
568
|
+
function Ia(e, t, n) {
|
|
569
|
+
return n ? e.replace(fa, (o, r) => {
|
|
553
570
|
if (!Object.prototype.hasOwnProperty.call(n, r)) return o;
|
|
554
571
|
const s = n[r];
|
|
555
|
-
return typeof s == "number" && Number.isFinite(s) ? On(
|
|
572
|
+
return typeof s == "number" && Number.isFinite(s) ? On(ya, t, () => new Intl.NumberFormat(t)).format(s) : String(s);
|
|
556
573
|
}) : e;
|
|
557
574
|
}
|
|
558
|
-
function
|
|
575
|
+
function Ma(e, t, n) {
|
|
559
576
|
const o = n == null ? void 0 : n.count;
|
|
560
577
|
if (typeof o == "number" && Number.isFinite(o)) {
|
|
561
|
-
const r = On(
|
|
578
|
+
const r = On(ba, t, () => new Intl.PluralRules(t)).select(o), s = e[r];
|
|
562
579
|
if (typeof s == "string") return s;
|
|
563
580
|
}
|
|
564
581
|
return typeof e.other == "string" ? e.other : void 0;
|
|
@@ -566,32 +583,32 @@ function la(e, t, n) {
|
|
|
566
583
|
function Wt(e, t, n) {
|
|
567
584
|
if (typeof e == "string") return e;
|
|
568
585
|
if (e !== null && typeof e == "object")
|
|
569
|
-
return
|
|
586
|
+
return Ma(e, t, n);
|
|
570
587
|
}
|
|
571
588
|
const Gt = /* @__PURE__ */ new Set();
|
|
572
|
-
function
|
|
589
|
+
function Ta(e) {
|
|
573
590
|
Gt.has(e) || (Gt.add(e), console.warn(
|
|
574
591
|
`[platform-modules] no translation for "${e}"; it will render as itself. Add it to the catalog passed to ModulesI18nProvider.`
|
|
575
592
|
));
|
|
576
593
|
}
|
|
577
|
-
function
|
|
594
|
+
function Sa(e, t, n, o, r) {
|
|
578
595
|
const s = Wt(e == null ? void 0 : e[t], n, r);
|
|
579
596
|
if (typeof s == "string") return s;
|
|
580
|
-
const
|
|
581
|
-
return typeof
|
|
597
|
+
const i = Wt(ha[t], n, r);
|
|
598
|
+
return typeof i == "string" ? i : (o && Ta(t), t);
|
|
582
599
|
}
|
|
583
600
|
function kn(e, t = ae, n = !1) {
|
|
584
|
-
return (o, r) =>
|
|
601
|
+
return (o, r) => Ia(Sa(e, o, t, n, r), t, r);
|
|
585
602
|
}
|
|
586
|
-
const
|
|
587
|
-
function
|
|
603
|
+
const va = kn(), wa = { t: va, locale: ae }, at = dt(null);
|
|
604
|
+
function $l({
|
|
588
605
|
translations: e,
|
|
589
606
|
locale: t,
|
|
590
607
|
timezone: n,
|
|
591
608
|
warnOnMissingKey: o,
|
|
592
609
|
children: r
|
|
593
610
|
}) {
|
|
594
|
-
const s = Ke(at),
|
|
611
|
+
const s = Ke(at), i = W(() => {
|
|
595
612
|
const c = (s == null ? void 0 : s.translations) === void 0 ? e : { ...s.translations, ...e }, d = t ?? (s == null ? void 0 : s.locale) ?? ae;
|
|
596
613
|
return {
|
|
597
614
|
t: kn(c, d, o),
|
|
@@ -600,13 +617,13 @@ function Dl({
|
|
|
600
617
|
translations: c
|
|
601
618
|
};
|
|
602
619
|
}, [s, e, t, n, o]);
|
|
603
|
-
return /* @__PURE__ */ l(at.Provider, { value:
|
|
620
|
+
return /* @__PURE__ */ l(at.Provider, { value: i, children: r });
|
|
604
621
|
}
|
|
605
622
|
function oe() {
|
|
606
|
-
return Ke(at) ??
|
|
623
|
+
return Ke(at) ?? wa;
|
|
607
624
|
}
|
|
608
625
|
const ct = 864e5, lt = "en-US", jt = /* @__PURE__ */ new Map(), Ht = /* @__PURE__ */ new Map();
|
|
609
|
-
function
|
|
626
|
+
function Ea(e) {
|
|
610
627
|
const t = Ht.get(e);
|
|
611
628
|
if (t) return t;
|
|
612
629
|
const n = new Intl.NumberFormat(e, { useGrouping: !1 });
|
|
@@ -651,7 +668,7 @@ function yt(e, t) {
|
|
|
651
668
|
function Yt(e, t) {
|
|
652
669
|
return new Date(Ge(e, t)).getUTCFullYear();
|
|
653
670
|
}
|
|
654
|
-
function
|
|
671
|
+
function Pa(e, t) {
|
|
655
672
|
var o;
|
|
656
673
|
const n = (o = e.zone) == null ? void 0 : o.formatToParts(t).find((r) => r.type === "timeZoneName");
|
|
657
674
|
return (n == null ? void 0 : n.value) ?? null;
|
|
@@ -664,7 +681,7 @@ function Ge(e, t) {
|
|
|
664
681
|
const n = e.civilDay.formatToParts(t), o = (r) => Fn(n, r);
|
|
665
682
|
return Date.UTC(o("year"), o("month") - 1, o("day"));
|
|
666
683
|
}
|
|
667
|
-
function
|
|
684
|
+
function Ca(e, t, n) {
|
|
668
685
|
return Bn(yt(ae, n), e, t);
|
|
669
686
|
}
|
|
670
687
|
const Qt = {
|
|
@@ -676,7 +693,7 @@ const Qt = {
|
|
|
676
693
|
minute: "numeric",
|
|
677
694
|
second: "numeric"
|
|
678
695
|
}, Vt = /* @__PURE__ */ new Map();
|
|
679
|
-
function
|
|
696
|
+
function _a(e) {
|
|
680
697
|
const t = e || void 0, n = t ?? "", o = Vt.get(n);
|
|
681
698
|
if (o) return o;
|
|
682
699
|
let r;
|
|
@@ -688,7 +705,7 @@ function ba(e) {
|
|
|
688
705
|
return Vt.set(n, r), r;
|
|
689
706
|
}
|
|
690
707
|
function Zt(e, t) {
|
|
691
|
-
const n =
|
|
708
|
+
const n = _a(e).formatToParts(t), o = (s) => Fn(n, s);
|
|
692
709
|
return Date.UTC(
|
|
693
710
|
o("year"),
|
|
694
711
|
o("month") - 1,
|
|
@@ -702,7 +719,7 @@ function Xt(e, t) {
|
|
|
702
719
|
const n = Ge(yt(ae, t), e), o = new Date(n - Zt(t, e));
|
|
703
720
|
return n - Zt(t, o);
|
|
704
721
|
}
|
|
705
|
-
function
|
|
722
|
+
function Aa(e, t, n) {
|
|
706
723
|
const o = Xt(e, n), r = new Date(o + t * ct + ct / 2);
|
|
707
724
|
return {
|
|
708
725
|
start: e.toISOString(),
|
|
@@ -717,7 +734,7 @@ function zn(e) {
|
|
|
717
734
|
}
|
|
718
735
|
function Un(e, t, n) {
|
|
719
736
|
const o = zn(e);
|
|
720
|
-
return o === null || $n(e, t) ? !1 :
|
|
737
|
+
return o === null || $n(e, t) ? !1 : Ca(o, t, n) < qn;
|
|
721
738
|
}
|
|
722
739
|
function $n(e, t) {
|
|
723
740
|
const n = zn(e);
|
|
@@ -726,28 +743,28 @@ function $n(e, t) {
|
|
|
726
743
|
function Bn(e, t, n) {
|
|
727
744
|
return Math.round((Ge(e, t) - Ge(e, n)) / ct);
|
|
728
745
|
}
|
|
729
|
-
function
|
|
746
|
+
function Da(e, t, n, { locale: o = ae, timezone: r } = {}) {
|
|
730
747
|
const s = new Date(t);
|
|
731
748
|
if (Number.isNaN(s.getTime())) return t;
|
|
732
|
-
const
|
|
733
|
-
if (h === 0) return e("dateTimeToday", { time:
|
|
734
|
-
if (h === -1) return e("dateTimeYesterday", { time:
|
|
735
|
-
if (h === 1) return e("dateTimeTomorrow", { time:
|
|
736
|
-
const
|
|
737
|
-
return e("dateTimeWithDate", { date:
|
|
749
|
+
const i = yt(o, r), c = Pa(i, s), d = i.time.format(s), p = c ? e("timeWithZone", { time: d, zone: c }) : d, h = Bn(i, s, n);
|
|
750
|
+
if (h === 0) return e("dateTimeToday", { time: p });
|
|
751
|
+
if (h === -1) return e("dateTimeYesterday", { time: p });
|
|
752
|
+
if (h === 1) return e("dateTimeTomorrow", { time: p });
|
|
753
|
+
const f = Yt(i, s) === Yt(i, n) ? i.day.format(s) : i.dayYear.format(s);
|
|
754
|
+
return e("dateTimeWithDate", { date: f, time: p });
|
|
738
755
|
}
|
|
739
756
|
function Wn(e, t = ae) {
|
|
740
|
-
return !Number.isInteger(e) || e < 1 ? null :
|
|
757
|
+
return !Number.isInteger(e) || e < 1 ? null : Ea(t).format(e);
|
|
741
758
|
}
|
|
742
|
-
function
|
|
759
|
+
function La(e, t, n = ae) {
|
|
743
760
|
if (!e || t === void 0) return null;
|
|
744
761
|
const o = Wn(t, n);
|
|
745
762
|
return o === null ? null : `${e}.${o}`;
|
|
746
763
|
}
|
|
747
|
-
function
|
|
764
|
+
function xa(e, t) {
|
|
748
765
|
return t == null ? null : e("pointsAbbreviated", { count: t });
|
|
749
766
|
}
|
|
750
|
-
function
|
|
767
|
+
function Na(e, t) {
|
|
751
768
|
switch (t.type) {
|
|
752
769
|
case "must_view":
|
|
753
770
|
return e("requirementMustView");
|
|
@@ -765,21 +782,21 @@ function Sa(e, t) {
|
|
|
765
782
|
return e("requirementUnknown");
|
|
766
783
|
}
|
|
767
784
|
}
|
|
768
|
-
function
|
|
785
|
+
function Ra(e, t, n) {
|
|
769
786
|
return e("progressSummary", { met: t, count: n });
|
|
770
787
|
}
|
|
771
|
-
function
|
|
788
|
+
function Bl(e, t, n) {
|
|
772
789
|
return e("progressScreenReaderValue", { met: t, count: n });
|
|
773
790
|
}
|
|
774
|
-
function
|
|
791
|
+
function Oa(e) {
|
|
775
792
|
if (!e) return null;
|
|
776
793
|
const t = e.map((n) => Ln(n)).filter((n) => n !== null);
|
|
777
794
|
return t.length === 0 ? null : t.reduce((n, o) => n + o, 0);
|
|
778
795
|
}
|
|
779
|
-
function
|
|
796
|
+
function Wl(e) {
|
|
780
797
|
if (!e) return null;
|
|
781
798
|
const t = e.filter((n) => n.status !== void 0 && n.status !== "complete");
|
|
782
|
-
return
|
|
799
|
+
return Oa(t);
|
|
783
800
|
}
|
|
784
801
|
function Gn(e) {
|
|
785
802
|
return { hours: Math.floor(e / 60), mins: e % 60 };
|
|
@@ -788,17 +805,17 @@ function jn(e, t) {
|
|
|
788
805
|
const { hours: n, mins: o } = Gn(t);
|
|
789
806
|
return n > 0 && o > 0 ? e("estimatedDurationHoursAndMinutes", { hours: n, minutes: o }) : n > 0 ? e("estimatedDurationHours", { count: n }) : e("estimatedDurationMinutesAbbreviated", { count: o });
|
|
790
807
|
}
|
|
791
|
-
function
|
|
808
|
+
function ka(e, t) {
|
|
792
809
|
return e("estimatedDurationByline", { duration: jn(e, t) });
|
|
793
810
|
}
|
|
794
|
-
function
|
|
811
|
+
function Fa(e, t) {
|
|
795
812
|
return e("remainingDurationByline", { duration: jn(e, t) });
|
|
796
813
|
}
|
|
797
|
-
function
|
|
814
|
+
function qa(e, t) {
|
|
798
815
|
const { hours: n, mins: o } = Gn(t);
|
|
799
816
|
return n > 0 && o > 0 ? e("durationHoursAndMinutes", { hours: n, minutes: o }) : n > 0 ? e("durationHours", { count: n }) : e("durationMinutes", { count: o });
|
|
800
817
|
}
|
|
801
|
-
const
|
|
818
|
+
const za = "all", Ua = qn, $a = {
|
|
802
819
|
all: {
|
|
803
820
|
label: "filterAll",
|
|
804
821
|
order: 10,
|
|
@@ -843,7 +860,7 @@ const _a = "all", Aa = qn, Da = {
|
|
|
843
860
|
target: "module",
|
|
844
861
|
field: "dueWithinDays",
|
|
845
862
|
op: "within",
|
|
846
|
-
value:
|
|
863
|
+
value: Ua
|
|
847
864
|
}
|
|
848
865
|
},
|
|
849
866
|
missing: {
|
|
@@ -856,7 +873,7 @@ const _a = "all", Aa = qn, Da = {
|
|
|
856
873
|
query: { target: "module", field: "moduleStatus", op: "eq", value: "missing" }
|
|
857
874
|
}
|
|
858
875
|
};
|
|
859
|
-
function
|
|
876
|
+
function It(e) {
|
|
860
877
|
return e == null ? void 0 : e.query;
|
|
861
878
|
}
|
|
862
879
|
function Hn(e) {
|
|
@@ -865,32 +882,32 @@ function Hn(e) {
|
|
|
865
882
|
function Jt(e) {
|
|
866
883
|
return e !== void 0 && !Hn(e);
|
|
867
884
|
}
|
|
868
|
-
function
|
|
869
|
-
return e !== void 0 &&
|
|
885
|
+
function Ba(e) {
|
|
886
|
+
return e !== void 0 && It(e) === void 0;
|
|
870
887
|
}
|
|
871
|
-
const
|
|
888
|
+
const Wa = {
|
|
872
889
|
moduleLabel: (e, t, { locale: n }) => Wn(e, n),
|
|
873
|
-
dateTime: (e, t, { t: n, locale: o, timezone: r }) =>
|
|
874
|
-
points: (e, { t }) =>
|
|
875
|
-
progress: (e, t, n, { t: o }) =>
|
|
876
|
-
}, te = { size: "xs", color: "mutedColor" },
|
|
890
|
+
dateTime: (e, t, { t: n, locale: o, timezone: r }) => Da(n, e, t, { locale: o, timezone: r }),
|
|
891
|
+
points: (e, { t }) => xa(t, e),
|
|
892
|
+
progress: (e, t, n, { t: o }) => Ra(o, t, n)
|
|
893
|
+
}, te = { size: "xs", color: "mutedColor" }, Ga = {
|
|
877
894
|
assignment: {
|
|
878
895
|
label: "itemTypeAssignment",
|
|
879
896
|
order: 10,
|
|
880
897
|
icon: /* @__PURE__ */ l(_o, { ...te })
|
|
881
898
|
},
|
|
882
|
-
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ l(
|
|
899
|
+
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ l(Co, { ...te }) },
|
|
883
900
|
discussion: {
|
|
884
901
|
label: "itemTypeDiscussion",
|
|
885
902
|
order: 30,
|
|
886
|
-
icon: /* @__PURE__ */ l(
|
|
903
|
+
icon: /* @__PURE__ */ l(Po, { ...te })
|
|
887
904
|
},
|
|
888
|
-
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ l(
|
|
889
|
-
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ l(
|
|
905
|
+
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ l(Eo, { ...te }) },
|
|
906
|
+
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ l(wo, { ...te }) },
|
|
890
907
|
external_url: {
|
|
891
908
|
label: "itemTypeExternalUrl",
|
|
892
909
|
order: 60,
|
|
893
|
-
icon: /* @__PURE__ */ l(
|
|
910
|
+
icon: /* @__PURE__ */ l(vo, { ...te })
|
|
894
911
|
},
|
|
895
912
|
external_tool: {
|
|
896
913
|
label: "itemTypeExternalTool",
|
|
@@ -898,20 +915,20 @@ const xa = {
|
|
|
898
915
|
icon: /* @__PURE__ */ l(So, { ...te })
|
|
899
916
|
},
|
|
900
917
|
sub_header: { label: "itemTypeSubHeader", order: 80, icon: null }
|
|
901
|
-
},
|
|
918
|
+
}, Gl = "type", ja = { fontSizeMedium: "inherit" }, en = /* @__PURE__ */ l(pt, { ...te });
|
|
902
919
|
function tn({ item: e, today: t }) {
|
|
903
920
|
return e.status !== "complete" && e.status !== "locked" && $n(e.dueAt, t);
|
|
904
921
|
}
|
|
905
|
-
const
|
|
922
|
+
const Ha = {
|
|
906
923
|
type: {
|
|
907
924
|
label: "metaFieldTypeLabel",
|
|
908
925
|
order: 10,
|
|
909
926
|
renderIcon: ({ item: e, config: t }) => {
|
|
910
|
-
const n =
|
|
927
|
+
const n = ve(t.itemTypes, e.type);
|
|
911
928
|
return n ? n.renderIcon ? n.renderIcon({ item: e }) : n.icon : null;
|
|
912
929
|
},
|
|
913
930
|
render: ({ item: e, t, config: n }) => {
|
|
914
|
-
const o =
|
|
931
|
+
const o = ve(n.itemTypes, e.type);
|
|
915
932
|
return o ? t(o.label) : null;
|
|
916
933
|
}
|
|
917
934
|
},
|
|
@@ -923,7 +940,7 @@ const Oa = {
|
|
|
923
940
|
requirement: {
|
|
924
941
|
label: "metaFieldRequirementLabel",
|
|
925
942
|
order: 30,
|
|
926
|
-
render: ({ item: e, t }) => e.completionRequirement ?
|
|
943
|
+
render: ({ item: e, t }) => e.completionRequirement ? Na(t, e.completionRequirement) : null
|
|
927
944
|
},
|
|
928
945
|
dueAt: {
|
|
929
946
|
label: "metaFieldDueAtLabel",
|
|
@@ -933,11 +950,11 @@ const Oa = {
|
|
|
933
950
|
renderIcon: (e) => {
|
|
934
951
|
var n;
|
|
935
952
|
const t = (n = e.config.itemMeta.dueAt) == null ? void 0 : n.icon;
|
|
936
|
-
return t !== en || !tn(e) ? t : /* @__PURE__ */ l(
|
|
953
|
+
return t !== en || !tn(e) ? t : /* @__PURE__ */ l(pt, { ...te, color: "errorColor" });
|
|
937
954
|
},
|
|
938
955
|
render: (e) => {
|
|
939
956
|
const { item: t, today: n, formatters: o } = e;
|
|
940
|
-
return t.dueAt ? tn(e) ? /* @__PURE__ */ l(ue, { color: "danger", themeOverride:
|
|
957
|
+
return t.dueAt ? tn(e) ? /* @__PURE__ */ l(ue, { color: "danger", themeOverride: ja, children: o.pastDueByline(t.dueAt, n) }) : o.dueByline(t.dueAt, n) : null;
|
|
941
958
|
}
|
|
942
959
|
},
|
|
943
960
|
estimatedDuration: {
|
|
@@ -946,7 +963,7 @@ const Oa = {
|
|
|
946
963
|
icon: /* @__PURE__ */ l(Ao, { ...te }),
|
|
947
964
|
render: ({ item: e, t }) => {
|
|
948
965
|
const n = Ln(e);
|
|
949
|
-
return n === null ? null :
|
|
966
|
+
return n === null ? null : qa(t, n);
|
|
950
967
|
}
|
|
951
968
|
},
|
|
952
969
|
unpublished: {
|
|
@@ -954,35 +971,35 @@ const Oa = {
|
|
|
954
971
|
order: 60,
|
|
955
972
|
render: ({ item: e, t }) => e.published ? null : t("itemUnpublishedLabel")
|
|
956
973
|
}
|
|
957
|
-
},
|
|
958
|
-
formatters:
|
|
959
|
-
itemTypes:
|
|
974
|
+
}, Mt = {
|
|
975
|
+
formatters: Wa,
|
|
976
|
+
itemTypes: Ga,
|
|
960
977
|
itemStatuses: {},
|
|
961
|
-
itemMeta:
|
|
962
|
-
filters:
|
|
978
|
+
itemMeta: Ha,
|
|
979
|
+
filters: $a,
|
|
963
980
|
moduleActions: {},
|
|
964
981
|
itemActions: {},
|
|
965
982
|
navigation: {},
|
|
966
983
|
permissions: {},
|
|
967
984
|
notify: void 0
|
|
968
985
|
};
|
|
969
|
-
Object.freeze(
|
|
970
|
-
for (const e of Object.values(
|
|
986
|
+
Object.freeze(Mt);
|
|
987
|
+
for (const e of Object.values(Mt)) {
|
|
971
988
|
Object.freeze(e);
|
|
972
989
|
for (const t of Object.values(e ?? {})) Object.freeze(t);
|
|
973
990
|
}
|
|
974
|
-
function
|
|
991
|
+
function Ka(e, t) {
|
|
975
992
|
return Rn(e).filter((n) => {
|
|
976
993
|
if (Hn(n)) return !1;
|
|
977
|
-
const o =
|
|
994
|
+
const o = It(n);
|
|
978
995
|
return o === void 0 ? !0 : !Bo(t, o);
|
|
979
996
|
}).map((n) => n.key);
|
|
980
997
|
}
|
|
981
998
|
function nn(e) {
|
|
982
999
|
return `[platform-modules] the adapter cannot serve filter(s): ${e.join(", ")}. Give the entry a query the adapter's capabilities declare, or mark it unfiltered.`;
|
|
983
1000
|
}
|
|
984
|
-
function
|
|
985
|
-
const n =
|
|
1001
|
+
function Ya(e, t) {
|
|
1002
|
+
const n = Ka(e, t);
|
|
986
1003
|
if (n.length === 0) return e;
|
|
987
1004
|
if (process.env.NODE_ENV !== "production")
|
|
988
1005
|
throw new Error(nn(n));
|
|
@@ -991,114 +1008,114 @@ function Fa(e, t) {
|
|
|
991
1008
|
return { ...e, ...o };
|
|
992
1009
|
}
|
|
993
1010
|
const Kn = dt(null);
|
|
994
|
-
function
|
|
1011
|
+
function jl({ value: e, children: t }) {
|
|
995
1012
|
return /* @__PURE__ */ l(Kn.Provider, { value: e, children: t });
|
|
996
1013
|
}
|
|
997
1014
|
function Ye() {
|
|
998
|
-
return Ke(Kn) ??
|
|
1015
|
+
return Ke(Kn) ?? Mt;
|
|
999
1016
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return
|
|
1017
|
+
function Hl(e) {
|
|
1018
|
+
return ve(Ye().itemMeta, e) !== void 0;
|
|
1002
1019
|
}
|
|
1003
|
-
const Re =
|
|
1004
|
-
label:
|
|
1005
|
-
order:
|
|
1006
|
-
hidden:
|
|
1020
|
+
const Re = a.object({
|
|
1021
|
+
label: a.string(),
|
|
1022
|
+
order: a.number(),
|
|
1023
|
+
hidden: a.boolean().optional()
|
|
1007
1024
|
});
|
|
1008
1025
|
function ye(e) {
|
|
1009
|
-
return
|
|
1026
|
+
return a.record(a.string(), e);
|
|
1010
1027
|
}
|
|
1011
|
-
const
|
|
1028
|
+
const Qa = ye(Re.strict()), Tt = (e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "bigint" || typeof e == "boolean" || mt(e) || Array.isArray(e) && e.every(Tt), Yn = (e) => {
|
|
1012
1029
|
var t;
|
|
1013
1030
|
return e == null || typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
|
|
1014
|
-
},
|
|
1015
|
-
icon:
|
|
1016
|
-
renderIcon:
|
|
1031
|
+
}, Va = Re.extend({
|
|
1032
|
+
icon: a.custom(Tt, { message: "icon must be a ReactNode" }),
|
|
1033
|
+
renderIcon: a.custom(Yn, {
|
|
1017
1034
|
message: "renderIcon must be a function of the item, not a React component"
|
|
1018
1035
|
})
|
|
1019
1036
|
}).strict(), Qn = (e) => {
|
|
1020
1037
|
var t;
|
|
1021
1038
|
return typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
|
|
1022
1039
|
}, on = (e) => e == null || Qn(e), rn = Re.extend({
|
|
1023
|
-
onSelect:
|
|
1040
|
+
onSelect: a.custom(Qn, {
|
|
1024
1041
|
message: "onSelect must be a function taking an ActionContext"
|
|
1025
1042
|
}),
|
|
1026
|
-
visible:
|
|
1043
|
+
visible: a.custom(on, {
|
|
1027
1044
|
message: "visible must be a function taking an ActionContext, not a React component"
|
|
1028
1045
|
}),
|
|
1029
|
-
renderModal:
|
|
1046
|
+
renderModal: a.custom(on, {
|
|
1030
1047
|
message: "renderModal must be a function taking an ActionContext, not a React component"
|
|
1031
1048
|
})
|
|
1032
1049
|
}).strict();
|
|
1033
1050
|
function Ue() {
|
|
1034
|
-
return
|
|
1051
|
+
return a.custom((e) => typeof e == "function", {
|
|
1035
1052
|
message: "Expected a function"
|
|
1036
1053
|
});
|
|
1037
1054
|
}
|
|
1038
|
-
const
|
|
1039
|
-
render:
|
|
1055
|
+
const Za = Re.extend({
|
|
1056
|
+
render: a.custom((e) => typeof e == "function", {
|
|
1040
1057
|
message: "render must be a function taking a MetaFieldContext"
|
|
1041
1058
|
}),
|
|
1042
|
-
icon:
|
|
1043
|
-
renderIcon:
|
|
1059
|
+
icon: a.custom(Tt, { message: "icon must be a ReactNode" }),
|
|
1060
|
+
renderIcon: a.custom(Yn, {
|
|
1044
1061
|
message: "renderIcon must be a function of the field context, not a React component"
|
|
1045
1062
|
})
|
|
1046
|
-
}).strict(),
|
|
1047
|
-
predicate:
|
|
1063
|
+
}).strict(), Xa = Re.extend({
|
|
1064
|
+
predicate: a.custom((e) => typeof e == "function", {
|
|
1048
1065
|
message: "predicate must be a function of the module and a FilterContext"
|
|
1049
1066
|
}),
|
|
1050
1067
|
query: $o.optional(),
|
|
1051
|
-
unfiltered:
|
|
1052
|
-
}).strict(), Le = () =>
|
|
1068
|
+
unfiltered: a.boolean().optional()
|
|
1069
|
+
}).strict(), Le = () => a.custom((e) => typeof e == "function", { message: "Expected a function" }).optional(), Ja = a.object({
|
|
1053
1070
|
getItemHref: Le(),
|
|
1054
1071
|
getItemEditHref: Le(),
|
|
1055
1072
|
getModuleHref: Le(),
|
|
1056
1073
|
onItemClick: Le()
|
|
1057
|
-
}).strict(),
|
|
1058
|
-
createModule:
|
|
1059
|
-
updateModule:
|
|
1060
|
-
deleteModule:
|
|
1061
|
-
reorderModules:
|
|
1062
|
-
setModulesPublished:
|
|
1063
|
-
createModuleItem:
|
|
1064
|
-
updateModuleItem:
|
|
1065
|
-
deleteModuleItem:
|
|
1066
|
-
reorderModuleItems:
|
|
1067
|
-
}).strict(),
|
|
1068
|
-
formatters:
|
|
1074
|
+
}).strict(), ec = a.object({
|
|
1075
|
+
createModule: a.boolean().optional(),
|
|
1076
|
+
updateModule: a.boolean().optional(),
|
|
1077
|
+
deleteModule: a.boolean().optional(),
|
|
1078
|
+
reorderModules: a.boolean().optional(),
|
|
1079
|
+
setModulesPublished: a.boolean().optional(),
|
|
1080
|
+
createModuleItem: a.boolean().optional(),
|
|
1081
|
+
updateModuleItem: a.boolean().optional(),
|
|
1082
|
+
deleteModuleItem: a.boolean().optional(),
|
|
1083
|
+
reorderModuleItems: a.boolean().optional()
|
|
1084
|
+
}).strict(), Kl = a.object({
|
|
1085
|
+
formatters: a.object({
|
|
1069
1086
|
moduleLabel: Ue(),
|
|
1070
1087
|
dateTime: Ue(),
|
|
1071
1088
|
points: Ue(),
|
|
1072
1089
|
progress: Ue()
|
|
1073
1090
|
}).strict(),
|
|
1074
|
-
itemTypes: ye(
|
|
1075
|
-
itemStatuses:
|
|
1076
|
-
itemMeta: ye(
|
|
1077
|
-
filters: ye(
|
|
1091
|
+
itemTypes: ye(Va),
|
|
1092
|
+
itemStatuses: Qa,
|
|
1093
|
+
itemMeta: ye(Za),
|
|
1094
|
+
filters: ye(Xa),
|
|
1078
1095
|
moduleActions: ye(rn),
|
|
1079
1096
|
itemActions: ye(rn),
|
|
1080
|
-
navigation:
|
|
1081
|
-
permissions:
|
|
1097
|
+
navigation: Ja,
|
|
1098
|
+
permissions: ec,
|
|
1082
1099
|
notify: Le()
|
|
1083
1100
|
});
|
|
1084
1101
|
function Vn() {
|
|
1085
1102
|
const { formatters: e } = Ye(), { t, locale: n, timezone: o } = oe();
|
|
1086
1103
|
return W(() => {
|
|
1087
|
-
const r = { t, locale: n, timezone: o }, s = (
|
|
1104
|
+
const r = { t, locale: n, timezone: o }, s = (i, c) => e.dateTime(i, c, r);
|
|
1088
1105
|
return {
|
|
1089
|
-
moduleLabel: (
|
|
1090
|
-
dueByline: (
|
|
1091
|
-
pastDueByline: (
|
|
1092
|
-
unlockByline: (
|
|
1093
|
-
unlockedByline: (
|
|
1094
|
-
estimatedDurationByline: (
|
|
1095
|
-
remainingDurationByline: (
|
|
1096
|
-
points: (
|
|
1097
|
-
progress: (
|
|
1106
|
+
moduleLabel: (i, c) => e.moduleLabel(i, c, r) || null,
|
|
1107
|
+
dueByline: (i, c) => t("dueByline", { when: s(i, c) }),
|
|
1108
|
+
pastDueByline: (i, c) => t("pastDueByline", { when: s(i, c) }),
|
|
1109
|
+
unlockByline: (i, c) => t("unlockByline", { when: s(i, c) }),
|
|
1110
|
+
unlockedByline: (i, c) => t("unlockedByline", { when: s(i, c) }),
|
|
1111
|
+
estimatedDurationByline: (i) => ka(t, i),
|
|
1112
|
+
remainingDurationByline: (i) => Fa(t, i),
|
|
1113
|
+
points: (i) => e.points(i, r),
|
|
1114
|
+
progress: (i, c, d) => e.progress(i, c, d, r)
|
|
1098
1115
|
};
|
|
1099
1116
|
}, [e, t, n, o]);
|
|
1100
1117
|
}
|
|
1101
|
-
const St = 10,
|
|
1118
|
+
const St = 10, tc = 4, nc = 20, Zn = 100, oc = 4, rc = 4, vt = 5 * 60 * 1e3, Xn = 20;
|
|
1102
1119
|
function Jn(e) {
|
|
1103
1120
|
const {
|
|
1104
1121
|
courseId: t,
|
|
@@ -1106,46 +1123,46 @@ function Jn(e) {
|
|
|
1106
1123
|
page: o,
|
|
1107
1124
|
pageSize: r,
|
|
1108
1125
|
includeItems: s,
|
|
1109
|
-
filter:
|
|
1126
|
+
filter: i,
|
|
1110
1127
|
dueRange: c,
|
|
1111
1128
|
inlineItemsFirst: d,
|
|
1112
|
-
inlineFirst:
|
|
1129
|
+
inlineFirst: p,
|
|
1113
1130
|
view: h,
|
|
1114
|
-
staleTime:
|
|
1115
|
-
enabled:
|
|
1131
|
+
staleTime: g,
|
|
1132
|
+
enabled: f
|
|
1116
1133
|
} = e;
|
|
1117
1134
|
return {
|
|
1118
1135
|
// `inlineItemsFirst`/`inlineFirst` are deliberately out of the key: derived from this list.
|
|
1119
|
-
queryKey: Ne.list(t, { view: h, pageSize: r, includeItems: s, filter:
|
|
1120
|
-
queryFn: ({ signal:
|
|
1136
|
+
queryKey: Ne.list(t, { view: h, pageSize: r, includeItems: s, filter: i, page: o }),
|
|
1137
|
+
queryFn: ({ signal: M }) => n.listModules({
|
|
1121
1138
|
courseId: t,
|
|
1122
1139
|
page: o,
|
|
1123
1140
|
pageSize: r,
|
|
1124
1141
|
includeItems: s,
|
|
1125
|
-
filter:
|
|
1142
|
+
filter: i,
|
|
1126
1143
|
dueRange: c,
|
|
1127
1144
|
inlineItemsFirst: d,
|
|
1128
|
-
inlineFirst:
|
|
1129
|
-
signal:
|
|
1145
|
+
inlineFirst: p,
|
|
1146
|
+
signal: M
|
|
1130
1147
|
}),
|
|
1131
|
-
enabled:
|
|
1132
|
-
staleTime:
|
|
1148
|
+
enabled: f,
|
|
1149
|
+
staleTime: g,
|
|
1133
1150
|
refetchOnWindowFocus: !1
|
|
1134
1151
|
};
|
|
1135
1152
|
}
|
|
1136
|
-
function
|
|
1137
|
-
const { courseId: t, moduleId: n, adapter: o, page: r, pageSize: s, view:
|
|
1153
|
+
function sc(e) {
|
|
1154
|
+
const { courseId: t, moduleId: n, adapter: o, page: r, pageSize: s, view: i, staleTime: c, enabled: d, limit: p } = e;
|
|
1138
1155
|
return {
|
|
1139
|
-
queryKey: Ne.items(t, n, { view:
|
|
1156
|
+
queryKey: Ne.items(t, n, { view: i, pageSize: s, page: r }),
|
|
1140
1157
|
queryFn: ({ signal: h }) => {
|
|
1141
|
-
const
|
|
1142
|
-
return
|
|
1158
|
+
const g = () => o.listModuleItems({ courseId: t, moduleId: n, page: r, pageSize: s, signal: h });
|
|
1159
|
+
return p ? p(() => {
|
|
1143
1160
|
if (h.aborted)
|
|
1144
1161
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
1145
|
-
return
|
|
1146
|
-
}) :
|
|
1162
|
+
return g();
|
|
1163
|
+
}) : g();
|
|
1147
1164
|
},
|
|
1148
|
-
placeholderData:
|
|
1165
|
+
placeholderData: Mn,
|
|
1149
1166
|
enabled: d,
|
|
1150
1167
|
staleTime: c,
|
|
1151
1168
|
refetchOnWindowFocus: !1
|
|
@@ -1155,7 +1172,7 @@ const je = { request: { kind: "first" }, page: 1 };
|
|
|
1155
1172
|
function xe(e, t) {
|
|
1156
1173
|
return e === null ? 1 : Math.max(1, Math.ceil(e / t));
|
|
1157
1174
|
}
|
|
1158
|
-
function
|
|
1175
|
+
function ic(e, t, n, o) {
|
|
1159
1176
|
switch (e) {
|
|
1160
1177
|
case "first":
|
|
1161
1178
|
return je;
|
|
@@ -1172,7 +1189,7 @@ function Qa(e, t, n, o) {
|
|
|
1172
1189
|
}
|
|
1173
1190
|
}
|
|
1174
1191
|
}
|
|
1175
|
-
const tt = { kind: "first" },
|
|
1192
|
+
const tt = { kind: "first" }, ac = {
|
|
1176
1193
|
hasNextPage: !1,
|
|
1177
1194
|
endCursor: null,
|
|
1178
1195
|
hasPreviousPage: !1,
|
|
@@ -1180,7 +1197,7 @@ const tt = { kind: "first" }, Va = {
|
|
|
1180
1197
|
totalCount: null,
|
|
1181
1198
|
totalNrOfPages: null
|
|
1182
1199
|
};
|
|
1183
|
-
function
|
|
1200
|
+
function cc(e) {
|
|
1184
1201
|
var Q, se, ce;
|
|
1185
1202
|
const {
|
|
1186
1203
|
courseId: t,
|
|
@@ -1188,66 +1205,66 @@ function Za(e) {
|
|
|
1188
1205
|
pageSize: o = St,
|
|
1189
1206
|
includeItems: r = !1,
|
|
1190
1207
|
filter: s,
|
|
1191
|
-
dueRange:
|
|
1208
|
+
dueRange: i,
|
|
1192
1209
|
inlineItemsFirst: c,
|
|
1193
1210
|
inlineFirst: d,
|
|
1194
|
-
view:
|
|
1195
|
-
staleTime: h =
|
|
1196
|
-
enabled:
|
|
1197
|
-
} = e, [
|
|
1211
|
+
view: p,
|
|
1212
|
+
staleTime: h = vt,
|
|
1213
|
+
enabled: g = !0
|
|
1214
|
+
} = e, [f, M] = ne(tt), [x, O] = ne(1), A = JSON.stringify([t, p, o, r, s]), S = _(A);
|
|
1198
1215
|
me(() => {
|
|
1199
|
-
|
|
1216
|
+
S.current !== A && (S.current = A, M(tt), O(1));
|
|
1200
1217
|
}, [A]);
|
|
1201
|
-
const
|
|
1218
|
+
const w = Tn({
|
|
1202
1219
|
...Jn({
|
|
1203
1220
|
courseId: t,
|
|
1204
1221
|
adapter: n,
|
|
1205
|
-
page:
|
|
1222
|
+
page: f,
|
|
1206
1223
|
pageSize: o,
|
|
1207
1224
|
includeItems: r,
|
|
1208
1225
|
filter: s,
|
|
1209
|
-
dueRange:
|
|
1226
|
+
dueRange: i,
|
|
1210
1227
|
inlineItemsFirst: c,
|
|
1211
1228
|
inlineFirst: d,
|
|
1212
|
-
view:
|
|
1229
|
+
view: p,
|
|
1213
1230
|
staleTime: h,
|
|
1214
|
-
enabled:
|
|
1231
|
+
enabled: g
|
|
1215
1232
|
}),
|
|
1216
1233
|
// `useItemsMode` shares `modulesQueryOptions`, and `inlineFirst` is out of that key.
|
|
1217
|
-
placeholderData:
|
|
1218
|
-
}),
|
|
1219
|
-
((Q =
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1224
|
-
}, []), j =
|
|
1225
|
-
!j || H === null || (
|
|
1226
|
-
}, [j, H,
|
|
1227
|
-
!k ||
|
|
1228
|
-
}, [k,
|
|
1229
|
-
const V =
|
|
1230
|
-
|
|
1234
|
+
placeholderData: Mn
|
|
1235
|
+
}), N = _(null);
|
|
1236
|
+
((Q = w.data) == null ? void 0 : Q.pageInfo.totalCount) != null && (N.current = w.data.pageInfo.totalCount);
|
|
1237
|
+
const D = _(1);
|
|
1238
|
+
w.isPlaceholderData || (D.current = x);
|
|
1239
|
+
const E = D.current, v = ((se = w.data) == null ? void 0 : se.pageInfo) ?? ac, T = ((ce = w.data) == null ? void 0 : ce.modules) ?? [], L = v.totalCount, K = xe(L, o), G = R(() => {
|
|
1240
|
+
M(tt), O(1);
|
|
1241
|
+
}, []), j = v.hasPreviousPage, H = v.startCursor, I = R(() => {
|
|
1242
|
+
!j || H === null || (M({ kind: "before", cursor: H }), O(E - 1));
|
|
1243
|
+
}, [j, H, E]), k = v.hasNextPage, C = v.endCursor, re = R(() => {
|
|
1244
|
+
!k || C === null || (M({ kind: "after", cursor: C }), O(E + 1));
|
|
1245
|
+
}, [k, C, E]), $ = R(() => {
|
|
1246
|
+
const V = N.current, Z = V !== null && V > 0 && V % o || o;
|
|
1247
|
+
M({ kind: "last", count: Z }), O(K);
|
|
1231
1248
|
}, [o, K]);
|
|
1232
1249
|
return {
|
|
1233
|
-
modules:
|
|
1234
|
-
pageInfo:
|
|
1235
|
-
page:
|
|
1250
|
+
modules: T,
|
|
1251
|
+
pageInfo: v,
|
|
1252
|
+
page: E,
|
|
1236
1253
|
pageCount: K,
|
|
1237
1254
|
hasNextPage: k,
|
|
1238
1255
|
hasPreviousPage: j,
|
|
1239
1256
|
goToFirstPage: G,
|
|
1240
|
-
goToPreviousPage:
|
|
1257
|
+
goToPreviousPage: I,
|
|
1241
1258
|
goToNextPage: re,
|
|
1242
1259
|
goToLastPage: $,
|
|
1243
|
-
isLoading:
|
|
1244
|
-
isPending:
|
|
1245
|
-
isPlaceholderData:
|
|
1246
|
-
error:
|
|
1260
|
+
isLoading: w.isLoading,
|
|
1261
|
+
isPending: w.isPending,
|
|
1262
|
+
isPlaceholderData: w.isPlaceholderData,
|
|
1263
|
+
error: w.error
|
|
1247
1264
|
};
|
|
1248
1265
|
}
|
|
1249
|
-
const
|
|
1250
|
-
function
|
|
1266
|
+
const lc = { kind: "first" };
|
|
1267
|
+
function uc(e, t, n = Nn) {
|
|
1251
1268
|
if (e.pageInfo.hasNextPage) return "onDemand";
|
|
1252
1269
|
let o = 0, r = 0;
|
|
1253
1270
|
for (const s of e.modules) {
|
|
@@ -1256,33 +1273,33 @@ function Ja(e, t, n = Nn) {
|
|
|
1256
1273
|
}
|
|
1257
1274
|
return o > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(r, 1) <= n ? "inline" : "onDemand";
|
|
1258
1275
|
}
|
|
1259
|
-
function
|
|
1276
|
+
function dc(e) {
|
|
1260
1277
|
const {
|
|
1261
1278
|
courseId: t,
|
|
1262
1279
|
adapter: n,
|
|
1263
1280
|
mode: o = "auto",
|
|
1264
1281
|
inlineThreshold: r = Zn,
|
|
1265
1282
|
nodeBudget: s = n.inlineNodeBudget ?? Nn,
|
|
1266
|
-
pageSize:
|
|
1283
|
+
pageSize: i = St,
|
|
1267
1284
|
filter: c,
|
|
1268
1285
|
dueRange: d,
|
|
1269
|
-
view:
|
|
1270
|
-
staleTime: h =
|
|
1271
|
-
} = e,
|
|
1286
|
+
view: p,
|
|
1287
|
+
staleTime: h = vt
|
|
1288
|
+
} = e, g = o === "auto", f = Tn(
|
|
1272
1289
|
Jn({
|
|
1273
1290
|
courseId: t,
|
|
1274
1291
|
adapter: n,
|
|
1275
|
-
page:
|
|
1276
|
-
pageSize:
|
|
1292
|
+
page: lc,
|
|
1293
|
+
pageSize: i,
|
|
1277
1294
|
includeItems: !1,
|
|
1278
1295
|
filter: c,
|
|
1279
1296
|
dueRange: d,
|
|
1280
|
-
view:
|
|
1297
|
+
view: p,
|
|
1281
1298
|
staleTime: h,
|
|
1282
|
-
enabled:
|
|
1299
|
+
enabled: g
|
|
1283
1300
|
})
|
|
1284
1301
|
);
|
|
1285
|
-
if (!
|
|
1302
|
+
if (!g)
|
|
1286
1303
|
return {
|
|
1287
1304
|
resolvedMode: o,
|
|
1288
1305
|
isResolving: !1,
|
|
@@ -1290,34 +1307,34 @@ function ec(e) {
|
|
|
1290
1307
|
error: null,
|
|
1291
1308
|
inlineShape: null
|
|
1292
1309
|
};
|
|
1293
|
-
if (
|
|
1310
|
+
if (f.error)
|
|
1294
1311
|
return {
|
|
1295
1312
|
resolvedMode: "onDemand",
|
|
1296
1313
|
isResolving: !1,
|
|
1297
1314
|
probed: !0,
|
|
1298
|
-
error:
|
|
1315
|
+
error: f.error,
|
|
1299
1316
|
inlineShape: null
|
|
1300
1317
|
};
|
|
1301
|
-
const
|
|
1302
|
-
return
|
|
1303
|
-
resolvedMode:
|
|
1318
|
+
const M = f.data;
|
|
1319
|
+
return M ? {
|
|
1320
|
+
resolvedMode: uc(M, r, s),
|
|
1304
1321
|
isResolving: !1,
|
|
1305
1322
|
probed: !0,
|
|
1306
1323
|
error: null,
|
|
1307
|
-
inlineShape:
|
|
1324
|
+
inlineShape: mc(M)
|
|
1308
1325
|
} : { resolvedMode: null, isResolving: !0, probed: !0, error: null, inlineShape: null };
|
|
1309
1326
|
}
|
|
1310
|
-
function
|
|
1327
|
+
function mc(e) {
|
|
1311
1328
|
let t = 1;
|
|
1312
1329
|
for (const n of e.modules)
|
|
1313
1330
|
n.itemCount > t && (t = n.itemCount);
|
|
1314
1331
|
return { moduleCount: Math.max(e.modules.length, 1), maxItemCount: t };
|
|
1315
1332
|
}
|
|
1316
|
-
const
|
|
1333
|
+
const pc = `(max-width: ${To.mobileOnly.maxWidth})`;
|
|
1317
1334
|
function sn() {
|
|
1318
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(
|
|
1335
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(pc);
|
|
1319
1336
|
}
|
|
1320
|
-
function
|
|
1337
|
+
function gc() {
|
|
1321
1338
|
const [e, t] = ne(() => {
|
|
1322
1339
|
var n;
|
|
1323
1340
|
return ((n = sn()) == null ? void 0 : n.matches) ?? !1;
|
|
@@ -1330,75 +1347,75 @@ function oc() {
|
|
|
1330
1347
|
return n.addEventListener("change", o), () => n.removeEventListener("change", o);
|
|
1331
1348
|
}, []), e;
|
|
1332
1349
|
}
|
|
1333
|
-
const nt = "\0",
|
|
1334
|
-
function
|
|
1350
|
+
const nt = "\0", fc = /* @__PURE__ */ new Map();
|
|
1351
|
+
function hc(e, t, {
|
|
1335
1352
|
pageSize: n,
|
|
1336
1353
|
retainCollapsedLimit: o = Xn,
|
|
1337
1354
|
partition: r = ""
|
|
1338
1355
|
}) {
|
|
1339
|
-
const s = Sn(),
|
|
1356
|
+
const s = Sn(), i = _(/* @__PURE__ */ new Map()), c = _(/* @__PURE__ */ new Map()), d = `${n}${nt}${r}`, p = _(d), [h, g] = ne(fc), f = e.join(nt), M = W(() => f === "" ? [] : f.split(nt), [f]);
|
|
1340
1357
|
me(() => {
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1358
|
+
const S = i.current, w = c.current;
|
|
1359
|
+
p.current !== d && (w.clear(), p.current = d);
|
|
1360
|
+
const N = () => {
|
|
1361
|
+
g((T) => {
|
|
1345
1362
|
const L = /* @__PURE__ */ new Map();
|
|
1346
|
-
let K =
|
|
1347
|
-
for (const [G, j] of
|
|
1348
|
-
const H = j.getCurrentResult(),
|
|
1349
|
-
if (
|
|
1350
|
-
L.set(G,
|
|
1363
|
+
let K = T.size !== S.size;
|
|
1364
|
+
for (const [G, j] of S) {
|
|
1365
|
+
const H = j.getCurrentResult(), I = w.get(G), k = I ? H.isPlaceholderData ? I.shownPage : I.page : 1, C = T.get(G);
|
|
1366
|
+
if (C && C.result === H && C.page === k) {
|
|
1367
|
+
L.set(G, C);
|
|
1351
1368
|
continue;
|
|
1352
1369
|
}
|
|
1353
1370
|
L.set(G, { result: H, page: k }), K = !0;
|
|
1354
1371
|
}
|
|
1355
|
-
return K ? L :
|
|
1372
|
+
return K ? L : T;
|
|
1356
1373
|
});
|
|
1357
|
-
},
|
|
1358
|
-
for (const
|
|
1359
|
-
if (
|
|
1374
|
+
}, D = (T) => (w.get(T) ?? je).request, E = new Set(M);
|
|
1375
|
+
for (const T of M) {
|
|
1376
|
+
if (S.has(T)) continue;
|
|
1360
1377
|
const L = new yo(
|
|
1361
1378
|
s,
|
|
1362
|
-
t(
|
|
1379
|
+
t(T, !0, D(T))
|
|
1363
1380
|
);
|
|
1364
|
-
|
|
1381
|
+
S.set(T, L), L.subscribe(N);
|
|
1365
1382
|
}
|
|
1366
|
-
for (const [
|
|
1367
|
-
L.setOptions(t(
|
|
1368
|
-
for (const
|
|
1369
|
-
const L =
|
|
1370
|
-
L && (
|
|
1383
|
+
for (const [T, L] of S)
|
|
1384
|
+
L.setOptions(t(T, E.has(T), D(T)));
|
|
1385
|
+
for (const T of M) {
|
|
1386
|
+
const L = S.get(T);
|
|
1387
|
+
L && (S.delete(T), S.set(T, L));
|
|
1371
1388
|
}
|
|
1372
|
-
let
|
|
1373
|
-
if (
|
|
1374
|
-
for (const [
|
|
1375
|
-
if (
|
|
1376
|
-
|
|
1389
|
+
let v = S.size - E.size;
|
|
1390
|
+
if (v > o)
|
|
1391
|
+
for (const [T, L] of S) {
|
|
1392
|
+
if (v <= o) break;
|
|
1393
|
+
E.has(T) || (L.destroy(), S.delete(T), w.delete(T), v -= 1);
|
|
1377
1394
|
}
|
|
1378
|
-
|
|
1379
|
-
}, [s, t,
|
|
1380
|
-
const
|
|
1395
|
+
N();
|
|
1396
|
+
}, [s, t, M, o, d]), me(() => {
|
|
1397
|
+
const S = i.current;
|
|
1381
1398
|
return () => {
|
|
1382
|
-
for (const
|
|
1383
|
-
|
|
1399
|
+
for (const w of S.values()) w.destroy();
|
|
1400
|
+
S.clear();
|
|
1384
1401
|
};
|
|
1385
1402
|
}, []);
|
|
1386
1403
|
const x = _(n);
|
|
1387
1404
|
x.current = n;
|
|
1388
1405
|
const O = _(t);
|
|
1389
1406
|
O.current = t;
|
|
1390
|
-
const A = R((
|
|
1391
|
-
const
|
|
1392
|
-
if (!
|
|
1393
|
-
const
|
|
1394
|
-
!
|
|
1395
|
-
O.current(
|
|
1407
|
+
const A = R((S, w) => {
|
|
1408
|
+
const N = i.current.get(S), D = N == null ? void 0 : N.getCurrentResult();
|
|
1409
|
+
if (!N || !(D != null && D.data) || D.isPlaceholderData) return;
|
|
1410
|
+
const E = c.current.get(S) ?? je, v = ic(w, E.page, D.data.pageInfo, x.current);
|
|
1411
|
+
!v || v.page === E.page || (c.current.set(S, { ...v, shownPage: E.page }), N.setOptions(
|
|
1412
|
+
O.current(S, N.options.enabled !== !1, v.request)
|
|
1396
1413
|
));
|
|
1397
1414
|
}, []);
|
|
1398
1415
|
return { entries: h, goToPage: A };
|
|
1399
1416
|
}
|
|
1400
|
-
const
|
|
1401
|
-
function
|
|
1417
|
+
const bc = [];
|
|
1418
|
+
function Yl(e) {
|
|
1402
1419
|
var Lt, xt;
|
|
1403
1420
|
const {
|
|
1404
1421
|
courseId: t,
|
|
@@ -1406,112 +1423,112 @@ function Fl(e) {
|
|
|
1406
1423
|
view: o,
|
|
1407
1424
|
itemsMode: r = "auto",
|
|
1408
1425
|
inlineThreshold: s = Zn,
|
|
1409
|
-
pageSize:
|
|
1410
|
-
mobilePageSize: c =
|
|
1411
|
-
itemPageSize: d =
|
|
1412
|
-
itemConcurrency:
|
|
1426
|
+
pageSize: i = St,
|
|
1427
|
+
mobilePageSize: c = tc,
|
|
1428
|
+
itemPageSize: d = nc,
|
|
1429
|
+
itemConcurrency: p = oc,
|
|
1413
1430
|
retainCollapsedLimit: h = Xn,
|
|
1414
|
-
staleTime:
|
|
1415
|
-
initialExpandedModuleIds:
|
|
1416
|
-
initialFilter:
|
|
1431
|
+
staleTime: g = vt,
|
|
1432
|
+
initialExpandedModuleIds: f,
|
|
1433
|
+
initialFilter: M = za,
|
|
1417
1434
|
today: x
|
|
1418
|
-
} = e, O =
|
|
1419
|
-
() =>
|
|
1420
|
-
[
|
|
1421
|
-
),
|
|
1422
|
-
() => (
|
|
1423
|
-
[
|
|
1424
|
-
), j =
|
|
1435
|
+
} = e, O = gc() ? c : i, A = Sn(), S = Ye(), [w, N] = ne(M), D = W(
|
|
1436
|
+
() => Ya(S.filters, n.capabilities),
|
|
1437
|
+
[S.filters, n.capabilities]
|
|
1438
|
+
), E = ve(D, w), v = It(E), { timezone: T } = oe(), [L] = ne(() => /* @__PURE__ */ new Date()), K = x ?? L, G = W(
|
|
1439
|
+
() => (v == null ? void 0 : v.op) === "within" ? Aa(K, Number(v.value), T) : void 0,
|
|
1440
|
+
[v == null ? void 0 : v.op, v == null ? void 0 : v.value, K, T]
|
|
1441
|
+
), j = dc({
|
|
1425
1442
|
courseId: t,
|
|
1426
1443
|
adapter: n,
|
|
1427
1444
|
mode: r,
|
|
1428
1445
|
inlineThreshold: s,
|
|
1429
1446
|
pageSize: O,
|
|
1430
|
-
filter:
|
|
1447
|
+
filter: v,
|
|
1431
1448
|
dueRange: G,
|
|
1432
1449
|
view: o,
|
|
1433
|
-
staleTime:
|
|
1434
|
-
}), H = j.resolvedMode,
|
|
1450
|
+
staleTime: g
|
|
1451
|
+
}), H = j.resolvedMode, I = cc({
|
|
1435
1452
|
courseId: t,
|
|
1436
1453
|
adapter: n,
|
|
1437
1454
|
pageSize: O,
|
|
1438
|
-
filter:
|
|
1455
|
+
filter: v,
|
|
1439
1456
|
dueRange: G,
|
|
1440
1457
|
view: o,
|
|
1441
|
-
staleTime:
|
|
1458
|
+
staleTime: g,
|
|
1442
1459
|
includeItems: H === "inline",
|
|
1443
1460
|
inlineItemsFirst: (Lt = j.inlineShape) == null ? void 0 : Lt.maxItemCount,
|
|
1444
1461
|
inlineFirst: (xt = j.inlineShape) == null ? void 0 : xt.moduleCount,
|
|
1445
1462
|
enabled: H !== null
|
|
1446
|
-
}), [k,
|
|
1447
|
-
() =>
|
|
1448
|
-
), re =
|
|
1463
|
+
}), [k, C] = ne(
|
|
1464
|
+
() => f ?? []
|
|
1465
|
+
), re = f === void 0, $ = _(!1), Q = Jt(E), se = _(Q);
|
|
1449
1466
|
se.current = Q;
|
|
1450
|
-
const ce = _(
|
|
1451
|
-
ce.current =
|
|
1452
|
-
const V = _(
|
|
1453
|
-
V.current =
|
|
1454
|
-
!re || $.current || Q ||
|
|
1455
|
-
const m = new Set(u),
|
|
1456
|
-
for (const
|
|
1457
|
-
|
|
1458
|
-
return
|
|
1467
|
+
const ce = _(I.hasNextPage);
|
|
1468
|
+
ce.current = I.hasNextPage;
|
|
1469
|
+
const V = _(I.isPlaceholderData);
|
|
1470
|
+
V.current = I.isPlaceholderData, me(() => {
|
|
1471
|
+
!re || $.current || Q || I.isPlaceholderData || C((u) => {
|
|
1472
|
+
const m = new Set(u), b = [...u];
|
|
1473
|
+
for (const P of I.modules)
|
|
1474
|
+
P.collapsed === !1 && !m.has(P.id) && b.push(P.id);
|
|
1475
|
+
return b.length === u.length ? u : b;
|
|
1459
1476
|
});
|
|
1460
|
-
}, [
|
|
1477
|
+
}, [I.modules, I.isPlaceholderData, re, Q]);
|
|
1461
1478
|
const Z = W(() => {
|
|
1462
1479
|
const u = /* @__PURE__ */ new Map();
|
|
1463
|
-
for (const m of
|
|
1480
|
+
for (const m of I.modules) u.set(m.id, m);
|
|
1464
1481
|
return u;
|
|
1465
|
-
}, [
|
|
1482
|
+
}, [I.modules]), pe = W(
|
|
1466
1483
|
() => k.filter((u) => {
|
|
1467
1484
|
const m = Z.get(u);
|
|
1468
1485
|
return m !== void 0 && m.items === void 0;
|
|
1469
1486
|
}),
|
|
1470
1487
|
[k, Z]
|
|
1471
|
-
), Oe = W(() => new Set(
|
|
1472
|
-
(u, m,
|
|
1488
|
+
), Oe = W(() => new Set(pe), [pe]), we = W(() => kt(p), [p]), ke = R(
|
|
1489
|
+
(u, m, b) => sc({
|
|
1473
1490
|
courseId: t,
|
|
1474
1491
|
moduleId: u,
|
|
1475
1492
|
adapter: n,
|
|
1476
|
-
page:
|
|
1493
|
+
page: b,
|
|
1477
1494
|
pageSize: d,
|
|
1478
1495
|
view: o,
|
|
1479
|
-
staleTime:
|
|
1496
|
+
staleTime: g,
|
|
1480
1497
|
enabled: m,
|
|
1481
|
-
limit:
|
|
1498
|
+
limit: we
|
|
1482
1499
|
}),
|
|
1483
|
-
[t, n, d, o,
|
|
1484
|
-
),
|
|
1500
|
+
[t, n, d, o, g, we]
|
|
1501
|
+
), Ee = hc(pe, ke, {
|
|
1485
1502
|
pageSize: d,
|
|
1486
1503
|
retainCollapsedLimit: h,
|
|
1487
1504
|
partition: JSON.stringify([t, o])
|
|
1488
|
-
}), y = W(() => kt(
|
|
1489
|
-
(u, m,
|
|
1505
|
+
}), y = W(() => kt(rc), []), [X, F] = ne(0), le = R((u) => (F((m) => m + 1), u.finally(() => F((m) => m - 1))), []), Pe = _(/* @__PURE__ */ new Map()), Ve = _(Promise.resolve()), ee = R(
|
|
1506
|
+
(u, m, b) => {
|
|
1490
1507
|
if (se.current) return;
|
|
1491
|
-
const
|
|
1492
|
-
if (!
|
|
1493
|
-
const q = Promise.all([Ve.current,
|
|
1494
|
-
() => y(() =>
|
|
1495
|
-
), z = ((
|
|
1508
|
+
const P = n.setModuleCollapsed;
|
|
1509
|
+
if (!P) return;
|
|
1510
|
+
const q = Promise.all([Ve.current, Pe.current.get(u)]).then(
|
|
1511
|
+
() => y(() => P({ courseId: t, moduleId: u, collapsed: m }))
|
|
1512
|
+
), z = ((b == null ? void 0 : b.track) === !0 ? le(q) : q).catch((Y) => {
|
|
1496
1513
|
console.warn(
|
|
1497
1514
|
`[platform-modules] failed to persist module ${u} collapsed=${m}: ${String(Y)}`
|
|
1498
1515
|
);
|
|
1499
1516
|
}).finally(() => {
|
|
1500
|
-
|
|
1517
|
+
Pe.current.get(u) === z && Pe.current.delete(u);
|
|
1501
1518
|
});
|
|
1502
|
-
|
|
1519
|
+
Pe.current.set(u, z);
|
|
1503
1520
|
},
|
|
1504
1521
|
[n, t, y, le]
|
|
1505
1522
|
), Fe = R(
|
|
1506
1523
|
(u, m) => {
|
|
1507
|
-
const
|
|
1508
|
-
if (!(!se.current && !ce.current && !V.current &&
|
|
1524
|
+
const b = n.setAllModulesCollapsed;
|
|
1525
|
+
if (!(!se.current && !ce.current && !V.current && b !== void 0)) {
|
|
1509
1526
|
for (const z of m) ee(z, u, { track: !0 });
|
|
1510
1527
|
return;
|
|
1511
1528
|
}
|
|
1512
1529
|
const q = le(
|
|
1513
|
-
Promise.all([Ve.current, ...
|
|
1514
|
-
() =>
|
|
1530
|
+
Promise.all([Ve.current, ...Pe.current.values()]).then(
|
|
1531
|
+
() => b({ courseId: t, collapsed: u })
|
|
1515
1532
|
)
|
|
1516
1533
|
).catch((z) => {
|
|
1517
1534
|
console.warn(
|
|
@@ -1523,21 +1540,21 @@ function Fl(e) {
|
|
|
1523
1540
|
[n, t, ee, le]
|
|
1524
1541
|
), Ze = R(
|
|
1525
1542
|
(u, m) => {
|
|
1526
|
-
$.current = !0,
|
|
1527
|
-
(
|
|
1543
|
+
$.current = !0, C(
|
|
1544
|
+
(b) => b.includes(u) ? b : [...b, u]
|
|
1528
1545
|
), (m == null ? void 0 : m.persist) !== !1 && ee(u, !1);
|
|
1529
1546
|
},
|
|
1530
1547
|
[ee]
|
|
1531
|
-
),
|
|
1548
|
+
), Ce = R(
|
|
1532
1549
|
(u, m) => {
|
|
1533
|
-
$.current = !0,
|
|
1550
|
+
$.current = !0, C((b) => b.filter((P) => P !== u)), A.cancelQueries({ queryKey: We(t, u) }), (m == null ? void 0 : m.persist) !== !1 && ee(u, !0);
|
|
1534
1551
|
},
|
|
1535
1552
|
[A, t, ee]
|
|
1536
1553
|
), co = R(
|
|
1537
1554
|
(u) => {
|
|
1538
|
-
$.current = !0,
|
|
1539
|
-
const
|
|
1540
|
-
return
|
|
1555
|
+
$.current = !0, C((m) => {
|
|
1556
|
+
const b = new Set(m), P = u.filter((q) => !b.has(q));
|
|
1557
|
+
return P.length === 0 ? m : [...m, ...P];
|
|
1541
1558
|
});
|
|
1542
1559
|
for (const m of u) ee(m, !1, { track: !0 });
|
|
1543
1560
|
},
|
|
@@ -1546,64 +1563,64 @@ function Fl(e) {
|
|
|
1546
1563
|
(u) => {
|
|
1547
1564
|
$.current = !0;
|
|
1548
1565
|
const m = new Set(u);
|
|
1549
|
-
|
|
1550
|
-
const
|
|
1551
|
-
return
|
|
1566
|
+
C((b) => {
|
|
1567
|
+
const P = b.filter((q) => !m.has(q));
|
|
1568
|
+
return P.length === b.length ? b : P;
|
|
1552
1569
|
});
|
|
1553
|
-
for (const
|
|
1554
|
-
A.cancelQueries({ queryKey: We(t,
|
|
1570
|
+
for (const b of m)
|
|
1571
|
+
A.cancelQueries({ queryKey: We(t, b) }), ee(b, !0, { track: !0 });
|
|
1555
1572
|
},
|
|
1556
1573
|
[A, t, ee]
|
|
1557
|
-
),
|
|
1558
|
-
|
|
1574
|
+
), ge = _(k);
|
|
1575
|
+
ge.current = k;
|
|
1559
1576
|
const uo = R(() => {
|
|
1560
1577
|
$.current = !0;
|
|
1561
|
-
const u =
|
|
1578
|
+
const u = ge.current;
|
|
1562
1579
|
if (u.length !== 0) {
|
|
1563
1580
|
for (const m of u)
|
|
1564
1581
|
A.cancelQueries({ queryKey: We(t, m) });
|
|
1565
|
-
|
|
1582
|
+
C([]), Fe(!0, u);
|
|
1566
1583
|
}
|
|
1567
1584
|
}, [A, t, Fe]), mo = R(() => {
|
|
1568
1585
|
$.current = !0;
|
|
1569
|
-
const u =
|
|
1570
|
-
u.length !== 0 && (
|
|
1571
|
-
}, [
|
|
1572
|
-
Xe.current =
|
|
1573
|
-
const fe = _(null),
|
|
1586
|
+
const u = I.modules.map((m) => m.id);
|
|
1587
|
+
u.length !== 0 && (C(u), Fe(!1, u));
|
|
1588
|
+
}, [I.modules, Fe]), Xe = _(w);
|
|
1589
|
+
Xe.current = w;
|
|
1590
|
+
const fe = _(null), po = R(
|
|
1574
1591
|
(u) => {
|
|
1575
1592
|
if (u === Xe.current) return;
|
|
1576
|
-
if (Xe.current = u, Jt(
|
|
1577
|
-
fe.current === null && (fe.current =
|
|
1578
|
-
const
|
|
1579
|
-
for (const
|
|
1580
|
-
$.current =
|
|
1581
|
-
} else fe.current !== null && (
|
|
1582
|
-
|
|
1593
|
+
if (Xe.current = u, Jt(ve(D, u))) {
|
|
1594
|
+
fe.current === null && (fe.current = ge.current);
|
|
1595
|
+
const b = $.current;
|
|
1596
|
+
for (const P of ge.current) Ce(P, { persist: !1 });
|
|
1597
|
+
$.current = b;
|
|
1598
|
+
} else fe.current !== null && (C(fe.current), ge.current = fe.current, fe.current = null);
|
|
1599
|
+
N(u);
|
|
1583
1600
|
},
|
|
1584
|
-
[
|
|
1585
|
-
),
|
|
1601
|
+
[D, Ce]
|
|
1602
|
+
), go = R(
|
|
1586
1603
|
(u) => {
|
|
1587
|
-
|
|
1604
|
+
ge.current.includes(u) ? Ce(u) : Ze(u);
|
|
1588
1605
|
},
|
|
1589
|
-
[
|
|
1590
|
-
),
|
|
1591
|
-
|
|
1592
|
-
const [
|
|
1606
|
+
[Ce, Ze]
|
|
1607
|
+
), Et = _(Z);
|
|
1608
|
+
Et.current = Z;
|
|
1609
|
+
const [Pt, fo] = ne(() => /* @__PURE__ */ new Map()), Ct = Ee.goToPage, he = R(
|
|
1593
1610
|
(u, m) => {
|
|
1594
1611
|
var q;
|
|
1595
|
-
const
|
|
1596
|
-
if (
|
|
1597
|
-
|
|
1612
|
+
const b = (q = Et.current.get(u)) == null ? void 0 : q.items;
|
|
1613
|
+
if (b === void 0) {
|
|
1614
|
+
Ct(u, m);
|
|
1598
1615
|
return;
|
|
1599
1616
|
}
|
|
1600
|
-
const
|
|
1617
|
+
const P = xe(b.length, d);
|
|
1601
1618
|
fo((z) => {
|
|
1602
|
-
const Y = Math.min(z.get(u) ?? 1,
|
|
1619
|
+
const Y = Math.min(z.get(u) ?? 1, P), _e = m === "first" ? 1 : m === "last" ? P : Math.min(Math.max(Y + (m === "next" ? 1 : -1), 1), P);
|
|
1603
1620
|
return _e === Y ? z : new Map(z).set(u, _e);
|
|
1604
1621
|
});
|
|
1605
1622
|
},
|
|
1606
|
-
[
|
|
1623
|
+
[Ct, d]
|
|
1607
1624
|
), Je = W(() => /* @__PURE__ */ new Map(), [he]), _t = R(
|
|
1608
1625
|
(u) => {
|
|
1609
1626
|
let m = Je.get(u);
|
|
@@ -1615,16 +1632,16 @@ function Fl(e) {
|
|
|
1615
1632
|
}, Je.set(u, m)), m;
|
|
1616
1633
|
},
|
|
1617
1634
|
[Je, he]
|
|
1618
|
-
), At =
|
|
1635
|
+
), At = Ee.entries, Dt = _(/* @__PURE__ */ new Map()), ho = R(
|
|
1619
1636
|
(u) => {
|
|
1620
1637
|
var Nt, Rt;
|
|
1621
|
-
const m = Z.get(u),
|
|
1622
|
-
if (Y && Y.items === (m == null ? void 0 : m.items) && Y.entry ===
|
|
1638
|
+
const m = Z.get(u), b = At.get(u), P = Oe.has(u), q = Pt.get(u), z = _t(u), Y = Dt.current.get(u);
|
|
1639
|
+
if (Y && Y.items === (m == null ? void 0 : m.items) && Y.entry === b && Y.active === P && Y.inlinePage === q && Y.navigation === z)
|
|
1623
1640
|
return Y.value;
|
|
1624
1641
|
const _e = (Ae) => (Dt.current.set(u, {
|
|
1625
1642
|
items: m == null ? void 0 : m.items,
|
|
1626
|
-
entry:
|
|
1627
|
-
active:
|
|
1643
|
+
entry: b,
|
|
1644
|
+
active: P,
|
|
1628
1645
|
inlinePage: q,
|
|
1629
1646
|
navigation: z,
|
|
1630
1647
|
value: Ae
|
|
@@ -1643,63 +1660,62 @@ function Fl(e) {
|
|
|
1643
1660
|
source: "inline"
|
|
1644
1661
|
});
|
|
1645
1662
|
}
|
|
1646
|
-
const B =
|
|
1663
|
+
const B = b == null ? void 0 : b.result, qe = (b == null ? void 0 : b.page) ?? 1, be = (Nt = B == null ? void 0 : B.data) == null ? void 0 : Nt.pageInfo;
|
|
1647
1664
|
return _e({
|
|
1648
|
-
items: ((Rt = B == null ? void 0 : B.data) == null ? void 0 : Rt.items) ??
|
|
1665
|
+
items: ((Rt = B == null ? void 0 : B.data) == null ? void 0 : Rt.items) ?? bc,
|
|
1649
1666
|
page: qe,
|
|
1650
1667
|
pageCount: Math.max(
|
|
1651
1668
|
xe((be == null ? void 0 : be.totalCount) ?? null, d),
|
|
1652
1669
|
be != null && be.hasNextPage ? qe + 1 : qe
|
|
1653
1670
|
),
|
|
1654
|
-
// Assumes earlier pages hold no sub-headers. Exact numbers need a per-module running count.
|
|
1655
1671
|
itemOffset: (qe - 1) * d,
|
|
1656
1672
|
...z,
|
|
1657
|
-
isLoading: B ? B.isLoading :
|
|
1673
|
+
isLoading: B ? B.isLoading : P,
|
|
1658
1674
|
isRefreshing: (B == null ? void 0 : B.isPlaceholderData) ?? !1,
|
|
1659
1675
|
error: (B == null ? void 0 : B.error) ?? null,
|
|
1660
1676
|
source: "onDemand"
|
|
1661
1677
|
});
|
|
1662
1678
|
},
|
|
1663
|
-
[Z, At, Oe,
|
|
1679
|
+
[Z, At, Oe, Pt, _t, d]
|
|
1664
1680
|
);
|
|
1665
1681
|
return {
|
|
1666
|
-
modules:
|
|
1667
|
-
pageInfo:
|
|
1668
|
-
page:
|
|
1669
|
-
pageCount:
|
|
1682
|
+
modules: I.modules,
|
|
1683
|
+
pageInfo: I.pageInfo,
|
|
1684
|
+
page: I.page,
|
|
1685
|
+
pageCount: I.pageCount,
|
|
1670
1686
|
pageSize: O,
|
|
1671
|
-
hasNextPage:
|
|
1672
|
-
hasPreviousPage:
|
|
1673
|
-
goToFirstPage:
|
|
1674
|
-
goToPreviousPage:
|
|
1675
|
-
goToNextPage:
|
|
1676
|
-
goToLastPage:
|
|
1677
|
-
isLoading: (j.isResolving ||
|
|
1678
|
-
isRefreshing:
|
|
1679
|
-
error:
|
|
1687
|
+
hasNextPage: I.hasNextPage,
|
|
1688
|
+
hasPreviousPage: I.hasPreviousPage,
|
|
1689
|
+
goToFirstPage: I.goToFirstPage,
|
|
1690
|
+
goToPreviousPage: I.goToPreviousPage,
|
|
1691
|
+
goToNextPage: I.goToNextPage,
|
|
1692
|
+
goToLastPage: I.goToLastPage,
|
|
1693
|
+
isLoading: (j.isResolving || I.isPending) && !I.isPlaceholderData,
|
|
1694
|
+
isRefreshing: I.isPlaceholderData,
|
|
1695
|
+
error: I.error ?? j.error,
|
|
1680
1696
|
itemsMode: H,
|
|
1681
1697
|
getItems: ho,
|
|
1682
1698
|
expandModule: Ze,
|
|
1683
|
-
collapseModule:
|
|
1699
|
+
collapseModule: Ce,
|
|
1684
1700
|
expandModules: co,
|
|
1685
1701
|
collapseModules: lo,
|
|
1686
1702
|
collapseAllModules: uo,
|
|
1687
1703
|
expandAllModules: mo,
|
|
1688
|
-
toggleModule:
|
|
1704
|
+
toggleModule: go,
|
|
1689
1705
|
expandedModuleIds: k,
|
|
1690
|
-
filter:
|
|
1691
|
-
setFilter:
|
|
1692
|
-
filterEntry:
|
|
1693
|
-
filterPredicate:
|
|
1706
|
+
filter: w,
|
|
1707
|
+
setFilter: po,
|
|
1708
|
+
filterEntry: E,
|
|
1709
|
+
filterPredicate: Ba(E) ? E == null ? void 0 : E.predicate : void 0,
|
|
1694
1710
|
isPersistingCollapsed: X > 0
|
|
1695
1711
|
};
|
|
1696
1712
|
}
|
|
1697
|
-
const
|
|
1713
|
+
const yc = 20, Ic = 4.5, an = 7, Mc = 5, Tc = 20, eo = "#000000", to = "#FFFFFF", no = {
|
|
1698
1714
|
primary: { semantic: "base", textKey: "baseTextColor", borderKey: "baseBorderColor" },
|
|
1699
1715
|
info: { semantic: "info", textKey: "infoTextColor", borderKey: "infoBorderColor" },
|
|
1700
1716
|
success: { semantic: "success", textKey: "successTextColor", borderKey: "successBorderColor" },
|
|
1701
1717
|
warning: { semantic: "warning", textKey: "warningTextColor", borderKey: "warningBorderColor" }
|
|
1702
|
-
},
|
|
1718
|
+
}, Sc = {
|
|
1703
1719
|
card: {
|
|
1704
1720
|
primary: { fill: "#E8EAEC", stroke: "#8D959F", text: "#273540" },
|
|
1705
1721
|
info: { fill: "#D5E4F2", stroke: "#2B7ABC", text: "#23649A" },
|
|
@@ -1713,27 +1729,27 @@ const ac = 20, cc = 4.5, an = 7, lc = 5, uc = 20, eo = "#000000", to = "#FFFFFF"
|
|
|
1713
1729
|
warning: { fill: "#EBD2C4", stroke: "#CF4A00", text: "#A13900" }
|
|
1714
1730
|
}
|
|
1715
1731
|
};
|
|
1716
|
-
function
|
|
1732
|
+
function vc(e, t) {
|
|
1717
1733
|
const n = Fo(
|
|
1718
1734
|
st(e),
|
|
1719
|
-
st(qo(t,
|
|
1735
|
+
st(qo(t, yc))
|
|
1720
1736
|
);
|
|
1721
|
-
return
|
|
1737
|
+
return Pn(n);
|
|
1722
1738
|
}
|
|
1723
|
-
function
|
|
1724
|
-
const o = de(n, t) >= an ? an :
|
|
1739
|
+
function wc(e, t, n) {
|
|
1740
|
+
const o = de(n, t) >= an ? an : Ic;
|
|
1725
1741
|
return Math.min(o, Math.max(de(e, eo), de(e, to)));
|
|
1726
1742
|
}
|
|
1727
|
-
function
|
|
1728
|
-
const o =
|
|
1743
|
+
function Ec(e, t, n) {
|
|
1744
|
+
const o = wc(e, t, n);
|
|
1729
1745
|
if (de(e, t) >= o) return t;
|
|
1730
1746
|
const r = de(e, eo) > de(e, to) ? zo : Uo;
|
|
1731
1747
|
let s = t;
|
|
1732
|
-
for (let
|
|
1733
|
-
s = r(s,
|
|
1734
|
-
return
|
|
1748
|
+
for (let i = 0; i < Tc && de(e, s) < o; i++)
|
|
1749
|
+
s = r(s, Mc);
|
|
1750
|
+
return Pn(s);
|
|
1735
1751
|
}
|
|
1736
|
-
function
|
|
1752
|
+
function Pc(e) {
|
|
1737
1753
|
return rt(e) && st(e).a === 1;
|
|
1738
1754
|
}
|
|
1739
1755
|
function cn(e, t) {
|
|
@@ -1741,15 +1757,15 @@ function cn(e, t) {
|
|
|
1741
1757
|
return t === "card" ? (n = e == null ? void 0 : e.elevatedSurface) == null ? void 0 : n.base : e == null ? void 0 : e.muted;
|
|
1742
1758
|
}
|
|
1743
1759
|
function ln(e, t, n, o) {
|
|
1744
|
-
var
|
|
1745
|
-
const r =
|
|
1760
|
+
var i, c, d, p;
|
|
1761
|
+
const r = Sc[n][e], s = t;
|
|
1746
1762
|
try {
|
|
1747
|
-
const h = s == null ? void 0 : s.newTheme,
|
|
1748
|
-
if (!
|
|
1749
|
-
const { semantic:
|
|
1750
|
-
if (!
|
|
1751
|
-
const A =
|
|
1752
|
-
return { fill: A, stroke: x, text:
|
|
1763
|
+
const h = s == null ? void 0 : s.newTheme, g = (i = h == null ? void 0 : h.semantics) == null ? void 0 : i.call(h, h.primitives);
|
|
1764
|
+
if (!g) return r;
|
|
1765
|
+
const { semantic: f } = no[e], M = cn((p = (d = (c = s == null ? void 0 : s.themeOverride) == null ? void 0 : c.semantics) == null ? void 0 : d.color) == null ? void 0 : p.background, n) ?? cn(g.color.background, n) ?? "", x = o.stroke ?? g.color.stroke[f], O = o.label ?? g.color.text[f];
|
|
1766
|
+
if (!Pc(M) || !rt(x) || !rt(O)) return r;
|
|
1767
|
+
const A = vc(M, x);
|
|
1768
|
+
return { fill: A, stroke: x, text: Ec(A, O, M) };
|
|
1753
1769
|
} catch {
|
|
1754
1770
|
return r;
|
|
1755
1771
|
}
|
|
@@ -1760,19 +1776,19 @@ function oo(e, t, n, o = {}) {
|
|
|
1760
1776
|
return ln(e, t, n, o);
|
|
1761
1777
|
let r = un.get(t);
|
|
1762
1778
|
r === void 0 && (r = /* @__PURE__ */ new Map(), un.set(t, r));
|
|
1763
|
-
const s = `${n}:${e}:${o.stroke ?? ""}:${o.label ?? ""}`,
|
|
1764
|
-
if (
|
|
1779
|
+
const s = `${n}:${e}:${o.stroke ?? ""}:${o.label ?? ""}`, i = r.get(s);
|
|
1780
|
+
if (i !== void 0) return i;
|
|
1765
1781
|
const c = ln(e, t, n, o);
|
|
1766
1782
|
return r.set(s, c), c;
|
|
1767
1783
|
}
|
|
1768
1784
|
function $e(e, t) {
|
|
1769
1785
|
const { textKey: n, borderKey: o } = no[e];
|
|
1770
1786
|
return (r, s) => {
|
|
1771
|
-
const
|
|
1772
|
-
stroke:
|
|
1773
|
-
label:
|
|
1787
|
+
const i = r, { fill: c, stroke: d, text: p } = oo(e, s, t, {
|
|
1788
|
+
stroke: i == null ? void 0 : i[o],
|
|
1789
|
+
label: i == null ? void 0 : i[n]
|
|
1774
1790
|
});
|
|
1775
|
-
return { backgroundColor: c, [n]:
|
|
1791
|
+
return { backgroundColor: c, [n]: p, [o]: d };
|
|
1776
1792
|
};
|
|
1777
1793
|
}
|
|
1778
1794
|
function dn(e) {
|
|
@@ -1783,42 +1799,42 @@ function dn(e) {
|
|
|
1783
1799
|
warning: $e("warning", e)
|
|
1784
1800
|
};
|
|
1785
1801
|
}
|
|
1786
|
-
const
|
|
1802
|
+
const Cc = {
|
|
1787
1803
|
card: dn("card"),
|
|
1788
1804
|
row: dn("row")
|
|
1789
|
-
},
|
|
1805
|
+
}, _c = "#9242B4", Ac = "#9E58BD";
|
|
1790
1806
|
function mn(e) {
|
|
1791
1807
|
return (t, n) => {
|
|
1792
|
-
var
|
|
1808
|
+
var i, c, d, p;
|
|
1793
1809
|
const { fill: o, stroke: r, text: s } = oo("primary", n, e, {
|
|
1794
|
-
stroke: ((c = (
|
|
1795
|
-
label: ((
|
|
1810
|
+
stroke: ((c = (i = n.colors) == null ? void 0 : i.contrasts) == null ? void 0 : c.violet4570) ?? Ac,
|
|
1811
|
+
label: ((p = (d = n.colors) == null ? void 0 : d.contrasts) == null ? void 0 : p.violet5790) ?? _c
|
|
1796
1812
|
});
|
|
1797
1813
|
return { backgroundColor: o, baseTextColor: s, baseBorderColor: r };
|
|
1798
1814
|
};
|
|
1799
1815
|
}
|
|
1800
1816
|
const ro = {
|
|
1801
1817
|
tone: "primary",
|
|
1802
|
-
icon: /* @__PURE__ */ l(
|
|
1818
|
+
icon: /* @__PURE__ */ l(pt, { size: "sm" }),
|
|
1803
1819
|
themes: {
|
|
1804
1820
|
card: mn("card"),
|
|
1805
1821
|
row: mn("row")
|
|
1806
1822
|
}
|
|
1807
|
-
},
|
|
1823
|
+
}, Dc = {
|
|
1808
1824
|
not_started: { tone: "primary", icon: /* @__PURE__ */ l(bt, { size: "sm" }) },
|
|
1809
1825
|
in_progress: { tone: "info", icon: /* @__PURE__ */ l(ht, { size: "sm" }) },
|
|
1810
1826
|
complete: { tone: "success", icon: /* @__PURE__ */ l(ft, { size: "sm" }) },
|
|
1811
1827
|
missing: { tone: "warning", icon: /* @__PURE__ */ l(Te, { size: "sm" }) },
|
|
1812
1828
|
incomplete: { tone: "warning", icon: /* @__PURE__ */ l(Te, { size: "sm" }) },
|
|
1813
1829
|
missing_and_incomplete: { tone: "warning", icon: /* @__PURE__ */ l(Te, { size: "sm" }) },
|
|
1814
|
-
locked: { tone: "primary", icon: /* @__PURE__ */ l(
|
|
1815
|
-
},
|
|
1830
|
+
locked: { tone: "primary", icon: /* @__PURE__ */ l(gt, { size: "sm" }) }
|
|
1831
|
+
}, Lc = {
|
|
1816
1832
|
not_started: { tone: "primary", icon: /* @__PURE__ */ l(bt, { size: "sm" }) },
|
|
1817
1833
|
in_progress: { tone: "info", icon: /* @__PURE__ */ l(ht, { size: "sm" }) },
|
|
1818
1834
|
complete: { tone: "success", icon: /* @__PURE__ */ l(ft, { size: "sm" }) },
|
|
1819
1835
|
incomplete: { tone: "warning", icon: /* @__PURE__ */ l(Te, { size: "sm" }) },
|
|
1820
1836
|
missing: { tone: "warning", icon: /* @__PURE__ */ l(Te, { size: "sm" }) },
|
|
1821
|
-
locked: { tone: "primary", icon: /* @__PURE__ */ l(
|
|
1837
|
+
locked: { tone: "primary", icon: /* @__PURE__ */ l(gt, { size: "sm" }) }
|
|
1822
1838
|
};
|
|
1823
1839
|
function so(e, t, n, o) {
|
|
1824
1840
|
switch (t) {
|
|
@@ -1841,7 +1857,7 @@ function so(e, t, n, o) {
|
|
|
1841
1857
|
return e("moduleStatusLocked");
|
|
1842
1858
|
}
|
|
1843
1859
|
}
|
|
1844
|
-
function
|
|
1860
|
+
function xc(e, t) {
|
|
1845
1861
|
switch (t) {
|
|
1846
1862
|
case "not_started":
|
|
1847
1863
|
return e("itemStatusNotStarted");
|
|
@@ -1864,65 +1880,65 @@ function Qe(e, t, n, o) {
|
|
|
1864
1880
|
{
|
|
1865
1881
|
color: e.tone,
|
|
1866
1882
|
renderIcon: e.icon,
|
|
1867
|
-
themeOverride: ((r = e.themes) == null ? void 0 : r[o]) ??
|
|
1883
|
+
themeOverride: ((r = e.themes) == null ? void 0 : r[o]) ?? Cc[o][e.tone],
|
|
1868
1884
|
"data-testid": n,
|
|
1869
1885
|
children: t
|
|
1870
1886
|
}
|
|
1871
1887
|
);
|
|
1872
1888
|
}
|
|
1873
|
-
function
|
|
1889
|
+
function Ql({
|
|
1874
1890
|
status: e,
|
|
1875
1891
|
missingCount: t,
|
|
1876
1892
|
incompleteCount: n
|
|
1877
1893
|
}) {
|
|
1878
1894
|
const { t: o } = oe();
|
|
1879
1895
|
return Qe(
|
|
1880
|
-
|
|
1896
|
+
Dc[e],
|
|
1881
1897
|
so(o, e, t, n),
|
|
1882
1898
|
"module-status-pill",
|
|
1883
1899
|
"card"
|
|
1884
1900
|
);
|
|
1885
1901
|
}
|
|
1886
|
-
function
|
|
1902
|
+
function Nc({ status: e }) {
|
|
1887
1903
|
const { t } = oe();
|
|
1888
1904
|
return Qe(
|
|
1889
|
-
|
|
1890
|
-
|
|
1905
|
+
Lc[e],
|
|
1906
|
+
xc(t, e),
|
|
1891
1907
|
"item-status-pill",
|
|
1892
1908
|
"row"
|
|
1893
1909
|
);
|
|
1894
1910
|
}
|
|
1895
|
-
function
|
|
1911
|
+
function Vl() {
|
|
1896
1912
|
const { t: e } = oe();
|
|
1897
1913
|
return Qe(ro, e("moduleStatusDueSoon"), "module-due-soon-pill", "card");
|
|
1898
1914
|
}
|
|
1899
|
-
function
|
|
1915
|
+
function Rc() {
|
|
1900
1916
|
const { t: e } = oe();
|
|
1901
1917
|
return Qe(ro, e("itemStatusDueSoon"), "item-due-soon-pill", "row");
|
|
1902
1918
|
}
|
|
1903
|
-
function
|
|
1904
|
-
const e =
|
|
1919
|
+
function Oc() {
|
|
1920
|
+
const e = wn();
|
|
1905
1921
|
return "key" in e && e.key === "canvas-high-contrast" ? "inline" : "standalone";
|
|
1906
1922
|
}
|
|
1907
|
-
const io = 2.75,
|
|
1923
|
+
const io = 2.75, kc = `${io}rem`, pn = "0.065em", Se = "0.8em", Fc = "0.28em", gn = "1px", qc = "0.57em", ao = {
|
|
1908
1924
|
display: "inline-block",
|
|
1909
1925
|
paddingLeft: Se,
|
|
1910
1926
|
marginLeft: `-${Se}`,
|
|
1911
|
-
backgroundImage: `radial-gradient(circle, currentColor ${
|
|
1927
|
+
backgroundImage: `radial-gradient(circle, currentColor ${pn}, transparent ${pn})`,
|
|
1912
1928
|
backgroundRepeat: "no-repeat",
|
|
1913
1929
|
backgroundSize: `${Se} 100%`,
|
|
1914
1930
|
backgroundPosition: "left center"
|
|
1915
|
-
},
|
|
1931
|
+
}, zc = {
|
|
1916
1932
|
...ao,
|
|
1917
1933
|
backgroundImage: "none",
|
|
1918
|
-
borderLeft: `${
|
|
1919
|
-
paddingLeft: `calc(${Se} / 2 - ${
|
|
1934
|
+
borderLeft: `${gn} solid`,
|
|
1935
|
+
paddingLeft: `calc(${Se} / 2 - ${gn})`,
|
|
1920
1936
|
marginLeft: `calc(-${Se} / 2)`
|
|
1921
1937
|
};
|
|
1922
1938
|
function fn() {
|
|
1923
1939
|
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia("(forced-colors: active)");
|
|
1924
1940
|
}
|
|
1925
|
-
function
|
|
1941
|
+
function Uc() {
|
|
1926
1942
|
const [e, t] = ne(() => {
|
|
1927
1943
|
var n;
|
|
1928
1944
|
return ((n = fn()) == null ? void 0 : n.matches) ?? !1;
|
|
@@ -1933,49 +1949,49 @@ function Ac() {
|
|
|
1933
1949
|
t(n.matches);
|
|
1934
1950
|
const o = (r) => t(r.matches);
|
|
1935
1951
|
return n.addEventListener("change", o), () => n.removeEventListener("change", o);
|
|
1936
|
-
}, []), e ?
|
|
1952
|
+
}, []), e ? zc : ao;
|
|
1937
1953
|
}
|
|
1938
|
-
const
|
|
1954
|
+
const $c = {
|
|
1939
1955
|
overflowX: "clip",
|
|
1940
1956
|
overflowWrap: "anywhere",
|
|
1941
1957
|
lineHeight: 0
|
|
1942
|
-
},
|
|
1958
|
+
}, Bc = "#6A7883", wt = 0.5, He = { display: "block" }, Wc = { ...He, marginTop: `${wt}rem` }, Gc = {
|
|
1943
1959
|
...He,
|
|
1944
|
-
marginTop: `-${
|
|
1945
|
-
}, hn = { marginTop: `${
|
|
1960
|
+
marginTop: `-${wt}rem`
|
|
1961
|
+
}, hn = { marginTop: `${wt}rem` }, bn = { display: "inline-block" }, jc = {
|
|
1946
1962
|
display: "-webkit-box",
|
|
1947
1963
|
WebkitLineClamp: 2,
|
|
1948
1964
|
WebkitBoxOrient: "vertical",
|
|
1949
1965
|
overflow: "hidden"
|
|
1950
|
-
},
|
|
1951
|
-
marginRight: `calc(${Se} - ${
|
|
1952
|
-
},
|
|
1966
|
+
}, Hc = {
|
|
1967
|
+
marginRight: `calc(${Se} - ${Fc})`
|
|
1968
|
+
}, Kc = {
|
|
1953
1969
|
display: "inline-flex",
|
|
1954
1970
|
alignItems: "center",
|
|
1955
1971
|
height: "1lh",
|
|
1956
1972
|
verticalAlign: "top",
|
|
1957
|
-
marginInlineEnd:
|
|
1973
|
+
marginInlineEnd: qc
|
|
1958
1974
|
};
|
|
1959
|
-
function
|
|
1960
|
-
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(
|
|
1975
|
+
function Me(e) {
|
|
1976
|
+
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(Me) : mt(e) && e.type === vn ? Me(e.props.children) : !1;
|
|
1961
1977
|
}
|
|
1962
|
-
const
|
|
1963
|
-
function
|
|
1978
|
+
const Yc = 1.5, Qc = 0.25, Vc = 0.5;
|
|
1979
|
+
function Zc(e, t) {
|
|
1964
1980
|
var o, r;
|
|
1965
|
-
const n =
|
|
1981
|
+
const n = wn();
|
|
1966
1982
|
return ("colors" in n ? (r = (o = n.colors) == null ? void 0 : o.contrasts) == null ? void 0 : r[e] : void 0) ?? t;
|
|
1967
1983
|
}
|
|
1968
|
-
function
|
|
1984
|
+
function Xc({
|
|
1969
1985
|
item: e,
|
|
1970
1986
|
today: t,
|
|
1971
1987
|
attachedAbove: n,
|
|
1972
1988
|
attachedBelow: o,
|
|
1973
1989
|
stackPill: r = !1,
|
|
1974
1990
|
moduleLabel: s,
|
|
1975
|
-
itemNumber:
|
|
1991
|
+
itemNumber: i
|
|
1976
1992
|
}) {
|
|
1977
|
-
var
|
|
1978
|
-
const { t: c, locale: d, timezone:
|
|
1993
|
+
var Ee;
|
|
1994
|
+
const { t: c, locale: d, timezone: p } = oe(), h = tr(), g = Oc(), f = Zc("grey4570", Bc), M = Uc(), x = _(null), O = Vn(), A = Ye(), { navigation: S } = A, w = W(() => Rn(A.itemMeta), [A.itemMeta]), N = e.title || c("itemUntitled");
|
|
1979
1995
|
if (e.type === "sub_header")
|
|
1980
1996
|
return /* @__PURE__ */ l(
|
|
1981
1997
|
ie,
|
|
@@ -1992,12 +2008,12 @@ function $c({
|
|
|
1992
2008
|
transform: "uppercase",
|
|
1993
2009
|
"data-testid": "module-item-title",
|
|
1994
2010
|
"data-sub-header": "true",
|
|
1995
|
-
children:
|
|
2011
|
+
children: N
|
|
1996
2012
|
}
|
|
1997
2013
|
)
|
|
1998
2014
|
}
|
|
1999
2015
|
);
|
|
2000
|
-
const
|
|
2016
|
+
const D = La(s, i, d), E = D ? c("itemNameWithLabel", { label: D, name: N }) : N, v = ((Ee = S.getItemHref) == null ? void 0 : Ee.call(S, e)) ?? e.url ?? null, T = e.status === "locked", L = T ? null : v, K = e.status !== void 0 && e.status !== "complete" && !T && Un(e.dueAt, t, p), G = S.onItemClick, j = (y) => {
|
|
2001
2017
|
h(`item-click-${e.type}`), G == null || G(e, y);
|
|
2002
2018
|
}, H = (y) => {
|
|
2003
2019
|
var F;
|
|
@@ -2012,23 +2028,23 @@ function $c({
|
|
|
2012
2028
|
altKey: y.altKey
|
|
2013
2029
|
})
|
|
2014
2030
|
);
|
|
2015
|
-
},
|
|
2031
|
+
}, I = { item: e, t: c, today: t, locale: d, timezone: p, formatters: O, config: A }, k = w.map((y) => ({
|
|
2016
2032
|
key: y.key,
|
|
2017
|
-
node: y.render(
|
|
2018
|
-
icon: y.renderIcon ? y.renderIcon(
|
|
2019
|
-
})).filter((y) => !
|
|
2033
|
+
node: y.render(I),
|
|
2034
|
+
icon: y.renderIcon ? y.renderIcon(I) : y.icon
|
|
2035
|
+
})).filter((y) => !Me(y.node)), C = [];
|
|
2020
2036
|
let re;
|
|
2021
|
-
const $ = r ? k.find((y) => y.key === "dueAt" && !
|
|
2037
|
+
const $ = r ? k.find((y) => y.key === "dueAt" && !Me(y.icon)) : void 0, Q = $ && k.find((y) => y.key === "estimatedDuration");
|
|
2022
2038
|
for (const y of k)
|
|
2023
2039
|
if (y !== Q)
|
|
2024
|
-
if (!
|
|
2040
|
+
if (!Me(y.icon) && (r || !re)) {
|
|
2025
2041
|
const X = y === $ && Q ? [y, Q] : [y];
|
|
2026
|
-
|
|
2027
|
-
} else re ? re.push(y) :
|
|
2028
|
-
const se = r ? { ...bn, ...hn } : bn, ce = r ? { ...
|
|
2029
|
-
K ? /* @__PURE__ */ l(U.Item, { children: /* @__PURE__ */ l(
|
|
2030
|
-
e.status ? /* @__PURE__ */ l(U.Item, { children: /* @__PURE__ */ l(
|
|
2031
|
-
] }) : null, Z = r ? /* @__PURE__ */ l("span", { style:
|
|
2042
|
+
C.push(X), re ?? (re = X);
|
|
2043
|
+
} else re ? re.push(y) : C.length === 0 ? C.push([y]) : C[0].push(y);
|
|
2044
|
+
const se = r ? { ...bn, ...hn } : bn, ce = r ? { ...M, ...hn } : M, V = K || e.status ? /* @__PURE__ */ J(U, { alignItems: "center", gap: "x-small", wrap: r ? "wrap" : "no-wrap", children: [
|
|
2045
|
+
K ? /* @__PURE__ */ l(U.Item, { children: /* @__PURE__ */ l(Rc, {}) }) : null,
|
|
2046
|
+
e.status ? /* @__PURE__ */ l(U.Item, { children: /* @__PURE__ */ l(Nc, { status: e.status }) }) : null
|
|
2047
|
+
] }) : null, Z = r ? /* @__PURE__ */ l("span", { style: jc, "data-title-clamp": "", children: E }) : E, pe = {
|
|
2032
2048
|
weight: "bold",
|
|
2033
2049
|
size: r ? "medium" : "small",
|
|
2034
2050
|
lineHeight: "condensed",
|
|
@@ -2042,30 +2058,30 @@ function $c({
|
|
|
2042
2058
|
},
|
|
2043
2059
|
onClick: j,
|
|
2044
2060
|
forceButtonRole: !1,
|
|
2045
|
-
variant:
|
|
2061
|
+
variant: g,
|
|
2046
2062
|
display: r ? "block" : void 0,
|
|
2047
2063
|
target: e.newTab ? "_blank" : void 0,
|
|
2048
2064
|
rel: e.newTab ? "noopener noreferrer" : void 0,
|
|
2049
2065
|
children: [
|
|
2050
|
-
/* @__PURE__ */ l(ue, { ...
|
|
2051
|
-
e.newTab ? /* @__PURE__ */ l(
|
|
2066
|
+
/* @__PURE__ */ l(ue, { ...pe, color: "primary", children: Z }),
|
|
2067
|
+
e.newTab ? /* @__PURE__ */ l(En, { children: ` ${c("opensInNewWindow")}` }) : null
|
|
2052
2068
|
]
|
|
2053
2069
|
}
|
|
2054
2070
|
) : /* @__PURE__ */ l(
|
|
2055
2071
|
ue,
|
|
2056
2072
|
{
|
|
2057
|
-
...
|
|
2058
|
-
color:
|
|
2059
|
-
"data-locked":
|
|
2073
|
+
...pe,
|
|
2074
|
+
color: T ? "secondary" : "primary",
|
|
2075
|
+
"data-locked": T ? "true" : void 0,
|
|
2060
2076
|
children: Z
|
|
2061
2077
|
}
|
|
2062
|
-
),
|
|
2078
|
+
), we = n ? "none" : "large", ke = o ? "none" : "large";
|
|
2063
2079
|
return /* @__PURE__ */ l(
|
|
2064
2080
|
ie,
|
|
2065
2081
|
{
|
|
2066
2082
|
as: "div",
|
|
2067
2083
|
background: "secondary",
|
|
2068
|
-
borderRadius: `${
|
|
2084
|
+
borderRadius: `${we} ${we} ${ke} ${ke}`,
|
|
2069
2085
|
padding: r ? "small" : "mediumSmall",
|
|
2070
2086
|
margin: n ? "0" : "x-small 0 0 0",
|
|
2071
2087
|
cursor: L ? "pointer" : void 0,
|
|
@@ -2076,10 +2092,10 @@ function $c({
|
|
|
2076
2092
|
e.indent > 0 ? /* @__PURE__ */ l(
|
|
2077
2093
|
U.Item,
|
|
2078
2094
|
{
|
|
2079
|
-
size:
|
|
2095
|
+
size: kc,
|
|
2080
2096
|
textAlign: "center",
|
|
2081
2097
|
"data-testid": "item-nest-arrow",
|
|
2082
|
-
children: /* @__PURE__ */ l("span", { style: { color:
|
|
2098
|
+
children: /* @__PURE__ */ l("span", { style: { color: f }, children: /* @__PURE__ */ l(Do, { size: "md", color: "inherit" }) })
|
|
2083
2099
|
}
|
|
2084
2100
|
) : null,
|
|
2085
2101
|
/* @__PURE__ */ J(U.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
@@ -2087,26 +2103,26 @@ function $c({
|
|
|
2087
2103
|
"div",
|
|
2088
2104
|
{
|
|
2089
2105
|
style: {
|
|
2090
|
-
lineHeight: r ? 0 : `${
|
|
2091
|
-
marginBottom: k.length === 0 ? 0 : `${r ?
|
|
2106
|
+
lineHeight: r ? 0 : `${Yc}rem`,
|
|
2107
|
+
marginBottom: k.length === 0 ? 0 : `${r ? Vc : Qc}rem`
|
|
2092
2108
|
},
|
|
2093
2109
|
children: Oe
|
|
2094
2110
|
}
|
|
2095
2111
|
),
|
|
2096
|
-
/* @__PURE__ */ l("div", { style:
|
|
2112
|
+
/* @__PURE__ */ l("div", { style: $c, children: /* @__PURE__ */ l(
|
|
2097
2113
|
ue,
|
|
2098
2114
|
{
|
|
2099
2115
|
size: r ? "small" : "x-small",
|
|
2100
2116
|
lineHeight: "default",
|
|
2101
2117
|
color: "secondary",
|
|
2102
2118
|
"data-testid": "module-item-meta",
|
|
2103
|
-
children:
|
|
2119
|
+
children: C.map((y, X) => /* @__PURE__ */ l(
|
|
2104
2120
|
"span",
|
|
2105
2121
|
{
|
|
2106
|
-
style: r ? X > 0 ? He :
|
|
2122
|
+
style: r ? X > 0 ? He : Gc : C.length > 1 ? X > 0 ? Wc : He : void 0,
|
|
2107
2123
|
"data-testid": "meta-line",
|
|
2108
|
-
children: y.map((F, le) => /* @__PURE__ */ J(
|
|
2109
|
-
le > 0 ? /* @__PURE__ */ l("span", { style:
|
|
2124
|
+
children: y.map((F, le) => /* @__PURE__ */ J(vn, { children: [
|
|
2125
|
+
le > 0 ? /* @__PURE__ */ l("span", { style: Hc, children: " " }) : null,
|
|
2110
2126
|
/* @__PURE__ */ J(
|
|
2111
2127
|
"span",
|
|
2112
2128
|
{
|
|
@@ -2114,13 +2130,13 @@ function $c({
|
|
|
2114
2130
|
"data-testid": "meta-fact",
|
|
2115
2131
|
"data-fact-key": F.key,
|
|
2116
2132
|
children: [
|
|
2117
|
-
|
|
2133
|
+
Me(F.icon) ? null : /* @__PURE__ */ l(
|
|
2118
2134
|
"span",
|
|
2119
2135
|
{
|
|
2120
|
-
style:
|
|
2136
|
+
style: Kc,
|
|
2121
2137
|
"aria-hidden": "true",
|
|
2122
2138
|
"data-testid": `meta-icon-${F.key}`,
|
|
2123
|
-
children: r && mt(F.icon) && F.icon.props.size === "xs" ?
|
|
2139
|
+
children: r && mt(F.icon) && F.icon.props.size === "xs" ? Mo(F.icon, { size: "sm" }) : F.icon
|
|
2124
2140
|
}
|
|
2125
2141
|
),
|
|
2126
2142
|
F.node
|
|
@@ -2141,8 +2157,8 @@ function $c({
|
|
|
2141
2157
|
}
|
|
2142
2158
|
);
|
|
2143
2159
|
}
|
|
2144
|
-
const
|
|
2145
|
-
function
|
|
2160
|
+
const Zl = Io(Xc);
|
|
2161
|
+
function Jc(e) {
|
|
2146
2162
|
switch (e) {
|
|
2147
2163
|
case "complete":
|
|
2148
2164
|
return "complete";
|
|
@@ -2167,7 +2183,7 @@ function ot(e) {
|
|
|
2167
2183
|
};
|
|
2168
2184
|
};
|
|
2169
2185
|
}
|
|
2170
|
-
const
|
|
2186
|
+
const el = {
|
|
2171
2187
|
missing: {
|
|
2172
2188
|
background: "primary-inverse",
|
|
2173
2189
|
borderWidth: "none",
|
|
@@ -2194,14 +2210,14 @@ const Wc = {
|
|
|
2194
2210
|
locked: {
|
|
2195
2211
|
background: "secondary",
|
|
2196
2212
|
borderWidth: "small",
|
|
2197
|
-
icon: /* @__PURE__ */ l(
|
|
2213
|
+
icon: /* @__PURE__ */ l(gt, { size: "sm", color: "baseColor" })
|
|
2198
2214
|
}
|
|
2199
2215
|
};
|
|
2200
|
-
function
|
|
2201
|
-
var
|
|
2216
|
+
function tl(e) {
|
|
2217
|
+
var i, c, d;
|
|
2202
2218
|
let t = 0, n = 0, o = 0;
|
|
2203
|
-
for (const
|
|
2204
|
-
((
|
|
2219
|
+
for (const p of e)
|
|
2220
|
+
((i = p.progress) == null ? void 0 : i.status) === "complete" && (t += 1), n += ((c = p.progress) == null ? void 0 : c.requirementCount) ?? 0, o += ((d = p.progress) == null ? void 0 : d.requirementsMet) ?? 0;
|
|
2205
2221
|
const r = e.length, s = r === 0 ? 0 : t === r ? 100 : Math.floor(t / r * 100);
|
|
2206
2222
|
return {
|
|
2207
2223
|
totalModules: r,
|
|
@@ -2211,27 +2227,27 @@ function Gc(e) {
|
|
|
2211
2227
|
percent: s
|
|
2212
2228
|
};
|
|
2213
2229
|
}
|
|
2214
|
-
const ut = 32,
|
|
2215
|
-
function
|
|
2216
|
-
const o =
|
|
2230
|
+
const ut = 32, nl = "4px", ol = 4, De = { none: 0, small: 1, medium: 2 }, rl = 6, sl = 8, yn = 2, Be = 3;
|
|
2231
|
+
function il(e, t, n) {
|
|
2232
|
+
const o = ol + n / 2, r = e ? ut / 2 : o, s = t ? ut / 2 : o;
|
|
2217
2233
|
return `${r}px ${s}px ${s}px ${r}px`;
|
|
2218
2234
|
}
|
|
2219
|
-
function
|
|
2235
|
+
function al({
|
|
2220
2236
|
module: e,
|
|
2221
2237
|
isFirst: t,
|
|
2222
2238
|
isLast: n,
|
|
2223
2239
|
onClick: o
|
|
2224
2240
|
}) {
|
|
2225
|
-
var
|
|
2226
|
-
const { t: r } = oe(),
|
|
2241
|
+
var f, M, x;
|
|
2242
|
+
const { t: r } = oe(), i = Vn().moduleLabel(e.position, e), c = i ? r("moduleNameWithLabel", { label: i, name: e.name }) : e.name, d = ((f = e.progress) == null ? void 0 : f.status) ?? "not_started", p = Jc(d), h = r("moduleProgressSegmentLabel", {
|
|
2227
2243
|
name: c,
|
|
2228
2244
|
status: so(
|
|
2229
2245
|
r,
|
|
2230
2246
|
d,
|
|
2231
|
-
((
|
|
2247
|
+
((M = e.progress) == null ? void 0 : M.missingCount) ?? 0,
|
|
2232
2248
|
((x = e.progress) == null ? void 0 : x.incompleteCount) ?? 0
|
|
2233
2249
|
)
|
|
2234
|
-
}),
|
|
2250
|
+
}), g = el[p];
|
|
2235
2251
|
return /* @__PURE__ */ l(U.Item, { shouldGrow: !0, shouldShrink: !0, size: "0", children: /* @__PURE__ */ l(ko, { renderTip: c, children: () => /* @__PURE__ */ J(
|
|
2236
2252
|
ie,
|
|
2237
2253
|
{
|
|
@@ -2242,17 +2258,17 @@ function Vc({
|
|
|
2242
2258
|
height: `${ut}px`,
|
|
2243
2259
|
padding: "0",
|
|
2244
2260
|
position: "relative",
|
|
2245
|
-
borderRadius:
|
|
2246
|
-
borderWidth:
|
|
2261
|
+
borderRadius: il(t, n, De[g.borderWidth]),
|
|
2262
|
+
borderWidth: g.borderWidth,
|
|
2247
2263
|
borderColor: "secondary",
|
|
2248
|
-
background:
|
|
2249
|
-
themeOverride:
|
|
2264
|
+
background: g.background,
|
|
2265
|
+
themeOverride: g.themeOverride,
|
|
2250
2266
|
cursor: o ? "pointer" : void 0,
|
|
2251
2267
|
onClick: o ? () => o(e.id) : void 0,
|
|
2252
2268
|
"data-testid": `modules-progress-segment-${e.id}`,
|
|
2253
2269
|
children: [
|
|
2254
|
-
/* @__PURE__ */ l(U, { as: "span", height: "100%", justifyItems: "center", alignItems: "center", children:
|
|
2255
|
-
/* @__PURE__ */ l(
|
|
2270
|
+
/* @__PURE__ */ l(U, { as: "span", height: "100%", justifyItems: "center", alignItems: "center", children: g.icon }),
|
|
2271
|
+
/* @__PURE__ */ l(En, { children: h }),
|
|
2256
2272
|
/* @__PURE__ */ l(
|
|
2257
2273
|
"span",
|
|
2258
2274
|
{
|
|
@@ -2260,10 +2276,10 @@ function Vc({
|
|
|
2260
2276
|
"data-testid": `modules-progress-hit-area-${e.id}`,
|
|
2261
2277
|
style: {
|
|
2262
2278
|
position: "absolute",
|
|
2263
|
-
top: `-${
|
|
2264
|
-
bottom: `-${
|
|
2265
|
-
left: `${yn - De[
|
|
2266
|
-
right: `${yn - De[
|
|
2279
|
+
top: `-${rl + De[g.borderWidth]}px`,
|
|
2280
|
+
bottom: `-${sl + De[g.borderWidth]}px`,
|
|
2281
|
+
left: `${yn - De[g.borderWidth]}px`,
|
|
2282
|
+
right: `${yn - De[g.borderWidth]}px`
|
|
2267
2283
|
}
|
|
2268
2284
|
}
|
|
2269
2285
|
)
|
|
@@ -2271,7 +2287,7 @@ function Vc({
|
|
|
2271
2287
|
}
|
|
2272
2288
|
) }) });
|
|
2273
2289
|
}
|
|
2274
|
-
function
|
|
2290
|
+
function Xl({
|
|
2275
2291
|
modules: e,
|
|
2276
2292
|
onModuleClick: t,
|
|
2277
2293
|
hasMoreModules: n = !1,
|
|
@@ -2279,14 +2295,14 @@ function $l({
|
|
|
2279
2295
|
continuesAfter: r = !1,
|
|
2280
2296
|
pagination: s
|
|
2281
2297
|
}) {
|
|
2282
|
-
const { t:
|
|
2283
|
-
if (!e.some((
|
|
2284
|
-
const
|
|
2298
|
+
const { t: i } = oe(), c = W(() => tl(e), [e]);
|
|
2299
|
+
if (!e.some((g) => g.progress !== void 0) || c.totalModules === 0) return null;
|
|
2300
|
+
const p = i("moduleProgressOverviewSummary", {
|
|
2285
2301
|
count: c.totalModules,
|
|
2286
2302
|
completedModules: c.completedModules,
|
|
2287
2303
|
totalModules: c.totalModules
|
|
2288
|
-
}), h = c.totalItems > 0 ?
|
|
2289
|
-
itemsSummary:
|
|
2304
|
+
}), h = c.totalItems > 0 ? i("moduleProgressOverviewDetail", {
|
|
2305
|
+
itemsSummary: i("moduleProgressOverviewItemsSummary", {
|
|
2290
2306
|
count: c.totalItems,
|
|
2291
2307
|
completedItems: c.completedItems,
|
|
2292
2308
|
totalItems: c.totalItems
|
|
@@ -2300,34 +2316,34 @@ function $l({
|
|
|
2300
2316
|
level: "reset",
|
|
2301
2317
|
variant: "titleSection",
|
|
2302
2318
|
"data-testid": "modules-progress-overview-percent",
|
|
2303
|
-
children:
|
|
2319
|
+
children: i("moduleProgressOverviewPercentLabel", { percent: c.percent })
|
|
2304
2320
|
}
|
|
2305
2321
|
) }),
|
|
2306
|
-
/* @__PURE__ */ l(ue, { variant: "content", "data-testid": "modules-progress-overview-summary", children: h ? `${
|
|
2322
|
+
/* @__PURE__ */ l(ue, { variant: "content", "data-testid": "modules-progress-overview-summary", children: h ? `${p} ${h}` : p })
|
|
2307
2323
|
] }) }),
|
|
2308
2324
|
/* @__PURE__ */ l(ie, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ l(
|
|
2309
2325
|
U,
|
|
2310
2326
|
{
|
|
2311
|
-
gap:
|
|
2327
|
+
gap: nl,
|
|
2312
2328
|
role: "group",
|
|
2313
|
-
"aria-label":
|
|
2329
|
+
"aria-label": i("moduleProgressOverviewGroupLabel"),
|
|
2314
2330
|
"data-testid": "modules-progress-overview-segments",
|
|
2315
|
-
children: e.map((
|
|
2316
|
-
|
|
2331
|
+
children: e.map((g, f) => /* @__PURE__ */ l(
|
|
2332
|
+
al,
|
|
2317
2333
|
{
|
|
2318
|
-
module:
|
|
2319
|
-
isFirst:
|
|
2320
|
-
isLast:
|
|
2334
|
+
module: g,
|
|
2335
|
+
isFirst: f === 0 && !o,
|
|
2336
|
+
isLast: f === e.length - 1 && !r,
|
|
2321
2337
|
onClick: t
|
|
2322
2338
|
},
|
|
2323
|
-
|
|
2339
|
+
g.id
|
|
2324
2340
|
))
|
|
2325
2341
|
}
|
|
2326
2342
|
) }),
|
|
2327
|
-
s ? /* @__PURE__ */ l(
|
|
2343
|
+
s ? /* @__PURE__ */ l(cl, { pagination: s, shownCount: e.length }) : null
|
|
2328
2344
|
] });
|
|
2329
2345
|
}
|
|
2330
|
-
function
|
|
2346
|
+
function In({
|
|
2331
2347
|
targetRef: e,
|
|
2332
2348
|
testId: t,
|
|
2333
2349
|
children: n
|
|
@@ -2349,19 +2365,19 @@ function Mn({
|
|
|
2349
2365
|
}
|
|
2350
2366
|
);
|
|
2351
2367
|
}
|
|
2352
|
-
function
|
|
2368
|
+
function cl({
|
|
2353
2369
|
pagination: e,
|
|
2354
2370
|
shownCount: t
|
|
2355
2371
|
}) {
|
|
2356
|
-
const { t: n } = oe(), { rangeStart: o, totalCount: r, hasPreviousPage: s, hasNextPage:
|
|
2372
|
+
const { t: n } = oe(), { rangeStart: o, totalCount: r, hasPreviousPage: s, hasNextPage: i, disabled: c = !1 } = e, d = _(null), p = _(null), h = _(null);
|
|
2357
2373
|
me(() => {
|
|
2358
|
-
var
|
|
2374
|
+
var M, x;
|
|
2359
2375
|
if (c) return;
|
|
2360
|
-
const
|
|
2361
|
-
h.current = null,
|
|
2362
|
-
}, [c,
|
|
2363
|
-
const
|
|
2364
|
-
c || (h.current =
|
|
2376
|
+
const f = h.current;
|
|
2377
|
+
h.current = null, f === "next" && !i && ((M = d.current) == null || M.focus()), f === "previous" && !s && ((x = p.current) == null || x.focus());
|
|
2378
|
+
}, [c, i, s]);
|
|
2379
|
+
const g = (f) => {
|
|
2380
|
+
c || (h.current = f, f === "next" ? e.onNextPage() : e.onPreviousPage());
|
|
2365
2381
|
};
|
|
2366
2382
|
return /* @__PURE__ */ l(ie, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ J(
|
|
2367
2383
|
U,
|
|
@@ -2373,7 +2389,7 @@ function Zc({
|
|
|
2373
2389
|
"aria-label": n("moduleProgressOverviewPaginationLabel"),
|
|
2374
2390
|
"data-testid": "modules-progress-overview-pagination",
|
|
2375
2391
|
children: [
|
|
2376
|
-
/* @__PURE__ */ l(
|
|
2392
|
+
/* @__PURE__ */ l(In, { targetRef: d, testId: "modules-progress-overview-previous-hit-area", children: /* @__PURE__ */ l(
|
|
2377
2393
|
Ft,
|
|
2378
2394
|
{
|
|
2379
2395
|
size: "small",
|
|
@@ -2382,10 +2398,10 @@ function Zc({
|
|
|
2382
2398
|
renderIcon: /* @__PURE__ */ l(Lo, {}),
|
|
2383
2399
|
screenReaderLabel: n("paginationPreviousPage"),
|
|
2384
2400
|
interaction: s ? "enabled" : "disabled",
|
|
2385
|
-
elementRef: (
|
|
2386
|
-
d.current =
|
|
2401
|
+
elementRef: (f) => {
|
|
2402
|
+
d.current = f;
|
|
2387
2403
|
},
|
|
2388
|
-
onClick: () =>
|
|
2404
|
+
onClick: () => g("previous")
|
|
2389
2405
|
}
|
|
2390
2406
|
) }),
|
|
2391
2407
|
r === null ? null : /* @__PURE__ */ l(ue, { size: "small", color: "secondary", "data-testid": "modules-progress-overview-range", children: n("moduleProgressOverviewPageRange", {
|
|
@@ -2393,7 +2409,7 @@ function Zc({
|
|
|
2393
2409
|
end: o + t - 1,
|
|
2394
2410
|
total: r
|
|
2395
2411
|
}) }),
|
|
2396
|
-
/* @__PURE__ */ l(
|
|
2412
|
+
/* @__PURE__ */ l(In, { targetRef: p, testId: "modules-progress-overview-next-hit-area", children: /* @__PURE__ */ l(
|
|
2397
2413
|
Ft,
|
|
2398
2414
|
{
|
|
2399
2415
|
size: "small",
|
|
@@ -2401,11 +2417,11 @@ function Zc({
|
|
|
2401
2417
|
withBorder: !1,
|
|
2402
2418
|
renderIcon: /* @__PURE__ */ l(xo, {}),
|
|
2403
2419
|
screenReaderLabel: n("paginationNextPage"),
|
|
2404
|
-
interaction:
|
|
2405
|
-
elementRef: (
|
|
2406
|
-
|
|
2420
|
+
interaction: i ? "enabled" : "disabled",
|
|
2421
|
+
elementRef: (f) => {
|
|
2422
|
+
p.current = f;
|
|
2407
2423
|
},
|
|
2408
|
-
onClick: () =>
|
|
2424
|
+
onClick: () => g("next")
|
|
2409
2425
|
}
|
|
2410
2426
|
) })
|
|
2411
2427
|
]
|
|
@@ -2414,26 +2430,26 @@ function Zc({
|
|
|
2414
2430
|
}
|
|
2415
2431
|
export {
|
|
2416
2432
|
Qo as $,
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2433
|
+
$c as A,
|
|
2434
|
+
Hc as B,
|
|
2435
|
+
Vl as C,
|
|
2420
2436
|
ro as D,
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2437
|
+
Wl as E,
|
|
2438
|
+
Bl as F,
|
|
2439
|
+
Zl as G,
|
|
2424
2440
|
Vo as H,
|
|
2425
2441
|
Nn as I,
|
|
2426
2442
|
Jo as J,
|
|
2427
2443
|
Xo as K,
|
|
2428
2444
|
Zo as L,
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2445
|
+
Al as M,
|
|
2446
|
+
$l as N,
|
|
2447
|
+
jl as O,
|
|
2448
|
+
kl as P,
|
|
2449
|
+
Yl as Q,
|
|
2450
|
+
Xl as R,
|
|
2451
|
+
za as S,
|
|
2452
|
+
Cn as T,
|
|
2437
2453
|
Ho as U,
|
|
2438
2454
|
$o as V,
|
|
2439
2455
|
Bo as W,
|
|
@@ -2441,76 +2457,76 @@ export {
|
|
|
2441
2457
|
Go as Y,
|
|
2442
2458
|
Wo as Z,
|
|
2443
2459
|
Ko as _,
|
|
2444
|
-
|
|
2460
|
+
_l as a,
|
|
2445
2461
|
An as a0,
|
|
2446
2462
|
jo as a1,
|
|
2447
|
-
|
|
2463
|
+
Cl as a2,
|
|
2448
2464
|
Yo as a3,
|
|
2449
2465
|
Dn as a4,
|
|
2450
2466
|
Ln as a5,
|
|
2451
|
-
|
|
2467
|
+
Ol as a6,
|
|
2452
2468
|
nr as a7,
|
|
2453
2469
|
rn as a8,
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2470
|
+
$a as a9,
|
|
2471
|
+
Rc as aA,
|
|
2472
|
+
xc as aB,
|
|
2473
|
+
Nc as aC,
|
|
2458
2474
|
so as aD,
|
|
2459
2475
|
kn as aE,
|
|
2460
2476
|
ae as aF,
|
|
2461
|
-
|
|
2462
|
-
|
|
2477
|
+
va as aG,
|
|
2478
|
+
Me as aH,
|
|
2463
2479
|
io as aI,
|
|
2464
2480
|
ot as aJ,
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2481
|
+
Wa as aa,
|
|
2482
|
+
Ua as ab,
|
|
2483
|
+
It as ac,
|
|
2484
|
+
Xa as ad,
|
|
2485
|
+
Ya as ae,
|
|
2486
|
+
Ba as af,
|
|
2487
|
+
Va as ag,
|
|
2488
|
+
Za as ah,
|
|
2473
2489
|
Re as ai,
|
|
2474
2490
|
ye as aj,
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2491
|
+
Gl as ak,
|
|
2492
|
+
Ka as al,
|
|
2493
|
+
Hl as am,
|
|
2494
|
+
ve as an,
|
|
2479
2495
|
Zn as ao,
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2496
|
+
oc as ap,
|
|
2497
|
+
nc as aq,
|
|
2498
|
+
tc as ar,
|
|
2483
2499
|
St as as,
|
|
2484
2500
|
Xn as at,
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2501
|
+
vt as au,
|
|
2502
|
+
cc as av,
|
|
2503
|
+
zl as aw,
|
|
2488
2504
|
We as ax,
|
|
2489
2505
|
Ne as ay,
|
|
2490
2506
|
cr as az,
|
|
2491
2507
|
qt as b,
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2508
|
+
Fl as c,
|
|
2509
|
+
Kl as d,
|
|
2510
|
+
Nl as e,
|
|
2511
|
+
xl as f,
|
|
2512
|
+
Rl as g,
|
|
2497
2513
|
it as h,
|
|
2498
|
-
|
|
2499
|
-
|
|
2514
|
+
ql as i,
|
|
2515
|
+
Mt as j,
|
|
2500
2516
|
Ye as k,
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2517
|
+
Dc as l,
|
|
2518
|
+
Ul as m,
|
|
2519
|
+
Kc as n,
|
|
2504
2520
|
Bt as o,
|
|
2505
2521
|
tr as p,
|
|
2506
2522
|
Vn as q,
|
|
2507
|
-
|
|
2508
|
-
|
|
2523
|
+
Oc as r,
|
|
2524
|
+
Ql as s,
|
|
2509
2525
|
Un as t,
|
|
2510
2526
|
oe as u,
|
|
2511
2527
|
Rn as v,
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2528
|
+
Dl as w,
|
|
2529
|
+
Ll as x,
|
|
2530
|
+
Uc as y,
|
|
2531
|
+
Oa as z
|
|
2516
2532
|
};
|