@pie-players/pie-assessment-player 0.3.73 → 0.3.74
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.
|
@@ -1,150 +1,46 @@
|
|
|
1
1
|
import "@pie-players/pie-section-player/components/section-player-splitpane-element";
|
|
2
2
|
import "@pie-players/pie-section-player/components/section-player-vertical-element";
|
|
3
|
-
import { SECTION_PLAYER_PUBLIC_EVENTS as
|
|
4
|
-
import { coerceBooleanLike as
|
|
5
|
-
import { createNewAssessmentSession as
|
|
6
|
-
var
|
|
3
|
+
import { SECTION_PLAYER_PUBLIC_EVENTS as N } from "@pie-players/pie-section-player/contracts/public-events";
|
|
4
|
+
import { coerceBooleanLike as R, defineCustomElementSafely as B } from "@pie-players/pie-players-shared";
|
|
5
|
+
import { createNewAssessmentSession as V, frameworkErrorFromUnknown as Q, setCurrentSectionPosition as J, upsertSectionSession as K } from "@pie-players/pie-assessment-toolkit";
|
|
6
|
+
var b = (e) => {
|
|
7
7
|
if (e === null || typeof e != "object") return e;
|
|
8
|
-
if (Array.isArray(e)) return e.map(
|
|
8
|
+
if (Array.isArray(e)) return e.map(b);
|
|
9
9
|
const t = {};
|
|
10
|
-
for (const i in e) Object.hasOwn(e, i) && (t[i] =
|
|
10
|
+
for (const i in e) Object.hasOwn(e, i) && (t[i] = b(e[i]));
|
|
11
11
|
return t;
|
|
12
|
-
}, Y = "https://proxy.pie-api.com", de = `${Y}/bundles/`;
|
|
13
|
-
function W(e) {
|
|
14
|
-
try {
|
|
15
|
-
const t = {
|
|
16
|
-
BASE_URL: "/",
|
|
17
|
-
DEV: !1,
|
|
18
|
-
MODE: "production",
|
|
19
|
-
PROD: !0,
|
|
20
|
-
SSR: !1
|
|
21
|
-
}[e];
|
|
22
|
-
if (typeof t == "string" && t.length > 0) return t;
|
|
23
|
-
} catch {
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
var nt = typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || W("PUBLIC_BUILDER_ORIGIN_URL") || Y, ue = typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || W("PUBLIC_BUILDER_BUNDLE_URL") || de, he = {
|
|
27
|
-
retryDelayMs: 3e3,
|
|
28
|
-
timeoutMs: 12e4
|
|
29
12
|
};
|
|
30
|
-
function
|
|
13
|
+
function S(e) {
|
|
31
14
|
"@babel/helpers - typeof";
|
|
32
|
-
return
|
|
15
|
+
return S = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
33
16
|
return typeof t;
|
|
34
17
|
} : function(t) {
|
|
35
18
|
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
36
|
-
},
|
|
19
|
+
}, S(e);
|
|
37
20
|
}
|
|
38
|
-
function
|
|
39
|
-
if (
|
|
21
|
+
function Y(e, t) {
|
|
22
|
+
if (S(e) != "object" || !e) return e;
|
|
40
23
|
var i = e[Symbol.toPrimitive];
|
|
41
24
|
if (i !== void 0) {
|
|
42
25
|
var s = i.call(e, t || "default");
|
|
43
|
-
if (
|
|
26
|
+
if (S(s) != "object") return s;
|
|
44
27
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
45
28
|
}
|
|
46
29
|
return (t === "string" ? String : Number)(e);
|
|
47
30
|
}
|
|
48
|
-
function
|
|
49
|
-
var t =
|
|
50
|
-
return
|
|
31
|
+
function Z(e) {
|
|
32
|
+
var t = Y(e, "string");
|
|
33
|
+
return S(t) == "symbol" ? t : t + "";
|
|
51
34
|
}
|
|
52
|
-
function
|
|
53
|
-
return (t =
|
|
35
|
+
function g(e, t, i) {
|
|
36
|
+
return (t = Z(t)) in e ? Object.defineProperty(e, t, {
|
|
54
37
|
value: i,
|
|
55
38
|
enumerable: !0,
|
|
56
39
|
configurable: !0,
|
|
57
40
|
writable: !0
|
|
58
41
|
}) : e[t] = i, e;
|
|
59
42
|
}
|
|
60
|
-
|
|
61
|
-
(function(e) {
|
|
62
|
-
e.SAVE = "save", e.MODEL = "model", e.SCORE = "score", e.MANUAL_SCORE = "manual-score";
|
|
63
|
-
})(D || (D = {}));
|
|
64
|
-
var _;
|
|
65
|
-
(function(e) {
|
|
66
|
-
e.AUTO = "auto", e.MANUAL = "manual";
|
|
67
|
-
})(_ || (_ = {}));
|
|
68
|
-
var U;
|
|
69
|
-
(function(e) {
|
|
70
|
-
e.GATHER = "gather", e.VIEW = "view", e.EVALUATE = "evaluate";
|
|
71
|
-
})(U || (U = {}));
|
|
72
|
-
var M;
|
|
73
|
-
(function(e) {
|
|
74
|
-
e.PENDING = "pending", e.IN_PROGRESS = "in_progress", e.COMPLETED = "completed", e.FAILED = "failed";
|
|
75
|
-
})(M || (M = {}));
|
|
76
|
-
var ge = class Q extends CustomEvent {
|
|
77
|
-
constructor(t, i = !1) {
|
|
78
|
-
super(Q.TYPE, {
|
|
79
|
-
bubbles: !0,
|
|
80
|
-
detail: {
|
|
81
|
-
update: t,
|
|
82
|
-
reset: i
|
|
83
|
-
}
|
|
84
|
-
}), a(this, "update", void 0), a(this, "reset", void 0), this.update = t, this.reset = i;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
a(ge, "TYPE", "model.updated");
|
|
88
|
-
var fe = class J extends CustomEvent {
|
|
89
|
-
constructor(t, i) {
|
|
90
|
-
super(J.TYPE, {
|
|
91
|
-
bubbles: !0,
|
|
92
|
-
detail: {
|
|
93
|
-
src: t,
|
|
94
|
-
done: i
|
|
95
|
-
}
|
|
96
|
-
}), a(this, "src", void 0), a(this, "done", void 0), this.src = t, this.done = i;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
a(fe, "TYPE", "delete.image");
|
|
100
|
-
var ve = class K extends CustomEvent {
|
|
101
|
-
constructor(t) {
|
|
102
|
-
super(K.TYPE, {
|
|
103
|
-
bubbles: !0,
|
|
104
|
-
detail: t
|
|
105
|
-
}), a(this, "handler", void 0), this.handler = t;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
a(ve, "TYPE", "insert.image");
|
|
109
|
-
var ye = class Z extends CustomEvent {
|
|
110
|
-
constructor(t, i) {
|
|
111
|
-
super(Z.TYPE, {
|
|
112
|
-
bubbles: !0,
|
|
113
|
-
detail: {
|
|
114
|
-
src: t,
|
|
115
|
-
done: i
|
|
116
|
-
}
|
|
117
|
-
}), a(this, "src", void 0), a(this, "done", void 0), this.src = t, this.done = i;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
a(ye, "TYPE", "delete.sound");
|
|
121
|
-
var be = class X extends CustomEvent {
|
|
122
|
-
constructor(t) {
|
|
123
|
-
super(X.TYPE, {
|
|
124
|
-
bubbles: !0,
|
|
125
|
-
detail: t
|
|
126
|
-
}), a(this, "handler", void 0), this.handler = t;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
a(be, "TYPE", "insert.sound");
|
|
130
|
-
var Se = class ee extends CustomEvent {
|
|
131
|
-
constructor(t, i) {
|
|
132
|
-
super(ee.TYPE, {
|
|
133
|
-
bubbles: !0,
|
|
134
|
-
composed: !0,
|
|
135
|
-
detail: {
|
|
136
|
-
complete: i,
|
|
137
|
-
component: t
|
|
138
|
-
}
|
|
139
|
-
}), a(this, "component", void 0), a(this, "complete", void 0), this.component = t, this.complete = i;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
a(Se, "TYPE", "session-changed");
|
|
143
|
-
var F;
|
|
144
|
-
(function(e) {
|
|
145
|
-
e[e.ROOT = 0] = "ROOT", e[e.SUBJECT = 1] = "SUBJECT", e[e.LEVEL = 2] = "LEVEL", e[e.STANDARD = 3] = "STANDARD";
|
|
146
|
-
})(F || (F = {}));
|
|
147
|
-
function v(e, t) {
|
|
43
|
+
function O(e, t) {
|
|
148
44
|
const i = `[${e}]`;
|
|
149
45
|
return {
|
|
150
46
|
debug: (s, ...n) => {
|
|
@@ -155,38 +51,22 @@ function v(e, t) {
|
|
|
155
51
|
error: (s, ...n) => console.error(i, s, ...n)
|
|
156
52
|
};
|
|
157
53
|
}
|
|
158
|
-
function
|
|
54
|
+
function H() {
|
|
159
55
|
return typeof window < "u" && window.PIE_DEBUG === !0;
|
|
160
56
|
}
|
|
161
|
-
|
|
162
|
-
(function(e) {
|
|
163
|
-
e.player = "player.js", e.clientPlayer = "client-player.js", e.editor = "editor.js";
|
|
164
|
-
})(T || (T = {}));
|
|
165
|
-
var B;
|
|
166
|
-
(function(e) {
|
|
167
|
-
e.loading = "loading", e.loaded = "loaded";
|
|
168
|
-
})(B || (B = {}));
|
|
169
|
-
var ot = v("pie-scoring", () => y()), rt = v("pie-initialize-element", () => y()), at = v("math-rendering", () => y()), lt = v("pie-updates", () => y()), ct = v("pie-initialization", () => y()), dt = he.timeoutMs, ut = {
|
|
170
|
-
buildServiceBase: ue,
|
|
171
|
-
bundleType: T.player,
|
|
172
|
-
env: {
|
|
173
|
-
mode: "gather",
|
|
174
|
-
role: "student"
|
|
175
|
-
}
|
|
176
|
-
}, ht = v("pie-element-observer", () => y()), pt = v("asset-handler", () => y()), mt = v("authoring", () => y());
|
|
177
|
-
function te(e) {
|
|
57
|
+
function q(e) {
|
|
178
58
|
if (!e || typeof e != "object") return !1;
|
|
179
59
|
const t = e;
|
|
180
60
|
return typeof t.providerId == "string" && typeof t.providerName == "string" && typeof t.initialize == "function" && typeof t.trackError == "function" && typeof t.trackEvent == "function" && typeof t.destroy == "function" && typeof t.isReady == "function";
|
|
181
61
|
}
|
|
182
|
-
var
|
|
183
|
-
function
|
|
62
|
+
var X = O("instrumentation-event-bridge", () => H());
|
|
63
|
+
function ee(e) {
|
|
184
64
|
return e && typeof e == "object" ? e : typeof e > "u" ? {} : { value: e };
|
|
185
65
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
66
|
+
function te(e) {
|
|
67
|
+
X.warn(`[InstrumentationEventBridge:${e}] Ignoring invalid instrumentation provider; expected InstrumentationProvider contract`);
|
|
188
68
|
}
|
|
189
|
-
function
|
|
69
|
+
function ie(e) {
|
|
190
70
|
try {
|
|
191
71
|
e.provider.trackError(e.error instanceof Error ? e.error : new Error(String(e.error ?? "Unknown instrumentation bridge error")), {
|
|
192
72
|
component: e.component,
|
|
@@ -196,62 +76,72 @@ function Ie(e) {
|
|
|
196
76
|
} catch {
|
|
197
77
|
}
|
|
198
78
|
}
|
|
199
|
-
function
|
|
79
|
+
function se(e) {
|
|
200
80
|
if (!e.host || !e.eventMap.length) return () => {
|
|
201
81
|
};
|
|
202
82
|
if (!e.instrumentationProvider) return () => {
|
|
203
83
|
};
|
|
204
|
-
if (!
|
|
205
|
-
return e.debug &&
|
|
84
|
+
if (!q(e.instrumentationProvider))
|
|
85
|
+
return e.debug && te(e.component), () => {
|
|
206
86
|
};
|
|
207
|
-
const t = e.instrumentationProvider, i = [], s = Math.max(0, e.dedupeWindowMs ?? 0), n = /* @__PURE__ */ new Map(), o = (r,
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
].map((
|
|
216
|
-
return `${r.instrumentationEventName}|${
|
|
87
|
+
const t = e.instrumentationProvider, i = [], s = Math.max(0, e.dedupeWindowMs ?? 0), n = /* @__PURE__ */ new Map(), o = (r, a) => {
|
|
88
|
+
const h = [
|
|
89
|
+
a.assessmentId,
|
|
90
|
+
a.sectionId,
|
|
91
|
+
a.attemptId,
|
|
92
|
+
a.itemId,
|
|
93
|
+
a.canonicalItemId,
|
|
94
|
+
a.sourceRuntimeId
|
|
95
|
+
].map((d) => String(d ?? "")).join("|");
|
|
96
|
+
return `${r.instrumentationEventName}|${h}`;
|
|
217
97
|
};
|
|
218
98
|
for (const r of e.eventMap) {
|
|
219
|
-
const
|
|
99
|
+
const a = (h) => {
|
|
220
100
|
try {
|
|
221
|
-
if (!t.isReady() || e.shouldTrackEvent && !e.shouldTrackEvent(
|
|
222
|
-
const
|
|
223
|
-
...
|
|
101
|
+
if (!t.isReady() || e.shouldTrackEvent && !e.shouldTrackEvent(h)) return;
|
|
102
|
+
const d = ee(h.detail), c = (/* @__PURE__ */ new Date()).toISOString(), m = {
|
|
103
|
+
...d,
|
|
224
104
|
...e.staticAttributes,
|
|
225
105
|
component: e.component,
|
|
226
106
|
sourceEventName: r.sourceEventName,
|
|
227
|
-
timestamp:
|
|
107
|
+
timestamp: c
|
|
228
108
|
};
|
|
229
109
|
if (s > 0) {
|
|
230
|
-
const
|
|
231
|
-
if (typeof f == "number" &&
|
|
232
|
-
n.set(
|
|
110
|
+
const u = Date.now(), l = o(r, m), f = n.get(l);
|
|
111
|
+
if (typeof f == "number" && u - f < s) return;
|
|
112
|
+
n.set(l, u);
|
|
233
113
|
}
|
|
234
|
-
t.trackEvent(r.instrumentationEventName, { ...
|
|
235
|
-
} catch (
|
|
236
|
-
|
|
114
|
+
t.trackEvent(r.instrumentationEventName, { ...m });
|
|
115
|
+
} catch (d) {
|
|
116
|
+
ie({
|
|
237
117
|
provider: t,
|
|
238
118
|
component: e.component,
|
|
239
|
-
error:
|
|
119
|
+
error: d,
|
|
240
120
|
sourceEventName: r.sourceEventName
|
|
241
121
|
});
|
|
242
122
|
}
|
|
243
123
|
};
|
|
244
|
-
e.host.addEventListener(r.sourceEventName,
|
|
245
|
-
e.host?.removeEventListener(r.sourceEventName,
|
|
124
|
+
e.host.addEventListener(r.sourceEventName, a), i.push(() => {
|
|
125
|
+
e.host?.removeEventListener(r.sourceEventName, a);
|
|
246
126
|
});
|
|
247
127
|
}
|
|
248
128
|
return () => {
|
|
249
129
|
for (const r of i) r();
|
|
250
130
|
};
|
|
251
131
|
}
|
|
252
|
-
|
|
132
|
+
function T(e) {
|
|
133
|
+
const t = e;
|
|
134
|
+
return typeof t?.noticeError == "function" && typeof t.addPageAction == "function";
|
|
135
|
+
}
|
|
136
|
+
function y() {
|
|
137
|
+
if (typeof window > "u") return;
|
|
138
|
+
const { newrelic: e, NREUM: t } = window;
|
|
139
|
+
if (T(e)) return e;
|
|
140
|
+
if (T(t)) return t;
|
|
141
|
+
}
|
|
142
|
+
var ne = class {
|
|
253
143
|
constructor() {
|
|
254
|
-
|
|
144
|
+
g(this, "initialized", !1), g(this, "config", void 0);
|
|
255
145
|
}
|
|
256
146
|
trackError(e, t) {
|
|
257
147
|
if (!this.guardedOperation("trackError", e, t) || !this.applyErrorFilter(e, t)) return;
|
|
@@ -313,42 +203,42 @@ var Ce = class {
|
|
|
313
203
|
transformAttributes(e) {
|
|
314
204
|
return this.config?.attributeTransformer ? this.config.attributeTransformer(e) : e;
|
|
315
205
|
}
|
|
316
|
-
},
|
|
206
|
+
}, oe = class extends ne {
|
|
317
207
|
constructor(...e) {
|
|
318
|
-
super(...e),
|
|
208
|
+
super(...e), g(this, "providerId", "newrelic"), g(this, "providerName", "New Relic");
|
|
319
209
|
}
|
|
320
210
|
async initialize(e) {
|
|
321
|
-
this.config = e,
|
|
211
|
+
this.config = e, this.initialized = !0, this.config?.debug && console.log(y() ? "[NewRelicProvider] Initialized successfully" : "[NewRelicProvider] Initialized; sends once the New Relic agent is on the page");
|
|
322
212
|
}
|
|
323
213
|
isReady() {
|
|
324
|
-
return this.initialized &&
|
|
214
|
+
return this.initialized && y() !== void 0;
|
|
325
215
|
}
|
|
326
216
|
destroy() {
|
|
327
217
|
this.initialized = !1, this.config?.debug && console.log("[NewRelicProvider] Destroyed");
|
|
328
218
|
}
|
|
329
219
|
doTrackError(e, t) {
|
|
330
|
-
|
|
220
|
+
y()?.noticeError(e, t);
|
|
331
221
|
}
|
|
332
222
|
doTrackEvent(e, t) {
|
|
333
|
-
|
|
223
|
+
y()?.addPageAction(e, t);
|
|
334
224
|
}
|
|
335
225
|
doSetUserContext(e, t) {
|
|
336
|
-
const i =
|
|
337
|
-
if (i
|
|
226
|
+
const i = y();
|
|
227
|
+
if (typeof i?.setUserId == "function" && i.setUserId(e), t && typeof i?.setCustomAttribute == "function") for (const [s, n] of Object.entries(t)) i.setCustomAttribute(s, n);
|
|
338
228
|
}
|
|
339
229
|
doSetGlobalAttributes(e) {
|
|
340
|
-
const t =
|
|
341
|
-
if (t
|
|
230
|
+
const t = y();
|
|
231
|
+
if (typeof t?.setCustomAttribute == "function") for (const [i, s] of Object.entries(e)) t.setCustomAttribute(i, s);
|
|
342
232
|
}
|
|
343
233
|
};
|
|
344
|
-
function
|
|
234
|
+
function L(e) {
|
|
345
235
|
return e && typeof e == "object" ? e : {};
|
|
346
236
|
}
|
|
347
|
-
function
|
|
348
|
-
const t =
|
|
237
|
+
function D(e) {
|
|
238
|
+
const t = L(L(e).loaderConfig);
|
|
349
239
|
return Object.keys(t).length > 0 ? t : null;
|
|
350
240
|
}
|
|
351
|
-
function
|
|
241
|
+
function M(e) {
|
|
352
242
|
if (!e || !("instrumentationProvider" in e)) return { kind: "unset" };
|
|
353
243
|
const t = e.instrumentationProvider;
|
|
354
244
|
return t === null ? { kind: "null" } : typeof t > "u" ? { kind: "unset" } : {
|
|
@@ -356,35 +246,30 @@ function G(e) {
|
|
|
356
246
|
value: t
|
|
357
247
|
};
|
|
358
248
|
}
|
|
359
|
-
function
|
|
249
|
+
function F(e) {
|
|
360
250
|
if (!e || !("trackPageActions" in e)) return;
|
|
361
251
|
const t = e.trackPageActions;
|
|
362
252
|
return typeof t == "boolean" ? t : void 0;
|
|
363
253
|
}
|
|
364
|
-
function
|
|
254
|
+
function re(e, t) {
|
|
365
255
|
return e.kind === "value" || e.kind === "null" ? e : t;
|
|
366
256
|
}
|
|
367
|
-
var I,
|
|
368
|
-
function
|
|
369
|
-
return I || (I = new
|
|
257
|
+
var I, ae = O("instrumentation-provider-resolution", () => H());
|
|
258
|
+
function le() {
|
|
259
|
+
return I || (I = new oe(), I.initialize()), I;
|
|
370
260
|
}
|
|
371
|
-
function
|
|
372
|
-
const t =
|
|
261
|
+
function ce(e) {
|
|
262
|
+
const t = D(e.runtimePlayer), i = D(e.player), s = F(t), n = F(i), o = s ?? n ?? !1, r = re(M(t), M(i));
|
|
373
263
|
if (r.kind !== "null") {
|
|
374
|
-
if (r.kind === "unset") return o ?
|
|
375
|
-
if (
|
|
264
|
+
if (r.kind === "unset") return o ? le() : void 0;
|
|
265
|
+
if (q(r.value)) return r.value;
|
|
376
266
|
if (e.debug) {
|
|
377
|
-
const
|
|
378
|
-
|
|
267
|
+
const a = e.component ? `[${e.component}] ` : "";
|
|
268
|
+
ae.warn(`${a}Ignoring invalid instrumentation provider; expected InstrumentationProvider contract`);
|
|
379
269
|
}
|
|
380
270
|
}
|
|
381
271
|
}
|
|
382
|
-
var
|
|
383
|
-
"composed",
|
|
384
|
-
"engine-ready",
|
|
385
|
-
"interactive",
|
|
386
|
-
"disposed"
|
|
387
|
-
]), xe = [
|
|
272
|
+
var de = [
|
|
388
273
|
{
|
|
389
274
|
sourceEventName: "assessment-controller-ready",
|
|
390
275
|
instrumentationEventName: "pie-assessment-controller-ready"
|
|
@@ -417,26 +302,17 @@ var gt = Object.freeze([
|
|
|
417
302
|
sourceEventName: "assessment-error",
|
|
418
303
|
instrumentationEventName: "pie-assessment-error"
|
|
419
304
|
}
|
|
420
|
-
],
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
.../* @__PURE__ */ new Set([
|
|
424
|
-
"complete",
|
|
425
|
-
"component",
|
|
426
|
-
"timestamp",
|
|
427
|
-
"sourceRuntimeId"
|
|
428
|
-
])
|
|
429
|
-
]), vt = v("pie-overrides", () => y()), De = { "nl-NL": () => import("./nl-NL-FLtEAIq9.js") }, _e = ["en-US", "nl-NL"];
|
|
430
|
-
async function Ue(e) {
|
|
431
|
-
const t = De[e];
|
|
305
|
+
], ue = { "nl-NL": () => import("./nl-NL-BVlv1TF9.js") }, he = ["en-US", "nl-NL"];
|
|
306
|
+
async function pe(e) {
|
|
307
|
+
const t = ue[e];
|
|
432
308
|
if (!t) throw new Error(`No bundled i18n catalog for locale: ${e}`);
|
|
433
309
|
return (await t()).default;
|
|
434
310
|
}
|
|
435
|
-
function
|
|
311
|
+
function w(e) {
|
|
436
312
|
return e ? e.trim().replace(/_/g, "-").split(/[.@]/)[0].toLowerCase() : "";
|
|
437
313
|
}
|
|
438
|
-
function
|
|
439
|
-
const t =
|
|
314
|
+
function me(e) {
|
|
315
|
+
const t = w(e);
|
|
440
316
|
if (!t) return [];
|
|
441
317
|
const i = t.split("-"), s = [];
|
|
442
318
|
for (let n = i.length; n > 0; n--) {
|
|
@@ -445,13 +321,13 @@ function Me(e) {
|
|
|
445
321
|
}
|
|
446
322
|
return s;
|
|
447
323
|
}
|
|
448
|
-
function
|
|
449
|
-
for (const i of
|
|
450
|
-
const s = t.find((n) =>
|
|
324
|
+
function ge(e, t) {
|
|
325
|
+
for (const i of me(e)) {
|
|
326
|
+
const s = t.find((n) => w(n) === i);
|
|
451
327
|
if (s != null) return s;
|
|
452
328
|
}
|
|
453
329
|
}
|
|
454
|
-
var
|
|
330
|
+
var fe = {
|
|
455
331
|
common: {
|
|
456
332
|
close: "Close",
|
|
457
333
|
cancel: "Cancel",
|
|
@@ -496,6 +372,7 @@ var Be = {
|
|
|
496
372
|
items: "Items",
|
|
497
373
|
section: "Section",
|
|
498
374
|
loadingSection: "Loading section content…",
|
|
375
|
+
sectionLoadError: "Section content could not be loaded.",
|
|
499
376
|
loadingPassage: "Loading passage content…",
|
|
500
377
|
configurationError: "Configuration Error",
|
|
501
378
|
playerError: "Player Error",
|
|
@@ -561,6 +438,11 @@ var Be = {
|
|
|
561
438
|
centerA11y: "Center tool window",
|
|
562
439
|
closeA11y: "Close tool"
|
|
563
440
|
},
|
|
441
|
+
placement: {
|
|
442
|
+
controlsA11y: "Move and rotate",
|
|
443
|
+
rotateClockwiseA11y: "Rotate {degrees}° clockwise",
|
|
444
|
+
rotateCounterclockwiseA11y: "Rotate {degrees}° counterclockwise"
|
|
445
|
+
},
|
|
564
446
|
announce: {
|
|
565
447
|
movedUp: "Moved up to {position}",
|
|
566
448
|
movedDown: "Moved down to {position}",
|
|
@@ -588,8 +470,8 @@ var Be = {
|
|
|
588
470
|
},
|
|
589
471
|
graph: {
|
|
590
472
|
name: "Graph",
|
|
591
|
-
description: "
|
|
592
|
-
buttonA11y: "Graph,
|
|
473
|
+
description: "Coordinate plane",
|
|
474
|
+
buttonA11y: "Graph, coordinate plane",
|
|
593
475
|
tooltip: "Graph",
|
|
594
476
|
toolA11y: "Graph tool — draw points and lines on a coordinate grid",
|
|
595
477
|
canvasA11y: "Graph canvas — use tools to add points and draw lines",
|
|
@@ -952,7 +834,7 @@ var Be = {
|
|
|
952
834
|
coordinatorUnavailable: "Toolkit coordinator is not available for text-to-speech updates."
|
|
953
835
|
}
|
|
954
836
|
}
|
|
955
|
-
}, k = "en-US",
|
|
837
|
+
}, k = "en-US", ye = /* @__PURE__ */ new Set([
|
|
956
838
|
"ar",
|
|
957
839
|
"ckb",
|
|
958
840
|
"dv",
|
|
@@ -968,7 +850,7 @@ var Be = {
|
|
|
968
850
|
"ug",
|
|
969
851
|
"ur",
|
|
970
852
|
"yi"
|
|
971
|
-
]),
|
|
853
|
+
]), ve = /* @__PURE__ */ new Set([
|
|
972
854
|
"zero",
|
|
973
855
|
"one",
|
|
974
856
|
"two",
|
|
@@ -976,23 +858,23 @@ var Be = {
|
|
|
976
858
|
"many",
|
|
977
859
|
"other"
|
|
978
860
|
]);
|
|
979
|
-
function
|
|
861
|
+
function _(e) {
|
|
980
862
|
if (typeof e != "object" || e === null) return !1;
|
|
981
863
|
const t = Object.keys(e);
|
|
982
|
-
return t.length > 0 && t.every((i) =>
|
|
864
|
+
return t.length > 0 && t.every((i) => ve.has(i));
|
|
983
865
|
}
|
|
984
|
-
function
|
|
866
|
+
function z(e) {
|
|
985
867
|
try {
|
|
986
868
|
const i = new Intl.Locale(e).textInfo;
|
|
987
869
|
if (i?.direction === "rtl" || i?.direction === "ltr") return i.direction;
|
|
988
870
|
} catch {
|
|
989
871
|
}
|
|
990
|
-
const t =
|
|
991
|
-
return
|
|
872
|
+
const t = w(e).split("-")[0] ?? "";
|
|
873
|
+
return ye.has(t) ? "rtl" : "ltr";
|
|
992
874
|
}
|
|
993
|
-
var
|
|
875
|
+
var G = class E {
|
|
994
876
|
constructor(t = {}) {
|
|
995
|
-
|
|
877
|
+
g(this, "locale", void 0), g(this, "fallbackLocale", void 0), g(this, "catalogs", void 0), g(this, "customMessages", void 0), g(this, "loading", void 0), g(this, "listeners", /* @__PURE__ */ new Set()), g(this, "config", void 0), this.config = { ...t }, this.fallbackLocale = C(t.fallbackLocale) || "en-US", this.catalogs = /* @__PURE__ */ new Map([[k, fe]]), this.customMessages = { ...t.customMessages ?? {} }, this.loading = /* @__PURE__ */ new Map(), this.locale = this.resolveLocaleTag(t.locale) ?? "en-US";
|
|
996
878
|
}
|
|
997
879
|
async initialize(t) {
|
|
998
880
|
if (this.config = {
|
|
@@ -1007,7 +889,7 @@ var ie = class R {
|
|
|
1007
889
|
async setLocale(t) {
|
|
1008
890
|
const i = this.resolveLocaleTag(t);
|
|
1009
891
|
if (!i) {
|
|
1010
|
-
this.locale =
|
|
892
|
+
this.locale = C(t) || "en-US", this.notify();
|
|
1011
893
|
return;
|
|
1012
894
|
}
|
|
1013
895
|
if (!this.catalogs.has(i)) {
|
|
@@ -1027,14 +909,14 @@ var ie = class R {
|
|
|
1027
909
|
}
|
|
1028
910
|
t(t, i) {
|
|
1029
911
|
const s = this.lookup(t);
|
|
1030
|
-
return s === void 0 ? (this.config.onMissingKey?.(t, this.locale), t) :
|
|
912
|
+
return s === void 0 ? (this.config.onMissingKey?.(t, this.locale), t) : U(s, i);
|
|
1031
913
|
}
|
|
1032
914
|
plural(t, i) {
|
|
1033
915
|
const s = this.lookupNode(t);
|
|
1034
|
-
return s === void 0 || !
|
|
916
|
+
return s === void 0 || !_(s) ? this.t(t, i) : U(s[this.selectPluralCategory(i.count)] ?? s.other, i);
|
|
1035
917
|
}
|
|
1036
918
|
getDirection() {
|
|
1037
|
-
return
|
|
919
|
+
return z(this.locale);
|
|
1038
920
|
}
|
|
1039
921
|
getAvailableLocales() {
|
|
1040
922
|
return [.../* @__PURE__ */ new Set([
|
|
@@ -1056,13 +938,13 @@ var ie = class R {
|
|
|
1056
938
|
return this.lookup(t) !== void 0;
|
|
1057
939
|
}
|
|
1058
940
|
addCustomMessages(t, i) {
|
|
1059
|
-
const s =
|
|
1060
|
-
this.customMessages[s] =
|
|
941
|
+
const s = C(t);
|
|
942
|
+
this.customMessages[s] = $(this.customMessages[s] ?? {}, i), this.notify();
|
|
1061
943
|
}
|
|
1062
944
|
withLocale(t) {
|
|
1063
|
-
const i = this.resolveLocaleTag(t) ??
|
|
945
|
+
const i = this.resolveLocaleTag(t) ?? C(t);
|
|
1064
946
|
if (i === this.locale) return this;
|
|
1065
|
-
const s = new
|
|
947
|
+
const s = new E({
|
|
1066
948
|
...this.config,
|
|
1067
949
|
locale: i
|
|
1068
950
|
});
|
|
@@ -1090,16 +972,16 @@ var ie = class R {
|
|
|
1090
972
|
return {
|
|
1091
973
|
locale: i,
|
|
1092
974
|
translations: s,
|
|
1093
|
-
direction:
|
|
975
|
+
direction: z(i)
|
|
1094
976
|
};
|
|
1095
977
|
}
|
|
1096
978
|
resolveLocaleTag(t) {
|
|
1097
979
|
if (!t) return;
|
|
1098
|
-
const i = this.getAvailableLocales(), s =
|
|
980
|
+
const i = this.getAvailableLocales(), s = ge(t, i);
|
|
1099
981
|
if (s) return s;
|
|
1100
|
-
const n =
|
|
982
|
+
const n = w(t).split("-")[0];
|
|
1101
983
|
if (n)
|
|
1102
|
-
return i.find((o) =>
|
|
984
|
+
return i.find((o) => w(o).split("-")[0] === n);
|
|
1103
985
|
}
|
|
1104
986
|
async loadCatalog(t) {
|
|
1105
987
|
const i = this.config.loadCatalog;
|
|
@@ -1118,24 +1000,24 @@ var ie = class R {
|
|
|
1118
1000
|
this.catalogs.get(this.fallbackLocale)
|
|
1119
1001
|
];
|
|
1120
1002
|
for (const s of i) {
|
|
1121
|
-
const n =
|
|
1003
|
+
const n = be(s, t);
|
|
1122
1004
|
if (n !== void 0) return n;
|
|
1123
1005
|
}
|
|
1124
1006
|
}
|
|
1125
1007
|
lookup(t) {
|
|
1126
1008
|
const i = this.lookupNode(t);
|
|
1127
1009
|
if (typeof i == "string") return i;
|
|
1128
|
-
if (i !== void 0 &&
|
|
1010
|
+
if (i !== void 0 && _(i)) return i.other;
|
|
1129
1011
|
}
|
|
1130
1012
|
selectPluralCategory(t) {
|
|
1131
|
-
let i =
|
|
1013
|
+
let i = E.pluralRules.get(this.locale);
|
|
1132
1014
|
if (!i) {
|
|
1133
1015
|
try {
|
|
1134
1016
|
i = new Intl.PluralRules(this.locale);
|
|
1135
1017
|
} catch {
|
|
1136
1018
|
return t === 1 ? "one" : "other";
|
|
1137
1019
|
}
|
|
1138
|
-
|
|
1020
|
+
E.pluralRules.set(this.locale, i);
|
|
1139
1021
|
}
|
|
1140
1022
|
return i.select(t);
|
|
1141
1023
|
}
|
|
@@ -1143,63 +1025,63 @@ var ie = class R {
|
|
|
1143
1025
|
for (const t of this.listeners) t();
|
|
1144
1026
|
}
|
|
1145
1027
|
};
|
|
1146
|
-
|
|
1147
|
-
function
|
|
1028
|
+
g(G, "pluralRules", /* @__PURE__ */ new Map());
|
|
1029
|
+
function C(e) {
|
|
1148
1030
|
return e ? e.trim().replace(/_/g, "-") : "";
|
|
1149
1031
|
}
|
|
1150
|
-
function
|
|
1032
|
+
function be(e, t) {
|
|
1151
1033
|
if (!e) return;
|
|
1152
1034
|
let i = e;
|
|
1153
1035
|
for (const s of t.split("."))
|
|
1154
1036
|
if (typeof i != "object" || i === null || (i = i[s], i === void 0)) return;
|
|
1155
1037
|
return i;
|
|
1156
1038
|
}
|
|
1157
|
-
function
|
|
1039
|
+
function U(e, t) {
|
|
1158
1040
|
return t ? e.replace(/\{(\w+)\}/g, (i, s) => {
|
|
1159
1041
|
const n = t[s];
|
|
1160
1042
|
return n == null ? i : String(n);
|
|
1161
1043
|
}) : e;
|
|
1162
1044
|
}
|
|
1163
|
-
function
|
|
1045
|
+
function $(e, t) {
|
|
1164
1046
|
const i = { ...e };
|
|
1165
1047
|
for (const [s, n] of Object.entries(t)) {
|
|
1166
1048
|
const o = i[s];
|
|
1167
|
-
n && typeof n == "object" && o && typeof o == "object" ? i[s] =
|
|
1049
|
+
n && typeof n == "object" && o && typeof o == "object" ? i[s] = $(o, n) : i[s] = n;
|
|
1168
1050
|
}
|
|
1169
1051
|
return i;
|
|
1170
1052
|
}
|
|
1171
|
-
function
|
|
1172
|
-
return new
|
|
1173
|
-
loadCatalog:
|
|
1174
|
-
availableLocales:
|
|
1053
|
+
function Se(e = {}) {
|
|
1054
|
+
return new G({
|
|
1055
|
+
loadCatalog: pe,
|
|
1056
|
+
availableLocales: he,
|
|
1175
1057
|
...e
|
|
1176
1058
|
});
|
|
1177
1059
|
}
|
|
1178
|
-
function
|
|
1060
|
+
function v() {
|
|
1179
1061
|
return Date.now();
|
|
1180
1062
|
}
|
|
1181
|
-
function
|
|
1063
|
+
function P(e) {
|
|
1182
1064
|
return e.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
1183
1065
|
}
|
|
1184
|
-
function
|
|
1185
|
-
if (e.attemptId) return `aas_v1_${
|
|
1186
|
-
const t =
|
|
1187
|
-
return `aas_v1_${
|
|
1066
|
+
function we(e) {
|
|
1067
|
+
if (e.attemptId) return `aas_v1_${P(e.assessmentId)}_${P(e.attemptId)}`;
|
|
1068
|
+
const t = j(), i = t ? Ae(t) : "anon";
|
|
1069
|
+
return `aas_v1_${P(e.assessmentId)}_${P(i)}`;
|
|
1188
1070
|
}
|
|
1189
|
-
function
|
|
1071
|
+
function j() {
|
|
1190
1072
|
try {
|
|
1191
1073
|
return typeof window > "u" ? null : window.localStorage;
|
|
1192
1074
|
} catch {
|
|
1193
1075
|
return null;
|
|
1194
1076
|
}
|
|
1195
1077
|
}
|
|
1196
|
-
function
|
|
1078
|
+
function Ae(e) {
|
|
1197
1079
|
const t = "pie:assessment-player:anonymous-device-id", i = e.getItem(t);
|
|
1198
1080
|
if (i) return i;
|
|
1199
1081
|
const s = `anon-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
|
|
1200
1082
|
return e.setItem(t, s), s;
|
|
1201
1083
|
}
|
|
1202
|
-
function
|
|
1084
|
+
function Ie(e) {
|
|
1203
1085
|
if (!e) return [];
|
|
1204
1086
|
const t = [], i = e.testParts || [];
|
|
1205
1087
|
return i.length > 0 ? (i.forEach((s, n) => {
|
|
@@ -1222,7 +1104,7 @@ function je(e) {
|
|
|
1222
1104
|
});
|
|
1223
1105
|
}), t);
|
|
1224
1106
|
}
|
|
1225
|
-
var
|
|
1107
|
+
var Ce = class {
|
|
1226
1108
|
constructor(e) {
|
|
1227
1109
|
this.args = e, this.listeners = /* @__PURE__ */ new Set(), this.deliveryPlan = { sections: [] }, this.session = null, this.readiness = "bootstrapping", this.submitted = !1, this.disposed = !1, this.storageContext = {
|
|
1228
1110
|
assessmentId: e.assessmentId,
|
|
@@ -1248,7 +1130,7 @@ var Ve = class {
|
|
|
1248
1130
|
async getPersistenceStrategy() {
|
|
1249
1131
|
if (this.persistenceStrategy) return this.persistenceStrategy;
|
|
1250
1132
|
const e = { createDefaultPersistence: () => {
|
|
1251
|
-
const t =
|
|
1133
|
+
const t = j(), i = `pie:assessment-controller:v1:${this.storageContext.assessmentId}:${this.storageContext.attemptId || "default"}`;
|
|
1252
1134
|
return {
|
|
1253
1135
|
async loadSession() {
|
|
1254
1136
|
if (!t) return null;
|
|
@@ -1271,7 +1153,7 @@ var Ve = class {
|
|
|
1271
1153
|
return this.persistenceStrategy = await this.args.hooks?.createAssessmentSessionPersistence?.(this.storageContext, e) ?? await e.createDefaultPersistence(), this.persistenceStrategy;
|
|
1272
1154
|
}
|
|
1273
1155
|
async createDeliveryPlan() {
|
|
1274
|
-
const e = { createDefaultDeliveryPlan: () => ({ sections:
|
|
1156
|
+
const e = { createDefaultDeliveryPlan: () => ({ sections: Ie(this.args.assessment) }) }, t = {
|
|
1275
1157
|
assessmentId: this.args.assessmentId,
|
|
1276
1158
|
attemptId: this.args.attemptId,
|
|
1277
1159
|
assessment: this.args.assessment
|
|
@@ -1281,8 +1163,8 @@ var Ve = class {
|
|
|
1281
1163
|
ensureSession() {
|
|
1282
1164
|
if (this.session) return this.session;
|
|
1283
1165
|
const e = this.deliveryPlan.sections.map((t) => t.sectionIdentifier);
|
|
1284
|
-
return this.session =
|
|
1285
|
-
assessmentAttemptSessionIdentifier:
|
|
1166
|
+
return this.session = V({
|
|
1167
|
+
assessmentAttemptSessionIdentifier: we({
|
|
1286
1168
|
assessmentId: this.args.assessmentId,
|
|
1287
1169
|
attemptId: this.args.attemptId
|
|
1288
1170
|
}),
|
|
@@ -1318,7 +1200,7 @@ var Ve = class {
|
|
|
1318
1200
|
const t = await e.loadSession(this.storageContext);
|
|
1319
1201
|
this.assertActive(), t && (this.session = t), this.ensureSession(), this.readiness = "ready", t && this.emit({
|
|
1320
1202
|
type: "assessment-session-applied",
|
|
1321
|
-
timestamp:
|
|
1203
|
+
timestamp: v()
|
|
1322
1204
|
}), this.assertActive();
|
|
1323
1205
|
} catch (e) {
|
|
1324
1206
|
try {
|
|
@@ -1379,14 +1261,14 @@ var Ve = class {
|
|
|
1379
1261
|
const t = this.buildNavigationSnapshot();
|
|
1380
1262
|
if (e < 0 || e >= t.totalSections) return !1;
|
|
1381
1263
|
const i = t.currentSectionId, s = this.deliveryPlan.sections[e];
|
|
1382
|
-
this.session =
|
|
1264
|
+
this.session = J(this.ensureSession(), {
|
|
1383
1265
|
currentSectionIndex: e,
|
|
1384
1266
|
currentSectionIdentifier: s?.sectionIdentifier
|
|
1385
1267
|
});
|
|
1386
1268
|
const n = this.buildNavigationSnapshot();
|
|
1387
1269
|
return this.emit({
|
|
1388
1270
|
type: "assessment-route-changed",
|
|
1389
|
-
timestamp:
|
|
1271
|
+
timestamp: v(),
|
|
1390
1272
|
currentSectionIndex: n.currentSectionIndex,
|
|
1391
1273
|
totalSections: n.totalSections,
|
|
1392
1274
|
currentSectionId: n.currentSectionId,
|
|
@@ -1395,10 +1277,10 @@ var Ve = class {
|
|
|
1395
1277
|
canPrevious: n.canPrevious
|
|
1396
1278
|
}), this.disposed || (this.emit({
|
|
1397
1279
|
type: "assessment-session-changed",
|
|
1398
|
-
timestamp:
|
|
1280
|
+
timestamp: v()
|
|
1399
1281
|
}), this.disposed) ? !1 : (this.emit({
|
|
1400
1282
|
type: "assessment-progress-changed",
|
|
1401
|
-
timestamp:
|
|
1283
|
+
timestamp: v(),
|
|
1402
1284
|
visitedSectionCount: this.ensureSession().navigationState.visitedSectionIdentifiers.length,
|
|
1403
1285
|
totalSections: n.totalSections
|
|
1404
1286
|
}), !0);
|
|
@@ -1419,7 +1301,7 @@ var Ve = class {
|
|
|
1419
1301
|
async submit() {
|
|
1420
1302
|
this.assertActive(), this.submitted = !0, this.emit({
|
|
1421
1303
|
type: "assessment-submission-state-changed",
|
|
1422
|
-
timestamp:
|
|
1304
|
+
timestamp: v(),
|
|
1423
1305
|
submitted: !0
|
|
1424
1306
|
}), await this.persist();
|
|
1425
1307
|
}
|
|
@@ -1438,18 +1320,17 @@ var Ve = class {
|
|
|
1438
1320
|
return this.disposed ? null : this.ensureSession().sectionSessions[e]?.session || null;
|
|
1439
1321
|
}
|
|
1440
1322
|
updateSectionSession(e, t) {
|
|
1441
|
-
this.disposed || (this.session =
|
|
1323
|
+
this.disposed || (this.session = K(this.ensureSession(), {
|
|
1442
1324
|
sectionIdentifier: e,
|
|
1443
1325
|
sectionSession: t
|
|
1444
1326
|
}), this.emit({
|
|
1445
1327
|
type: "assessment-session-changed",
|
|
1446
|
-
timestamp:
|
|
1328
|
+
timestamp: v()
|
|
1447
1329
|
}));
|
|
1448
1330
|
}
|
|
1449
|
-
},
|
|
1331
|
+
}, p = {
|
|
1450
1332
|
controllerReady: "assessment-controller-ready",
|
|
1451
1333
|
navigationRequested: "assessment-navigation-requested",
|
|
1452
|
-
submitRequested: "assessment-submit-requested",
|
|
1453
1334
|
routeChanged: "assessment-route-changed",
|
|
1454
1335
|
sessionApplied: "assessment-session-applied",
|
|
1455
1336
|
sessionChanged: "assessment-session-changed",
|
|
@@ -1457,7 +1338,7 @@ var Ve = class {
|
|
|
1457
1338
|
submissionStateChanged: "assessment-submission-state-changed",
|
|
1458
1339
|
error: "assessment-error"
|
|
1459
1340
|
};
|
|
1460
|
-
function
|
|
1341
|
+
function Pe(e, t) {
|
|
1461
1342
|
return !e?.delivery || e.delivery.enabled === !1 || !t || e.delivery.assignmentId !== void 0 ? e : {
|
|
1462
1343
|
...e,
|
|
1463
1344
|
delivery: {
|
|
@@ -1466,10 +1347,10 @@ function Ye(e, t) {
|
|
|
1466
1347
|
}
|
|
1467
1348
|
};
|
|
1468
1349
|
}
|
|
1469
|
-
function
|
|
1350
|
+
function Ee(e) {
|
|
1470
1351
|
const { sectionPlayerRuntime: t, playerType: i, attemptId: s, env: n, coordinator: o } = e, r = t?.player && typeof t.player == "object" ? {
|
|
1471
1352
|
...t.player,
|
|
1472
|
-
backend:
|
|
1353
|
+
backend: Pe(t.player.backend ? b(t.player.backend) : void 0, s)
|
|
1473
1354
|
} : t?.player;
|
|
1474
1355
|
return {
|
|
1475
1356
|
playerType: i,
|
|
@@ -1479,9 +1360,9 @@ function We(e) {
|
|
|
1479
1360
|
...r !== void 0 ? { player: r } : {}
|
|
1480
1361
|
};
|
|
1481
1362
|
}
|
|
1482
|
-
var
|
|
1363
|
+
var ke = "pie-section-player-splitpane", Re = "pie-section-player-vertical", xe = class extends HTMLElement {
|
|
1483
1364
|
constructor(...e) {
|
|
1484
|
-
super(...e), this._assessmentId = "", this._attemptId = "", this._locale = "", this._assessment = null, this._env = null, this._coordinator = null, this._hooks = null, this._showNavigation = !0, this._sectionPlayerLayout = "splitpane", this._playerType = "iife", this._debug = void 0, this.controller = null, this.initializingController = null, this.generation = 0, this.reconcileQueued = !1, this.controllerWaiters = /* @__PURE__ */ new Set(), this.i18n =
|
|
1365
|
+
super(...e), this._assessmentId = "", this._attemptId = "", this._locale = "", this._assessment = null, this._env = null, this._coordinator = null, this._hooks = null, this._showNavigation = !0, this._sectionPlayerLayout = "splitpane", this._playerType = "iife", this._debug = void 0, this.controller = null, this.initializingController = null, this.generation = 0, this.reconcileQueued = !1, this.controllerWaiters = /* @__PURE__ */ new Set(), this.i18n = Se(), this.sectionHost = null, this.sectionControllerRef = null, this.sectionSessionReady = !1, this.containerRef = null, this.announcer = null, this.restoreFocusOnRender = !1, this._sectionPlayerRuntime = null, this.readiness = { phase: "bootstrapping" };
|
|
1485
1366
|
}
|
|
1486
1367
|
static get observedAttributes() {
|
|
1487
1368
|
return [
|
|
@@ -1617,7 +1498,7 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1617
1498
|
return;
|
|
1618
1499
|
}
|
|
1619
1500
|
this.readiness = { phase: "bootstrapping" }, this.renderEmptyState();
|
|
1620
|
-
const e = this.generation, t = this.hooks, i = () => this.isConnected && this.generation === e, s = new
|
|
1501
|
+
const e = this.generation, t = this.hooks, i = () => this.isConnected && this.generation === e, s = new Ce({
|
|
1621
1502
|
assessmentId: this.assessmentId,
|
|
1622
1503
|
attemptId: this.attemptId || void 0,
|
|
1623
1504
|
assessment: this.assessment,
|
|
@@ -1628,7 +1509,7 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1628
1509
|
try {
|
|
1629
1510
|
t?.onError?.(n, o);
|
|
1630
1511
|
} finally {
|
|
1631
|
-
i() && o.phase === "session-load" && this.controller === s && (this.retireController(), this.readiness = { phase: "error" }, this.renderEmptyState(), this.dispatch(
|
|
1512
|
+
i() && o.phase === "session-load" && this.controller === s && (this.retireController(), this.readiness = { phase: "error" }, this.renderEmptyState(), this.dispatch(p.error, { error: n }));
|
|
1632
1513
|
}
|
|
1633
1514
|
}
|
|
1634
1515
|
}
|
|
@@ -1636,10 +1517,10 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1636
1517
|
this.initializingController = s, this.unsubscribeController = s.subscribe((n) => {
|
|
1637
1518
|
if (i()) {
|
|
1638
1519
|
if (n.type === "assessment-route-changed") {
|
|
1639
|
-
if (this.syncCurrentSectionSessionIntoAssessment(), !i() || (this.cleanupTtsForSectionNavigation(n), !i()) || (this.dispatch(
|
|
1520
|
+
if (this.syncCurrentSectionSessionIntoAssessment(), !i() || (this.cleanupTtsForSectionNavigation(n), !i()) || (this.dispatch(p.routeChanged, n), !i())) return;
|
|
1640
1521
|
this.restoreFocusOnRender = !0, this.render(!1);
|
|
1641
1522
|
}
|
|
1642
|
-
n.type === "assessment-session-applied" && this.dispatch(
|
|
1523
|
+
n.type === "assessment-session-applied" && this.dispatch(p.sessionApplied, n), n.type === "assessment-session-changed" && this.dispatch(p.sessionChanged, n), n.type === "assessment-progress-changed" && this.dispatch(p.progressChanged, n), n.type === "assessment-submission-state-changed" && this.dispatch(p.submissionStateChanged, n);
|
|
1643
1524
|
}
|
|
1644
1525
|
});
|
|
1645
1526
|
try {
|
|
@@ -1652,7 +1533,7 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1652
1533
|
} catch (r) {
|
|
1653
1534
|
console.error("Assessment error hook failed", r);
|
|
1654
1535
|
}
|
|
1655
|
-
i() && this.dispatch(
|
|
1536
|
+
i() && this.dispatch(p.error, { error: o });
|
|
1656
1537
|
}
|
|
1657
1538
|
};
|
|
1658
1539
|
try {
|
|
@@ -1660,24 +1541,24 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1660
1541
|
} catch (o) {
|
|
1661
1542
|
n(o);
|
|
1662
1543
|
}
|
|
1663
|
-
i() && this.dispatch(
|
|
1544
|
+
i() && this.dispatch(p.controllerReady, { controller: s });
|
|
1664
1545
|
} catch (n) {
|
|
1665
1546
|
if (!i()) return;
|
|
1666
|
-
this.retireController(), this.readiness = { phase: "error" }, this.renderEmptyState(), this.dispatch(
|
|
1547
|
+
this.retireController(), this.readiness = { phase: "error" }, this.renderEmptyState(), this.dispatch(p.error, { error: n });
|
|
1667
1548
|
}
|
|
1668
1549
|
}
|
|
1669
1550
|
resolveInstrumentationProvider() {
|
|
1670
|
-
return
|
|
1551
|
+
return ce({
|
|
1671
1552
|
runtimePlayer: this.sectionPlayerRuntime?.player,
|
|
1672
1553
|
component: "pie-assessment-player-default"
|
|
1673
1554
|
});
|
|
1674
1555
|
}
|
|
1675
1556
|
attachInstrumentationBridge() {
|
|
1676
|
-
this.detachInstrumentationBridge?.(), this.detachInstrumentationBridge =
|
|
1557
|
+
this.detachInstrumentationBridge?.(), this.detachInstrumentationBridge = se({
|
|
1677
1558
|
host: this,
|
|
1678
1559
|
instrumentationProvider: this.resolveInstrumentationProvider(),
|
|
1679
1560
|
component: "pie-assessment-player-default",
|
|
1680
|
-
eventMap:
|
|
1561
|
+
eventMap: de,
|
|
1681
1562
|
staticAttributes: {
|
|
1682
1563
|
instrumentationLayer: "assessment",
|
|
1683
1564
|
assessmentId: this.assessmentId,
|
|
@@ -1750,10 +1631,10 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1750
1631
|
return;
|
|
1751
1632
|
}
|
|
1752
1633
|
buildSectionPlayerTag() {
|
|
1753
|
-
return this.sectionPlayerLayout === "vertical" ?
|
|
1634
|
+
return this.sectionPlayerLayout === "vertical" ? Re : ke;
|
|
1754
1635
|
}
|
|
1755
1636
|
buildSectionRuntime() {
|
|
1756
|
-
return
|
|
1637
|
+
return Ee({
|
|
1757
1638
|
sectionPlayerRuntime: this.sectionPlayerRuntime,
|
|
1758
1639
|
playerType: this.playerType,
|
|
1759
1640
|
attemptId: this.attemptId || void 0,
|
|
@@ -1770,7 +1651,7 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1770
1651
|
const t = this.coordinator, i = t?.ttsService;
|
|
1771
1652
|
if (!i) return;
|
|
1772
1653
|
const s = (n) => {
|
|
1773
|
-
t?.reportFrameworkError?.(
|
|
1654
|
+
t?.reportFrameworkError?.(Q({
|
|
1774
1655
|
kind: "tts-init",
|
|
1775
1656
|
source: "AssessmentPlayerDefaultElement.cleanupTtsForSectionNavigation",
|
|
1776
1657
|
error: n,
|
|
@@ -1794,53 +1675,53 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1794
1675
|
const t = this.sectionControllerRef;
|
|
1795
1676
|
if (!t?.getSession) return;
|
|
1796
1677
|
const i = this.sectionHost?.firstElementChild?.getAttribute("section-id");
|
|
1797
|
-
i && e.updateSectionSession(i,
|
|
1678
|
+
i && e.updateSectionSession(i, b(t.getSession()));
|
|
1798
1679
|
}
|
|
1799
1680
|
attachSectionControllerReadyListener(e, t) {
|
|
1800
|
-
const i = e, s = this.generation, n = this.sectionHost, o = this.controller, r =
|
|
1681
|
+
const i = e, s = this.generation, n = this.sectionHost, o = this.controller, r = b(o.getSectionSession(t)), a = () => this.isConnected && this.generation === s && this.sectionHost === n && this.controller === o;
|
|
1801
1682
|
n.setAttribute("aria-busy", "true"), i.inert = !0;
|
|
1802
|
-
let
|
|
1803
|
-
new Promise((
|
|
1804
|
-
let
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1807
|
-
},
|
|
1808
|
-
if (
|
|
1809
|
-
const { stage:
|
|
1810
|
-
|
|
1811
|
-
}, f = setTimeout(() =>
|
|
1812
|
-
i.addEventListener(
|
|
1813
|
-
}).then(async (
|
|
1814
|
-
if (
|
|
1815
|
-
if (!
|
|
1683
|
+
let h;
|
|
1684
|
+
new Promise((c) => {
|
|
1685
|
+
let m = !1;
|
|
1686
|
+
const u = (A) => {
|
|
1687
|
+
m || (m = !0, clearTimeout(f), i.removeEventListener(N.stageChange, l), c(A));
|
|
1688
|
+
}, l = (A) => {
|
|
1689
|
+
if (A.target !== i) return;
|
|
1690
|
+
const { stage: x, status: W } = A.detail;
|
|
1691
|
+
W === "failed" || x === "disposed" ? u(null) : x === "engine-ready" && u(i.getSectionController?.() || null);
|
|
1692
|
+
}, f = setTimeout(() => u(null), 5e3);
|
|
1693
|
+
i.addEventListener(N.stageChange, l), h = () => u(null);
|
|
1694
|
+
}).then(async (c) => {
|
|
1695
|
+
if (a()) {
|
|
1696
|
+
if (!c) throw new Error("Section controller did not become ready");
|
|
1816
1697
|
if (r) {
|
|
1817
|
-
if (!
|
|
1818
|
-
await
|
|
1698
|
+
if (!c.applySession) throw new Error("Section controller cannot restore its saved session");
|
|
1699
|
+
await c.applySession(r, { mode: "replace" });
|
|
1819
1700
|
}
|
|
1820
|
-
|
|
1701
|
+
a() && (this.sectionControllerRef = c, this.sectionSessionReady = !0, i.inert = !1, n.setAttribute("aria-busy", "false"));
|
|
1821
1702
|
}
|
|
1822
|
-
}).catch((
|
|
1823
|
-
if (!
|
|
1703
|
+
}).catch((c) => {
|
|
1704
|
+
if (!a()) return;
|
|
1824
1705
|
this.detachSectionListeners?.(), this.detachSectionListeners = void 0, this.sectionControllerRef = null, this.sectionSessionReady = !1;
|
|
1825
|
-
const
|
|
1706
|
+
const m = n.contains(document.activeElement), u = this.createStatusContent(r ? "player.assessment.restoreFailed" : "player.assessment.loadFailed", () => {
|
|
1826
1707
|
this.restoreFocusOnRender = this.contains(document.activeElement), this.render();
|
|
1827
1708
|
});
|
|
1828
|
-
n.replaceChildren(
|
|
1709
|
+
n.replaceChildren(u), n.setAttribute("aria-busy", "false"), m && u.focus();
|
|
1829
1710
|
try {
|
|
1830
|
-
this.hooks?.onError?.(
|
|
1711
|
+
this.hooks?.onError?.(c instanceof Error ? c : new Error(String(c)), {
|
|
1831
1712
|
phase: "navigation",
|
|
1832
1713
|
details: { sectionIdentifier: t }
|
|
1833
1714
|
});
|
|
1834
|
-
} catch (
|
|
1835
|
-
console.error("Assessment error hook failed",
|
|
1715
|
+
} catch (l) {
|
|
1716
|
+
console.error("Assessment error hook failed", l);
|
|
1836
1717
|
}
|
|
1837
|
-
|
|
1718
|
+
a() && this.dispatch(p.error, { error: c });
|
|
1838
1719
|
});
|
|
1839
|
-
const
|
|
1840
|
-
|
|
1720
|
+
const d = () => {
|
|
1721
|
+
a() && this.syncCurrentSectionSessionIntoAssessment();
|
|
1841
1722
|
};
|
|
1842
|
-
e.addEventListener("session-changed",
|
|
1843
|
-
|
|
1723
|
+
e.addEventListener("session-changed", d), this.detachSectionListeners = () => {
|
|
1724
|
+
h(), e.removeEventListener("session-changed", d);
|
|
1844
1725
|
};
|
|
1845
1726
|
}
|
|
1846
1727
|
render(e = !0) {
|
|
@@ -1904,53 +1785,53 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
1904
1785
|
overflow: hidden;
|
|
1905
1786
|
}
|
|
1906
1787
|
`, n.appendChild(o);
|
|
1907
|
-
const r = this.getSnapshot(),
|
|
1788
|
+
const r = this.getSnapshot(), a = r.navigation.totalSections > 0 ? this.i18n.t("player.assessment.sectionPosition", {
|
|
1908
1789
|
position: r.navigation.currentIndex + 1,
|
|
1909
1790
|
total: r.navigation.totalSections
|
|
1910
1791
|
}) : this.i18n.t("player.assessment.noSections");
|
|
1911
|
-
let
|
|
1792
|
+
let h = null, d = null;
|
|
1912
1793
|
{
|
|
1913
|
-
const
|
|
1914
|
-
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1794
|
+
const u = document.createElement("div");
|
|
1795
|
+
u.className = "pie-assessment-player-navigation", u.hidden = !R(this.showNavigation, !0);
|
|
1796
|
+
const l = document.createElement("div");
|
|
1797
|
+
l.className = "pie-assessment-player-current-position", l.textContent = a;
|
|
1917
1798
|
const f = document.createElement("div");
|
|
1918
|
-
f.className = "pie-assessment-player-nav-controls",
|
|
1799
|
+
f.className = "pie-assessment-player-nav-controls", h = document.createElement("button"), h.type = "button", h.className = "pie-assessment-player-nav-btn", h.setAttribute("data-pie-navigation", "previous"), h.textContent = this.i18n.t("common.back"), h.disabled = !r.navigation.canPrevious, h.addEventListener("click", () => {
|
|
1919
1800
|
this.navigatePrevious();
|
|
1920
|
-
}),
|
|
1801
|
+
}), d = document.createElement("button"), d.type = "button", d.className = "pie-assessment-player-nav-btn", d.setAttribute("data-pie-navigation", "next"), d.textContent = this.i18n.t("common.next"), d.disabled = !r.navigation.canNext, d.addEventListener("click", () => {
|
|
1921
1802
|
this.navigateNext();
|
|
1922
|
-
}), f.appendChild(
|
|
1803
|
+
}), f.appendChild(h), f.appendChild(d), u.appendChild(l), u.appendChild(f), n.appendChild(u);
|
|
1923
1804
|
}
|
|
1924
|
-
const
|
|
1925
|
-
|
|
1926
|
-
const
|
|
1927
|
-
if (
|
|
1928
|
-
const
|
|
1929
|
-
if (
|
|
1805
|
+
const c = document.createElement("div");
|
|
1806
|
+
c.className = "pie-assessment-player-section-host", c.setAttribute("role", "region"), c.setAttribute("aria-label", a), c.tabIndex = -1, this.sectionHost = c;
|
|
1807
|
+
const m = i?.getCurrentSection() || null;
|
|
1808
|
+
if (m) {
|
|
1809
|
+
const u = this.buildSectionPlayerTag(), l = document.createElement(u);
|
|
1810
|
+
if (l.setAttribute("assessment-id", this.assessmentId), l.setAttribute("section-id", m.sectionIdentifier), this.attemptId && l.setAttribute("attempt-id", this.attemptId), this.locale && l.setAttribute("locale", this.locale), this.debug !== void 0 && this.debug !== null) {
|
|
1930
1811
|
const f = typeof this.debug == "boolean" ? String(this.debug) : this.debug;
|
|
1931
|
-
|
|
1812
|
+
l.setAttribute("debug", f);
|
|
1932
1813
|
}
|
|
1933
|
-
|
|
1814
|
+
l.section = m.section, l.runtime = this.buildSectionRuntime(), l.hooks = { cardTitleFormatter: this.hooks?.cardTitleFormatter }, c.appendChild(l), this.attachSectionControllerReadyListener(l, m.sectionIdentifier);
|
|
1934
1815
|
}
|
|
1935
|
-
n.appendChild(
|
|
1936
|
-
previous:
|
|
1937
|
-
next:
|
|
1938
|
-
}), this.announceSectionChange(
|
|
1816
|
+
n.appendChild(c), this.swapContent(n), s && (this.applyFocusIntent(s, {
|
|
1817
|
+
previous: h,
|
|
1818
|
+
next: d
|
|
1819
|
+
}), this.announceSectionChange(a));
|
|
1939
1820
|
}
|
|
1940
1821
|
updateNavigationChrome() {
|
|
1941
1822
|
const e = this.selectNavigation(), t = e.totalSections > 0 ? this.i18n.t("player.assessment.sectionPosition", {
|
|
1942
1823
|
position: e.currentIndex + 1,
|
|
1943
1824
|
total: e.totalSections
|
|
1944
1825
|
}) : this.i18n.t("player.assessment.noSections"), i = this.containerRef?.querySelector(".pie-assessment-player-navigation");
|
|
1945
|
-
i && (i.hidden = !
|
|
1826
|
+
i && (i.hidden = !R(this.showNavigation, !0), i.hidden && i.contains(document.activeElement) && this.sectionHost?.focus());
|
|
1946
1827
|
const s = this.containerRef?.querySelector(".pie-assessment-player-current-position");
|
|
1947
1828
|
s && (s.textContent = t);
|
|
1948
1829
|
const n = i?.querySelector('[data-pie-navigation="previous"]'), o = i?.querySelector('[data-pie-navigation="next"]');
|
|
1949
1830
|
n && (n.textContent = this.i18n.t("common.back")), o && (o.textContent = this.i18n.t("common.next")), this.sectionHost?.setAttribute("aria-label", t);
|
|
1950
1831
|
const r = this.containerRef?.querySelector(".pie-assessment-player-status-message");
|
|
1951
1832
|
r instanceof HTMLElement && r.dataset.pieMessageKey && (r.textContent = this.i18n.t(r.dataset.pieMessageKey));
|
|
1952
|
-
const
|
|
1953
|
-
|
|
1833
|
+
const a = this.containerRef?.querySelector(".pie-assessment-player-retry");
|
|
1834
|
+
a && (a.textContent = this.i18n.t("common.retry")), this.forwardLocaleToSection();
|
|
1954
1835
|
}
|
|
1955
1836
|
announceSectionChange(e) {
|
|
1956
1837
|
const t = this.ensureAnnouncer();
|
|
@@ -2005,7 +1886,7 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
2005
1886
|
if (typeof e == "number")
|
|
2006
1887
|
n = e, o = this.controller?.getSectionAt(n)?.sectionIdentifier;
|
|
2007
1888
|
else if (o = e, this.controller?.getCurrentSection()?.sectionIdentifier === o) return !0;
|
|
2008
|
-
if (!this.dispatch(
|
|
1889
|
+
if (!this.dispatch(p.navigationRequested, {
|
|
2009
1890
|
fromIndex: i,
|
|
2010
1891
|
toIndex: n,
|
|
2011
1892
|
fromSectionId: s,
|
|
@@ -2017,7 +1898,7 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
2017
1898
|
}
|
|
2018
1899
|
navigateNext() {
|
|
2019
1900
|
const e = this.selectNavigation(), t = this.controller?.getSectionAt(e.currentIndex + 1);
|
|
2020
|
-
if (!this.dispatch(
|
|
1901
|
+
if (!this.dispatch(p.navigationRequested, {
|
|
2021
1902
|
fromIndex: e.currentIndex,
|
|
2022
1903
|
toIndex: e.currentIndex + 1,
|
|
2023
1904
|
fromSectionId: e.currentSectionId,
|
|
@@ -2029,7 +1910,7 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
2029
1910
|
}
|
|
2030
1911
|
navigatePrevious() {
|
|
2031
1912
|
const e = this.selectNavigation(), t = this.controller?.getSectionAt(e.currentIndex - 1);
|
|
2032
|
-
if (!this.dispatch(
|
|
1913
|
+
if (!this.dispatch(p.navigationRequested, {
|
|
2033
1914
|
fromIndex: e.currentIndex,
|
|
2034
1915
|
toIndex: e.currentIndex - 1,
|
|
2035
1916
|
fromSectionId: e.currentSectionId,
|
|
@@ -2052,8 +1933,8 @@ var Qe = "pie-section-player-splitpane", Je = "pie-section-player-vertical", Ke
|
|
|
2052
1933
|
}));
|
|
2053
1934
|
}
|
|
2054
1935
|
};
|
|
2055
|
-
|
|
2056
|
-
var
|
|
1936
|
+
B("pie-assessment-player-default", xe, "assessment player default tag");
|
|
1937
|
+
var Ne = class extends HTMLElement {
|
|
2057
1938
|
constructor(...e) {
|
|
2058
1939
|
super(...e), this.showNavigation = !0;
|
|
2059
1940
|
}
|
|
@@ -2067,7 +1948,7 @@ var Ze = class extends HTMLElement {
|
|
|
2067
1948
|
e === "show-navigation" && (this.showNavigation = i), this.render();
|
|
2068
1949
|
}
|
|
2069
1950
|
render() {
|
|
2070
|
-
const e =
|
|
1951
|
+
const e = R(this.showNavigation, !0);
|
|
2071
1952
|
this.innerHTML = "";
|
|
2072
1953
|
const t = document.createElement("style");
|
|
2073
1954
|
t.textContent = `
|
|
@@ -2099,7 +1980,7 @@ var Ze = class extends HTMLElement {
|
|
|
2099
1980
|
s.appendChild(n), i.appendChild(s), this.appendChild(t), this.appendChild(i);
|
|
2100
1981
|
}
|
|
2101
1982
|
};
|
|
2102
|
-
|
|
1983
|
+
B("pie-assessment-player-shell", Ne, "assessment player shell tag");
|
|
2103
1984
|
export {
|
|
2104
|
-
|
|
1985
|
+
p as ASSESSMENT_PLAYER_PUBLIC_EVENTS
|
|
2105
1986
|
};
|