@pie-element/mc-populated-blank 0.2.9 → 0.2.11
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/README.md +20 -10
- package/dist/author/index.js +186 -152
- package/dist/author/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +41 -73
- package/dist/controller/defaults.d.ts.map +1 -1
- package/dist/controller/index.d.ts +154 -10
- package/dist/controller/index.d.ts.map +1 -1
- package/dist/controller/index.js +30 -30
- package/dist/controller/index.js.map +1 -1
- package/dist/controller/index.test.d.ts +63 -0
- package/dist/controller/index.test.d.ts.map +1 -0
- package/dist/delivery/AudioPlayer.test.d.ts +2 -0
- package/dist/delivery/AudioPlayer.test.d.ts.map +1 -0
- package/dist/delivery/ChoiceRow.test.d.ts +2 -0
- package/dist/delivery/ChoiceRow.test.d.ts.map +1 -0
- package/dist/delivery/ClozeMarker.test.d.ts +2 -0
- package/dist/delivery/ClozeMarker.test.d.ts.map +1 -0
- package/dist/delivery/McPopulatedBlank.transcript.test.d.ts +2 -0
- package/dist/delivery/McPopulatedBlank.transcript.test.d.ts.map +1 -0
- package/dist/delivery/computeAudioMode.d.ts +7 -0
- package/dist/delivery/computeAudioMode.d.ts.map +1 -0
- package/dist/delivery/computeAudioMode.test.d.ts +2 -0
- package/dist/delivery/computeAudioMode.test.d.ts.map +1 -0
- package/dist/delivery/computeChoiceCorrectness.d.ts +18 -0
- package/dist/delivery/computeChoiceCorrectness.d.ts.map +1 -0
- package/dist/delivery/computeChoiceCorrectness.test.d.ts +19 -0
- package/dist/delivery/computeChoiceCorrectness.test.d.ts.map +1 -0
- package/dist/delivery/computeDisplayState.d.ts +47 -0
- package/dist/delivery/computeDisplayState.d.ts.map +1 -0
- package/dist/delivery/computeDisplayState.test.d.ts +38 -0
- package/dist/delivery/computeDisplayState.test.d.ts.map +1 -0
- package/dist/delivery/computeLayoutProfile.d.ts +18 -0
- package/dist/delivery/computeLayoutProfile.d.ts.map +1 -0
- package/dist/delivery/computeLayoutProfile.test.d.ts +2 -0
- package/dist/delivery/computeLayoutProfile.test.d.ts.map +1 -0
- package/dist/delivery/computeLayoutStyle.d.ts +27 -0
- package/dist/delivery/computeLayoutStyle.d.ts.map +1 -0
- package/dist/delivery/computeLayoutStyle.test.d.ts +2 -0
- package/dist/delivery/computeLayoutStyle.test.d.ts.map +1 -0
- package/dist/delivery/index.d.ts.map +1 -1
- package/dist/delivery/index.js +1650 -881
- package/dist/delivery/index.js.map +1 -1
- package/dist/delivery/variant-css-map.d.ts +10 -0
- package/dist/delivery/variant-css-map.d.ts.map +1 -0
- package/dist/index.iife.d.ts +151 -10
- package/dist/index.iife.d.ts.map +1 -1
- package/dist/index.iife.js +409 -16
- package/dist/index.js +1650 -881
- package/dist/index.js.map +1 -1
- package/dist/print/index.js +194 -166
- package/dist/print/index.js.map +1 -1
- package/dist/shared/layoutLimits.d.ts +40 -0
- package/dist/shared/layoutLimits.d.ts.map +1 -0
- package/dist/shared/types.d.ts +82 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/package.json +4 -2
- package/src/controller/defaults.ts +9 -39
- package/src/controller/index.test.ts +428 -0
- package/src/controller/index.ts +64 -50
- package/src/delivery/AudioPlayer.svelte +246 -0
- package/src/delivery/AudioPlayer.test.ts +149 -0
- package/src/delivery/ChoiceRow.svelte +222 -0
- package/src/delivery/ChoiceRow.test.ts +179 -0
- package/src/delivery/ClozeMarker.svelte +83 -0
- package/src/delivery/ClozeMarker.test.ts +128 -0
- package/src/delivery/McPopulatedBlank.svelte +234 -709
- package/src/delivery/McPopulatedBlank.transcript.test.ts +154 -0
- package/src/delivery/computeAudioMode.test.ts +40 -0
- package/src/delivery/computeAudioMode.ts +11 -0
- package/src/delivery/computeChoiceCorrectness.test.ts +120 -0
- package/src/delivery/computeChoiceCorrectness.ts +42 -0
- package/src/delivery/computeDisplayState.test.ts +274 -0
- package/src/delivery/computeDisplayState.ts +101 -0
- package/src/delivery/computeLayoutProfile.test.ts +163 -0
- package/src/delivery/computeLayoutProfile.ts +72 -0
- package/src/delivery/computeLayoutStyle.test.ts +168 -0
- package/src/delivery/computeLayoutStyle.ts +128 -0
- package/src/delivery/cqt-css/sel-r1-base.css +59 -0
- package/src/delivery/cqt-css/sel-r1-g-stem.css +14 -0
- package/src/delivery/cqt-css/sel-r1-gg-plus.css +12 -0
- package/src/delivery/cqt-css/sel-r1-ggplus.css +17 -0
- package/src/delivery/cqt-css/sel-r1-gplusggg.css +25 -0
- package/src/delivery/cqt-css/sel-r1-plusggg.css +17 -0
- package/src/delivery/cqt-css/sel-r1-s3.css +85 -0
- package/src/delivery/cqt-css/sel-vic.css +99 -0
- package/src/delivery/cqt-css/sr-vic.css +63 -0
- package/src/delivery/index.ts +14 -23
- package/src/delivery/variant-css-map.ts +124 -0
- package/src/shared/layoutLimits.ts +76 -0
- package/src/shared/types.ts +84 -0
- package/src/types/css-raw.d.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
1
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/disclose-version.js
|
|
2
2
|
if (typeof window !== "undefined") {
|
|
3
3
|
var _window$__svelte, _window;
|
|
4
4
|
((_window$__svelte = (_window = window).__svelte ?? (_window.__svelte = {})).v ?? (_window$__svelte.v = /* @__PURE__ */ new Set())).add("5");
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
7
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/constants.js
|
|
8
8
|
var HYDRATION_ERROR = {};
|
|
9
9
|
var UNINITIALIZED = Symbol();
|
|
10
10
|
var NAMESPACE_SVG = "http://www.w3.org/2000/svg";
|
|
11
11
|
var NAMESPACE_MATHML = "http://www.w3.org/1998/Math/MathML";
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
13
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/shared/utils.js
|
|
14
14
|
var is_array = Array.isArray;
|
|
15
15
|
var index_of = Array.prototype.indexOf;
|
|
16
16
|
var includes = Array.prototype.includes;
|
|
@@ -47,7 +47,7 @@ function deferred() {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
|
-
//#region \0@oxc-project+runtime@0.
|
|
50
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
51
51
|
function _typeof(o) {
|
|
52
52
|
"@babel/helpers - typeof";
|
|
53
53
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -57,7 +57,7 @@ function _typeof(o) {
|
|
|
57
57
|
}, _typeof(o);
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
|
-
//#region \0@oxc-project+runtime@0.
|
|
60
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
61
61
|
function toPrimitive(t, r) {
|
|
62
62
|
if ("object" != _typeof(t) || !t) return t;
|
|
63
63
|
var e = t[Symbol.toPrimitive];
|
|
@@ -69,13 +69,13 @@ function toPrimitive(t, r) {
|
|
|
69
69
|
return ("string" === r ? String : Number)(t);
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
|
-
//#region \0@oxc-project+runtime@0.
|
|
72
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
73
73
|
function toPropertyKey(t) {
|
|
74
74
|
var i = toPrimitive(t, "string");
|
|
75
75
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
76
76
|
}
|
|
77
77
|
//#endregion
|
|
78
|
-
//#region \0@oxc-project+runtime@0.
|
|
78
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
79
79
|
function _defineProperty(e, r, t) {
|
|
80
80
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
81
81
|
value: t,
|
|
@@ -104,7 +104,8 @@ var EFFECT_OFFSCREEN = 1 << 25;
|
|
|
104
104
|
/**
|
|
105
105
|
* Tells that we marked this derived and its reactions as visited during the "mark as (maybe) dirty"-phase.
|
|
106
106
|
* Will be lifted during execution of the derived and during checking its dirty state (both are necessary
|
|
107
|
-
* because a derived might be checked but not executed).
|
|
107
|
+
* because a derived might be checked but not executed). This is a pure performance optimization flag and
|
|
108
|
+
* should not be used for any other purpose!
|
|
108
109
|
*/
|
|
109
110
|
var WAS_MARKED = 65536;
|
|
110
111
|
var REACTION_IS_UPDATING = 1 << 21;
|
|
@@ -123,7 +124,7 @@ var STALE_REACTION = new class StaleReactionError extends Error {
|
|
|
123
124
|
}();
|
|
124
125
|
var IS_XHTML = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
125
126
|
//#endregion
|
|
126
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
127
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/errors.js
|
|
127
128
|
/**
|
|
128
129
|
* Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
|
|
129
130
|
* @returns {never}
|
|
@@ -215,6 +216,12 @@ function svelte_boundary_reset_onerror() {
|
|
|
215
216
|
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
216
217
|
}
|
|
217
218
|
/**
|
|
219
|
+
* Reading a derived belonging to a now-destroyed effect may result in stale values
|
|
220
|
+
*/
|
|
221
|
+
function derived_inert() {
|
|
222
|
+
console.warn(`https://svelte.dev/e/derived_inert`);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
218
225
|
* Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%
|
|
219
226
|
* @param {string | undefined | null} [location]
|
|
220
227
|
*/
|
|
@@ -228,7 +235,7 @@ function svelte_boundary_reset_noop() {
|
|
|
228
235
|
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
|
229
236
|
}
|
|
230
237
|
//#endregion
|
|
231
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
238
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/hydration.js
|
|
232
239
|
/** @import { TemplateNode } from '#client' */
|
|
233
240
|
/**
|
|
234
241
|
* Use this variable to guard everything related to hydration code so it can be treeshaken out
|
|
@@ -307,7 +314,7 @@ function read_hydration_instruction(node) {
|
|
|
307
314
|
return node.data;
|
|
308
315
|
}
|
|
309
316
|
//#endregion
|
|
310
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
317
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/equality.js
|
|
311
318
|
/** @import { Equals } from '#client' */
|
|
312
319
|
/** @type {Equals} */
|
|
313
320
|
function equals(value) {
|
|
@@ -326,13 +333,13 @@ function safe_equals(value) {
|
|
|
326
333
|
return !safe_not_equal(value, this.v);
|
|
327
334
|
}
|
|
328
335
|
//#endregion
|
|
329
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
336
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/flags/index.js
|
|
330
337
|
/** True if experimental.async=true */
|
|
331
338
|
var async_mode_flag = false;
|
|
332
339
|
/** True if we're not certain that we only have Svelte 5 code in the compilation */
|
|
333
340
|
var legacy_mode_flag = false;
|
|
334
341
|
//#endregion
|
|
335
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
342
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/context.js
|
|
336
343
|
/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
|
|
337
344
|
/** @type {ComponentContext | null} */
|
|
338
345
|
var component_context = null;
|
|
@@ -384,7 +391,7 @@ function is_runes() {
|
|
|
384
391
|
return !legacy_mode_flag || component_context !== null && component_context.l === null;
|
|
385
392
|
}
|
|
386
393
|
//#endregion
|
|
387
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
394
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/task.js
|
|
388
395
|
/** @type {Array<() => void>} */
|
|
389
396
|
var micro_tasks = [];
|
|
390
397
|
function run_micro_tasks() {
|
|
@@ -442,7 +449,7 @@ function invoke_error_boundary(error, effect) {
|
|
|
442
449
|
throw error;
|
|
443
450
|
}
|
|
444
451
|
//#endregion
|
|
445
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
452
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/status.js
|
|
446
453
|
/** @import { Derived, Signal } from '#client' */
|
|
447
454
|
var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
|
|
448
455
|
/**
|
|
@@ -461,7 +468,7 @@ function update_derived_status(derived) {
|
|
|
461
468
|
else set_signal_status(derived, MAYBE_DIRTY);
|
|
462
469
|
}
|
|
463
470
|
//#endregion
|
|
464
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
471
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/utils.js
|
|
465
472
|
/** @import { Derived, Effect, Value } from '#client' */
|
|
466
473
|
/**
|
|
467
474
|
* @param {Value[] | null} deps
|
|
@@ -489,7 +496,7 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
|
|
|
489
496
|
set_signal_status(effect, CLEAN);
|
|
490
497
|
}
|
|
491
498
|
//#endregion
|
|
492
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
499
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/store.js
|
|
493
500
|
/**
|
|
494
501
|
* We set this to `true` when updating a store so that we correctly
|
|
495
502
|
* schedule effects if the update takes place inside a `$:` effect
|
|
@@ -519,38 +526,38 @@ function capture_store_binding(fn) {
|
|
|
519
526
|
}
|
|
520
527
|
}
|
|
521
528
|
//#endregion
|
|
522
|
-
//#region \0@oxc-project+runtime@0.
|
|
529
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/checkPrivateRedeclaration.js
|
|
523
530
|
function _checkPrivateRedeclaration(e, t) {
|
|
524
531
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
525
532
|
}
|
|
526
533
|
//#endregion
|
|
527
|
-
//#region \0@oxc-project+runtime@0.
|
|
534
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateMethodInitSpec.js
|
|
528
535
|
function _classPrivateMethodInitSpec(e, a) {
|
|
529
536
|
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
530
537
|
}
|
|
531
538
|
//#endregion
|
|
532
|
-
//#region \0@oxc-project+runtime@0.
|
|
539
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldInitSpec.js
|
|
533
540
|
function _classPrivateFieldInitSpec(e, t, a) {
|
|
534
541
|
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
535
542
|
}
|
|
536
543
|
//#endregion
|
|
537
|
-
//#region \0@oxc-project+runtime@0.
|
|
544
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/assertClassBrand.js
|
|
538
545
|
function _assertClassBrand(e, t, n) {
|
|
539
546
|
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
540
547
|
throw new TypeError("Private element is not present on this object");
|
|
541
548
|
}
|
|
542
549
|
//#endregion
|
|
543
|
-
//#region \0@oxc-project+runtime@0.
|
|
550
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldGet2.js
|
|
544
551
|
function _classPrivateFieldGet2(s, a) {
|
|
545
552
|
return s.get(_assertClassBrand(s, a));
|
|
546
553
|
}
|
|
547
554
|
//#endregion
|
|
548
|
-
//#region \0@oxc-project+runtime@0.
|
|
555
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldSet2.js
|
|
549
556
|
function _classPrivateFieldSet2(s, a, r) {
|
|
550
557
|
return s.set(_assertClassBrand(s, a), r), r;
|
|
551
558
|
}
|
|
552
559
|
//#endregion
|
|
553
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
560
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/batch.js
|
|
554
561
|
/** @import { Fork } from 'svelte' */
|
|
555
562
|
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
556
563
|
var _Batch;
|
|
@@ -588,6 +595,7 @@ var flush_count = 0;
|
|
|
588
595
|
var uid = 1;
|
|
589
596
|
var _commit_callbacks = /* @__PURE__ */ new WeakMap();
|
|
590
597
|
var _discard_callbacks = /* @__PURE__ */ new WeakMap();
|
|
598
|
+
var _fork_commit_callbacks = /* @__PURE__ */ new WeakMap();
|
|
591
599
|
var _pending = /* @__PURE__ */ new WeakMap();
|
|
592
600
|
var _blocking_pending = /* @__PURE__ */ new WeakMap();
|
|
593
601
|
var _deferred = /* @__PURE__ */ new WeakMap();
|
|
@@ -596,6 +604,7 @@ var _new_effects = /* @__PURE__ */ new WeakMap();
|
|
|
596
604
|
var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
597
605
|
var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
598
606
|
var _skipped_branches = /* @__PURE__ */ new WeakMap();
|
|
607
|
+
var _unskipped_branches = /* @__PURE__ */ new WeakMap();
|
|
599
608
|
var _decrement_queued = /* @__PURE__ */ new WeakMap();
|
|
600
609
|
var _blockers = /* @__PURE__ */ new WeakMap();
|
|
601
610
|
var _Batch_brand = /* @__PURE__ */ new WeakSet();
|
|
@@ -626,6 +635,7 @@ var Batch = class Batch {
|
|
|
626
635
|
);
|
|
627
636
|
_classPrivateFieldInitSpec(this, _commit_callbacks, /* @__PURE__ */ new Set());
|
|
628
637
|
_classPrivateFieldInitSpec(this, _discard_callbacks, /* @__PURE__ */ new Set());
|
|
638
|
+
_classPrivateFieldInitSpec(this, _fork_commit_callbacks, /* @__PURE__ */ new Set());
|
|
629
639
|
_classPrivateFieldInitSpec(this, _pending, /* @__PURE__ */ new Map());
|
|
630
640
|
_classPrivateFieldInitSpec(this, _blocking_pending, /* @__PURE__ */ new Map());
|
|
631
641
|
_classPrivateFieldInitSpec(this, _deferred, null);
|
|
@@ -634,6 +644,7 @@ var Batch = class Batch {
|
|
|
634
644
|
_classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
|
|
635
645
|
_classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
|
|
636
646
|
_classPrivateFieldInitSpec(this, _skipped_branches, /* @__PURE__ */ new Map());
|
|
647
|
+
_classPrivateFieldInitSpec(this, _unskipped_branches, /* @__PURE__ */ new Set());
|
|
637
648
|
_defineProperty(this, "is_fork", false);
|
|
638
649
|
_classPrivateFieldInitSpec(this, _decrement_queued, false);
|
|
639
650
|
_classPrivateFieldInitSpec(this, _blockers, /* @__PURE__ */ new Set());
|
|
@@ -647,39 +658,43 @@ var Batch = class Batch {
|
|
|
647
658
|
d: [],
|
|
648
659
|
m: []
|
|
649
660
|
});
|
|
661
|
+
_classPrivateFieldGet2(_unskipped_branches, this).delete(effect);
|
|
650
662
|
}
|
|
651
663
|
/**
|
|
652
664
|
* Remove an effect from the #skipped_branches map and reschedule
|
|
653
665
|
* any tracked dirty/maybe_dirty child effects
|
|
654
666
|
* @param {Effect} effect
|
|
667
|
+
* @param {(e: Effect) => void} callback
|
|
655
668
|
*/
|
|
656
|
-
unskip_effect(effect) {
|
|
669
|
+
unskip_effect(effect, callback = (e) => this.schedule(e)) {
|
|
657
670
|
var tracked = _classPrivateFieldGet2(_skipped_branches, this).get(effect);
|
|
658
671
|
if (tracked) {
|
|
659
672
|
_classPrivateFieldGet2(_skipped_branches, this).delete(effect);
|
|
660
673
|
for (var e of tracked.d) {
|
|
661
674
|
set_signal_status(e, DIRTY);
|
|
662
|
-
|
|
675
|
+
callback(e);
|
|
663
676
|
}
|
|
664
677
|
for (e of tracked.m) {
|
|
665
678
|
set_signal_status(e, MAYBE_DIRTY);
|
|
666
|
-
|
|
679
|
+
callback(e);
|
|
667
680
|
}
|
|
668
681
|
}
|
|
682
|
+
_classPrivateFieldGet2(_unskipped_branches, this).add(effect);
|
|
669
683
|
}
|
|
670
684
|
/**
|
|
671
685
|
* Associate a change to a given source with the current
|
|
672
686
|
* batch, noting its previous and current values
|
|
673
687
|
* @param {Value} source
|
|
674
|
-
* @param {any}
|
|
688
|
+
* @param {any} value
|
|
675
689
|
* @param {boolean} [is_derived]
|
|
676
690
|
*/
|
|
677
|
-
capture(source,
|
|
678
|
-
if (
|
|
691
|
+
capture(source, value, is_derived = false) {
|
|
692
|
+
if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v);
|
|
679
693
|
if ((source.f & 8388608) === 0) {
|
|
680
|
-
this.current.set(source, [
|
|
681
|
-
batch_values?.set(source,
|
|
694
|
+
this.current.set(source, [value, is_derived]);
|
|
695
|
+
batch_values?.set(source, value);
|
|
682
696
|
}
|
|
697
|
+
if (!this.is_fork) source.v = value;
|
|
683
698
|
}
|
|
684
699
|
activate() {
|
|
685
700
|
current_batch = this;
|
|
@@ -707,6 +722,7 @@ var Batch = class Batch {
|
|
|
707
722
|
discard() {
|
|
708
723
|
for (const fn of _classPrivateFieldGet2(_discard_callbacks, this)) fn(this);
|
|
709
724
|
_classPrivateFieldGet2(_discard_callbacks, this).clear();
|
|
725
|
+
_classPrivateFieldGet2(_fork_commit_callbacks, this).clear();
|
|
710
726
|
batches.delete(this);
|
|
711
727
|
}
|
|
712
728
|
/**
|
|
@@ -766,6 +782,14 @@ var Batch = class Batch {
|
|
|
766
782
|
ondiscard(fn) {
|
|
767
783
|
_classPrivateFieldGet2(_discard_callbacks, this).add(fn);
|
|
768
784
|
}
|
|
785
|
+
/** @param {(batch: Batch) => void} fn */
|
|
786
|
+
on_fork_commit(fn) {
|
|
787
|
+
_classPrivateFieldGet2(_fork_commit_callbacks, this).add(fn);
|
|
788
|
+
}
|
|
789
|
+
run_fork_commit_callbacks() {
|
|
790
|
+
for (const fn of _classPrivateFieldGet2(_fork_commit_callbacks, this)) fn(this);
|
|
791
|
+
_classPrivateFieldGet2(_fork_commit_callbacks, this).clear();
|
|
792
|
+
}
|
|
769
793
|
settled() {
|
|
770
794
|
return (_classPrivateFieldGet2(_deferred, this) ?? _classPrivateFieldSet2(_deferred, this, deferred())).promise;
|
|
771
795
|
}
|
|
@@ -911,7 +935,7 @@ function _process() {
|
|
|
911
935
|
batches.add(next_batch);
|
|
912
936
|
_assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
|
|
913
937
|
}
|
|
914
|
-
if (!batches.has(this)) _assertClassBrand(_Batch_brand, this, _commit$1).call(this);
|
|
938
|
+
if (async_mode_flag && !batches.has(this)) _assertClassBrand(_Batch_brand, this, _commit$1).call(this);
|
|
915
939
|
}
|
|
916
940
|
/**
|
|
917
941
|
* Traverse the effect tree, executing effects or stashing
|
|
@@ -973,6 +997,10 @@ function _commit$1() {
|
|
|
973
997
|
if (others.length === 0) {
|
|
974
998
|
if (is_earlier) batch.discard();
|
|
975
999
|
} else if (sources.length > 0) {
|
|
1000
|
+
if (is_earlier) for (const unskipped of _classPrivateFieldGet2(_unskipped_branches, this)) batch.unskip_effect(unskipped, (e) => {
|
|
1001
|
+
if ((e.f & 4194320) !== 0) batch.schedule(e);
|
|
1002
|
+
else _assertClassBrand(_Batch_brand, batch, _defer_effects).call(batch, [e]);
|
|
1003
|
+
});
|
|
976
1004
|
batch.activate();
|
|
977
1005
|
/** @type {Set<Value>} */
|
|
978
1006
|
var marked = /* @__PURE__ */ new Set();
|
|
@@ -1152,7 +1180,7 @@ function reset_all(effect) {
|
|
|
1152
1180
|
}
|
|
1153
1181
|
}
|
|
1154
1182
|
//#endregion
|
|
1155
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
1183
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/reactivity/create-subscriber.js
|
|
1156
1184
|
/**
|
|
1157
1185
|
* Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
|
|
1158
1186
|
* It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
|
|
@@ -1225,7 +1253,7 @@ function createSubscriber(start) {
|
|
|
1225
1253
|
};
|
|
1226
1254
|
}
|
|
1227
1255
|
//#endregion
|
|
1228
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
1256
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
1229
1257
|
/** @import { Effect, Source, TemplateNode, } from '#client' */
|
|
1230
1258
|
/**
|
|
1231
1259
|
* @typedef {{
|
|
@@ -1373,82 +1401,15 @@ var Boundary = class {
|
|
|
1373
1401
|
}
|
|
1374
1402
|
/** @param {unknown} error */
|
|
1375
1403
|
error(error) {
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
if (_classPrivateFieldGet2(_pending_effect, this)) {
|
|
1384
|
-
destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
1385
|
-
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
1386
|
-
}
|
|
1387
|
-
if (_classPrivateFieldGet2(_failed_effect, this)) {
|
|
1388
|
-
destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
1389
|
-
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
1390
|
-
}
|
|
1391
|
-
if (hydrating) {
|
|
1392
|
-
set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
|
|
1393
|
-
next();
|
|
1394
|
-
set_hydrate_node(skip_nodes());
|
|
1395
|
-
}
|
|
1396
|
-
var did_reset = false;
|
|
1397
|
-
var calling_on_error = false;
|
|
1398
|
-
const reset = () => {
|
|
1399
|
-
if (did_reset) {
|
|
1400
|
-
svelte_boundary_reset_noop();
|
|
1401
|
-
return;
|
|
1402
|
-
}
|
|
1403
|
-
did_reset = true;
|
|
1404
|
-
if (calling_on_error) svelte_boundary_reset_onerror();
|
|
1405
|
-
if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
|
|
1406
|
-
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
1404
|
+
if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
|
|
1405
|
+
if (current_batch?.is_fork) {
|
|
1406
|
+
if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
1407
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
1408
|
+
if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
1409
|
+
current_batch.on_fork_commit(() => {
|
|
1410
|
+
_assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
1407
1411
|
});
|
|
1408
|
-
|
|
1409
|
-
_assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
1410
|
-
});
|
|
1411
|
-
};
|
|
1412
|
-
/** @param {unknown} transformed_error */
|
|
1413
|
-
const handle_error_result = (transformed_error) => {
|
|
1414
|
-
try {
|
|
1415
|
-
calling_on_error = true;
|
|
1416
|
-
onerror?.(transformed_error, reset);
|
|
1417
|
-
calling_on_error = false;
|
|
1418
|
-
} catch (error) {
|
|
1419
|
-
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
1420
|
-
}
|
|
1421
|
-
if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
1422
|
-
try {
|
|
1423
|
-
return branch(() => {
|
|
1424
|
-
var effect = active_effect;
|
|
1425
|
-
effect.b = this;
|
|
1426
|
-
effect.f |= 128;
|
|
1427
|
-
failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
|
|
1428
|
-
});
|
|
1429
|
-
} catch (error) {
|
|
1430
|
-
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
1431
|
-
return null;
|
|
1432
|
-
}
|
|
1433
|
-
}));
|
|
1434
|
-
};
|
|
1435
|
-
queue_micro_task(() => {
|
|
1436
|
-
/** @type {unknown} */
|
|
1437
|
-
var result;
|
|
1438
|
-
try {
|
|
1439
|
-
result = this.transform_error(error);
|
|
1440
|
-
} catch (e) {
|
|
1441
|
-
invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
1442
|
-
return;
|
|
1443
|
-
}
|
|
1444
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function")
|
|
1445
|
-
/** @type {any} */ result.then(
|
|
1446
|
-
handle_error_result,
|
|
1447
|
-
/** @param {unknown} e */
|
|
1448
|
-
(e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
|
|
1449
|
-
);
|
|
1450
|
-
else handle_error_result(result);
|
|
1451
|
-
});
|
|
1412
|
+
} else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
1452
1413
|
}
|
|
1453
1414
|
};
|
|
1454
1415
|
function _hydrate_resolved_content() {
|
|
@@ -1564,8 +1525,88 @@ function _update_pending_count(d, batch) {
|
|
|
1564
1525
|
}
|
|
1565
1526
|
}
|
|
1566
1527
|
}
|
|
1528
|
+
/**
|
|
1529
|
+
* @param {unknown} error
|
|
1530
|
+
*/
|
|
1531
|
+
function _handle_error(error) {
|
|
1532
|
+
if (_classPrivateFieldGet2(_main_effect, this)) {
|
|
1533
|
+
destroy_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
1534
|
+
_classPrivateFieldSet2(_main_effect, this, null);
|
|
1535
|
+
}
|
|
1536
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) {
|
|
1537
|
+
destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
1538
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
1539
|
+
}
|
|
1540
|
+
if (_classPrivateFieldGet2(_failed_effect, this)) {
|
|
1541
|
+
destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
1542
|
+
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
1543
|
+
}
|
|
1544
|
+
if (hydrating) {
|
|
1545
|
+
set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
|
|
1546
|
+
next();
|
|
1547
|
+
set_hydrate_node(skip_nodes());
|
|
1548
|
+
}
|
|
1549
|
+
var onerror = _classPrivateFieldGet2(_props, this).onerror;
|
|
1550
|
+
let failed = _classPrivateFieldGet2(_props, this).failed;
|
|
1551
|
+
var did_reset = false;
|
|
1552
|
+
var calling_on_error = false;
|
|
1553
|
+
const reset = () => {
|
|
1554
|
+
if (did_reset) {
|
|
1555
|
+
svelte_boundary_reset_noop();
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
did_reset = true;
|
|
1559
|
+
if (calling_on_error) svelte_boundary_reset_onerror();
|
|
1560
|
+
if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
|
|
1561
|
+
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
1562
|
+
});
|
|
1563
|
+
_assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
1564
|
+
_assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
1565
|
+
});
|
|
1566
|
+
};
|
|
1567
|
+
/** @param {unknown} transformed_error */
|
|
1568
|
+
const handle_error_result = (transformed_error) => {
|
|
1569
|
+
try {
|
|
1570
|
+
calling_on_error = true;
|
|
1571
|
+
onerror?.(transformed_error, reset);
|
|
1572
|
+
calling_on_error = false;
|
|
1573
|
+
} catch (error) {
|
|
1574
|
+
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
1575
|
+
}
|
|
1576
|
+
if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
1577
|
+
try {
|
|
1578
|
+
return branch(() => {
|
|
1579
|
+
var effect = active_effect;
|
|
1580
|
+
effect.b = this;
|
|
1581
|
+
effect.f |= 128;
|
|
1582
|
+
failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
|
|
1583
|
+
});
|
|
1584
|
+
} catch (error) {
|
|
1585
|
+
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
1586
|
+
return null;
|
|
1587
|
+
}
|
|
1588
|
+
}));
|
|
1589
|
+
};
|
|
1590
|
+
queue_micro_task(() => {
|
|
1591
|
+
/** @type {unknown} */
|
|
1592
|
+
var result;
|
|
1593
|
+
try {
|
|
1594
|
+
result = this.transform_error(error);
|
|
1595
|
+
} catch (e) {
|
|
1596
|
+
invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
1597
|
+
return;
|
|
1598
|
+
}
|
|
1599
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function")
|
|
1600
|
+
/** @type {any} */ result.then(
|
|
1601
|
+
handle_error_result,
|
|
1602
|
+
/** @param {unknown} e */
|
|
1603
|
+
(e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
|
|
1604
|
+
);
|
|
1605
|
+
else handle_error_result(result);
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1567
1608
|
//#endregion
|
|
1568
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
1609
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/async.js
|
|
1569
1610
|
/** @import { Blocker, Effect, Value } from '#client' */
|
|
1570
1611
|
/**
|
|
1571
1612
|
* @param {Blocker[]} blockers
|
|
@@ -1657,7 +1698,6 @@ function increment_pending() {
|
|
|
1657
1698
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1658
1699
|
function derived(fn) {
|
|
1659
1700
|
var flags = 2 | DIRTY;
|
|
1660
|
-
var parent_derived = active_reaction !== null && (active_reaction.f & 2) !== 0 ? active_reaction : null;
|
|
1661
1701
|
if (active_effect !== null) active_effect.f |= EFFECT_PRESERVED;
|
|
1662
1702
|
return {
|
|
1663
1703
|
ctx: component_context,
|
|
@@ -1670,7 +1710,7 @@ function derived(fn) {
|
|
|
1670
1710
|
rv: 0,
|
|
1671
1711
|
v: UNINITIALIZED,
|
|
1672
1712
|
wv: 0,
|
|
1673
|
-
parent:
|
|
1713
|
+
parent: active_effect,
|
|
1674
1714
|
ac: null
|
|
1675
1715
|
};
|
|
1676
1716
|
}
|
|
@@ -1786,18 +1826,6 @@ function destroy_derived_effects(derived) {
|
|
|
1786
1826
|
}
|
|
1787
1827
|
}
|
|
1788
1828
|
/**
|
|
1789
|
-
* @param {Derived} derived
|
|
1790
|
-
* @returns {Effect | null}
|
|
1791
|
-
*/
|
|
1792
|
-
function get_derived_parent_effect(derived) {
|
|
1793
|
-
var parent = derived.parent;
|
|
1794
|
-
while (parent !== null) {
|
|
1795
|
-
if ((parent.f & 2) === 0) return (parent.f & 16384) === 0 ? parent : null;
|
|
1796
|
-
parent = parent.parent;
|
|
1797
|
-
}
|
|
1798
|
-
return null;
|
|
1799
|
-
}
|
|
1800
|
-
/**
|
|
1801
1829
|
* @template T
|
|
1802
1830
|
* @param {Derived} derived
|
|
1803
1831
|
* @returns {T}
|
|
@@ -1805,7 +1833,12 @@ function get_derived_parent_effect(derived) {
|
|
|
1805
1833
|
function execute_derived(derived) {
|
|
1806
1834
|
var value;
|
|
1807
1835
|
var prev_active_effect = active_effect;
|
|
1808
|
-
|
|
1836
|
+
var parent = derived.parent;
|
|
1837
|
+
if (!is_destroying_effect && parent !== null && (parent.f & 24576) !== 0) {
|
|
1838
|
+
derived_inert();
|
|
1839
|
+
return derived.v;
|
|
1840
|
+
}
|
|
1841
|
+
set_active_effect(parent);
|
|
1809
1842
|
try {
|
|
1810
1843
|
derived.f &= ~WAS_MARKED;
|
|
1811
1844
|
destroy_derived_effects(derived);
|
|
@@ -1820,13 +1853,12 @@ function execute_derived(derived) {
|
|
|
1820
1853
|
* @returns {void}
|
|
1821
1854
|
*/
|
|
1822
1855
|
function update_derived(derived) {
|
|
1823
|
-
var old_value = derived.v;
|
|
1824
1856
|
var value = execute_derived(derived);
|
|
1825
1857
|
if (!derived.equals(value)) {
|
|
1826
1858
|
derived.wv = increment_write_version();
|
|
1827
1859
|
if (!current_batch?.is_fork || derived.deps === null) {
|
|
1828
|
-
derived
|
|
1829
|
-
|
|
1860
|
+
if (current_batch !== null) current_batch.capture(derived, value, true);
|
|
1861
|
+
else derived.v = value;
|
|
1830
1862
|
if (derived.deps === null) {
|
|
1831
1863
|
set_signal_status(derived, CLEAN);
|
|
1832
1864
|
return;
|
|
@@ -1860,7 +1892,7 @@ function unfreeze_derived_effects(derived) {
|
|
|
1860
1892
|
for (const e of derived.effects) if (e.teardown) update_effect(e);
|
|
1861
1893
|
}
|
|
1862
1894
|
//#endregion
|
|
1863
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
1895
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/sources.js
|
|
1864
1896
|
/** @import { Derived, Effect, Source, Value } from '#client' */
|
|
1865
1897
|
/** @type {Set<any>} */
|
|
1866
1898
|
var eager_effects = /* @__PURE__ */ new Set();
|
|
@@ -1930,12 +1962,9 @@ function set(source, value, should_proxy = false) {
|
|
|
1930
1962
|
*/
|
|
1931
1963
|
function internal_set(source, value, updated_during_traversal = null) {
|
|
1932
1964
|
if (!source.equals(value)) {
|
|
1933
|
-
|
|
1934
|
-
if (is_destroying_effect) old_values.set(source, value);
|
|
1935
|
-
else old_values.set(source, old_value);
|
|
1936
|
-
source.v = value;
|
|
1965
|
+
old_values.set(source, is_destroying_effect ? value : source.v);
|
|
1937
1966
|
var batch = Batch.ensure();
|
|
1938
|
-
batch.capture(source,
|
|
1967
|
+
batch.capture(source, value);
|
|
1939
1968
|
if ((source.f & 2) !== 0) {
|
|
1940
1969
|
const derived = source;
|
|
1941
1970
|
if ((source.f & 2048) !== 0) execute_derived(derived);
|
|
@@ -1985,7 +2014,7 @@ function mark_reactions(signal, status, updated_during_traversal) {
|
|
|
1985
2014
|
var derived = reaction;
|
|
1986
2015
|
batch_values?.delete(derived);
|
|
1987
2016
|
if ((flags & 65536) === 0) {
|
|
1988
|
-
if (flags & 512) reaction.f |= WAS_MARKED;
|
|
2017
|
+
if (flags & 512 && (active_effect === null || (active_effect.f & 2097152) === 0)) reaction.f |= WAS_MARKED;
|
|
1989
2018
|
mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);
|
|
1990
2019
|
}
|
|
1991
2020
|
} else if (not_dirty) {
|
|
@@ -2155,7 +2184,7 @@ function proxy(value) {
|
|
|
2155
2184
|
});
|
|
2156
2185
|
}
|
|
2157
2186
|
//#endregion
|
|
2158
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
2187
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/operations.js
|
|
2159
2188
|
/** @import { Effect, TemplateNode } from '#client' */
|
|
2160
2189
|
/** @type {Window} */
|
|
2161
2190
|
var $window;
|
|
@@ -2327,7 +2356,7 @@ function merge_text_nodes(text) {
|
|
|
2327
2356
|
}
|
|
2328
2357
|
}
|
|
2329
2358
|
//#endregion
|
|
2330
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
2359
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/misc.js
|
|
2331
2360
|
var listening_to_form_reset = false;
|
|
2332
2361
|
function add_form_reset_listener() {
|
|
2333
2362
|
if (!listening_to_form_reset) {
|
|
@@ -2340,7 +2369,7 @@ function add_form_reset_listener() {
|
|
|
2340
2369
|
}
|
|
2341
2370
|
}
|
|
2342
2371
|
//#endregion
|
|
2343
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
2372
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
|
|
2344
2373
|
/**
|
|
2345
2374
|
* @template T
|
|
2346
2375
|
* @param {() => T} fn
|
|
@@ -2358,7 +2387,7 @@ function without_reactive_context(fn) {
|
|
|
2358
2387
|
}
|
|
2359
2388
|
}
|
|
2360
2389
|
//#endregion
|
|
2361
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
2390
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/effects.js
|
|
2362
2391
|
/** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
|
|
2363
2392
|
/**
|
|
2364
2393
|
* @param {'$effect' | '$effect.pre' | '$inspect'} rune
|
|
@@ -2687,8 +2716,10 @@ function pause_children(effect, transitions, local) {
|
|
|
2687
2716
|
var child = effect.first;
|
|
2688
2717
|
while (child !== null) {
|
|
2689
2718
|
var sibling = child.next;
|
|
2690
|
-
|
|
2691
|
-
|
|
2719
|
+
if ((child.f & 64) === 0) {
|
|
2720
|
+
var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
|
|
2721
|
+
pause_children(child, transitions, transparent ? local : false);
|
|
2722
|
+
}
|
|
2692
2723
|
child = sibling;
|
|
2693
2724
|
}
|
|
2694
2725
|
}
|
|
@@ -2740,14 +2771,14 @@ function move_effect(effect, fragment) {
|
|
|
2740
2771
|
}
|
|
2741
2772
|
}
|
|
2742
2773
|
//#endregion
|
|
2743
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
2774
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/legacy.js
|
|
2744
2775
|
/**
|
|
2745
2776
|
* @type {Set<Value> | null}
|
|
2746
2777
|
* @deprecated
|
|
2747
2778
|
*/
|
|
2748
2779
|
var captured_signals = null;
|
|
2749
2780
|
//#endregion
|
|
2750
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
2781
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/runtime.js
|
|
2751
2782
|
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
2752
2783
|
var is_updating_effect = false;
|
|
2753
2784
|
var is_destroying_effect = false;
|
|
@@ -2949,7 +2980,7 @@ function remove_reaction(signal, dependency) {
|
|
|
2949
2980
|
derived.f ^= 512;
|
|
2950
2981
|
derived.f &= ~WAS_MARKED;
|
|
2951
2982
|
}
|
|
2952
|
-
update_derived_status(derived);
|
|
2983
|
+
if (derived.v !== UNINITIALIZED) update_derived_status(derived);
|
|
2953
2984
|
freeze_derived_effects(derived);
|
|
2954
2985
|
remove_reactions(derived, 0);
|
|
2955
2986
|
}
|
|
@@ -3091,7 +3122,7 @@ function untrack(fn) {
|
|
|
3091
3122
|
}
|
|
3092
3123
|
}
|
|
3093
3124
|
//#endregion
|
|
3094
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
3125
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/events.js
|
|
3095
3126
|
/**
|
|
3096
3127
|
* Used on elements, as a map of event type -> event handler,
|
|
3097
3128
|
* and on events themselves to track which element handled an event
|
|
@@ -3174,8 +3205,10 @@ function handle_event_propagation(event) {
|
|
|
3174
3205
|
}
|
|
3175
3206
|
}
|
|
3176
3207
|
//#endregion
|
|
3177
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
3178
|
-
var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
3208
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/reconciler.js
|
|
3209
|
+
var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
3210
|
+
/** @param {string} html */
|
|
3211
|
+
createHTML: (html) => {
|
|
3179
3212
|
return html;
|
|
3180
3213
|
} });
|
|
3181
3214
|
/** @param {string} html */
|
|
@@ -3191,7 +3224,7 @@ function create_fragment_from_html(html) {
|
|
|
3191
3224
|
return elem.content;
|
|
3192
3225
|
}
|
|
3193
3226
|
//#endregion
|
|
3194
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
3227
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/template.js
|
|
3195
3228
|
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
3196
3229
|
/** @import { TemplateStructure } from './types' */
|
|
3197
3230
|
/**
|
|
@@ -3288,6 +3321,21 @@ function from_svg(content, flags) {
|
|
|
3288
3321
|
return /* @__PURE__ */ from_namespace(content, flags, "svg");
|
|
3289
3322
|
}
|
|
3290
3323
|
/**
|
|
3324
|
+
* @returns {TemplateNode | DocumentFragment}
|
|
3325
|
+
*/
|
|
3326
|
+
function comment() {
|
|
3327
|
+
if (hydrating) {
|
|
3328
|
+
assign_nodes(hydrate_node, null);
|
|
3329
|
+
return hydrate_node;
|
|
3330
|
+
}
|
|
3331
|
+
var frag = document.createDocumentFragment();
|
|
3332
|
+
var start = document.createComment("");
|
|
3333
|
+
var anchor = create_text();
|
|
3334
|
+
frag.append(start, anchor);
|
|
3335
|
+
assign_nodes(start, anchor);
|
|
3336
|
+
return frag;
|
|
3337
|
+
}
|
|
3338
|
+
/**
|
|
3291
3339
|
* Assign the created (or in hydration mode, traversed) dom elements to the current block
|
|
3292
3340
|
* and insert the elements into the dom (in client mode).
|
|
3293
3341
|
* @param {Text | Comment | Element} anchor
|
|
@@ -3508,7 +3556,7 @@ function unmount(component, options) {
|
|
|
3508
3556
|
return Promise.resolve();
|
|
3509
3557
|
}
|
|
3510
3558
|
//#endregion
|
|
3511
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
3559
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/blocks/branches.js
|
|
3512
3560
|
/** @import { Effect, TemplateNode } from '#client' */
|
|
3513
3561
|
var _batches = /* @__PURE__ */ new WeakMap();
|
|
3514
3562
|
var _onscreen = /* @__PURE__ */ new WeakMap();
|
|
@@ -3630,7 +3678,7 @@ var BranchManager = class {
|
|
|
3630
3678
|
}
|
|
3631
3679
|
};
|
|
3632
3680
|
//#endregion
|
|
3633
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
3681
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/blocks/if.js
|
|
3634
3682
|
/** @import { TemplateNode } from '#client' */
|
|
3635
3683
|
/**
|
|
3636
3684
|
* @param {TemplateNode} node
|
|
@@ -3676,7 +3724,7 @@ function if_block(node, fn, elseif = false) {
|
|
|
3676
3724
|
}, flags);
|
|
3677
3725
|
}
|
|
3678
3726
|
//#endregion
|
|
3679
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
3727
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/blocks/each.js
|
|
3680
3728
|
/** @import { EachItem, EachOutroGroup, EachState, Effect, EffectNodes, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */
|
|
3681
3729
|
/** @import { Batch } from '../../reactivity/batch.js'; */
|
|
3682
3730
|
/**
|
|
@@ -4134,14 +4182,14 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
|
|
|
4134
4182
|
var wrapper = create_element(svg ? "svg" : mathml ? "math" : "template", svg ? NAMESPACE_SVG : mathml ? NAMESPACE_MATHML : void 0);
|
|
4135
4183
|
wrapper.innerHTML = value;
|
|
4136
4184
|
/** @type {DocumentFragment | Element} */
|
|
4137
|
-
var node = svg || mathml ? wrapper : wrapper.content;
|
|
4185
|
+
var node = svg || mathml ? wrapper : /** @type {HTMLTemplateElement} */ wrapper.content;
|
|
4138
4186
|
assign_nodes(/* @__PURE__ */ get_first_child(node), node.lastChild);
|
|
4139
4187
|
if (svg || mathml) while (/* @__PURE__ */ get_first_child(node)) anchor.before(/* @__PURE__ */ get_first_child(node));
|
|
4140
4188
|
else anchor.before(node);
|
|
4141
4189
|
});
|
|
4142
4190
|
}
|
|
4143
4191
|
//#endregion
|
|
4144
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4192
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/css.js
|
|
4145
4193
|
/**
|
|
4146
4194
|
* @param {Node} anchor
|
|
4147
4195
|
* @param {{ hash: string, code: string }} css
|
|
@@ -4149,7 +4197,7 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
|
|
|
4149
4197
|
function append_styles$1(anchor, css) {
|
|
4150
4198
|
effect(() => {
|
|
4151
4199
|
var root = anchor.getRootNode();
|
|
4152
|
-
var target = root.host ? root : root.head ?? root.ownerDocument.head;
|
|
4200
|
+
var target = root.host ? root : /** @type {Document} */ root.head ?? root.ownerDocument.head;
|
|
4153
4201
|
if (!target.querySelector("#" + css.hash)) {
|
|
4154
4202
|
const style = create_element("style");
|
|
4155
4203
|
style.id = css.hash;
|
|
@@ -4159,7 +4207,7 @@ function append_styles$1(anchor, css) {
|
|
|
4159
4207
|
});
|
|
4160
4208
|
}
|
|
4161
4209
|
//#endregion
|
|
4162
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4210
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/shared/attributes.js
|
|
4163
4211
|
var whitespace = [..." \n\r\f\xA0\v"];
|
|
4164
4212
|
/**
|
|
4165
4213
|
* @param {any} value
|
|
@@ -4269,7 +4317,7 @@ function to_style(value, styles) {
|
|
|
4269
4317
|
return value == null ? null : String(value);
|
|
4270
4318
|
}
|
|
4271
4319
|
//#endregion
|
|
4272
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4320
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/class.js
|
|
4273
4321
|
/**
|
|
4274
4322
|
* @param {Element} dom
|
|
4275
4323
|
* @param {boolean | number} is_html
|
|
@@ -4294,7 +4342,7 @@ function set_class(dom, is_html, value, hash, prev_classes, next_classes) {
|
|
|
4294
4342
|
return next_classes;
|
|
4295
4343
|
}
|
|
4296
4344
|
//#endregion
|
|
4297
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4345
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/style.js
|
|
4298
4346
|
/**
|
|
4299
4347
|
* @param {Element & ElementCSSInlineStyle} dom
|
|
4300
4348
|
* @param {Record<string, any>} prev
|
|
@@ -4328,7 +4376,7 @@ function set_style(dom, value, prev_styles, next_styles) {
|
|
|
4328
4376
|
return next_styles;
|
|
4329
4377
|
}
|
|
4330
4378
|
//#endregion
|
|
4331
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4379
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/attributes.js
|
|
4332
4380
|
/** @import { Blocker, Effect } from '#client' */
|
|
4333
4381
|
var IS_CUSTOM_ELEMENT = Symbol("is custom element");
|
|
4334
4382
|
var IS_HTML = Symbol("is html");
|
|
@@ -4390,7 +4438,7 @@ function set_attribute(element, attribute, value, skip_warning) {
|
|
|
4390
4438
|
if (hydrating) {
|
|
4391
4439
|
attributes[attribute] = element.getAttribute(attribute);
|
|
4392
4440
|
if (attribute === "src" || attribute === "srcset" || attribute === "href" && element.nodeName === LINK_TAG) {
|
|
4393
|
-
if (!skip_warning)
|
|
4441
|
+
if (!skip_warning);
|
|
4394
4442
|
return;
|
|
4395
4443
|
}
|
|
4396
4444
|
}
|
|
@@ -4428,14 +4476,8 @@ function get_setters(element) {
|
|
|
4428
4476
|
}
|
|
4429
4477
|
return setters;
|
|
4430
4478
|
}
|
|
4431
|
-
/**
|
|
4432
|
-
* @param {any} element
|
|
4433
|
-
* @param {string} attribute
|
|
4434
|
-
* @param {string} value
|
|
4435
|
-
*/
|
|
4436
|
-
function check_src_in_dev_hydration(element, attribute, value) {}
|
|
4437
4479
|
//#endregion
|
|
4438
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4480
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
|
|
4439
4481
|
var _ResizeObserverSingleton;
|
|
4440
4482
|
var _listeners = /* @__PURE__ */ new WeakMap();
|
|
4441
4483
|
var _observer = /* @__PURE__ */ new WeakMap();
|
|
@@ -4487,7 +4529,7 @@ function _getObserver() {
|
|
|
4487
4529
|
}
|
|
4488
4530
|
_defineProperty(ResizeObserverSingleton, "entries", /* @__PURE__ */ new WeakMap());
|
|
4489
4531
|
//#endregion
|
|
4490
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4532
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js
|
|
4491
4533
|
/** @import { ComponentContext, Effect } from '#client' */
|
|
4492
4534
|
/**
|
|
4493
4535
|
* @param {any} bound_value
|
|
@@ -4539,7 +4581,7 @@ function bind_this(element_or_component = {}, update, get_value, get_parts) {
|
|
|
4539
4581
|
return element_or_component;
|
|
4540
4582
|
}
|
|
4541
4583
|
//#endregion
|
|
4542
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4584
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/props.js
|
|
4543
4585
|
/** @import { Effect, Source } from './types.js' */
|
|
4544
4586
|
/**
|
|
4545
4587
|
* This function is responsible for synchronizing a possibly bound prop with the inner component state.
|
|
@@ -4627,7 +4669,7 @@ function prop(props, key, flags, fallback) {
|
|
|
4627
4669
|
});
|
|
4628
4670
|
}
|
|
4629
4671
|
//#endregion
|
|
4630
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4672
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/legacy/legacy-client.js
|
|
4631
4673
|
/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
|
|
4632
4674
|
/**
|
|
4633
4675
|
* Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
|
|
@@ -4706,6 +4748,7 @@ var Svelte4Component = class {
|
|
|
4706
4748
|
get() {
|
|
4707
4749
|
return _classPrivateFieldGet2(_instance, this)[key];
|
|
4708
4750
|
},
|
|
4751
|
+
/** @param {any} value */
|
|
4709
4752
|
set(value) {
|
|
4710
4753
|
_classPrivateFieldGet2(_instance, this)[key] = value;
|
|
4711
4754
|
},
|
|
@@ -4745,7 +4788,7 @@ var Svelte4Component = class {
|
|
|
4745
4788
|
}
|
|
4746
4789
|
};
|
|
4747
4790
|
//#endregion
|
|
4748
|
-
//#region ../../../node_modules/.bun/svelte@5.55.
|
|
4791
|
+
//#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
|
|
4749
4792
|
/**
|
|
4750
4793
|
* @typedef {Object} CustomElementPropDefinition
|
|
4751
4794
|
* @property {string} [attribute]
|
|
@@ -5031,14 +5074,14 @@ function create_custom_element(Component, props_definition, slots, exports, shad
|
|
|
5031
5074
|
}
|
|
5032
5075
|
//#endregion
|
|
5033
5076
|
//#region ../../lib-svelte/styling/dist/index2.js
|
|
5034
|
-
var e = {
|
|
5077
|
+
var e$1 = {
|
|
5035
5078
|
50: "#e8f5e9",
|
|
5036
5079
|
500: "#4caf50"
|
|
5037
|
-
}, t = {
|
|
5080
|
+
}, t$2 = {
|
|
5038
5081
|
200: "#9fa8da",
|
|
5039
5082
|
500: "#3f51b5",
|
|
5040
5083
|
800: "#283593"
|
|
5041
|
-
}, n = { 500: "#ff9800" }, r = {
|
|
5084
|
+
}, n$1 = { 500: "#ff9800" }, r$1 = {
|
|
5042
5085
|
200: "#f48fb1",
|
|
5043
5086
|
900: "#880e4f",
|
|
5044
5087
|
A400: "#f50057"
|
|
@@ -5049,21 +5092,21 @@ var e = {
|
|
|
5049
5092
|
TEXT: "black",
|
|
5050
5093
|
DISABLED: "grey",
|
|
5051
5094
|
DISABLED_SECONDARY: "#ABABAB",
|
|
5052
|
-
CORRECT: e[500],
|
|
5053
|
-
CORRECT_SECONDARY: e[50],
|
|
5095
|
+
CORRECT: e$1[500],
|
|
5096
|
+
CORRECT_SECONDARY: e$1[50],
|
|
5054
5097
|
CORRECT_TERTIARY: "#0EA449",
|
|
5055
5098
|
CORRECT_WITH_ICON: "#087D38",
|
|
5056
|
-
INCORRECT: n[500],
|
|
5099
|
+
INCORRECT: n$1[500],
|
|
5057
5100
|
INCORRECT_SECONDARY: i[50],
|
|
5058
5101
|
INCORRECT_WITH_ICON: "#BF0D00",
|
|
5059
5102
|
MISSING: i[700],
|
|
5060
5103
|
MISSING_WITH_ICON: "#6A78A1",
|
|
5061
|
-
PRIMARY: t[500],
|
|
5062
|
-
PRIMARY_LIGHT: t[200],
|
|
5063
|
-
PRIMARY_DARK: t[800],
|
|
5064
|
-
SECONDARY: r.A400,
|
|
5065
|
-
SECONDARY_LIGHT: r[200],
|
|
5066
|
-
SECONDARY_DARK: r[900],
|
|
5104
|
+
PRIMARY: t$2[500],
|
|
5105
|
+
PRIMARY_LIGHT: t$2[200],
|
|
5106
|
+
PRIMARY_DARK: t$2[800],
|
|
5107
|
+
SECONDARY: r$1.A400,
|
|
5108
|
+
SECONDARY_LIGHT: r$1[200],
|
|
5109
|
+
SECONDARY_DARK: r$1[900],
|
|
5067
5110
|
TERTIARY: "#146EB3",
|
|
5068
5111
|
TERTIARY_LIGHT: "#D0E2F0",
|
|
5069
5112
|
BACKGROUND: "rgba(255,255,255,0)",
|
|
@@ -5136,354 +5179,1238 @@ var o = (e) => (...t) => {
|
|
|
5136
5179
|
blueGrey900: Y
|
|
5137
5180
|
};
|
|
5138
5181
|
//#endregion
|
|
5139
|
-
//#region
|
|
5140
|
-
var
|
|
5141
|
-
var
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
code: ".sr-only.svelte-6wlbb4 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.mc-populated-blank-root.svelte-6wlbb4 .prose {max-width:none;}.blank-slot.svelte-6wlbb4:focus-within {outline:2px solid var(--pie-focus, #2563eb);outline-offset:2px;}.blank-slot.svelte-6wlbb4 {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.pie-toggle-correct-answer.svelte-6wlbb4 {width:100%;cursor:pointer;border:0;background:transparent;padding:0;display:flex;justify-content:center;text-align:center;color:var(--pie-correct-answer-toggle-label-color, var(--pie-text, black));}.pie-correct-answer-toggle-row.svelte-6wlbb4 {width:100%;display:flex;justify-content:flex-end;}.pie-correct-answer-toggle-content.svelte-6wlbb4 {display:flex;margin:0 auto;align-items:center;}.pie-correct-answer-toggle-icon-holder.svelte-6wlbb4 {width:25px;margin-right:5px;display:inline-flex;align-items:center;justify-content:center;}.pie-correct-answer-toggle-svg.svelte-6wlbb4 {width:25px;height:25px;}.pie-correct-answer-toggle-label.svelte-6wlbb4 {width:fit-content;min-width:140px;align-self:center;vertical-align:middle;font-weight:400;user-select:none;}.pie-toggle-correct-answer.svelte-6wlbb4:hover .pie-correct-answer-toggle-label:where(.svelte-6wlbb4),\n .pie-toggle-correct-answer.svelte-6wlbb4:focus-visible .pie-correct-answer-toggle-label:where(.svelte-6wlbb4) {text-decoration:underline;}.template-line.svelte-6wlbb4 {white-space:pre-wrap;}.template-line.svelte-6wlbb4 p {margin:0;}.blank-inner-empty.svelte-6wlbb4 {display:inline-block;min-width:4ch;}.blank-slot-standalone.svelte-6wlbb4 {width:var(--mpb-blank-standalone-width, 7rem);}.listen-button.svelte-6wlbb4 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);border:0;padding:0;background-color:transparent;cursor:pointer;z-index:1;}.listen-button.svelte-6wlbb4:hover {background-color:#e2f1fe;}.listen-feature-icon.svelte-6wlbb4 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);object-fit:contain;display:none;}.listen-feature-icon.listen-active.svelte-6wlbb4 {display:block;}.choice-row-horizontal.svelte-6wlbb4 {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));gap:0;}.choice-tile.svelte-6wlbb4 {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-6wlbb4 {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-6wlbb4:hover .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-hover-bg, #ececec);}.choice-row-horizontal.is-selected.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);}.choice-row-horizontal.is-selected.svelte-6wlbb4:hover .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);}.pie-choice.choice-correct.svelte-6wlbb4 {border-left:3px solid var(--pie-correct-answer-choice-correct-border, #0ea449);}.pie-choice.choice-incorrect.svelte-6wlbb4 {border-left:3px solid var(--pie-correct-answer-choice-incorrect-border, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-correct-bg, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-incorrect-bg, #ffebee);}.pie-choice-feedback-badge.svelte-6wlbb4 {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:1.1rem;height:1.1rem;border-radius:9999px;font-size:0.72rem;line-height:1;font-weight:700;color:var(--pie-correct-answer-feedback-glyph-color, #fff);}.pie-choice-feedback-correct.svelte-6wlbb4 {background:var(--pie-correct-answer-feedback-correct-bg, #087d38);}.pie-choice-feedback-incorrect.svelte-6wlbb4 {background:var(--pie-correct-answer-feedback-incorrect-bg, #bf0d00);}.choice-row-horizontal.svelte-6wlbb4 p {margin:0;text-align:center;}.choice-label.svelte-6wlbb4 p,\n .blank-inner.svelte-6wlbb4 p {margin:0;}.blank-inner.svelte-6wlbb4 {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.choice-radio-bottom.svelte-6wlbb4 {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}.choice-radio-inline.svelte-6wlbb4 {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}.layout-audio_blank_only.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {display:flex;width:min(100%, var(--mpb-audio-instructions-max-width, 875px));margin-left:auto;margin-right:auto;justify-content:flex-end;}.layout-audio_blank_only.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {text-align:center;margin:var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);}.layout-audio_blank_only.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4) {width:var(--mpb-blank-wide-width, 10rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);}.layout-stimulus_image_blank.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;grid-template-areas:'sentence audio'\n '. template'\n 'choices choices';column-gap:var(--mpb-stimulus-grid-column-gap, 2rem);row-gap:var(--mpb-stimulus-grid-row-gap, 0.7rem);align-items:start;}.layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;}.layout-stimulus_image_blank.svelte-6wlbb4 .sentence-line:where(.svelte-6wlbb4) {grid-area:sentence;margin:var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;}.layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:0;text-align:center;justify-self:center;}.layout-stimulus_image_blank.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-stimulus-choices-margin-top, 0.9rem);}.layout-token_sequence.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-token-grid-column-gap, 1.5rem);row-gap:var(--mpb-token-grid-row-gap, 0.8rem);align-items:start;}.layout-token_sequence.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;justify-self:end;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-token-template-margin-top, 0.6rem) 0 0;justify-self:center;text-align:center;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) span + span {margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4) {width:var(--mpb-blank-standalone-width, 7rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-token-choices-margin-top, 0.2rem);}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-inline-grid-column-gap, 1.5rem);row-gap:var(--mpb-inline-grid-row-gap, 0.65rem);align-items:start;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;justify-self:end;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-inline-template-margin-top, 0.45rem) 0 0;text-align:center;justify-self:center;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-inline-choices-margin-top, 0.25rem);}\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {.layout-audio_blank_only.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {width:100%;margin-left:0;margin-right:0;justify-content:flex-start;justify-self:start;}.layout-audio_blank_only.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4) {flex-direction:column;align-items:flex-start;justify-content:flex-start;}.layout-audio_blank_only.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4) {width:min(100%, var(--mpb-narrow-choice-max-width, 230px));align-items:flex-start;}\n }"
|
|
5182
|
+
//#region ../../lib-svelte/delivery-events/dist/index2.js
|
|
5183
|
+
var _e, _e2;
|
|
5184
|
+
var e = (_e = class e extends CustomEvent {
|
|
5185
|
+
constructor(t, n, r) {
|
|
5186
|
+
super(e.TYPE, {
|
|
5187
|
+
bubbles: !0,
|
|
5188
|
+
composed: !0,
|
|
5189
|
+
detail: {
|
|
5190
|
+
complete: n,
|
|
5191
|
+
component: t,
|
|
5192
|
+
hasModel: r
|
|
5193
|
+
}
|
|
5194
|
+
}), this.component = t, this.complete = n;
|
|
5195
|
+
}
|
|
5196
|
+
}, _e.TYPE = "model-set", _e), t$1 = (_e2 = class e extends CustomEvent {
|
|
5197
|
+
constructor(t, n) {
|
|
5198
|
+
super(e.TYPE, {
|
|
5199
|
+
bubbles: !0,
|
|
5200
|
+
composed: !0,
|
|
5201
|
+
detail: {
|
|
5202
|
+
complete: n,
|
|
5203
|
+
component: t
|
|
5204
|
+
}
|
|
5205
|
+
}), this.component = t, this.complete = n;
|
|
5206
|
+
}
|
|
5207
|
+
}, _e2.TYPE = "session-changed", _e2);
|
|
5208
|
+
//#endregion
|
|
5209
|
+
//#region ../../lib-svelte/delivery-events/dist/index3.js
|
|
5210
|
+
var t = (e) => {
|
|
5211
|
+
let t = e;
|
|
5212
|
+
return t ? typeof t.onSessionChange == "function" || typeof t.onAudioStarted == "function" || typeof t.onAudioEnded == "function" : !1;
|
|
5168
5213
|
};
|
|
5169
|
-
function
|
|
5214
|
+
function n(e, n = {}) {
|
|
5215
|
+
let r = n.hostPredicate ?? t, i = e;
|
|
5216
|
+
for (; i;) {
|
|
5217
|
+
if (r(i)) return i;
|
|
5218
|
+
i = i.parentElement;
|
|
5219
|
+
}
|
|
5220
|
+
if (typeof document < "u" && n.fallbackSelector) {
|
|
5221
|
+
let e = document.querySelector(n.fallbackSelector);
|
|
5222
|
+
if (r(e)) return e;
|
|
5223
|
+
}
|
|
5224
|
+
return null;
|
|
5225
|
+
}
|
|
5226
|
+
function r({ sourceEl: t, fallbackSelector: r, component: i, complete: a, session: o }) {
|
|
5227
|
+
let s = n(t, { fallbackSelector: r });
|
|
5228
|
+
return s ? typeof s.onSessionChange == "function" ? (s.onSessionChange(o), s) : (s.dispatchEvent(new t$1(i, a)), s) : null;
|
|
5229
|
+
}
|
|
5230
|
+
//#endregion
|
|
5231
|
+
//#region src/delivery/computeAudioMode.ts
|
|
5232
|
+
function computeAudioMode(params) {
|
|
5233
|
+
if (!params.hasAudio) return "none";
|
|
5234
|
+
if (!params.audioUrl) return "error";
|
|
5235
|
+
return params.useFeatureButtonAudio ? "feature-button" : "controls";
|
|
5236
|
+
}
|
|
5237
|
+
//#endregion
|
|
5238
|
+
//#region src/delivery/AudioPlayer.svelte
|
|
5239
|
+
var root_2$3 = /* @__PURE__ */ from_html(`<audio class="sr-only pie-audio-player svelte-ypdwb3" preload="metadata" aria-hidden="true" tabindex="-1"></audio> <button class="listen-button pie-listen-button rli-feature-audio svelte-ypdwb3" type="button"><img/> <img/></button>`, 1);
|
|
5240
|
+
var root_4$2 = /* @__PURE__ */ from_html(`<button class="mt-2 text-sm underline pie-audio-autoplay-enable" type="button"> </button>`);
|
|
5241
|
+
var root_3$3 = /* @__PURE__ */ from_html(`<audio controls="" class="w-full max-w-md pie-audio-player" preload="metadata"><track kind="captions"/></audio> <!>`, 1);
|
|
5242
|
+
var root_5$2 = /* @__PURE__ */ from_html(`<p class="text-sm text-red-700 pie-audio-error" role="alert"> </p>`);
|
|
5243
|
+
var root_1$3 = /* @__PURE__ */ from_html(`<div class="mb-4 audio-container pie-audio-container"><!></div>`);
|
|
5244
|
+
var $$css$3 = {
|
|
5245
|
+
hash: "svelte-ypdwb3",
|
|
5246
|
+
code: ".listen-button.svelte-ypdwb3 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);border:0;padding:0;background-color:transparent;cursor:pointer;z-index:1;}.listen-button.svelte-ypdwb3:hover {background-color:#e2f1fe;}.listen-feature-icon.svelte-ypdwb3 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);object-fit:contain;display:none;}.listen-feature-icon.listen-active.svelte-ypdwb3 {display:block;}.sr-only.svelte-ypdwb3 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}"
|
|
5247
|
+
};
|
|
5248
|
+
function AudioPlayer($$anchor, $$props) {
|
|
5170
5249
|
push($$props, true);
|
|
5171
|
-
append_styles$1($$anchor, $$css);
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
blankUnderlineWidthPx: 2,
|
|
5178
|
-
blankUnderlineWideWidthPx: 4,
|
|
5179
|
-
horizontalChoiceWidthPx: 170,
|
|
5180
|
-
horizontalChoiceWidthVw: 30,
|
|
5181
|
-
horizontalChoiceTileMinHeightRem: 11,
|
|
5182
|
-
horizontalChoiceContentMinHeightRem: 7.5,
|
|
5183
|
-
selectedImageMaxHeightRem: 4,
|
|
5184
|
-
choiceImageMaxHeightRem: 5,
|
|
5185
|
-
listenButtonSizePx: 128,
|
|
5186
|
-
stimulusMinColumnPx: 210,
|
|
5187
|
-
textMinColumnPx: 260,
|
|
5188
|
-
legendMaxChars: 120,
|
|
5189
|
-
choiceGroupGapRem: .5,
|
|
5190
|
-
choiceRowGapRem: .5,
|
|
5191
|
-
toggleButtonGapRem: .5,
|
|
5192
|
-
horizontalChoiceRadioTopMarginRem: .5,
|
|
5193
|
-
audioBlankTemplateMarginTopRem: .8,
|
|
5194
|
-
audioBlankTemplateMarginBottomRem: 1.8,
|
|
5195
|
-
audioInstructionsMaxWidthPx: 875,
|
|
5196
|
-
narrowHorizontalChoiceMaxWidthPx: 230,
|
|
5197
|
-
stimulusGridColumnGapRem: 2,
|
|
5198
|
-
stimulusGridRowGapRem: .7,
|
|
5199
|
-
stimulusSentenceMarginTopRem: .2,
|
|
5200
|
-
stimulusChoicesMarginTopRem: .9,
|
|
5201
|
-
tokenGridColumnGapRem: 1.5,
|
|
5202
|
-
tokenGridRowGapRem: .8,
|
|
5203
|
-
tokenTemplateMarginTopRem: .6,
|
|
5204
|
-
tokenInlineTokenGapRem: .35,
|
|
5205
|
-
tokenChoicesMarginTopRem: .2,
|
|
5206
|
-
inlineGridColumnGapRem: 1.5,
|
|
5207
|
-
inlineGridRowGapRem: .65,
|
|
5208
|
-
inlineTemplateMarginTopRem: .45,
|
|
5209
|
-
inlineChoicesMarginTopRem: .25
|
|
5210
|
-
};
|
|
5211
|
-
const DEFAULT_LAYOUT_PROFILE_PRESETS = {
|
|
5212
|
-
audio_blank_only: {
|
|
5213
|
-
blankWideWidthRem: 10,
|
|
5214
|
-
blankUnderlineWideWidthPx: 4
|
|
5215
|
-
},
|
|
5216
|
-
stimulus_image_blank: {
|
|
5217
|
-
blankWideWidthRem: 10,
|
|
5218
|
-
blankUnderlineWideWidthPx: 4
|
|
5219
|
-
},
|
|
5220
|
-
token_sequence: {
|
|
5221
|
-
blankStandaloneWidthRem: 7,
|
|
5222
|
-
blankUnderlineWideWidthPx: 4
|
|
5223
|
-
}
|
|
5224
|
-
};
|
|
5225
|
-
const DEFAULT_AUDIO_BUTTON_SKINS = {
|
|
5226
|
-
default: {
|
|
5227
|
-
silentUrl: "https://assets.learnosity.com/organisations/844/0c9f2aa3-3cd5-4de7-93ef-541c24ca35da.svg",
|
|
5228
|
-
playingUrl: "https://assets.learnosity.com/organisations/844/231dfdc2-c113-4be5-91fb-e75a0ca5994b.svg"
|
|
5229
|
-
},
|
|
5230
|
-
es: {
|
|
5231
|
-
silentUrl: "https://assets.learnosity.com/organisations/844/27a9d5b5-d873-4bd5-b9ba-22748782d8ba.svg",
|
|
5232
|
-
playingUrl: "https://assets.learnosity.com/organisations/844/120f216d-96b7-4560-94b8-1d90710216b7.svg"
|
|
5233
|
-
}
|
|
5234
|
-
};
|
|
5235
|
-
const DEFAULT_UI_TEXT = {
|
|
5236
|
-
answerChoices: "Answer choices",
|
|
5237
|
-
selectedAnswerInSentence: "Selected answer in sentence",
|
|
5238
|
-
showCorrectAnswer: "Show correct answer",
|
|
5239
|
-
hideCorrectAnswer: "Hide correct answer",
|
|
5240
|
-
clickToEnableAutoplay: "Click to enable audio autoplay",
|
|
5241
|
-
audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
|
|
5242
|
-
transcriptLabel: "Transcript",
|
|
5243
|
-
listenLabelEn: "Listen",
|
|
5244
|
-
listenLabelEs: "Escuchar"
|
|
5250
|
+
append_styles$1($$anchor, $$css$3);
|
|
5251
|
+
const AUDIO_PLAYBACK = {
|
|
5252
|
+
IDLE: "idle",
|
|
5253
|
+
PLAYING: "playing",
|
|
5254
|
+
BLOCKED: "blocked",
|
|
5255
|
+
PAUSED: "paused"
|
|
5245
5256
|
};
|
|
5246
|
-
let
|
|
5257
|
+
let hasAudio = prop($$props, "hasAudio", 7, false), audioUrl = prop($$props, "audioUrl", 7), useFeatureButtonAudio = prop($$props, "useFeatureButtonAudio", 7, false), autoplayEnabled = prop($$props, "autoplayEnabled", 7, false), audioTranscript = prop($$props, "audioTranscript", 7), showVisibleTranscript = prop($$props, "showVisibleTranscript", 7), transcriptId = prop($$props, "transcriptId", 7), featureAudioSkin = prop($$props, "featureAudioSkin", 7), uiText = prop($$props, "uiText", 7), locale = prop($$props, "locale", 7, ""), onaudiostarted = prop($$props, "onaudiostarted", 7), onaudioended = prop($$props, "onaudioended", 7);
|
|
5247
5258
|
let audioEl = /* @__PURE__ */ state(null);
|
|
5248
|
-
let isMediaPlaying = /* @__PURE__ */ state(false);
|
|
5249
|
-
let localChoiceId = /* @__PURE__ */ state("");
|
|
5250
|
-
let autoPlayPromptOpen = /* @__PURE__ */ state(false);
|
|
5251
|
-
let autoplayAttempted = /* @__PURE__ */ state(false);
|
|
5252
5259
|
let featureAudioButtonEl = /* @__PURE__ */ state(null);
|
|
5253
5260
|
let autoplayEnableButtonEl = /* @__PURE__ */ state(null);
|
|
5254
|
-
let
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
const correctness = /* @__PURE__ */ user_derived(() => model()?.correctness);
|
|
5260
|
-
const isResponseCorrect = /* @__PURE__ */ user_derived(() => typeof model()?.responseCorrect === "boolean" ? model().responseCorrect : get(correctness) === "correct");
|
|
5261
|
-
const isCorrect = /* @__PURE__ */ user_derived(() => get(correctness) === "correct");
|
|
5262
|
-
const isIncorrect = /* @__PURE__ */ user_derived(() => get(correctness) === "incorrect");
|
|
5263
|
-
const isAudioOnlyMode = /* @__PURE__ */ user_derived(() => model()?.interactionMode === "audio_mc_only");
|
|
5264
|
-
const isBlankOnlyTemplate = /* @__PURE__ */ user_derived(() => {
|
|
5265
|
-
const t = model()?.template || "";
|
|
5266
|
-
if (!t) return false;
|
|
5267
|
-
return t.replace(/<[^>]+>/g, "").replace(/ /g, " ").trim() === BLANK_TOKEN;
|
|
5268
|
-
});
|
|
5269
|
-
const layoutProfile = /* @__PURE__ */ user_derived(() => model()?.layoutProfile || "");
|
|
5270
|
-
const choiceLayout = /* @__PURE__ */ user_derived(() => model()?.choiceLayout || (get(isAudioOnlyMode) || get(isBlankOnlyTemplate) ? "horizontal" : "vertical"));
|
|
5271
|
-
const isHorizontalChoices = /* @__PURE__ */ user_derived(() => get(choiceLayout) === "horizontal");
|
|
5272
|
-
const showVisibleTranscript = /* @__PURE__ */ user_derived(() => !!model()?.showVisibleTranscript);
|
|
5273
|
-
const hasPlayableAudio = /* @__PURE__ */ user_derived(() => !!model()?.hasAudio && !!model()?.audioUrl);
|
|
5274
|
-
const hasAudioButMissingResource = /* @__PURE__ */ user_derived(() => !!model()?.hasAudio && !model()?.audioUrl);
|
|
5275
|
-
const hasInlineSentenceAudioLayout = /* @__PURE__ */ user_derived(() => get(layoutProfile) === "inline_sentence" && !!model()?.hasAudio);
|
|
5276
|
-
const uiText = /* @__PURE__ */ user_derived(() => ({
|
|
5277
|
-
...DEFAULT_UI_TEXT,
|
|
5278
|
-
...model()?.uiText || {}
|
|
5261
|
+
let audioPlaybackState = /* @__PURE__ */ state(proxy(AUDIO_PLAYBACK.IDLE));
|
|
5262
|
+
const audioMode = /* @__PURE__ */ user_derived(() => computeAudioMode({
|
|
5263
|
+
hasAudio: hasAudio(),
|
|
5264
|
+
audioUrl: audioUrl(),
|
|
5265
|
+
useFeatureButtonAudio: useFeatureButtonAudio()
|
|
5279
5266
|
}));
|
|
5280
|
-
const
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
...defaults,
|
|
5287
|
-
...custom
|
|
5288
|
-
};
|
|
5289
|
-
});
|
|
5290
|
-
const layoutLimits = /* @__PURE__ */ user_derived(() => {
|
|
5291
|
-
const configured = model()?.layoutLimits && typeof model().layoutLimits === "object" ? model().layoutLimits : {};
|
|
5292
|
-
return {
|
|
5293
|
-
...DEFAULT_LAYOUT_LIMITS,
|
|
5294
|
-
...get(profilePresetLimits),
|
|
5295
|
-
...configured
|
|
5296
|
-
};
|
|
5297
|
-
});
|
|
5298
|
-
const correctAnswerStyleVars = /* @__PURE__ */ user_derived(() => [
|
|
5299
|
-
`--pie-correct-answer-toggle-label-color:${Z.text()}`,
|
|
5300
|
-
`--pie-correct-answer-toggle-icon-open-bg:${Z.tertiaryLight()}`,
|
|
5301
|
-
`--pie-correct-answer-toggle-icon-closed-bg:${Z.backgroundDark()}`,
|
|
5302
|
-
`--pie-correct-answer-toggle-icon-glyph-color:${Z.tertiary()}`,
|
|
5303
|
-
`--pie-correct-answer-choice-hover-bg:${Z.backgroundDark()}`,
|
|
5304
|
-
`--pie-correct-answer-choice-selected-bg:${Z.secondaryBackground()}`,
|
|
5305
|
-
`--pie-correct-answer-choice-correct-bg:${Z.correctSecondary()}`,
|
|
5306
|
-
`--pie-correct-answer-choice-incorrect-bg:${Z.incorrectSecondary()}`,
|
|
5307
|
-
`--pie-correct-answer-choice-correct-border:${Z.correctTertiary()}`,
|
|
5308
|
-
`--pie-correct-answer-choice-incorrect-border:${Z.incorrectWithIcon()}`,
|
|
5309
|
-
`--pie-correct-answer-feedback-correct-bg:${Z.correctWithIcon()}`,
|
|
5310
|
-
`--pie-correct-answer-feedback-incorrect-bg:${Z.incorrectWithIcon()}`,
|
|
5311
|
-
`--pie-correct-answer-feedback-glyph-color:${Z.white()}`
|
|
5312
|
-
].join(";"));
|
|
5313
|
-
const rootStyle = /* @__PURE__ */ user_derived(() => [
|
|
5314
|
-
`--mpb-listen-button-size:${get(layoutLimits).listenButtonSizePx}px`,
|
|
5315
|
-
`--mpb-blank-standalone-width:${get(layoutLimits).blankStandaloneWidthRem}rem`,
|
|
5316
|
-
`--mpb-blank-wide-width:${get(layoutLimits).blankWideWidthRem}rem`,
|
|
5317
|
-
`--mpb-blank-underline-width:${get(layoutLimits).blankUnderlineWidthPx}px`,
|
|
5318
|
-
`--mpb-blank-underline-wide-width:${get(layoutLimits).blankUnderlineWideWidthPx}px`,
|
|
5319
|
-
`--mpb-selected-image-max-height:${get(layoutLimits).selectedImageMaxHeightRem}rem`,
|
|
5320
|
-
`--mpb-choice-image-max-height:${get(layoutLimits).choiceImageMaxHeightRem}rem`,
|
|
5321
|
-
`--mpb-choice-width-px:${get(layoutLimits).horizontalChoiceWidthPx}px`,
|
|
5322
|
-
`--mpb-choice-width-vw:${get(layoutLimits).horizontalChoiceWidthVw}vw`,
|
|
5323
|
-
`--mpb-choice-tile-min-height:${get(layoutLimits).horizontalChoiceTileMinHeightRem}rem`,
|
|
5324
|
-
`--mpb-choice-content-min-height:${get(layoutLimits).horizontalChoiceContentMinHeightRem}rem`,
|
|
5325
|
-
`--mpb-stimulus-min-column:${get(layoutLimits).stimulusMinColumnPx}px`,
|
|
5326
|
-
`--mpb-text-min-column:${get(layoutLimits).textMinColumnPx}px`,
|
|
5327
|
-
`--mpb-choice-group-gap:${get(layoutLimits).choiceGroupGapRem}rem`,
|
|
5328
|
-
`--mpb-choice-row-gap:${get(layoutLimits).choiceRowGapRem}rem`,
|
|
5329
|
-
`--mpb-toggle-button-gap:${get(layoutLimits).toggleButtonGapRem}rem`,
|
|
5330
|
-
`--mpb-horizontal-choice-radio-top-margin:${get(layoutLimits).horizontalChoiceRadioTopMarginRem}rem`,
|
|
5331
|
-
`--mpb-audio-blank-template-margin-top:${get(layoutLimits).audioBlankTemplateMarginTopRem}rem`,
|
|
5332
|
-
`--mpb-audio-blank-template-margin-bottom:${get(layoutLimits).audioBlankTemplateMarginBottomRem}rem`,
|
|
5333
|
-
`--mpb-audio-instructions-max-width:${get(layoutLimits).audioInstructionsMaxWidthPx}px`,
|
|
5334
|
-
`--mpb-narrow-choice-max-width:${get(layoutLimits).narrowHorizontalChoiceMaxWidthPx}px`,
|
|
5335
|
-
`--mpb-stimulus-grid-column-gap:${get(layoutLimits).stimulusGridColumnGapRem}rem`,
|
|
5336
|
-
`--mpb-stimulus-grid-row-gap:${get(layoutLimits).stimulusGridRowGapRem}rem`,
|
|
5337
|
-
`--mpb-stimulus-sentence-margin-top:${get(layoutLimits).stimulusSentenceMarginTopRem}rem`,
|
|
5338
|
-
`--mpb-stimulus-choices-margin-top:${get(layoutLimits).stimulusChoicesMarginTopRem}rem`,
|
|
5339
|
-
`--mpb-token-grid-column-gap:${get(layoutLimits).tokenGridColumnGapRem}rem`,
|
|
5340
|
-
`--mpb-token-grid-row-gap:${get(layoutLimits).tokenGridRowGapRem}rem`,
|
|
5341
|
-
`--mpb-token-template-margin-top:${get(layoutLimits).tokenTemplateMarginTopRem}rem`,
|
|
5342
|
-
`--mpb-token-inline-token-gap:${get(layoutLimits).tokenInlineTokenGapRem}rem`,
|
|
5343
|
-
`--mpb-token-choices-margin-top:${get(layoutLimits).tokenChoicesMarginTopRem}rem`,
|
|
5344
|
-
`--mpb-inline-grid-column-gap:${get(layoutLimits).inlineGridColumnGapRem}rem`,
|
|
5345
|
-
`--mpb-inline-grid-row-gap:${get(layoutLimits).inlineGridRowGapRem}rem`,
|
|
5346
|
-
`--mpb-inline-template-margin-top:${get(layoutLimits).inlineTemplateMarginTopRem}rem`,
|
|
5347
|
-
`--mpb-inline-choices-margin-top:${get(layoutLimits).inlineChoicesMarginTopRem}rem`,
|
|
5348
|
-
get(correctAnswerStyleVars)
|
|
5349
|
-
].join(";"));
|
|
5350
|
-
const useFeatureButtonAudio = /* @__PURE__ */ user_derived(() => {
|
|
5351
|
-
if (typeof model()?.useFeatureButtonAudio === "boolean") return !!model().useFeatureButtonAudio;
|
|
5352
|
-
const profile = get(layoutProfile) || "";
|
|
5353
|
-
return !!model()?.hasAudio && (profile === "audio_blank_only" || profile === "stimulus_image_blank" || profile === "token_sequence");
|
|
5354
|
-
});
|
|
5355
|
-
const templateParts = /* @__PURE__ */ user_derived(() => {
|
|
5356
|
-
const t = model()?.template || "";
|
|
5357
|
-
const idx = t.indexOf(BLANK_TOKEN);
|
|
5358
|
-
if (idx < 0) return {
|
|
5359
|
-
before: t,
|
|
5360
|
-
after: ""
|
|
5361
|
-
};
|
|
5362
|
-
return {
|
|
5363
|
-
before: t.slice(0, idx),
|
|
5364
|
-
after: t.slice(idx + 9)
|
|
5365
|
-
};
|
|
5366
|
-
});
|
|
5367
|
-
const blankWidth = /* @__PURE__ */ user_derived(() => {
|
|
5368
|
-
if (get(layoutProfile) === "audio_blank_only" || get(layoutProfile) === "stimulus_image_blank") return `${get(layoutLimits).blankWideWidthRem}rem`;
|
|
5369
|
-
if (get(isBlankOnlyTemplate)) return `${get(layoutLimits).blankStandaloneWidthRem}rem`;
|
|
5370
|
-
return "auto";
|
|
5371
|
-
});
|
|
5372
|
-
const blankBorderWidth = /* @__PURE__ */ user_derived(() => {
|
|
5373
|
-
if (get(layoutProfile) === "audio_blank_only" || get(layoutProfile) === "stimulus_image_blank") return `${get(layoutLimits).blankUnderlineWideWidthPx}px`;
|
|
5374
|
-
return `${get(layoutLimits).blankUnderlineWidthPx}px`;
|
|
5375
|
-
});
|
|
5376
|
-
const choices = /* @__PURE__ */ user_derived(() => Array.isArray(model()?.choices) ? model().choices : []);
|
|
5377
|
-
const choiceMode = /* @__PURE__ */ user_derived(() => model()?.choiceMode || "text");
|
|
5378
|
-
const selectedId = /* @__PURE__ */ user_derived(() => session()?.choiceId || get(localChoiceId) || "");
|
|
5379
|
-
const radioGroupName = /* @__PURE__ */ user_derived(() => `${instanceId}-choice-group-${model()?.id || "1"}`);
|
|
5380
|
-
let showCorrectAnswer = /* @__PURE__ */ state(false);
|
|
5381
|
-
const shouldShowCorrectAnswerToggle = /* @__PURE__ */ user_derived(() => get(isEvaluateMode) && !get(isResponseCorrect) && !!model()?.correctChoiceId);
|
|
5382
|
-
const displayChoiceId = /* @__PURE__ */ user_derived(() => {
|
|
5383
|
-
if (get(isEvaluateMode) && get(showCorrectAnswer) && model()?.correctChoiceId) return model().correctChoiceId;
|
|
5384
|
-
return get(selectedId);
|
|
5385
|
-
});
|
|
5386
|
-
const displayChoice = /* @__PURE__ */ user_derived(() => get(choices).find((c) => c.id === get(displayChoiceId)));
|
|
5387
|
-
const legendText = /* @__PURE__ */ user_derived(() => {
|
|
5388
|
-
const plain = (model()?.prompt || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
5389
|
-
const maxChars = Math.max(8, Number(get(layoutLimits).legendMaxChars) || DEFAULT_LAYOUT_LIMITS.legendMaxChars);
|
|
5390
|
-
return plain.length > maxChars ? `${plain.slice(0, Math.max(1, maxChars - 1))}…` : plain || get(uiText).answerChoices;
|
|
5391
|
-
});
|
|
5392
|
-
const promptId = /* @__PURE__ */ user_derived(() => `${instanceId}-prompt`);
|
|
5393
|
-
const transcriptId = /* @__PURE__ */ user_derived(() => `${instanceId}-transcript`);
|
|
5394
|
-
const legendId = /* @__PURE__ */ user_derived(() => `${instanceId}-choices-legend`);
|
|
5395
|
-
const resultId = /* @__PURE__ */ user_derived(() => `${instanceId}-result`);
|
|
5396
|
-
const choicesGroupLabelledBy = /* @__PURE__ */ user_derived(() => model()?.prompt ? get(promptId) : void 0);
|
|
5397
|
-
const choicesGroupAriaLabel = /* @__PURE__ */ user_derived(() => {
|
|
5398
|
-
if (model()?.prompt) return void 0;
|
|
5399
|
-
const explicit = String(model()?.choiceGroupLabel || "").trim();
|
|
5400
|
-
if (explicit) return explicit;
|
|
5401
|
-
return get(legendText);
|
|
5402
|
-
});
|
|
5403
|
-
const templateDescribedBy = /* @__PURE__ */ user_derived(() => {
|
|
5404
|
-
const ids = [];
|
|
5405
|
-
if (model()?.prompt) ids.push(get(promptId));
|
|
5406
|
-
if (model()?.hasAudio && model()?.audioTranscript) ids.push(get(transcriptId));
|
|
5407
|
-
return ids.length ? ids.join(" ") : void 0;
|
|
5267
|
+
const isMediaPlaying = /* @__PURE__ */ user_derived(() => get(audioPlaybackState) === AUDIO_PLAYBACK.PLAYING);
|
|
5268
|
+
const autoPlayPromptOpen = /* @__PURE__ */ user_derived(() => get(audioPlaybackState) === AUDIO_PLAYBACK.BLOCKED);
|
|
5269
|
+
const audioErrorMessage = /* @__PURE__ */ user_derived(() => get(audioMode) === "error" ? uiText().audioResourceUnavailable : "");
|
|
5270
|
+
user_effect(() => {
|
|
5271
|
+
audioUrl();
|
|
5272
|
+
set(audioPlaybackState, AUDIO_PLAYBACK.IDLE, true);
|
|
5408
5273
|
});
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5274
|
+
function playFeatureAudio() {
|
|
5275
|
+
if (get(audioMode) !== "none" && get(audioMode) !== "error" && get(audioEl)) get(audioEl).play().catch(() => {});
|
|
5276
|
+
}
|
|
5277
|
+
function handleEnableAutoplayClick() {
|
|
5278
|
+
if (get(audioMode) !== "none" && get(audioMode) !== "error" && get(audioEl)) get(audioEl).play().finally(() => {
|
|
5279
|
+
if (get(audioPlaybackState) === AUDIO_PLAYBACK.BLOCKED) set(audioPlaybackState, AUDIO_PLAYBACK.PAUSED, true);
|
|
5280
|
+
});
|
|
5281
|
+
}
|
|
5282
|
+
function useListener(getEl, event, handler) {
|
|
5283
|
+
user_effect(() => {
|
|
5284
|
+
const el = getEl();
|
|
5285
|
+
if (!el) return;
|
|
5286
|
+
el.addEventListener(event, handler);
|
|
5287
|
+
return () => el.removeEventListener(event, handler);
|
|
5288
|
+
});
|
|
5289
|
+
}
|
|
5290
|
+
useListener(() => get(audioEl), "playing", () => {
|
|
5291
|
+
set(audioPlaybackState, AUDIO_PLAYBACK.PLAYING, true);
|
|
5292
|
+
onaudiostarted()?.();
|
|
5412
5293
|
});
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
if (get(isCorrect)) return "Correct answer selected";
|
|
5417
|
-
if (get(isIncorrect) && get(selectedId)) return "Incorrect answer selected";
|
|
5418
|
-
return "";
|
|
5294
|
+
useListener(() => get(audioEl), "ended", () => {
|
|
5295
|
+
set(audioPlaybackState, AUDIO_PLAYBACK.PAUSED, true);
|
|
5296
|
+
onaudioended()?.();
|
|
5419
5297
|
});
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
if (
|
|
5425
|
-
if (get(
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
map.set(correctChoiceId, "incorrect");
|
|
5431
|
-
return map;
|
|
5432
|
-
}
|
|
5433
|
-
if (activeSelectedId === correctChoiceId) {
|
|
5434
|
-
map.set(correctChoiceId, "correct");
|
|
5435
|
-
return map;
|
|
5298
|
+
useListener(() => get(featureAudioButtonEl), "click", () => playFeatureAudio());
|
|
5299
|
+
useListener(() => get(autoplayEnableButtonEl), "click", () => handleEnableAutoplayClick());
|
|
5300
|
+
user_effect(() => {
|
|
5301
|
+
if (!autoplayEnabled() || get(audioMode) === "none" || get(audioMode) === "error") return;
|
|
5302
|
+
if (get(audioPlaybackState) !== AUDIO_PLAYBACK.IDLE) return;
|
|
5303
|
+
if (get(audioEl) && audioUrl()) {
|
|
5304
|
+
set(audioPlaybackState, AUDIO_PLAYBACK.PAUSED, true);
|
|
5305
|
+
get(audioEl).play().catch(() => {
|
|
5306
|
+
set(audioPlaybackState, AUDIO_PLAYBACK.BLOCKED, true);
|
|
5307
|
+
});
|
|
5436
5308
|
}
|
|
5437
|
-
map.set(activeSelectedId, "incorrect");
|
|
5438
|
-
map.set(correctChoiceId, "incorrect");
|
|
5439
|
-
return map;
|
|
5440
5309
|
});
|
|
5441
|
-
function
|
|
5442
|
-
|
|
5443
|
-
if (host?.onSessionChange) {
|
|
5444
|
-
host.onSessionChange(updatedSession);
|
|
5445
|
-
return;
|
|
5446
|
-
}
|
|
5447
|
-
host?.dispatchEvent(new CustomEvent("session-changed", {
|
|
5448
|
-
bubbles: true,
|
|
5449
|
-
composed: true,
|
|
5450
|
-
detail: {
|
|
5451
|
-
complete: !!updatedSession?.choiceId,
|
|
5452
|
-
component: "mc-populated-blank"
|
|
5453
|
-
}
|
|
5454
|
-
}));
|
|
5310
|
+
function speechButtonLabel(loc = "") {
|
|
5311
|
+
return loc.toLowerCase().startsWith("es") ? "Escuchar" : "Listen";
|
|
5455
5312
|
}
|
|
5456
|
-
function
|
|
5457
|
-
|
|
5458
|
-
if (!input.checked) return;
|
|
5459
|
-
const choiceId = input.value;
|
|
5460
|
-
set(localChoiceId, choiceId, true);
|
|
5461
|
-
emitSession({
|
|
5462
|
-
...session(),
|
|
5463
|
-
id: session()?.id || model()?.id || "1",
|
|
5464
|
-
element: "mc-populated-blank",
|
|
5465
|
-
choiceId
|
|
5466
|
-
}, input);
|
|
5313
|
+
function silentAlt(loc = "") {
|
|
5314
|
+
return loc.toLowerCase().startsWith("es") ? uiText().listenSilentAltEs ?? "Escuchar. Repetir las instrucciones." : uiText().listenSilentAlt ?? "Repeat instructions";
|
|
5467
5315
|
}
|
|
5468
|
-
function
|
|
5469
|
-
|
|
5470
|
-
set(showCorrectAnswer, !get(showCorrectAnswer));
|
|
5316
|
+
function playingAlt(loc = "") {
|
|
5317
|
+
return loc.toLowerCase().startsWith("es") ? uiText().listenPlayingAltEs ?? "Escuchar. Estas son las instrucciones." : uiText().listenPlayingAlt ?? "Instructions are playing";
|
|
5471
5318
|
}
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5319
|
+
var $$exports = {
|
|
5320
|
+
get hasAudio() {
|
|
5321
|
+
return hasAudio();
|
|
5322
|
+
},
|
|
5323
|
+
set hasAudio($$value = false) {
|
|
5324
|
+
hasAudio($$value);
|
|
5325
|
+
flushSync();
|
|
5326
|
+
},
|
|
5327
|
+
get audioUrl() {
|
|
5328
|
+
return audioUrl();
|
|
5329
|
+
},
|
|
5330
|
+
set audioUrl($$value) {
|
|
5331
|
+
audioUrl($$value);
|
|
5332
|
+
flushSync();
|
|
5333
|
+
},
|
|
5334
|
+
get useFeatureButtonAudio() {
|
|
5335
|
+
return useFeatureButtonAudio();
|
|
5336
|
+
},
|
|
5337
|
+
set useFeatureButtonAudio($$value = false) {
|
|
5338
|
+
useFeatureButtonAudio($$value);
|
|
5339
|
+
flushSync();
|
|
5340
|
+
},
|
|
5341
|
+
get autoplayEnabled() {
|
|
5342
|
+
return autoplayEnabled();
|
|
5343
|
+
},
|
|
5344
|
+
set autoplayEnabled($$value = false) {
|
|
5345
|
+
autoplayEnabled($$value);
|
|
5346
|
+
flushSync();
|
|
5347
|
+
},
|
|
5348
|
+
get audioTranscript() {
|
|
5349
|
+
return audioTranscript();
|
|
5350
|
+
},
|
|
5351
|
+
set audioTranscript($$value) {
|
|
5352
|
+
audioTranscript($$value);
|
|
5353
|
+
flushSync();
|
|
5354
|
+
},
|
|
5355
|
+
get showVisibleTranscript() {
|
|
5356
|
+
return showVisibleTranscript();
|
|
5357
|
+
},
|
|
5358
|
+
set showVisibleTranscript($$value) {
|
|
5359
|
+
showVisibleTranscript($$value);
|
|
5360
|
+
flushSync();
|
|
5361
|
+
},
|
|
5362
|
+
get transcriptId() {
|
|
5363
|
+
return transcriptId();
|
|
5364
|
+
},
|
|
5365
|
+
set transcriptId($$value) {
|
|
5366
|
+
transcriptId($$value);
|
|
5367
|
+
flushSync();
|
|
5368
|
+
},
|
|
5369
|
+
get featureAudioSkin() {
|
|
5370
|
+
return featureAudioSkin();
|
|
5371
|
+
},
|
|
5372
|
+
set featureAudioSkin($$value) {
|
|
5373
|
+
featureAudioSkin($$value);
|
|
5374
|
+
flushSync();
|
|
5375
|
+
},
|
|
5376
|
+
get uiText() {
|
|
5377
|
+
return uiText();
|
|
5378
|
+
},
|
|
5379
|
+
set uiText($$value) {
|
|
5380
|
+
uiText($$value);
|
|
5381
|
+
flushSync();
|
|
5382
|
+
},
|
|
5383
|
+
get locale() {
|
|
5384
|
+
return locale();
|
|
5385
|
+
},
|
|
5386
|
+
set locale($$value = "") {
|
|
5387
|
+
locale($$value);
|
|
5388
|
+
flushSync();
|
|
5389
|
+
},
|
|
5390
|
+
get onaudiostarted() {
|
|
5391
|
+
return onaudiostarted();
|
|
5392
|
+
},
|
|
5393
|
+
set onaudiostarted($$value) {
|
|
5394
|
+
onaudiostarted($$value);
|
|
5395
|
+
flushSync();
|
|
5396
|
+
},
|
|
5397
|
+
get onaudioended() {
|
|
5398
|
+
return onaudioended();
|
|
5399
|
+
},
|
|
5400
|
+
set onaudioended($$value) {
|
|
5401
|
+
onaudioended($$value);
|
|
5402
|
+
flushSync();
|
|
5403
|
+
}
|
|
5404
|
+
};
|
|
5405
|
+
var fragment = comment();
|
|
5406
|
+
var node = first_child(fragment);
|
|
5407
|
+
var consequent_4 = ($$anchor) => {
|
|
5408
|
+
var div = root_1$3();
|
|
5409
|
+
var node_1 = child(div);
|
|
5410
|
+
var consequent = ($$anchor) => {
|
|
5411
|
+
var fragment_1 = root_2$3();
|
|
5412
|
+
var audio = first_child(fragment_1);
|
|
5413
|
+
bind_this(audio, ($$value) => set(audioEl, $$value), () => get(audioEl));
|
|
5414
|
+
var button = sibling(audio, 2);
|
|
5415
|
+
var img = child(button);
|
|
5416
|
+
var img_1 = sibling(img, 2);
|
|
5417
|
+
reset(button);
|
|
5418
|
+
bind_this(button, ($$value) => set(featureAudioButtonEl, $$value), () => get(featureAudioButtonEl));
|
|
5419
|
+
template_effect(($0, $1, $2) => {
|
|
5420
|
+
set_attribute(audio, "src", audioUrl());
|
|
5421
|
+
set_attribute(button, "aria-label", $0);
|
|
5422
|
+
set_class(img, 1, `listen-feature-icon pie-listen-icon rli-feature-listen ${get(isMediaPlaying) ? "" : "listen-active"}`, "svelte-ypdwb3");
|
|
5423
|
+
set_attribute(img, "src", featureAudioSkin().silentUrl);
|
|
5424
|
+
set_attribute(img, "alt", $1);
|
|
5425
|
+
set_class(img_1, 1, `listen-feature-icon pie-listen-icon rli-feature-listen ${get(isMediaPlaying) ? "listen-active" : ""}`, "svelte-ypdwb3");
|
|
5426
|
+
set_attribute(img_1, "src", featureAudioSkin().playingUrl);
|
|
5427
|
+
set_attribute(img_1, "alt", $2);
|
|
5428
|
+
}, [
|
|
5429
|
+
() => speechButtonLabel(locale()),
|
|
5430
|
+
() => silentAlt(locale()),
|
|
5431
|
+
() => playingAlt(locale())
|
|
5432
|
+
]);
|
|
5433
|
+
append($$anchor, fragment_1);
|
|
5434
|
+
};
|
|
5435
|
+
var consequent_2 = ($$anchor) => {
|
|
5436
|
+
var fragment_2 = root_3$3();
|
|
5437
|
+
var audio_1 = first_child(fragment_2);
|
|
5438
|
+
bind_this(audio_1, ($$value) => set(audioEl, $$value), () => get(audioEl));
|
|
5439
|
+
var node_2 = sibling(audio_1, 2);
|
|
5440
|
+
var consequent_1 = ($$anchor) => {
|
|
5441
|
+
var button_1 = root_4$2();
|
|
5442
|
+
var text = child(button_1, true);
|
|
5443
|
+
reset(button_1);
|
|
5444
|
+
bind_this(button_1, ($$value) => set(autoplayEnableButtonEl, $$value), () => get(autoplayEnableButtonEl));
|
|
5445
|
+
template_effect(() => set_text(text, uiText().clickToEnableAutoplay));
|
|
5446
|
+
append($$anchor, button_1);
|
|
5447
|
+
};
|
|
5448
|
+
if_block(node_2, ($$render) => {
|
|
5449
|
+
if (get(autoPlayPromptOpen)) $$render(consequent_1);
|
|
5450
|
+
});
|
|
5451
|
+
template_effect(() => {
|
|
5452
|
+
set_attribute(audio_1, "src", audioUrl());
|
|
5453
|
+
set_attribute(audio_1, "aria-describedby", audioTranscript() ? transcriptId() : void 0);
|
|
5454
|
+
});
|
|
5455
|
+
append($$anchor, fragment_2);
|
|
5456
|
+
};
|
|
5457
|
+
var consequent_3 = ($$anchor) => {
|
|
5458
|
+
var p = root_5$2();
|
|
5459
|
+
var text_1 = child(p, true);
|
|
5460
|
+
reset(p);
|
|
5461
|
+
template_effect(() => set_text(text_1, get(audioErrorMessage)));
|
|
5462
|
+
append($$anchor, p);
|
|
5463
|
+
};
|
|
5464
|
+
if_block(node_1, ($$render) => {
|
|
5465
|
+
if (get(audioMode) === "feature-button") $$render(consequent);
|
|
5466
|
+
else if (get(audioMode) === "controls") $$render(consequent_2, 1);
|
|
5467
|
+
else if (get(audioMode) === "error") $$render(consequent_3, 2);
|
|
5468
|
+
});
|
|
5469
|
+
reset(div);
|
|
5470
|
+
append($$anchor, div);
|
|
5471
|
+
};
|
|
5472
|
+
if_block(node, ($$render) => {
|
|
5473
|
+
if (get(audioMode) !== "none") $$render(consequent_4);
|
|
5474
|
+
});
|
|
5475
|
+
append($$anchor, fragment);
|
|
5476
|
+
return pop($$exports);
|
|
5477
|
+
}
|
|
5478
|
+
create_custom_element(AudioPlayer, {
|
|
5479
|
+
hasAudio: {},
|
|
5480
|
+
audioUrl: {},
|
|
5481
|
+
useFeatureButtonAudio: {},
|
|
5482
|
+
autoplayEnabled: {},
|
|
5483
|
+
audioTranscript: {},
|
|
5484
|
+
showVisibleTranscript: {},
|
|
5485
|
+
transcriptId: {},
|
|
5486
|
+
featureAudioSkin: {},
|
|
5487
|
+
uiText: {},
|
|
5488
|
+
locale: {},
|
|
5489
|
+
onaudiostarted: {},
|
|
5490
|
+
onaudioended: {}
|
|
5491
|
+
}, [], [], { mode: "open" });
|
|
5492
|
+
//#endregion
|
|
5493
|
+
//#region src/delivery/ClozeMarker.svelte
|
|
5494
|
+
var root_1$2 = /* @__PURE__ */ from_html(`<img class="w-auto object-contain pie-blank-image" style="max-height:var(--mpb-selected-image-max-height, 4rem);"/>`);
|
|
5495
|
+
var root_2$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-value pie-blank-value svelte-d9l5tb"></span>`);
|
|
5496
|
+
var root_3$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-empty svelte-d9l5tb" aria-hidden="true"> </span>`);
|
|
5497
|
+
var root$2 = /* @__PURE__ */ from_html(`<span role="status" aria-live="polite" aria-atomic="true"><!></span>`);
|
|
5498
|
+
var $$css$2 = {
|
|
5499
|
+
hash: "svelte-d9l5tb",
|
|
5500
|
+
code: ".cloze-marker.svelte-d9l5tb {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.cloze-marker.svelte-d9l5tb:focus-within {outline:2px solid var(--pie-focus, #2563eb);outline-offset:2px;}.cloze-marker-standalone.svelte-d9l5tb {width:var(--mpb-blank-standalone-width, 7rem);}.cloze-marker-empty.svelte-d9l5tb {display:inline-block;min-width:4ch;}.cloze-marker-value.svelte-d9l5tb {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.cloze-marker-value.svelte-d9l5tb p {margin:0;}"
|
|
5501
|
+
};
|
|
5502
|
+
function ClozeMarker($$anchor, $$props) {
|
|
5503
|
+
push($$props, true);
|
|
5504
|
+
append_styles$1($$anchor, $$css$2);
|
|
5505
|
+
let choiceMode = prop($$props, "choiceMode", 7, "text"), displayChoice = prop($$props, "displayChoice", 7, void 0), displayChoiceLabelHtml = prop($$props, "displayChoiceLabelHtml", 7, ""), isStandalone = prop($$props, "isStandalone", 7, false), blankWidth = prop($$props, "blankWidth", 7), blankBorderWidth = prop($$props, "blankBorderWidth", 7), ariaLabel = prop($$props, "ariaLabel", 7);
|
|
5506
|
+
var $$exports = {
|
|
5507
|
+
get choiceMode() {
|
|
5508
|
+
return choiceMode();
|
|
5509
|
+
},
|
|
5510
|
+
set choiceMode($$value = "text") {
|
|
5511
|
+
choiceMode($$value);
|
|
5512
|
+
flushSync();
|
|
5513
|
+
},
|
|
5514
|
+
get displayChoice() {
|
|
5515
|
+
return displayChoice();
|
|
5516
|
+
},
|
|
5517
|
+
set displayChoice($$value = void 0) {
|
|
5518
|
+
displayChoice($$value);
|
|
5519
|
+
flushSync();
|
|
5520
|
+
},
|
|
5521
|
+
get displayChoiceLabelHtml() {
|
|
5522
|
+
return displayChoiceLabelHtml();
|
|
5523
|
+
},
|
|
5524
|
+
set displayChoiceLabelHtml($$value = "") {
|
|
5525
|
+
displayChoiceLabelHtml($$value);
|
|
5526
|
+
flushSync();
|
|
5527
|
+
},
|
|
5528
|
+
get isStandalone() {
|
|
5529
|
+
return isStandalone();
|
|
5530
|
+
},
|
|
5531
|
+
set isStandalone($$value = false) {
|
|
5532
|
+
isStandalone($$value);
|
|
5533
|
+
flushSync();
|
|
5534
|
+
},
|
|
5535
|
+
get blankWidth() {
|
|
5536
|
+
return blankWidth();
|
|
5537
|
+
},
|
|
5538
|
+
set blankWidth($$value) {
|
|
5539
|
+
blankWidth($$value);
|
|
5540
|
+
flushSync();
|
|
5541
|
+
},
|
|
5542
|
+
get blankBorderWidth() {
|
|
5543
|
+
return blankBorderWidth();
|
|
5544
|
+
},
|
|
5545
|
+
set blankBorderWidth($$value) {
|
|
5546
|
+
blankBorderWidth($$value);
|
|
5547
|
+
flushSync();
|
|
5548
|
+
},
|
|
5549
|
+
get ariaLabel() {
|
|
5550
|
+
return ariaLabel();
|
|
5551
|
+
},
|
|
5552
|
+
set ariaLabel($$value) {
|
|
5553
|
+
ariaLabel($$value);
|
|
5554
|
+
flushSync();
|
|
5555
|
+
}
|
|
5556
|
+
};
|
|
5557
|
+
var span = root$2();
|
|
5558
|
+
var node = child(span);
|
|
5559
|
+
var consequent = ($$anchor) => {
|
|
5560
|
+
var img = root_1$2();
|
|
5561
|
+
template_effect(() => {
|
|
5562
|
+
set_attribute(img, "src", displayChoice().imageUrl);
|
|
5563
|
+
set_attribute(img, "alt", displayChoice().imageAlt || "Selected answer image");
|
|
5564
|
+
});
|
|
5565
|
+
append($$anchor, img);
|
|
5566
|
+
};
|
|
5567
|
+
var consequent_1 = ($$anchor) => {
|
|
5568
|
+
var span_1 = root_2$2();
|
|
5569
|
+
html(span_1, displayChoiceLabelHtml, true);
|
|
5570
|
+
reset(span_1);
|
|
5571
|
+
append($$anchor, span_1);
|
|
5572
|
+
};
|
|
5573
|
+
var alternate = ($$anchor) => {
|
|
5574
|
+
append($$anchor, root_3$2());
|
|
5575
|
+
};
|
|
5576
|
+
if_block(node, ($$render) => {
|
|
5577
|
+
if (choiceMode() === "image" && displayChoice()?.imageUrl) $$render(consequent);
|
|
5578
|
+
else if (displayChoiceLabelHtml()) $$render(consequent_1, 1);
|
|
5579
|
+
else $$render(alternate, -1);
|
|
5580
|
+
});
|
|
5581
|
+
reset(span);
|
|
5582
|
+
template_effect(() => {
|
|
5583
|
+
set_class(span, 1, `inline-flex items-center min-h-[1.5em] px-2 mx-1 border-b-2 border-gray-500 align-baseline cloze-marker pie-blank-slot ${isStandalone() ? "cloze-marker-standalone pie-blank-slot-standalone" : ""}`, "svelte-d9l5tb");
|
|
5584
|
+
set_style(span, `width:${blankWidth()};border-bottom-width:${blankBorderWidth()};`);
|
|
5585
|
+
set_attribute(span, "aria-label", ariaLabel());
|
|
5586
|
+
});
|
|
5587
|
+
append($$anchor, span);
|
|
5588
|
+
return pop($$exports);
|
|
5589
|
+
}
|
|
5590
|
+
create_custom_element(ClozeMarker, {
|
|
5591
|
+
choiceMode: {},
|
|
5592
|
+
displayChoice: {},
|
|
5593
|
+
displayChoiceLabelHtml: {},
|
|
5594
|
+
isStandalone: {},
|
|
5595
|
+
blankWidth: {},
|
|
5596
|
+
blankBorderWidth: {},
|
|
5597
|
+
ariaLabel: {}
|
|
5598
|
+
}, [], [], { mode: "open" });
|
|
5599
|
+
//#endregion
|
|
5600
|
+
//#region src/delivery/ChoiceRow.svelte
|
|
5601
|
+
var root_2$1 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`);
|
|
5602
|
+
var root_3$1 = /* @__PURE__ */ from_html(`<span class="choice-html pie-choice-label svelte-8xu1pt"></span>`);
|
|
5603
|
+
var root_1$1 = /* @__PURE__ */ from_html(`<label class="cursor-pointer choice-tile text-center pie-choice-tile svelte-8xu1pt"><span class="choice-tile-content pie-choice-tile-content svelte-8xu1pt"><!></span> <input type="radio" class="choice-radio-bottom pie-choice-radio pie-choice-radio-bottom svelte-8xu1pt"/></label>`);
|
|
5604
|
+
var root_5$1 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`);
|
|
5605
|
+
var root_6$1 = /* @__PURE__ */ from_html(`<span class="choice-html pie-choice-label svelte-8xu1pt"></span>`);
|
|
5606
|
+
var root_4$1 = /* @__PURE__ */ from_html(`<input type="radio" class="choice-radio-inline pie-choice-radio pie-choice-radio-inline svelte-8xu1pt"/> <label class="cursor-pointer flex-1 pie-choice-label-wrap svelte-8xu1pt"><!></label>`, 1);
|
|
5607
|
+
var root_7$1 = /* @__PURE__ */ from_html(`<span aria-hidden="true"> </span>`);
|
|
5608
|
+
var root$1 = /* @__PURE__ */ from_html(`<div style="gap:var(--mpb-choice-row-gap, 0.5rem);"><!> <!></div>`);
|
|
5609
|
+
var $$css$1 = {
|
|
5610
|
+
hash: "svelte-8xu1pt",
|
|
5611
|
+
code: ".choice-row-horizontal.svelte-8xu1pt {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));min-height:var(--mpb-choice-tile-min-height, 11rem);gap:0;}.choice-tile.svelte-8xu1pt {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-8xu1pt {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-hover-bg, var(--pie-correct-answer-choice-hover-bg, #f2f2f2));}.pie-choice-horizontal.svelte-8xu1pt:not(.is-selected):not(:hover) .pie-choice-tile:where(.svelte-8xu1pt) {background:transparent;}.choice-row-horizontal.is-selected.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-correct-answer-choice-selected-bg, #fcfcd3));}.choice-row-horizontal.is-selected.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-correct-answer-choice-selected-bg, #fcfcd3));}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-hover-bg, #ececec);}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):not(.is-selected):not(:hover) .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:transparent;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);border-radius:6px;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt:hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);}.pie-choice.choice-correct.svelte-8xu1pt {border-left:3px solid var(--pie-correct-answer-choice-correct-border, #0ea449);}.pie-choice.choice-incorrect.svelte-8xu1pt {border-left:3px solid var(--pie-correct-answer-choice-incorrect-border, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-correct-bg, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-incorrect-bg, #ffebee);}.pie-choice-feedback-badge.svelte-8xu1pt {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:1.1rem;height:1.1rem;border-radius:9999px;font-size:0.72rem;line-height:1;font-weight:700;color:var(--pie-correct-answer-feedback-glyph-color, #fff);}.pie-choice-feedback-correct.svelte-8xu1pt {background:var(--pie-correct-answer-feedback-correct-bg, #087d38);}.pie-choice-feedback-incorrect.svelte-8xu1pt {background:var(--pie-correct-answer-feedback-incorrect-bg, #bf0d00);}.choice-row-horizontal.svelte-8xu1pt p {margin:0;text-align:center;}.choice-html.svelte-8xu1pt p {margin:0;}.choice-html.svelte-8xu1pt {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.choice-radio-bottom.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);padding:var(--mpb-choice-radio-padding, 0px);}.choice-radio-inline.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}"
|
|
5612
|
+
};
|
|
5613
|
+
function ChoiceRow($$anchor, $$props) {
|
|
5614
|
+
push($$props, true);
|
|
5615
|
+
append_styles$1($$anchor, $$css$1);
|
|
5616
|
+
let choice = prop($$props, "choice", 7), choiceMode = prop($$props, "choiceMode", 7, "text"), isHorizontal = prop($$props, "isHorizontal", 7, false), isSelected = prop($$props, "isSelected", 7, false), isDisabled = prop($$props, "isDisabled", 7, false), correctness = prop($$props, "correctness", 7, void 0), isEvaluateMode = prop($$props, "isEvaluateMode", 7, false), instanceId = prop($$props, "instanceId", 7), radioGroupName = prop($$props, "radioGroupName", 7);
|
|
5617
|
+
var $$exports = {
|
|
5618
|
+
get choice() {
|
|
5619
|
+
return choice();
|
|
5620
|
+
},
|
|
5621
|
+
set choice($$value) {
|
|
5622
|
+
choice($$value);
|
|
5623
|
+
flushSync();
|
|
5624
|
+
},
|
|
5625
|
+
get choiceMode() {
|
|
5626
|
+
return choiceMode();
|
|
5627
|
+
},
|
|
5628
|
+
set choiceMode($$value = "text") {
|
|
5629
|
+
choiceMode($$value);
|
|
5630
|
+
flushSync();
|
|
5631
|
+
},
|
|
5632
|
+
get isHorizontal() {
|
|
5633
|
+
return isHorizontal();
|
|
5634
|
+
},
|
|
5635
|
+
set isHorizontal($$value = false) {
|
|
5636
|
+
isHorizontal($$value);
|
|
5637
|
+
flushSync();
|
|
5638
|
+
},
|
|
5639
|
+
get isSelected() {
|
|
5640
|
+
return isSelected();
|
|
5641
|
+
},
|
|
5642
|
+
set isSelected($$value = false) {
|
|
5643
|
+
isSelected($$value);
|
|
5644
|
+
flushSync();
|
|
5645
|
+
},
|
|
5646
|
+
get isDisabled() {
|
|
5647
|
+
return isDisabled();
|
|
5648
|
+
},
|
|
5649
|
+
set isDisabled($$value = false) {
|
|
5650
|
+
isDisabled($$value);
|
|
5651
|
+
flushSync();
|
|
5652
|
+
},
|
|
5653
|
+
get correctness() {
|
|
5654
|
+
return correctness();
|
|
5655
|
+
},
|
|
5656
|
+
set correctness($$value = void 0) {
|
|
5657
|
+
correctness($$value);
|
|
5658
|
+
flushSync();
|
|
5659
|
+
},
|
|
5660
|
+
get isEvaluateMode() {
|
|
5661
|
+
return isEvaluateMode();
|
|
5662
|
+
},
|
|
5663
|
+
set isEvaluateMode($$value = false) {
|
|
5664
|
+
isEvaluateMode($$value);
|
|
5665
|
+
flushSync();
|
|
5666
|
+
},
|
|
5667
|
+
get instanceId() {
|
|
5668
|
+
return instanceId();
|
|
5669
|
+
},
|
|
5670
|
+
set instanceId($$value) {
|
|
5671
|
+
instanceId($$value);
|
|
5672
|
+
flushSync();
|
|
5673
|
+
},
|
|
5674
|
+
get radioGroupName() {
|
|
5675
|
+
return radioGroupName();
|
|
5676
|
+
},
|
|
5677
|
+
set radioGroupName($$value) {
|
|
5678
|
+
radioGroupName($$value);
|
|
5679
|
+
flushSync();
|
|
5680
|
+
}
|
|
5681
|
+
};
|
|
5682
|
+
var div = root$1();
|
|
5683
|
+
var node = child(div);
|
|
5684
|
+
var consequent_1 = ($$anchor) => {
|
|
5685
|
+
var label = root_1$1();
|
|
5686
|
+
var span = child(label);
|
|
5687
|
+
var node_1 = child(span);
|
|
5688
|
+
var consequent = ($$anchor) => {
|
|
5689
|
+
var img = root_2$1();
|
|
5690
|
+
template_effect(() => {
|
|
5691
|
+
set_attribute(img, "src", choice().imageUrl);
|
|
5692
|
+
set_attribute(img, "alt", choice().imageAlt || `Choice ${choice().id}`);
|
|
5693
|
+
});
|
|
5694
|
+
append($$anchor, img);
|
|
5695
|
+
};
|
|
5696
|
+
var alternate = ($$anchor) => {
|
|
5697
|
+
var span_1 = root_3$1();
|
|
5698
|
+
html(span_1, () => choice().labelHtml || "", true);
|
|
5699
|
+
reset(span_1);
|
|
5700
|
+
append($$anchor, span_1);
|
|
5701
|
+
};
|
|
5702
|
+
if_block(node_1, ($$render) => {
|
|
5703
|
+
if (choiceMode() === "image" && choice().imageUrl) $$render(consequent);
|
|
5704
|
+
else $$render(alternate, -1);
|
|
5705
|
+
});
|
|
5706
|
+
reset(span);
|
|
5707
|
+
var input = sibling(span, 2);
|
|
5708
|
+
remove_input_defaults(input);
|
|
5709
|
+
reset(label);
|
|
5710
|
+
template_effect(() => {
|
|
5711
|
+
set_attribute(label, "for", `${instanceId()}-opt-${choice().id}`);
|
|
5712
|
+
set_attribute(input, "name", radioGroupName());
|
|
5713
|
+
set_attribute(input, "id", `${instanceId()}-opt-${choice().id}`);
|
|
5714
|
+
set_value(input, choice().id);
|
|
5715
|
+
set_checked(input, isSelected());
|
|
5716
|
+
input.disabled = isDisabled();
|
|
5717
|
+
});
|
|
5718
|
+
append($$anchor, label);
|
|
5719
|
+
};
|
|
5720
|
+
var alternate_2 = ($$anchor) => {
|
|
5721
|
+
var fragment = root_4$1();
|
|
5722
|
+
var input_1 = first_child(fragment);
|
|
5723
|
+
remove_input_defaults(input_1);
|
|
5724
|
+
var label_1 = sibling(input_1, 2);
|
|
5725
|
+
var node_2 = child(label_1);
|
|
5726
|
+
var consequent_2 = ($$anchor) => {
|
|
5727
|
+
var img_1 = root_5$1();
|
|
5728
|
+
template_effect(() => {
|
|
5729
|
+
set_attribute(img_1, "src", choice().imageUrl);
|
|
5730
|
+
set_attribute(img_1, "alt", choice().imageAlt || `Choice ${choice().id}`);
|
|
5731
|
+
});
|
|
5732
|
+
append($$anchor, img_1);
|
|
5733
|
+
};
|
|
5734
|
+
var alternate_1 = ($$anchor) => {
|
|
5735
|
+
var span_2 = root_6$1();
|
|
5736
|
+
html(span_2, () => choice().labelHtml || "", true);
|
|
5737
|
+
reset(span_2);
|
|
5738
|
+
append($$anchor, span_2);
|
|
5739
|
+
};
|
|
5740
|
+
if_block(node_2, ($$render) => {
|
|
5741
|
+
if (choiceMode() === "image" && choice().imageUrl) $$render(consequent_2);
|
|
5742
|
+
else $$render(alternate_1, -1);
|
|
5743
|
+
});
|
|
5744
|
+
reset(label_1);
|
|
5745
|
+
template_effect(() => {
|
|
5746
|
+
set_attribute(input_1, "name", radioGroupName());
|
|
5747
|
+
set_attribute(input_1, "id", `${instanceId()}-opt-${choice().id}`);
|
|
5748
|
+
set_value(input_1, choice().id);
|
|
5749
|
+
set_checked(input_1, isSelected());
|
|
5750
|
+
input_1.disabled = isDisabled();
|
|
5751
|
+
set_attribute(label_1, "for", `${instanceId()}-opt-${choice().id}`);
|
|
5752
|
+
});
|
|
5753
|
+
append($$anchor, fragment);
|
|
5754
|
+
};
|
|
5755
|
+
if_block(node, ($$render) => {
|
|
5756
|
+
if (isHorizontal()) $$render(consequent_1);
|
|
5757
|
+
else $$render(alternate_2, -1);
|
|
5758
|
+
});
|
|
5759
|
+
var node_3 = sibling(node, 2);
|
|
5760
|
+
var consequent_3 = ($$anchor) => {
|
|
5761
|
+
var span_3 = root_7$1();
|
|
5762
|
+
var text = child(span_3, true);
|
|
5763
|
+
reset(span_3);
|
|
5764
|
+
template_effect(() => {
|
|
5765
|
+
set_class(span_3, 1, `pie-choice-feedback-badge ${correctness() === "correct" ? "pie-choice-feedback-correct" : "pie-choice-feedback-incorrect"}`, "svelte-8xu1pt");
|
|
5766
|
+
set_text(text, correctness() === "correct" ? "✓" : "✕");
|
|
5767
|
+
});
|
|
5768
|
+
append($$anchor, span_3);
|
|
5769
|
+
};
|
|
5770
|
+
if_block(node_3, ($$render) => {
|
|
5771
|
+
if (isEvaluateMode() && correctness()) $$render(consequent_3);
|
|
5772
|
+
});
|
|
5773
|
+
reset(div);
|
|
5774
|
+
template_effect(() => set_class(div, 1, `flex items-start choice-row pie-choice ${isHorizontal() ? "choice-row-horizontal pie-choice-horizontal" : ""} ${isSelected() ? "is-selected pie-choice-selected" : ""} ${correctness() ? `choice-${correctness()} pie-choice-${correctness()}` : ""}`, "svelte-8xu1pt"));
|
|
5775
|
+
append($$anchor, div);
|
|
5776
|
+
return pop($$exports);
|
|
5777
|
+
}
|
|
5778
|
+
create_custom_element(ChoiceRow, {
|
|
5779
|
+
choice: {},
|
|
5780
|
+
choiceMode: {},
|
|
5781
|
+
isHorizontal: {},
|
|
5782
|
+
isSelected: {},
|
|
5783
|
+
isDisabled: {},
|
|
5784
|
+
correctness: {},
|
|
5785
|
+
isEvaluateMode: {},
|
|
5786
|
+
instanceId: {},
|
|
5787
|
+
radioGroupName: {}
|
|
5788
|
+
}, [], [], { mode: "open" });
|
|
5789
|
+
//#endregion
|
|
5790
|
+
//#region src/delivery/computeChoiceCorrectness.ts
|
|
5791
|
+
/**
|
|
5792
|
+
* Computes which choice ids should display a correctness badge and what kind.
|
|
5793
|
+
*
|
|
5794
|
+
* Reveal mode (showCorrectAnswer=true) shows only the canonical correct answer —
|
|
5795
|
+
* the student's wrong selection is deliberately suppressed so the UI only
|
|
5796
|
+
* highlights what to remember, not what to regret.
|
|
5797
|
+
*
|
|
5798
|
+
* Unanswered-in-evaluate (selectedId='') treats the correct choice as missed
|
|
5799
|
+
* (incorrect badge) rather than triggering the two-badge wrong-answer path.
|
|
5800
|
+
*/
|
|
5801
|
+
function computeChoiceCorrectness(params) {
|
|
5802
|
+
const map = /* @__PURE__ */ new Map();
|
|
5803
|
+
const { isEvaluateMode, correctChoiceId, selectedId, showCorrectAnswer } = params;
|
|
5804
|
+
if (!isEvaluateMode || !correctChoiceId) return map;
|
|
5805
|
+
if (showCorrectAnswer) {
|
|
5806
|
+
map.set(correctChoiceId, "correct");
|
|
5807
|
+
return map;
|
|
5808
|
+
}
|
|
5809
|
+
if (!selectedId) {
|
|
5810
|
+
map.set(correctChoiceId, "incorrect");
|
|
5811
|
+
return map;
|
|
5812
|
+
}
|
|
5813
|
+
if (selectedId === correctChoiceId) {
|
|
5814
|
+
map.set(correctChoiceId, "correct");
|
|
5815
|
+
return map;
|
|
5816
|
+
}
|
|
5817
|
+
map.set(selectedId, "incorrect");
|
|
5818
|
+
map.set(correctChoiceId, "incorrect");
|
|
5819
|
+
return map;
|
|
5820
|
+
}
|
|
5821
|
+
//#endregion
|
|
5822
|
+
//#region src/delivery/computeLayoutProfile.ts
|
|
5823
|
+
var BLANK_TOKEN = "{{blank}}";
|
|
5824
|
+
var FEATURE_BUTTON_PROFILES = new Set([
|
|
5825
|
+
"audio_blank_only",
|
|
5826
|
+
"stimulus_image_blank",
|
|
5827
|
+
"token_sequence"
|
|
5828
|
+
]);
|
|
5829
|
+
function computeLayoutProfile(params) {
|
|
5830
|
+
const { interactionMode = "", template = "", choiceLayout: configuredChoiceLayout, layoutProfile = "", hasAudio = false, useFeatureButtonAudio: configuredFeatureButton } = params;
|
|
5831
|
+
const isAudioOnlyMode = interactionMode === "audio_mc_only";
|
|
5832
|
+
const isBlankOnlyTemplate = (() => {
|
|
5833
|
+
if (!template) return false;
|
|
5834
|
+
return template.replace(/<[^>]+>/g, "").replace(/ /g, " ").trim() === BLANK_TOKEN;
|
|
5835
|
+
})();
|
|
5836
|
+
const choiceLayout = configuredChoiceLayout === "horizontal" || configuredChoiceLayout === "vertical" ? configuredChoiceLayout : isAudioOnlyMode || isBlankOnlyTemplate ? "horizontal" : "vertical";
|
|
5837
|
+
return {
|
|
5838
|
+
isAudioOnlyMode,
|
|
5839
|
+
isBlankOnlyTemplate,
|
|
5840
|
+
choiceLayout,
|
|
5841
|
+
isHorizontalChoices: choiceLayout === "horizontal",
|
|
5842
|
+
hasInlineSentenceAudioLayout: layoutProfile === "inline_sentence" && hasAudio,
|
|
5843
|
+
useFeatureButtonAudio: typeof configuredFeatureButton === "boolean" ? configuredFeatureButton : hasAudio && FEATURE_BUTTON_PROFILES.has(layoutProfile)
|
|
5844
|
+
};
|
|
5845
|
+
}
|
|
5846
|
+
//#endregion
|
|
5847
|
+
//#region src/shared/layoutLimits.ts
|
|
5848
|
+
/** Baseline values tuned to match historical CQT visuals; override via model.layoutLimits. */
|
|
5849
|
+
var DEFAULT_LAYOUT_LIMITS = {
|
|
5850
|
+
blankStandaloneWidthRem: 7,
|
|
5851
|
+
blankWideWidthRem: 10,
|
|
5852
|
+
blankUnderlineWidthPx: 2,
|
|
5853
|
+
blankUnderlineWideWidthPx: 4,
|
|
5854
|
+
horizontalChoiceWidthPx: 170,
|
|
5855
|
+
horizontalChoiceWidthVw: 30,
|
|
5856
|
+
horizontalChoiceTileMinHeightRem: 11,
|
|
5857
|
+
horizontalChoiceContentMinHeightRem: 7.5,
|
|
5858
|
+
selectedImageMaxHeightRem: 4,
|
|
5859
|
+
choiceImageMaxHeightRem: 5,
|
|
5860
|
+
listenButtonSizePx: 128,
|
|
5861
|
+
stimulusMinColumnPx: 210,
|
|
5862
|
+
textMinColumnPx: 260,
|
|
5863
|
+
legendMaxChars: 120,
|
|
5864
|
+
choiceGroupGapRem: .5,
|
|
5865
|
+
choiceRowGapRem: .5,
|
|
5866
|
+
toggleButtonGapRem: .5,
|
|
5867
|
+
horizontalChoiceRadioTopMarginRem: .5,
|
|
5868
|
+
audioBlankTemplateMarginTopRem: .8,
|
|
5869
|
+
audioBlankTemplateMarginBottomRem: 1.8,
|
|
5870
|
+
audioInstructionsMaxWidthPx: 875,
|
|
5871
|
+
narrowHorizontalChoiceMaxWidthPx: 230,
|
|
5872
|
+
stimulusGridColumnGapRem: 2,
|
|
5873
|
+
stimulusGridRowGapRem: .7,
|
|
5874
|
+
stimulusSentenceMarginTopRem: .2,
|
|
5875
|
+
stimulusChoicesMarginTopRem: .9,
|
|
5876
|
+
tokenGridColumnGapRem: 1.5,
|
|
5877
|
+
tokenGridRowGapRem: .8,
|
|
5878
|
+
tokenTemplateMarginTopRem: .6,
|
|
5879
|
+
tokenInlineTokenGapRem: .35,
|
|
5880
|
+
tokenChoicesMarginTopRem: .2,
|
|
5881
|
+
inlineGridColumnGapRem: 1.5,
|
|
5882
|
+
inlineGridRowGapRem: .65,
|
|
5883
|
+
inlineTemplateMarginTopRem: .45,
|
|
5884
|
+
inlineChoicesMarginTopRem: .25
|
|
5885
|
+
};
|
|
5886
|
+
//#endregion
|
|
5887
|
+
//#region src/delivery/computeLayoutStyle.ts
|
|
5888
|
+
/**
|
|
5889
|
+
* Maps every LayoutLimits key (except legendMaxChars, which is a return value not a CSS var)
|
|
5890
|
+
* to its --mpb-* CSS variable name and CSS unit.
|
|
5891
|
+
* Add a single entry here when adding a new layout limit.
|
|
5892
|
+
*/
|
|
5893
|
+
var CSS_VAR_SPEC = {
|
|
5894
|
+
blankStandaloneWidthRem: {
|
|
5895
|
+
varName: "--mpb-blank-standalone-width",
|
|
5896
|
+
unit: "rem"
|
|
5897
|
+
},
|
|
5898
|
+
blankWideWidthRem: {
|
|
5899
|
+
varName: "--mpb-blank-wide-width",
|
|
5900
|
+
unit: "rem"
|
|
5901
|
+
},
|
|
5902
|
+
blankUnderlineWidthPx: {
|
|
5903
|
+
varName: "--mpb-blank-underline-width",
|
|
5904
|
+
unit: "px"
|
|
5905
|
+
},
|
|
5906
|
+
blankUnderlineWideWidthPx: {
|
|
5907
|
+
varName: "--mpb-blank-underline-wide-width",
|
|
5908
|
+
unit: "px"
|
|
5909
|
+
},
|
|
5910
|
+
horizontalChoiceWidthPx: {
|
|
5911
|
+
varName: "--mpb-choice-width-px",
|
|
5912
|
+
unit: "px"
|
|
5913
|
+
},
|
|
5914
|
+
horizontalChoiceWidthVw: {
|
|
5915
|
+
varName: "--mpb-choice-width-vw",
|
|
5916
|
+
unit: "vw"
|
|
5917
|
+
},
|
|
5918
|
+
horizontalChoiceTileMinHeightRem: {
|
|
5919
|
+
varName: "--mpb-choice-tile-min-height",
|
|
5920
|
+
unit: "rem"
|
|
5921
|
+
},
|
|
5922
|
+
horizontalChoiceContentMinHeightRem: {
|
|
5923
|
+
varName: "--mpb-choice-content-min-height",
|
|
5924
|
+
unit: "rem"
|
|
5925
|
+
},
|
|
5926
|
+
choiceImageMaxHeightRem: {
|
|
5927
|
+
varName: "--mpb-choice-image-max-height",
|
|
5928
|
+
unit: "rem"
|
|
5929
|
+
},
|
|
5930
|
+
selectedImageMaxHeightRem: {
|
|
5931
|
+
varName: "--mpb-selected-image-max-height",
|
|
5932
|
+
unit: "rem"
|
|
5933
|
+
},
|
|
5934
|
+
choiceGroupGapRem: {
|
|
5935
|
+
varName: "--mpb-choice-group-gap",
|
|
5936
|
+
unit: "rem"
|
|
5937
|
+
},
|
|
5938
|
+
choiceRowGapRem: {
|
|
5939
|
+
varName: "--mpb-choice-row-gap",
|
|
5940
|
+
unit: "rem"
|
|
5941
|
+
},
|
|
5942
|
+
horizontalChoiceRadioTopMarginRem: {
|
|
5943
|
+
varName: "--mpb-horizontal-choice-radio-top-margin",
|
|
5944
|
+
unit: "rem"
|
|
5945
|
+
},
|
|
5946
|
+
narrowHorizontalChoiceMaxWidthPx: {
|
|
5947
|
+
varName: "--mpb-narrow-choice-max-width",
|
|
5948
|
+
unit: "px"
|
|
5949
|
+
},
|
|
5950
|
+
toggleButtonGapRem: {
|
|
5951
|
+
varName: "--mpb-toggle-button-gap",
|
|
5952
|
+
unit: "rem"
|
|
5953
|
+
},
|
|
5954
|
+
listenButtonSizePx: {
|
|
5955
|
+
varName: "--mpb-listen-button-size",
|
|
5956
|
+
unit: "px"
|
|
5957
|
+
},
|
|
5958
|
+
audioBlankTemplateMarginTopRem: {
|
|
5959
|
+
varName: "--mpb-audio-blank-template-margin-top",
|
|
5960
|
+
unit: "rem"
|
|
5961
|
+
},
|
|
5962
|
+
audioBlankTemplateMarginBottomRem: {
|
|
5963
|
+
varName: "--mpb-audio-blank-template-margin-bottom",
|
|
5964
|
+
unit: "rem"
|
|
5965
|
+
},
|
|
5966
|
+
audioInstructionsMaxWidthPx: {
|
|
5967
|
+
varName: "--mpb-audio-instructions-max-width",
|
|
5968
|
+
unit: "px"
|
|
5969
|
+
},
|
|
5970
|
+
stimulusMinColumnPx: {
|
|
5971
|
+
varName: "--mpb-stimulus-min-column",
|
|
5972
|
+
unit: "px"
|
|
5973
|
+
},
|
|
5974
|
+
textMinColumnPx: {
|
|
5975
|
+
varName: "--mpb-text-min-column",
|
|
5976
|
+
unit: "px"
|
|
5977
|
+
},
|
|
5978
|
+
stimulusGridColumnGapRem: {
|
|
5979
|
+
varName: "--mpb-stimulus-grid-column-gap",
|
|
5980
|
+
unit: "rem"
|
|
5981
|
+
},
|
|
5982
|
+
stimulusGridRowGapRem: {
|
|
5983
|
+
varName: "--mpb-stimulus-grid-row-gap",
|
|
5984
|
+
unit: "rem"
|
|
5985
|
+
},
|
|
5986
|
+
stimulusSentenceMarginTopRem: {
|
|
5987
|
+
varName: "--mpb-stimulus-sentence-margin-top",
|
|
5988
|
+
unit: "rem"
|
|
5989
|
+
},
|
|
5990
|
+
stimulusChoicesMarginTopRem: {
|
|
5991
|
+
varName: "--mpb-stimulus-choices-margin-top",
|
|
5992
|
+
unit: "rem"
|
|
5993
|
+
},
|
|
5994
|
+
tokenGridColumnGapRem: {
|
|
5995
|
+
varName: "--mpb-token-grid-column-gap",
|
|
5996
|
+
unit: "rem"
|
|
5997
|
+
},
|
|
5998
|
+
tokenGridRowGapRem: {
|
|
5999
|
+
varName: "--mpb-token-grid-row-gap",
|
|
6000
|
+
unit: "rem"
|
|
6001
|
+
},
|
|
6002
|
+
tokenTemplateMarginTopRem: {
|
|
6003
|
+
varName: "--mpb-token-template-margin-top",
|
|
6004
|
+
unit: "rem"
|
|
6005
|
+
},
|
|
6006
|
+
tokenInlineTokenGapRem: {
|
|
6007
|
+
varName: "--mpb-token-inline-token-gap",
|
|
6008
|
+
unit: "rem"
|
|
6009
|
+
},
|
|
6010
|
+
tokenChoicesMarginTopRem: {
|
|
6011
|
+
varName: "--mpb-token-choices-margin-top",
|
|
6012
|
+
unit: "rem"
|
|
6013
|
+
},
|
|
6014
|
+
inlineGridColumnGapRem: {
|
|
6015
|
+
varName: "--mpb-inline-grid-column-gap",
|
|
6016
|
+
unit: "rem"
|
|
6017
|
+
},
|
|
6018
|
+
inlineGridRowGapRem: {
|
|
6019
|
+
varName: "--mpb-inline-grid-row-gap",
|
|
6020
|
+
unit: "rem"
|
|
6021
|
+
},
|
|
6022
|
+
inlineTemplateMarginTopRem: {
|
|
6023
|
+
varName: "--mpb-inline-template-margin-top",
|
|
6024
|
+
unit: "rem"
|
|
6025
|
+
},
|
|
6026
|
+
inlineChoicesMarginTopRem: {
|
|
6027
|
+
varName: "--mpb-inline-choices-margin-top",
|
|
6028
|
+
unit: "rem"
|
|
6029
|
+
}
|
|
6030
|
+
};
|
|
6031
|
+
var DEFAULT_LAYOUT_PROFILE_PRESETS = {
|
|
6032
|
+
audio_blank_only: {
|
|
6033
|
+
blankWideWidthRem: 10,
|
|
6034
|
+
blankUnderlineWideWidthPx: 6,
|
|
6035
|
+
horizontalChoiceTileMinHeightRem: 11.25,
|
|
6036
|
+
horizontalChoiceContentMinHeightRem: 9.375,
|
|
6037
|
+
choiceGroupGapRem: 1,
|
|
6038
|
+
audioBlankTemplateMarginBottomRem: 1.875
|
|
6039
|
+
},
|
|
6040
|
+
stimulus_image_blank: {
|
|
6041
|
+
blankWideWidthRem: 10,
|
|
6042
|
+
blankUnderlineWideWidthPx: 6
|
|
6043
|
+
},
|
|
6044
|
+
token_sequence: {
|
|
6045
|
+
blankStandaloneWidthRem: 7,
|
|
6046
|
+
blankUnderlineWideWidthPx: 6
|
|
6047
|
+
}
|
|
6048
|
+
};
|
|
6049
|
+
function computeLayoutStyle(params) {
|
|
6050
|
+
const { layoutProfile, isBlankOnlyTemplate, correctAnswerStyleVars } = params;
|
|
6051
|
+
const configured = params.configuredLimits && typeof params.configuredLimits === "object" ? params.configuredLimits : {};
|
|
6052
|
+
const customPresets = params.customProfilePresets && typeof params.customProfilePresets === "object" ? params.customProfilePresets : {};
|
|
6053
|
+
const customForProfile = customPresets[layoutProfile] && typeof customPresets[layoutProfile] === "object" ? customPresets[layoutProfile] : {};
|
|
6054
|
+
const profilePreset = {
|
|
6055
|
+
...DEFAULT_LAYOUT_PROFILE_PRESETS[layoutProfile] ?? {},
|
|
6056
|
+
...customForProfile
|
|
6057
|
+
};
|
|
6058
|
+
const l = {
|
|
6059
|
+
...DEFAULT_LAYOUT_LIMITS,
|
|
6060
|
+
...configured,
|
|
6061
|
+
...profilePreset
|
|
6062
|
+
};
|
|
6063
|
+
const wideBlankProfiles = ["audio_blank_only", "stimulus_image_blank"];
|
|
6064
|
+
const wideUnderlineProfiles = [
|
|
6065
|
+
"audio_blank_only",
|
|
6066
|
+
"stimulus_image_blank",
|
|
6067
|
+
"token_sequence"
|
|
6068
|
+
];
|
|
6069
|
+
const blankWidth = wideBlankProfiles.includes(layoutProfile) ? `${l.blankWideWidthRem}rem` : isBlankOnlyTemplate ? `${l.blankStandaloneWidthRem}rem` : "auto";
|
|
6070
|
+
const blankBorderWidth = wideUnderlineProfiles.includes(layoutProfile) ? `${l.blankUnderlineWideWidthPx}px` : `${l.blankUnderlineWidthPx}px`;
|
|
6071
|
+
return {
|
|
6072
|
+
rootStyle: [...Object.keys(CSS_VAR_SPEC).map((key) => `${CSS_VAR_SPEC[key].varName}:${l[key]}${CSS_VAR_SPEC[key].unit}`), correctAnswerStyleVars].join(";"),
|
|
6073
|
+
blankWidth,
|
|
6074
|
+
blankBorderWidth,
|
|
6075
|
+
legendMaxChars: l.legendMaxChars
|
|
6076
|
+
};
|
|
6077
|
+
}
|
|
6078
|
+
//#endregion
|
|
6079
|
+
//#region src/delivery/computeDisplayState.ts
|
|
6080
|
+
var DEFAULT_AUDIO_BUTTON_SKINS = {
|
|
6081
|
+
default: {
|
|
6082
|
+
silentUrl: "https://assets.learnosity.com/organisations/844/0c9f2aa3-3cd5-4de7-93ef-541c24ca35da.svg",
|
|
6083
|
+
playingUrl: "https://assets.learnosity.com/organisations/844/231dfdc2-c113-4be5-91fb-e75a0ca5994b.svg"
|
|
6084
|
+
},
|
|
6085
|
+
es: {
|
|
6086
|
+
silentUrl: "https://assets.learnosity.com/organisations/844/27a9d5b5-d873-4bd5-b9ba-22748782d8ba.svg",
|
|
6087
|
+
playingUrl: "https://assets.learnosity.com/organisations/844/120f216d-96b7-4560-94b8-1d90710216b7.svg"
|
|
6088
|
+
}
|
|
6089
|
+
};
|
|
6090
|
+
/**
|
|
6091
|
+
* Resolves the audio button skin to display.
|
|
6092
|
+
* Priority: byLocale[exact] > byLocale[lang] > byLocale.default > customSingle > built-in default
|
|
6093
|
+
*/
|
|
6094
|
+
function computeFeatureAudioSkin(params) {
|
|
6095
|
+
const locale = String(params.locale || "").toLowerCase();
|
|
6096
|
+
const lang = locale.slice(0, 2);
|
|
6097
|
+
const byLocale = params.audioButtonSkinsByLocale && typeof params.audioButtonSkinsByLocale === "object" ? params.audioButtonSkinsByLocale : {};
|
|
6098
|
+
const customSingle = params.audioButtonSkin && typeof params.audioButtonSkin === "object" ? params.audioButtonSkin : null;
|
|
6099
|
+
const defaultSkin = locale.startsWith("es") ? DEFAULT_AUDIO_BUTTON_SKINS.es : DEFAULT_AUDIO_BUTTON_SKINS.default;
|
|
6100
|
+
return byLocale[locale] || byLocale[lang] || byLocale.default || customSingle || defaultSkin;
|
|
6101
|
+
}
|
|
6102
|
+
/**
|
|
6103
|
+
* Returns the choice id that the ClozeMarker and selected-state highlight should display.
|
|
6104
|
+
* When the correct answer is revealed (alwaysShowCorrect or evaluate+showCorrectAnswer),
|
|
6105
|
+
* it shows the correct choice rather than the student's selection.
|
|
6106
|
+
*/
|
|
6107
|
+
function computeDisplayChoiceId(params) {
|
|
6108
|
+
const { selectedId, isEvaluateMode, showCorrectAnswer, alwaysShowCorrect, correctChoiceId } = params;
|
|
6109
|
+
if (alwaysShowCorrect && correctChoiceId) return correctChoiceId;
|
|
6110
|
+
if (isEvaluateMode && showCorrectAnswer && correctChoiceId) return correctChoiceId;
|
|
6111
|
+
return selectedId;
|
|
6112
|
+
}
|
|
6113
|
+
/**
|
|
6114
|
+
* Returns the screen-reader-only result announcement text shown after evaluate mode scoring.
|
|
6115
|
+
* Empty string means nothing is announced.
|
|
6116
|
+
*/
|
|
6117
|
+
function computeResultText(params) {
|
|
6118
|
+
const { isEvaluateMode, showCorrectAnswer, isCorrect, isIncorrect, selectedId } = params;
|
|
6119
|
+
if (!isEvaluateMode || showCorrectAnswer) return "";
|
|
6120
|
+
if (isCorrect) return "Correct answer selected";
|
|
6121
|
+
if (isIncorrect && selectedId) return "Incorrect answer selected";
|
|
6122
|
+
return "";
|
|
6123
|
+
}
|
|
6124
|
+
/**
|
|
6125
|
+
* Returns the visible legend text for the choices fieldset.
|
|
6126
|
+
* Strips HTML, truncates to legendMaxChars with an ellipsis, falls back to answerChoicesLabel.
|
|
6127
|
+
*/
|
|
6128
|
+
function computeLegendText(params) {
|
|
6129
|
+
const { prompt, legendMaxChars, answerChoicesLabel } = params;
|
|
6130
|
+
const plain = prompt.replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
6131
|
+
const maxChars = Math.max(8, legendMaxChars);
|
|
6132
|
+
if (!plain) return answerChoicesLabel;
|
|
6133
|
+
return plain.length > maxChars ? `${plain.slice(0, Math.max(1, maxChars - 1))}…` : plain;
|
|
6134
|
+
}
|
|
6135
|
+
//#endregion
|
|
6136
|
+
//#region src/delivery/cqt-css/sel-r1-base.css?raw
|
|
6137
|
+
var sel_r1_base_default = "/* Shared base styles for all sel_r1-*_plusggg variants.\n Applied via the data-mpb-variant=\"sel-r1-base\" style element.\n Uses [class*=\"variant-sel-r1-\"] so it covers every r1 variant class.\n Source: web-ItemBankViewer/learnosity/templates/Renaissance/r1.scss */\n\n/* r1.scss: Starial font throughout */\n[class*=\"variant-sel-r1-\"] {\n font-family: Starial, Arial, sans-serif;\n}\n\n/* r1.scss: .rli-r1-audio-transcript { font-family:Roboto; font-size:16px } */\n[class*=\"variant-sel-r1-\"] .pie-audio-transcript {\n font-family: Roboto, Arial, sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n}\n\n/* r1.scss: .rli-r1-content-element { font-size: 1.9em } wraps all stem tokens.\n Makes inline font-size spans in the template multiply on top of this base. */\n[class*=\"variant-sel-r1-\"] .pie-template-line {\n font-size: 1.9em;\n}\n\n/* r1.scss: .rli-r1-stem { display:flex; flex-direction:row; justify-content:center }\n r1.scss: .rli-r1-content-element { margin-right:2px; margin-left:2px } — 4px total gap.\n column-gap:4px replicates the 2px+2px per-element margin. */\n[class*=\"variant-sel-r1-\"] .pie-template-line {\n display: flex;\n flex-direction: row;\n align-items: baseline;\n justify-content: center;\n column-gap: 4px;\n}\n\n[class*=\"variant-sel-r1-\"] .pie-template-line p {\n margin: 0;\n display: flex;\n flex-direction: row;\n align-items: baseline;\n gap: 4px;\n}\n\n/* r1.scss: .rli-r1-content-element { min-width:150px; max-width:150px; min-height:150px;\n line-height:89px } — every stem token (blank slot and adjacent spans) is a 150px box.\n Scoped to token_sequence layout so the audio_blank_only standalone blank (160px) is unaffected. */\n[class*=\"variant-sel-r1-\"].layout-token_sequence .pie-template-line span:not([class]),\n[class*=\"variant-sel-r1-\"].layout-token_sequence .pie-template-line .pie-blank-slot {\n min-width: 150px;\n max-width: 150px;\n min-height: 150px;\n line-height: 89px;\n}\n\n/* r1.scss: .rli-r1-content-element { font-size:1.9em; line-height:89px } on distractors */\n[class*=\"variant-sel-r1-\"] .pie-choice-label {\n font-size: 1.9em;\n line-height: 89px;\n}\n";
|
|
6138
|
+
//#endregion
|
|
6139
|
+
//#region src/delivery/variant-css-map.ts
|
|
6140
|
+
var VARIANT_BY_CUSTOM_TYPE = {
|
|
6141
|
+
"sel_r1-_plusggg": {
|
|
6142
|
+
variantId: "sel-r1-plusggg",
|
|
6143
|
+
variantClass: "variant-sel-r1-plusggg",
|
|
6144
|
+
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css",
|
|
6145
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css */\n/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */\n.mc-populated-blank-root.variant-sel-r1-plusggg {\n max-width: 875px;\n margin-inline: auto;\n --mpb-listen-button-size: 128px;\n --mpb-choice-width-px: 155px;\n --mpb-choice-tile-min-height: 11.25rem;\n --mpb-choice-content-min-height: 9.375rem;\n --mpb-choice-group-gap: 1rem;\n --mpb-choice-hover-bg: #f2f2f2;\n --mpb-choice-selected-bg: #fcfcd3;\n}\n\n.mc-populated-blank-root.variant-sel-r1-plusggg {\n --mpb-choice-radio-padding: 20px;\n}\n"
|
|
6146
|
+
},
|
|
6147
|
+
"sr-vic": {
|
|
6148
|
+
variantId: "sr-vic",
|
|
6149
|
+
variantClass: "variant-sr-vic",
|
|
6150
|
+
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sr-vic/0.0.1/question.css",
|
|
6151
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sr-vic/0.0.1/question.css */\n/* Reference layout: web-ItemBankViewer/learnosity/templates/Renaissance/vic.scss */\n.mc-populated-blank-root.variant-sr-vic {\n font-family: Starial, Arial, sans-serif;\n --mpb-inline-grid-column-gap: 1rem;\n --mpb-inline-grid-row-gap: 0.5rem;\n --mpb-inline-template-margin-top: 0.2rem;\n --mpb-inline-choices-margin-top: 0.2rem;\n}\n\n.mc-populated-blank-root.variant-sr-vic .pie-template-line,\n.mc-populated-blank-root.variant-sr-vic .pie-blank-value,\n.mc-populated-blank-root.variant-sr-vic .pie-choice-label {\n line-height: 123%;\n}\n\n/* vic.scss: .rli-vic-answer uses display:flex so sentence and cloze stay on\n one line. The template HTML wraps text in <p>, which is block by default and\n breaks to a new line. Making <p> inline keeps the sentence and blank inline. */\n.mc-populated-blank-root.variant-sr-vic .pie-template-line p {\n display: inline;\n margin: 0;\n}\n\n/* vic.scss: .rli-vic-cloze > .rli-vic-content-element { color: #cc3333 } */\n.mc-populated-blank-root.variant-sr-vic .pie-blank-value {\n color: #cc3333;\n}\n\n/* vic.scss: .rli-vic-selected { background-color: #fcfcd3 } applied to the\n whole distractor row (radio + label), not just the label wrapper. */\n.mc-populated-blank-root.variant-sr-vic .pie-choice.is-selected {\n background-color: #fcfcd3;\n border-radius: 6px;\n}\n\n.mc-populated-blank-root.variant-sr-vic .pie-choice.is-selected .pie-choice-label-wrap {\n background-color: transparent;\n}\n\n/* vic.scss: distractor label text sits to the right of the radio — no centering. */\n.mc-populated-blank-root.variant-sr-vic .pie-choice-label {\n text-align: left;\n justify-content: flex-start;\n}\n\n/* vic.scss: .rli-vic-distractor:hover { background-color: #F2F2F2 } applied to\n the full row element, not only the inner label wrapper. */\n.mc-populated-blank-root.variant-sr-vic .pie-choice:not(.pie-choice-horizontal):hover {\n background-color: #f2f2f2;\n border-radius: 6px;\n}\n\n.mc-populated-blank-root.variant-sr-vic\n .pie-choice:not(.pie-choice-horizontal):hover\n .pie-choice-label-wrap {\n background-color: transparent;\n}\n\n/* Selected state must win over hover — yellow persists when hovering a chosen row. */\n.mc-populated-blank-root.variant-sr-vic .pie-choice:not(.pie-choice-horizontal).is-selected:hover {\n background-color: #fcfcd3;\n}\n"
|
|
6152
|
+
},
|
|
6153
|
+
sel_vic: {
|
|
6154
|
+
variantId: "sel-vic",
|
|
6155
|
+
variantClass: "variant-sel-vic",
|
|
6156
|
+
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css",
|
|
6157
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css */\n/* Reference layout: web-ItemBankViewer/learnosity/templates/Renaissance/sel_vic/scss/main.scss + vic.scss */\n.mc-populated-blank-root.variant-sel-vic {\n font-family: Starial, Arial, sans-serif;\n font-size: 1.5em;\n max-width: 800px;\n margin-inline: auto;\n --mpb-inline-grid-column-gap: 1rem;\n --mpb-inline-grid-row-gap: 0.5rem;\n --mpb-inline-template-margin-top: 0.2rem;\n --mpb-inline-choices-margin-top: 0.2rem;\n --pie-correct-answer-choice-hover-bg: #e2e2e2;\n --pie-correct-answer-choice-selected-bg: #fcfcd3;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {\n font-family: Roboto, Arial, sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-template-line,\n.mc-populated-blank-root.variant-sel-vic .pie-blank-value,\n.mc-populated-blank-root.variant-sel-vic .pie-choice-label {\n line-height: 123%;\n}\n\n/* sel_vic/main.scss: template left ~75%, audio right ~25% on the same row.\n Svelte scoping prevents the component-internal grid-area rule from reaching\n .audio-container inside AudioPlayer, so we override it here via the global\n .pie-audio-container class which is not subject to scope hashing. */\n.mc-populated-blank-root.variant-sel-vic .pie-audio-container {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n align-self: start;\n min-height: 128px;\n}\n\n/* vic.scss: sentence and cloze sit inline — the <p> wrapper must not break to\n a new line before the blank slot. */\n.mc-populated-blank-root.variant-sel-vic .pie-template-line p {\n display: inline;\n margin: 0;\n}\n\n/* vic.scss: .rli-vic-cloze > .rli-vic-content-element { color: #cc3333 } */\n.mc-populated-blank-root.variant-sel-vic .pie-blank-value {\n color: #cc3333;\n}\n\n/* sel_vic/main.scss: .sel-vic { max-width: 800px } — the fieldset/choices must\n also be constrained so rows don't span beyond 800px. */\n.mc-populated-blank-root.variant-sel-vic .pie-choices-fieldset {\n max-width: 800px;\n width: 100%;\n}\n\n/* vic.scss: distractor label text sits to the right of the radio — no centering. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice-label {\n text-align: left;\n justify-content: flex-start;\n}\n\n/* vic.scss: .rli-vic-selected { background-color: #fcfcd3 } on the full row. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice.is-selected {\n background-color: #fcfcd3;\n border-radius: 6px;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-choice.is-selected .pie-choice-label-wrap {\n background-color: transparent;\n}\n\n/* Selected state must win over hover. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice:not(.pie-choice-horizontal).is-selected:hover {\n background-color: #fcfcd3;\n}\n\n/* vic.scss: .rli-vic-distractor:hover { background-color: #F2F2F2 } on the full row. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice:not(.pie-choice-horizontal):hover {\n background-color: #f2f2f2;\n border-radius: 6px;\n}\n\n.mc-populated-blank-root.variant-sel-vic\n .pie-choice:not(.pie-choice-horizontal):hover\n .pie-choice-label-wrap {\n background-color: transparent;\n}\n\n@media (min-width: 620px) {\n .mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {\n min-width: 620px;\n max-width: 800px;\n transform: translateX(-55px);\n }\n}\n"
|
|
6158
|
+
},
|
|
6159
|
+
"sel_r1-_gplusggg": {
|
|
6160
|
+
variantId: "sel-r1-gplusggg",
|
|
6161
|
+
variantClass: "variant-sel-r1-gplusggg",
|
|
6162
|
+
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_gplusggg/0.0.1/question.css",
|
|
6163
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_gplusggg/0.0.1/question.css */\n/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */\n.mc-populated-blank-root.variant-sel-r1-gplusggg {\n max-width: 875px;\n margin-inline: auto;\n --mpb-listen-button-size: 128px;\n --mpb-choice-width-px: 155px;\n --mpb-choice-tile-min-height: 11.25rem;\n --mpb-choice-content-min-height: 9.375rem;\n --mpb-choice-group-gap: 1rem;\n --mpb-choice-hover-bg: #f2f2f2;\n --mpb-choice-selected-bg: #fcfcd3;\n}\n\n/* r1.scss: .rli-r1-content-element boxes all have fixed line-height:89px, so every\n token in the stem row shares a stable baseline regardless of content. In PIE,\n the blank slot's baseline shifts when the empty placeholder (short ) is\n replaced by the filled value span (full text height), dragging adjacent tokens\n down by ~9px. Switching to align-items:center is safe here because gplusggg has\n only one row of content (blank + \"four\"), so vertical centering and baseline\n alignment produce the same visual result. The :is() wrapper raises specificity\n above the base [class*=] rule without needing !important. */\n:is(.mc-populated-blank-root.variant-sel-r1-gplusggg) .pie-template-line {\n align-items: center;\n}\n"
|
|
6164
|
+
},
|
|
6165
|
+
"sel_r1-g_plusggg": {
|
|
6166
|
+
variantId: "sel-r1-g-stem",
|
|
6167
|
+
variantClass: "variant-sel-r1-g-stem",
|
|
6168
|
+
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-g_plusggg/0.0.1/question.css",
|
|
6169
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-g_plusggg/0.0.1/question.css */\n/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */\n.mc-populated-blank-root.variant-sel-r1-g-stem {\n max-width: 875px;\n margin-inline: auto;\n --mpb-listen-button-size: 128px;\n --mpb-choice-width-px: 155px;\n --mpb-choice-tile-min-height: 11.25rem;\n --mpb-choice-content-min-height: 9.375rem;\n --mpb-choice-hover-bg: #f2f2f2;\n --mpb-choice-selected-bg: #fcfcd3;\n /* r1.scss: .rli-r1-cloze { border-bottom: 6px solid } */\n --mpb-blank-underline-wide-width: 6px;\n}\n"
|
|
6170
|
+
},
|
|
6171
|
+
"sel_r1-gg_plusggg": {
|
|
6172
|
+
variantId: "sel-r1-gg-plus",
|
|
6173
|
+
variantClass: "variant-sel-r1-gg-plus",
|
|
6174
|
+
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-gg_plusggg/0.0.1/question.css",
|
|
6175
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-gg_plusggg/0.0.1/question.css */\n/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */\n.mc-populated-blank-root.variant-sel-r1-gg-plus {\n max-width: 875px;\n margin-inline: auto;\n --mpb-listen-button-size: 128px;\n --mpb-choice-width-px: 155px;\n --mpb-choice-tile-min-height: 11.25rem;\n --mpb-choice-content-min-height: 9.375rem;\n --mpb-choice-hover-bg: #f2f2f2;\n --mpb-choice-selected-bg: #fcfcd3;\n}\n"
|
|
6176
|
+
},
|
|
6177
|
+
"sel_r1-_ggplusggg": {
|
|
6178
|
+
variantId: "sel-r1-ggplus",
|
|
6179
|
+
variantClass: "variant-sel-r1-ggplus",
|
|
6180
|
+
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_ggplusggg/0.0.1/question.css",
|
|
6181
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_ggplusggg/0.0.1/question.css */\n/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */\n.mc-populated-blank-root.variant-sel-r1-ggplus {\n max-width: 875px;\n margin-inline: auto;\n --mpb-listen-button-size: 128px;\n --mpb-choice-width-px: 155px;\n --mpb-choice-tile-min-height: 11.25rem;\n --mpb-choice-content-min-height: 9.375rem;\n --mpb-choice-hover-bg: #f2f2f2;\n --mpb-choice-selected-bg: #fcfcd3;\n}\n\n/* In this variant, the blank appears before trailing tokens; avoid left-margin offset. */\n.mc-populated-blank-root.variant-sel-r1-ggplus.layout-token_sequence .pie-blank-slot {\n margin-left: 0;\n}\n"
|
|
6182
|
+
},
|
|
6183
|
+
"sel_r1-s3_plusggg": {
|
|
6184
|
+
variantId: "sel-r1-s3",
|
|
6185
|
+
variantClass: "variant-sel-r1-s3",
|
|
6186
|
+
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css",
|
|
6187
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css */\n/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */\n.mc-populated-blank-root.variant-sel-r1-s3 {\n max-width: 860px;\n margin-inline: auto;\n --mpb-listen-button-size: 128px;\n --mpb-choice-width-px: 155px;\n --mpb-choice-tile-min-height: 11.25rem;\n --mpb-choice-content-min-height: 9.375rem;\n --mpb-choice-group-gap: 0.35rem;\n --mpb-choice-row-gap: 0.35rem;\n --mpb-horizontal-choice-radio-top-margin: 0.25rem;\n --mpb-stimulus-min-column: 240px;\n --mpb-stimulus-grid-column-gap: 1.1rem;\n --mpb-stimulus-choices-margin-top: 0.85rem;\n --mpb-audio-blank-template-margin-bottom: 0.9rem;\n --mpb-blank-wide-width: 6.8rem;\n}\n\n/* s3 overrides base choice-label with font-weight:500 */\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label,\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label :is(span, p, div) {\n font-size: 1.9em;\n line-height: 89px;\n font-weight: 500;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value,\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value :is(span, p, div) {\n line-height: 1.1;\n white-space: nowrap;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-tile {\n border-radius: 6px;\n background: #f1f1f1;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank {\n grid-template-columns: minmax(220px, auto) auto auto;\n grid-template-areas:\n \"transcript transcript transcript\"\n \"sentence template audio\"\n \"choices choices choices\";\n justify-content: center;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-template-line {\n grid-area: template;\n justify-self: center;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-sentence-line {\n justify-self: end;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-audio-container {\n justify-self: start;\n align-self: start;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-choices-fieldset {\n justify-self: center;\n width: fit-content;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-sentence-line img {\n max-width: 100%;\n height: auto;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal:hover .pie-choice-tile {\n background: #e2e2e2;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal.is-selected .pie-choice-tile,\n.mc-populated-blank-root.variant-sel-r1-s3\n .pie-choice-horizontal.is-selected:hover\n .pie-choice-tile {\n background: #fcfcd3;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-radio {\n transform: scale(0.85);\n}\n"
|
|
6188
|
+
}
|
|
6189
|
+
};
|
|
6190
|
+
var normalizeCustomType = (value) => {
|
|
6191
|
+
return String(value || "").trim().toLowerCase().replace(/v\d+\.\d+\.\d+$/i, "");
|
|
6192
|
+
};
|
|
6193
|
+
var getVariantCssConfig = (customType) => {
|
|
6194
|
+
return VARIANT_BY_CUSTOM_TYPE[normalizeCustomType(customType)];
|
|
6195
|
+
};
|
|
6196
|
+
var getVariantRootClass = (customType) => {
|
|
6197
|
+
return getVariantCssConfig(customType)?.variantClass || "";
|
|
6198
|
+
};
|
|
6199
|
+
var SEL_R1_VARIANT_IDS = new Set([
|
|
6200
|
+
"sel-r1-plusggg",
|
|
6201
|
+
"sel-r1-gplusggg",
|
|
6202
|
+
"sel-r1-g-stem",
|
|
6203
|
+
"sel-r1-gg-plus",
|
|
6204
|
+
"sel-r1-ggplus",
|
|
6205
|
+
"sel-r1-s3"
|
|
6206
|
+
]);
|
|
6207
|
+
var injectStyleOnce = (id, variantName, cssText) => {
|
|
6208
|
+
const existing = document.getElementById(id);
|
|
6209
|
+
if (existing) {
|
|
6210
|
+
if (existing.textContent !== cssText) existing.textContent = cssText;
|
|
6211
|
+
return;
|
|
6212
|
+
}
|
|
6213
|
+
const style = document.createElement("style");
|
|
6214
|
+
style.id = id;
|
|
6215
|
+
style.setAttribute("data-mpb-variant", variantName);
|
|
6216
|
+
style.textContent = cssText;
|
|
6217
|
+
document.head.appendChild(style);
|
|
6218
|
+
};
|
|
6219
|
+
var ensureVariantCssInjected = (config) => {
|
|
6220
|
+
if (!config?.cssText || typeof document === "undefined") return;
|
|
6221
|
+
if (SEL_R1_VARIANT_IDS.has(config.variantId)) injectStyleOnce("mc-populated-blank-css-sel-r1-base", "sel-r1-base", sel_r1_base_default);
|
|
6222
|
+
injectStyleOnce(`mc-populated-blank-css-${config.variantId}`, config.variantId, config.cssText);
|
|
6223
|
+
};
|
|
6224
|
+
//#endregion
|
|
6225
|
+
//#region src/delivery/McPopulatedBlank.svelte
|
|
6226
|
+
var root_1 = /* @__PURE__ */ from_html(`<div class="mb-4 prose pie-prompt"></div>`);
|
|
6227
|
+
var root_2 = /* @__PURE__ */ from_html(`<p> </p>`);
|
|
6228
|
+
var root_4 = /* @__PURE__ */ from_svg(`<svg class="pie-correct-answer-toggle-svg svelte-6wlbb4" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-283 359 34 35"><circle cx="-266" cy="375.9" r="14" fill="var(--pie-correct-answer-toggle-icon-open-bg, #bce2ff)"></circle><path d="M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z" fill="var(--pie-correct-answer-toggle-icon-open-bg, #bce2ff)"></path><polygon points="-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6" fill="var(--pie-correct-answer-toggle-icon-glyph-color, #1a9cff)"></polygon></svg>`);
|
|
6229
|
+
var root_5 = /* @__PURE__ */ from_svg(`<svg class="pie-correct-answer-toggle-svg svelte-6wlbb4" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-129.5 127 34 35"><path d="M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z" fill="#D0CAC5" stroke="#E6E3E0" stroke-width="0.75"></path><path d="M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z" fill="#B3ABA4" stroke="#CDC7C2" stroke-width="0.5"></path><circle cx="-114.2" cy="143.5" r="14" fill="white"></circle><path d="M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z" fill="var(--pie-correct-answer-toggle-icon-closed-bg, #bce2ff)"></path><polygon points="-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2" fill="var(--pie-correct-answer-toggle-icon-glyph-color, #1a9cff)"></polygon></svg>`);
|
|
6230
|
+
var root_3 = /* @__PURE__ */ from_html(`<div class="pie-correct-answer-toggle-row svelte-6wlbb4"><button type="button" class="mb-3 pie-toggle-correct-answer svelte-6wlbb4" style="gap:var(--mpb-toggle-button-gap, 0.5rem);" data-testid="show-correct-answer"><span class="pie-correct-answer-toggle-content svelte-6wlbb4"><span class="pie-correct-answer-toggle-icon-holder svelte-6wlbb4" aria-hidden="true"><!></span> <span class="pie-correct-answer-toggle-label svelte-6wlbb4"> </span></span></button></div>`);
|
|
6231
|
+
var root_6 = /* @__PURE__ */ from_html(`<div class="mb-3 prose prose-p:my-1 sentence-line pie-sentence-line svelte-6wlbb4"></div>`);
|
|
6232
|
+
var root_7 = /* @__PURE__ */ from_html(`<div class="mb-4 template-line pie-template-line svelte-6wlbb4"><!> <!> <!></div>`);
|
|
6233
|
+
var root_8 = /* @__PURE__ */ from_html(`<p class="sr-only pie-result-feedback svelte-6wlbb4" role="status" aria-live="polite"> </p>`);
|
|
6234
|
+
var root = /* @__PURE__ */ from_html(`<div><!> <!> <!> <!> <!> <!> <!> <fieldset class="border-0 p-0 m-0 pie-choices-fieldset svelte-6wlbb4"><legend class="sr-only pie-choices-legend svelte-6wlbb4"> </legend> <div style="gap:var(--mpb-choice-group-gap, 0.5rem);" role="radiogroup" tabindex="-1"></div></fieldset></div>`);
|
|
6235
|
+
var $$css = {
|
|
6236
|
+
hash: "svelte-6wlbb4",
|
|
6237
|
+
code: ".sr-only.svelte-6wlbb4 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.mc-populated-blank-root.svelte-6wlbb4 .prose {max-width:none;}.pie-toggle-correct-answer.svelte-6wlbb4 {width:100%;cursor:pointer;border:0;background:transparent;padding:0;display:flex;justify-content:center;text-align:center;color:var(--pie-correct-answer-toggle-label-color, var(--pie-text, black));}.pie-correct-answer-toggle-row.svelte-6wlbb4 {width:100%;display:flex;justify-content:flex-end;}.pie-correct-answer-toggle-content.svelte-6wlbb4 {display:flex;margin:0 auto;align-items:center;}.pie-correct-answer-toggle-icon-holder.svelte-6wlbb4 {width:25px;margin-right:5px;display:inline-flex;align-items:center;justify-content:center;}.pie-correct-answer-toggle-svg.svelte-6wlbb4 {width:25px;height:25px;}.pie-correct-answer-toggle-label.svelte-6wlbb4 {width:fit-content;min-width:140px;align-self:center;vertical-align:middle;font-weight:400;user-select:none;}.pie-toggle-correct-answer.svelte-6wlbb4:hover .pie-correct-answer-toggle-label:where(.svelte-6wlbb4),\n .pie-toggle-correct-answer.svelte-6wlbb4:focus-visible .pie-correct-answer-toggle-label:where(.svelte-6wlbb4) {text-decoration:underline;}.template-line.svelte-6wlbb4 {white-space:pre-wrap;}.template-line.svelte-6wlbb4 p {margin:0;}.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container {display:flex;width:min(100%, var(--mpb-audio-instructions-max-width, 875px));margin-left:auto;margin-right:auto;justify-content:flex-end;}.layout-audio_blank_only.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {text-align:center;margin:var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);}.layout-audio_blank_only.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {display:flex;justify-content:center;}.layout-audio_blank_only.svelte-6wlbb4 .pie-blank-slot,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-blank-slot {width:var(--mpb-blank-wide-width, 10rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 6px);min-height:160px;padding-bottom:4px;}.layout-stimulus_image_blank.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;grid-template-areas:'transcript transcript'\n 'sentence audio'\n '. template'\n 'choices choices';column-gap:var(--mpb-stimulus-grid-column-gap, 2rem);row-gap:var(--mpb-stimulus-grid-row-gap, 0.7rem);align-items:start;}.layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-transcript:where(.svelte-6wlbb4) {grid-area:transcript;}.layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;}.layout-stimulus_image_blank.svelte-6wlbb4 .sentence-line:where(.svelte-6wlbb4) {grid-area:sentence;margin:var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;}.layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:0;text-align:center;justify-self:center;}.layout-stimulus_image_blank.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-stimulus-choices-margin-top, 0.9rem);}.layout-token_sequence.svelte-6wlbb4 {display:grid;grid-template-columns:1fr auto;grid-template-areas:'transcript audio'\n 'template template'\n 'choices choices';column-gap:var(--mpb-token-grid-column-gap, 1.5rem);row-gap:var(--mpb-token-grid-row-gap, 0.8rem);align-items:start;}.layout-token_sequence.svelte-6wlbb4 .pie-audio-transcript:where(.svelte-6wlbb4) {grid-area:transcript;}.layout-token_sequence.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;justify-self:end;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-token-template-margin-top, 0.6rem) 0 0;justify-self:center;text-align:center;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) span + span {margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 .pie-blank-slot {width:var(--mpb-blank-standalone-width, 7rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-token-choices-margin-top, 0.2rem);}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'transcript transcript'\n 'template audio'\n 'choices choices';column-gap:var(--mpb-inline-grid-column-gap, 1.5rem);row-gap:var(--mpb-inline-grid-row-gap, 0.65rem);align-items:start;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-transcript:where(.svelte-6wlbb4) {grid-area:transcript;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;justify-self:end;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-inline-template-margin-top, 0.45rem) 0 0;text-align:center;justify-self:center;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-inline-choices-margin-top, 0.25rem);}\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container,\n .layout-token_sequence.svelte-6wlbb4 .pie-audio-container,\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-container {width:100%;margin-left:0;margin-right:0;justify-content:flex-start;justify-self:start;}.layout-audio_blank_only.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4) {flex-direction:column;align-items:flex-start;justify-content:flex-start;}.layout-audio_blank_only.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4) {width:min(100%, var(--mpb-narrow-choice-max-width, 230px));align-items:flex-start;}\n }"
|
|
6238
|
+
};
|
|
6239
|
+
function McPopulatedBlank($$anchor, $$props) {
|
|
6240
|
+
push($$props, true);
|
|
6241
|
+
append_styles$1($$anchor, $$css);
|
|
6242
|
+
const BLANK_TOKEN = "{{blank}}";
|
|
6243
|
+
const DEFAULT_UI_TEXT = {
|
|
6244
|
+
answerChoices: "Answer choices",
|
|
6245
|
+
selectedAnswerInSentence: "Selected answer in sentence",
|
|
6246
|
+
showCorrectAnswer: "Show correct answer",
|
|
6247
|
+
hideCorrectAnswer: "Hide correct answer",
|
|
6248
|
+
clickToEnableAutoplay: "Click to enable audio autoplay",
|
|
6249
|
+
audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
|
|
6250
|
+
transcriptLabel: "Transcript"
|
|
6251
|
+
};
|
|
6252
|
+
let model = prop($$props, "model", 7), session = prop($$props, "session", 7);
|
|
6253
|
+
let localChoiceId = /* @__PURE__ */ state("");
|
|
6254
|
+
let toggleCorrectAnswerButtonEl = /* @__PURE__ */ state(null);
|
|
6255
|
+
let choicesGroupEl = /* @__PURE__ */ state(null);
|
|
6256
|
+
let rootEl = /* @__PURE__ */ state(null);
|
|
6257
|
+
let ancestorHasTranscriptClass = /* @__PURE__ */ state(false);
|
|
6258
|
+
const instanceId = `mc-populated-blank-${Math.random().toString(36).slice(2, 10)}`;
|
|
6259
|
+
const deliveryMode = /* @__PURE__ */ user_derived(() => (model()?.mode || model()?.env?.mode || "").toString());
|
|
6260
|
+
const isEvaluateMode = /* @__PURE__ */ user_derived(() => get(deliveryMode) === "evaluate");
|
|
6261
|
+
const correctness = /* @__PURE__ */ user_derived(() => model()?.correctness);
|
|
6262
|
+
const isResponseCorrect = /* @__PURE__ */ user_derived(() => typeof model()?.responseCorrect === "boolean" ? model().responseCorrect : get(correctness) === "correct");
|
|
6263
|
+
const isCorrect = /* @__PURE__ */ user_derived(() => get(correctness) === "correct");
|
|
6264
|
+
const isIncorrect = /* @__PURE__ */ user_derived(() => get(correctness) === "incorrect");
|
|
6265
|
+
let showCorrectAnswer = /* @__PURE__ */ state(false);
|
|
6266
|
+
const shouldShowCorrectAnswerToggle = /* @__PURE__ */ user_derived(() => get(isEvaluateMode) && !get(isResponseCorrect) && !!model()?.correctChoiceId);
|
|
6267
|
+
const layoutProfile = /* @__PURE__ */ user_derived(() => model()?.layoutProfile || "");
|
|
6268
|
+
const layoutProfileFlags = /* @__PURE__ */ user_derived(() => computeLayoutProfile({
|
|
6269
|
+
interactionMode: model()?.interactionMode,
|
|
6270
|
+
template: model()?.template,
|
|
6271
|
+
choiceLayout: model()?.choiceLayout,
|
|
6272
|
+
layoutProfile: get(layoutProfile),
|
|
6273
|
+
hasAudio: model()?.hasAudio,
|
|
6274
|
+
useFeatureButtonAudio: model()?.useFeatureButtonAudio
|
|
6275
|
+
}));
|
|
6276
|
+
const isAudioOnlyMode = /* @__PURE__ */ user_derived(() => get(layoutProfileFlags).isAudioOnlyMode);
|
|
6277
|
+
const isBlankOnlyTemplate = /* @__PURE__ */ user_derived(() => get(layoutProfileFlags).isBlankOnlyTemplate);
|
|
6278
|
+
const isHorizontalChoices = /* @__PURE__ */ user_derived(() => get(layoutProfileFlags).isHorizontalChoices);
|
|
6279
|
+
const hasInlineSentenceAudioLayout = /* @__PURE__ */ user_derived(() => get(layoutProfileFlags).hasInlineSentenceAudioLayout);
|
|
6280
|
+
const useFeatureButtonAudio = /* @__PURE__ */ user_derived(() => get(layoutProfileFlags).useFeatureButtonAudio);
|
|
6281
|
+
const showVisibleTranscript = /* @__PURE__ */ user_derived(() => get(ancestorHasTranscriptClass));
|
|
6282
|
+
const correctAnswerStyleVars = /* @__PURE__ */ user_derived(() => [
|
|
6283
|
+
`--pie-correct-answer-toggle-label-color:${Z.text()}`,
|
|
6284
|
+
`--pie-correct-answer-toggle-icon-open-bg:${Z.tertiaryLight()}`,
|
|
6285
|
+
`--pie-correct-answer-toggle-icon-closed-bg:${Z.backgroundDark()}`,
|
|
6286
|
+
`--pie-correct-answer-toggle-icon-glyph-color:${Z.tertiary()}`,
|
|
6287
|
+
`--pie-correct-answer-choice-hover-bg:${Z.backgroundDark()}`,
|
|
6288
|
+
`--pie-correct-answer-choice-selected-bg:${Z.secondaryBackground()}`,
|
|
6289
|
+
`--pie-correct-answer-choice-correct-bg:${Z.correctSecondary()}`,
|
|
6290
|
+
`--pie-correct-answer-choice-incorrect-bg:${Z.incorrectSecondary()}`,
|
|
6291
|
+
`--pie-correct-answer-choice-correct-border:${Z.correctTertiary()}`,
|
|
6292
|
+
`--pie-correct-answer-choice-incorrect-border:${Z.incorrectWithIcon()}`,
|
|
6293
|
+
`--pie-correct-answer-feedback-correct-bg:${Z.correctWithIcon()}`,
|
|
6294
|
+
`--pie-correct-answer-feedback-incorrect-bg:${Z.incorrectWithIcon()}`,
|
|
6295
|
+
`--pie-correct-answer-feedback-glyph-color:${Z.white()}`
|
|
6296
|
+
].join(";"));
|
|
6297
|
+
const layout = /* @__PURE__ */ user_derived(() => computeLayoutStyle({
|
|
6298
|
+
layoutProfile: get(layoutProfile),
|
|
6299
|
+
isBlankOnlyTemplate: get(isBlankOnlyTemplate),
|
|
6300
|
+
configuredLimits: model()?.layoutLimits,
|
|
6301
|
+
customProfilePresets: model()?.layoutProfilePresets,
|
|
6302
|
+
correctAnswerStyleVars: get(correctAnswerStyleVars)
|
|
6303
|
+
}));
|
|
6304
|
+
const choices = /* @__PURE__ */ user_derived(() => Array.isArray(model()?.choices) ? model().choices : []);
|
|
6305
|
+
const choiceMode = /* @__PURE__ */ user_derived(() => model()?.choiceMode || "text");
|
|
6306
|
+
const selectedId = /* @__PURE__ */ user_derived(() => session()?.choiceId || get(localChoiceId) || "");
|
|
6307
|
+
const radioGroupName = /* @__PURE__ */ user_derived(() => `${instanceId}-choice-group-${model()?.id || "1"}`);
|
|
6308
|
+
const displayChoiceId = /* @__PURE__ */ user_derived(() => computeDisplayChoiceId({
|
|
6309
|
+
selectedId: get(selectedId),
|
|
6310
|
+
isEvaluateMode: get(isEvaluateMode),
|
|
6311
|
+
showCorrectAnswer: get(showCorrectAnswer),
|
|
6312
|
+
alwaysShowCorrect: !!model()?.alwaysShowCorrect,
|
|
6313
|
+
correctChoiceId: String(model()?.correctChoiceId || "")
|
|
6314
|
+
}));
|
|
6315
|
+
const displayChoice = /* @__PURE__ */ user_derived(() => get(choices).find((c) => c.id === get(displayChoiceId)));
|
|
6316
|
+
const displayChoiceLabelHtml = /* @__PURE__ */ user_derived(() => String(get(displayChoice)?.labelHtml || ""));
|
|
6317
|
+
const resultText = /* @__PURE__ */ user_derived(() => computeResultText({
|
|
6318
|
+
isEvaluateMode: get(isEvaluateMode),
|
|
6319
|
+
showCorrectAnswer: get(showCorrectAnswer),
|
|
6320
|
+
isCorrect: get(isCorrect),
|
|
6321
|
+
isIncorrect: get(isIncorrect),
|
|
6322
|
+
selectedId: get(selectedId)
|
|
6323
|
+
}));
|
|
6324
|
+
const choiceCorrectnessById = /* @__PURE__ */ user_derived(() => computeChoiceCorrectness({
|
|
6325
|
+
isEvaluateMode: get(isEvaluateMode),
|
|
6326
|
+
correctChoiceId: String(model()?.correctChoiceId || ""),
|
|
6327
|
+
selectedId: String(get(selectedId) || ""),
|
|
6328
|
+
showCorrectAnswer: get(showCorrectAnswer)
|
|
6329
|
+
}));
|
|
6330
|
+
const uiText = /* @__PURE__ */ user_derived(() => ({
|
|
6331
|
+
...DEFAULT_UI_TEXT,
|
|
6332
|
+
...model()?.uiText || {}
|
|
6333
|
+
}));
|
|
6334
|
+
const promptId = /* @__PURE__ */ user_derived(() => `${instanceId}-prompt`);
|
|
6335
|
+
const transcriptId = /* @__PURE__ */ user_derived(() => `${instanceId}-transcript`);
|
|
6336
|
+
const legendId = /* @__PURE__ */ user_derived(() => `${instanceId}-choices-legend`);
|
|
6337
|
+
const resultId = /* @__PURE__ */ user_derived(() => `${instanceId}-result`);
|
|
6338
|
+
const legendText = /* @__PURE__ */ user_derived(() => computeLegendText({
|
|
6339
|
+
prompt: model()?.prompt || "",
|
|
6340
|
+
legendMaxChars: get(layout).legendMaxChars,
|
|
6341
|
+
answerChoicesLabel: get(uiText).answerChoices
|
|
6342
|
+
}));
|
|
6343
|
+
const choicesGroupLabelledBy = /* @__PURE__ */ user_derived(() => model()?.prompt ? get(promptId) : void 0);
|
|
6344
|
+
const choicesGroupAriaLabel = /* @__PURE__ */ user_derived(() => {
|
|
6345
|
+
if (model()?.prompt) return void 0;
|
|
6346
|
+
const explicit = String(model()?.choiceGroupLabel || "").trim();
|
|
6347
|
+
if (explicit) return explicit;
|
|
6348
|
+
return get(legendText);
|
|
6349
|
+
});
|
|
6350
|
+
const templateDescribedBy = /* @__PURE__ */ user_derived(() => {
|
|
6351
|
+
const ids = [];
|
|
6352
|
+
if (model()?.prompt) ids.push(get(promptId));
|
|
6353
|
+
if (model()?.hasAudio && model()?.audioTranscript) ids.push(get(transcriptId));
|
|
6354
|
+
return ids.length ? ids.join(" ") : void 0;
|
|
6355
|
+
});
|
|
6356
|
+
const lang = /* @__PURE__ */ user_derived(() => {
|
|
6357
|
+
const locale = model()?.locale || "";
|
|
6358
|
+
return locale ? locale.slice(0, 2) : "en";
|
|
6359
|
+
});
|
|
6360
|
+
const variantCssConfig = /* @__PURE__ */ user_derived(() => getVariantCssConfig(model()?.customType));
|
|
6361
|
+
const variantRootClass = /* @__PURE__ */ user_derived(() => getVariantRootClass(model()?.customType));
|
|
6362
|
+
const templateParts = /* @__PURE__ */ user_derived(() => {
|
|
6363
|
+
const t = model()?.template || "";
|
|
6364
|
+
const idx = t.indexOf(BLANK_TOKEN);
|
|
6365
|
+
if (idx < 0) return {
|
|
6366
|
+
before: t,
|
|
6367
|
+
after: ""
|
|
6368
|
+
};
|
|
6369
|
+
return {
|
|
6370
|
+
before: t.slice(0, idx),
|
|
6371
|
+
after: t.slice(idx + 9)
|
|
6372
|
+
};
|
|
6373
|
+
});
|
|
6374
|
+
function emitSession(updatedSession, sourceEl) {
|
|
6375
|
+
r({
|
|
6376
|
+
sourceEl,
|
|
6377
|
+
fallbackSelector: "mc-populated-blank",
|
|
6378
|
+
component: "mc-populated-blank",
|
|
6379
|
+
session: updatedSession,
|
|
6380
|
+
complete: !!updatedSession?.choiceId
|
|
6381
|
+
});
|
|
6382
|
+
}
|
|
6383
|
+
function onRadioChange(e) {
|
|
6384
|
+
const input = e.target;
|
|
6385
|
+
if (!input.checked) return;
|
|
6386
|
+
const choiceId = input.value;
|
|
6387
|
+
set(localChoiceId, choiceId, true);
|
|
6388
|
+
emitSession({
|
|
6389
|
+
...session(),
|
|
6390
|
+
id: session()?.id || model()?.id || "1",
|
|
6391
|
+
element: "mc-populated-blank",
|
|
6392
|
+
choiceId
|
|
6393
|
+
}, input);
|
|
6394
|
+
}
|
|
6395
|
+
function toggleCorrectAnswer() {
|
|
6396
|
+
if (!get(shouldShowCorrectAnswerToggle)) return;
|
|
6397
|
+
set(showCorrectAnswer, !get(showCorrectAnswer));
|
|
6398
|
+
}
|
|
6399
|
+
user_effect(() => {
|
|
6400
|
+
if (!get(isEvaluateMode) || get(isResponseCorrect)) set(showCorrectAnswer, false);
|
|
6401
|
+
});
|
|
6402
|
+
function onRadioGroupKeydown(e) {
|
|
6403
|
+
if (model()?.disabled) return;
|
|
6404
|
+
const key = e.key;
|
|
6405
|
+
if (![
|
|
6406
|
+
"ArrowDown",
|
|
6407
|
+
"ArrowRight",
|
|
6408
|
+
"ArrowUp",
|
|
6409
|
+
"ArrowLeft"
|
|
6410
|
+
].includes(key)) return;
|
|
6411
|
+
e.preventDefault();
|
|
6412
|
+
const container = e.currentTarget;
|
|
6413
|
+
const inputs = Array.from(container.querySelectorAll("input[type=\"radio\"]:not([disabled])"));
|
|
5487
6414
|
if (inputs.length === 0) return;
|
|
5488
6415
|
let idx = inputs.findIndex((i) => i.checked);
|
|
5489
6416
|
if (key === "ArrowDown" || key === "ArrowRight") idx = idx < 0 ? 0 : (idx + 1) % inputs.length;
|
|
@@ -5493,86 +6420,25 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5493
6420
|
next.dispatchEvent(new Event("change", { bubbles: true }));
|
|
5494
6421
|
next.focus();
|
|
5495
6422
|
}
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
6423
|
+
const featureAudioSkin = /* @__PURE__ */ user_derived(() => computeFeatureAudioSkin({
|
|
6424
|
+
locale: model()?.locale,
|
|
6425
|
+
audioButtonSkin: model()?.audioButtonSkin,
|
|
6426
|
+
audioButtonSkinsByLocale: model()?.audioButtonSkinsByLocale
|
|
6427
|
+
}));
|
|
6428
|
+
function onAudioStarted() {
|
|
6429
|
+
n(get(rootEl), { fallbackSelector: "mc-populated-blank" })?.onAudioStarted?.();
|
|
5500
6430
|
}
|
|
5501
|
-
function
|
|
5502
|
-
|
|
5503
|
-
set(isMediaPlaying, true);
|
|
5504
|
-
host?.onAudioStarted?.();
|
|
5505
|
-
set(autoPlayPromptOpen, false);
|
|
5506
|
-
}
|
|
5507
|
-
function onAudioEnded(e) {
|
|
5508
|
-
const host = getHostElement(e.currentTarget);
|
|
5509
|
-
set(isMediaPlaying, false);
|
|
5510
|
-
host?.onAudioEnded?.();
|
|
5511
|
-
}
|
|
5512
|
-
function getHostElement(sourceEl) {
|
|
5513
|
-
let cursor = sourceEl;
|
|
5514
|
-
while (cursor) {
|
|
5515
|
-
const maybeHost = cursor;
|
|
5516
|
-
if (typeof maybeHost?.onSessionChange === "function" || typeof maybeHost?.onAudioStarted === "function" || typeof maybeHost?.onAudioEnded === "function") return maybeHost;
|
|
5517
|
-
cursor = cursor.parentElement;
|
|
5518
|
-
}
|
|
5519
|
-
return document.querySelector("mc-populated-blank") || null;
|
|
5520
|
-
}
|
|
5521
|
-
function speechButtonLabel(locale = "") {
|
|
5522
|
-
return locale.toLowerCase().startsWith("es") ? get(uiText).listenLabelEs : get(uiText).listenLabelEn;
|
|
5523
|
-
}
|
|
5524
|
-
const featureAudioSkin = /* @__PURE__ */ user_derived(() => {
|
|
5525
|
-
const locale = String(model()?.locale || "").toLowerCase();
|
|
5526
|
-
const lang = locale.slice(0, 2);
|
|
5527
|
-
const byLocale = model()?.audioButtonSkinsByLocale && typeof model().audioButtonSkinsByLocale === "object" ? model().audioButtonSkinsByLocale : {};
|
|
5528
|
-
const customSingle = model()?.audioButtonSkin && typeof model().audioButtonSkin === "object" ? model().audioButtonSkin : null;
|
|
5529
|
-
const defaultSkin = locale.startsWith("es") ? DEFAULT_AUDIO_BUTTON_SKINS.es : DEFAULT_AUDIO_BUTTON_SKINS.default;
|
|
5530
|
-
return byLocale[locale] || byLocale[lang] || byLocale.default || customSingle || defaultSkin;
|
|
5531
|
-
});
|
|
5532
|
-
function playFeatureAudio() {
|
|
5533
|
-
if (get(hasPlayableAudio) && get(audioEl)) get(audioEl).play().catch(() => {});
|
|
6431
|
+
function onAudioEnded() {
|
|
6432
|
+
n(get(rootEl), { fallbackSelector: "mc-populated-blank" })?.onAudioEnded?.();
|
|
5534
6433
|
}
|
|
5535
6434
|
user_effect(() => {
|
|
5536
6435
|
if (session()?.choiceId) set(localChoiceId, session().choiceId, true);
|
|
5537
6436
|
});
|
|
5538
|
-
user_effect(() => {
|
|
5539
|
-
const el = get(audioEl);
|
|
5540
|
-
if (!el) return;
|
|
5541
|
-
const handlePlaying = (e) => onAudioPlaying(e);
|
|
5542
|
-
const handleEnded = (e) => onAudioEnded(e);
|
|
5543
|
-
el.addEventListener("playing", handlePlaying);
|
|
5544
|
-
el.addEventListener("ended", handleEnded);
|
|
5545
|
-
return () => {
|
|
5546
|
-
el.removeEventListener("playing", handlePlaying);
|
|
5547
|
-
el.removeEventListener("ended", handleEnded);
|
|
5548
|
-
};
|
|
5549
|
-
});
|
|
5550
|
-
user_effect(() => {
|
|
5551
|
-
const btn = get(featureAudioButtonEl);
|
|
5552
|
-
if (!btn) return;
|
|
5553
|
-
const handleClick = () => playFeatureAudio();
|
|
5554
|
-
btn.addEventListener("click", handleClick);
|
|
5555
|
-
return () => {
|
|
5556
|
-
btn.removeEventListener("click", handleClick);
|
|
5557
|
-
};
|
|
5558
|
-
});
|
|
5559
|
-
user_effect(() => {
|
|
5560
|
-
const btn = get(autoplayEnableButtonEl);
|
|
5561
|
-
if (!btn) return;
|
|
5562
|
-
const handleClick = () => handleEnableAutoplayClick();
|
|
5563
|
-
btn.addEventListener("click", handleClick);
|
|
5564
|
-
return () => {
|
|
5565
|
-
btn.removeEventListener("click", handleClick);
|
|
5566
|
-
};
|
|
5567
|
-
});
|
|
5568
6437
|
user_effect(() => {
|
|
5569
6438
|
const btn = get(toggleCorrectAnswerButtonEl);
|
|
5570
6439
|
if (!btn) return;
|
|
5571
|
-
|
|
5572
|
-
btn.
|
|
5573
|
-
return () => {
|
|
5574
|
-
btn.removeEventListener("click", handleClick);
|
|
5575
|
-
};
|
|
6440
|
+
btn.addEventListener("click", toggleCorrectAnswer);
|
|
6441
|
+
return () => btn.removeEventListener("click", toggleCorrectAnswer);
|
|
5576
6442
|
});
|
|
5577
6443
|
user_effect(() => {
|
|
5578
6444
|
const group = get(choicesGroupEl);
|
|
@@ -5591,12 +6457,25 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5591
6457
|
};
|
|
5592
6458
|
});
|
|
5593
6459
|
user_effect(() => {
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
6460
|
+
ensureVariantCssInjected(get(variantCssConfig));
|
|
6461
|
+
});
|
|
6462
|
+
user_effect(() => {
|
|
6463
|
+
const el = get(rootEl);
|
|
6464
|
+
if (!el) return;
|
|
6465
|
+
const check = () => {
|
|
6466
|
+
set(ancestorHasTranscriptClass, !!el.closest(".rli-with-audio-transcript"));
|
|
6467
|
+
};
|
|
6468
|
+
check();
|
|
6469
|
+
const observer = new MutationObserver(check);
|
|
6470
|
+
let node = el.parentElement;
|
|
6471
|
+
while (node) {
|
|
6472
|
+
observer.observe(node, {
|
|
6473
|
+
attributes: true,
|
|
6474
|
+
attributeFilter: ["class"]
|
|
6475
|
+
});
|
|
6476
|
+
node = node.parentElement;
|
|
6477
|
+
}
|
|
6478
|
+
return () => observer.disconnect();
|
|
5600
6479
|
});
|
|
5601
6480
|
var $$exports = {
|
|
5602
6481
|
get model() {
|
|
@@ -5615,7 +6494,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5615
6494
|
}
|
|
5616
6495
|
};
|
|
5617
6496
|
var div = root();
|
|
5618
|
-
var
|
|
6497
|
+
var node_1 = child(div);
|
|
5619
6498
|
var consequent = ($$anchor) => {
|
|
5620
6499
|
var div_1 = root_1();
|
|
5621
6500
|
html(div_1, () => model().prompt, true);
|
|
@@ -5623,29 +6502,44 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5623
6502
|
template_effect(() => set_attribute(div_1, "id", get(promptId)));
|
|
5624
6503
|
append($$anchor, div_1);
|
|
5625
6504
|
};
|
|
5626
|
-
if_block(
|
|
6505
|
+
if_block(node_1, ($$render) => {
|
|
5627
6506
|
if (model()?.prompt) $$render(consequent);
|
|
5628
6507
|
});
|
|
5629
|
-
var
|
|
5630
|
-
var
|
|
5631
|
-
var
|
|
6508
|
+
var node_2 = sibling(node_1, 2);
|
|
6509
|
+
var consequent_1 = ($$anchor) => {
|
|
6510
|
+
var p = root_2();
|
|
6511
|
+
var text = child(p, true);
|
|
6512
|
+
reset(p);
|
|
6513
|
+
template_effect(() => {
|
|
6514
|
+
set_class(p, 1, `text-sm mb-3 text-gray-700 text-center pie-audio-transcript ${get(showVisibleTranscript) ? "" : "sr-only"}`, "svelte-6wlbb4");
|
|
6515
|
+
set_attribute(p, "id", get(transcriptId));
|
|
6516
|
+
set_text(text, model().audioTranscript);
|
|
6517
|
+
});
|
|
6518
|
+
append($$anchor, p);
|
|
6519
|
+
};
|
|
6520
|
+
if_block(node_2, ($$render) => {
|
|
6521
|
+
if (model()?.audioTranscript) $$render(consequent_1);
|
|
6522
|
+
});
|
|
6523
|
+
var node_3 = sibling(node_2, 2);
|
|
6524
|
+
var consequent_3 = ($$anchor) => {
|
|
6525
|
+
var div_2 = root_3();
|
|
5632
6526
|
var button = child(div_2);
|
|
5633
6527
|
var span = child(button);
|
|
5634
6528
|
var span_1 = child(span);
|
|
5635
|
-
var
|
|
5636
|
-
var
|
|
5637
|
-
append($$anchor,
|
|
6529
|
+
var node_4 = child(span_1);
|
|
6530
|
+
var consequent_2 = ($$anchor) => {
|
|
6531
|
+
append($$anchor, root_4());
|
|
5638
6532
|
};
|
|
5639
6533
|
var alternate = ($$anchor) => {
|
|
5640
|
-
append($$anchor,
|
|
6534
|
+
append($$anchor, root_5());
|
|
5641
6535
|
};
|
|
5642
|
-
if_block(
|
|
5643
|
-
if (get(showCorrectAnswer)) $$render(
|
|
6536
|
+
if_block(node_4, ($$render) => {
|
|
6537
|
+
if (get(showCorrectAnswer)) $$render(consequent_2);
|
|
5644
6538
|
else $$render(alternate, -1);
|
|
5645
6539
|
});
|
|
5646
6540
|
reset(span_1);
|
|
5647
6541
|
var span_2 = sibling(span_1, 2);
|
|
5648
|
-
var
|
|
6542
|
+
var text_1 = child(span_2, true);
|
|
5649
6543
|
reset(span_2);
|
|
5650
6544
|
reset(span);
|
|
5651
6545
|
reset(button);
|
|
@@ -5653,300 +6547,190 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5653
6547
|
reset(div_2);
|
|
5654
6548
|
template_effect(() => {
|
|
5655
6549
|
set_attribute(button, "aria-pressed", get(showCorrectAnswer));
|
|
5656
|
-
set_text(
|
|
6550
|
+
set_text(text_1, get(showCorrectAnswer) ? get(uiText).hideCorrectAnswer : get(uiText).showCorrectAnswer);
|
|
5657
6551
|
});
|
|
5658
6552
|
append($$anchor, div_2);
|
|
5659
6553
|
};
|
|
5660
|
-
if_block(
|
|
5661
|
-
if (get(shouldShowCorrectAnswerToggle)) $$render(
|
|
6554
|
+
if_block(node_3, ($$render) => {
|
|
6555
|
+
if (get(shouldShowCorrectAnswerToggle)) $$render(consequent_3);
|
|
5662
6556
|
});
|
|
5663
|
-
var
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
set_attribute(audio_1, "src", model().audioUrl);
|
|
5704
|
-
set_attribute(audio_1, "aria-describedby", model()?.audioTranscript ? get(transcriptId) : void 0);
|
|
5705
|
-
});
|
|
5706
|
-
append($$anchor, fragment_1);
|
|
5707
|
-
};
|
|
5708
|
-
var consequent_6 = ($$anchor) => {
|
|
5709
|
-
var p = root_9();
|
|
5710
|
-
var text_2 = child(p, true);
|
|
5711
|
-
reset(p);
|
|
5712
|
-
template_effect(() => set_text(text_2, get(audioErrorMessage)));
|
|
5713
|
-
append($$anchor, p);
|
|
5714
|
-
};
|
|
5715
|
-
if_block(node_4, ($$render) => {
|
|
5716
|
-
if (get(hasPlayableAudio) && get(useFeatureButtonAudio)) $$render(consequent_3);
|
|
5717
|
-
else if (get(hasPlayableAudio)) $$render(consequent_5, 1);
|
|
5718
|
-
else if (get(hasAudioButMissingResource)) $$render(consequent_6, 2);
|
|
5719
|
-
});
|
|
5720
|
-
var node_6 = sibling(node_4, 2);
|
|
5721
|
-
var consequent_7 = ($$anchor) => {
|
|
5722
|
-
var p_1 = root_10();
|
|
5723
|
-
var strong = child(p_1);
|
|
5724
|
-
var text_3 = child(strong);
|
|
5725
|
-
reset(strong);
|
|
5726
|
-
var text_4 = sibling(strong);
|
|
5727
|
-
reset(p_1);
|
|
5728
|
-
template_effect(() => {
|
|
5729
|
-
set_class(p_1, 1, `text-sm mt-2 text-gray-700 pie-audio-transcript ${get(showVisibleTranscript) ? "" : "sr-only"}`, "svelte-6wlbb4");
|
|
5730
|
-
set_attribute(p_1, "id", get(transcriptId));
|
|
5731
|
-
set_text(text_3, `${get(uiText).transcriptLabel ?? ""}:`);
|
|
5732
|
-
set_text(text_4, ` ${model().audioTranscript ?? ""}`);
|
|
5733
|
-
});
|
|
5734
|
-
append($$anchor, p_1);
|
|
5735
|
-
};
|
|
5736
|
-
if_block(node_6, ($$render) => {
|
|
5737
|
-
if (model()?.audioTranscript) $$render(consequent_7);
|
|
6557
|
+
var node_5 = sibling(node_3, 2);
|
|
6558
|
+
{
|
|
6559
|
+
let $0 = /* @__PURE__ */ user_derived(() => !!model()?.hasAudio);
|
|
6560
|
+
let $1 = /* @__PURE__ */ user_derived(() => model()?.audioUrl);
|
|
6561
|
+
let $2 = /* @__PURE__ */ user_derived(() => !!model()?.autoplayAudioEnabled);
|
|
6562
|
+
let $3 = /* @__PURE__ */ user_derived(() => model()?.audioTranscript);
|
|
6563
|
+
let $4 = /* @__PURE__ */ user_derived(() => model()?.locale);
|
|
6564
|
+
AudioPlayer(node_5, {
|
|
6565
|
+
get hasAudio() {
|
|
6566
|
+
return get($0);
|
|
6567
|
+
},
|
|
6568
|
+
get audioUrl() {
|
|
6569
|
+
return get($1);
|
|
6570
|
+
},
|
|
6571
|
+
get useFeatureButtonAudio() {
|
|
6572
|
+
return get(useFeatureButtonAudio);
|
|
6573
|
+
},
|
|
6574
|
+
get autoplayEnabled() {
|
|
6575
|
+
return get($2);
|
|
6576
|
+
},
|
|
6577
|
+
get audioTranscript() {
|
|
6578
|
+
return get($3);
|
|
6579
|
+
},
|
|
6580
|
+
get showVisibleTranscript() {
|
|
6581
|
+
return get(showVisibleTranscript);
|
|
6582
|
+
},
|
|
6583
|
+
get transcriptId() {
|
|
6584
|
+
return get(transcriptId);
|
|
6585
|
+
},
|
|
6586
|
+
get featureAudioSkin() {
|
|
6587
|
+
return get(featureAudioSkin);
|
|
6588
|
+
},
|
|
6589
|
+
get uiText() {
|
|
6590
|
+
return get(uiText);
|
|
6591
|
+
},
|
|
6592
|
+
get locale() {
|
|
6593
|
+
return get($4);
|
|
6594
|
+
},
|
|
6595
|
+
onaudiostarted: onAudioStarted,
|
|
6596
|
+
onaudioended: onAudioEnded
|
|
5738
6597
|
});
|
|
6598
|
+
}
|
|
6599
|
+
var node_6 = sibling(node_5, 2);
|
|
6600
|
+
var consequent_4 = ($$anchor) => {
|
|
6601
|
+
var div_3 = root_6();
|
|
6602
|
+
html(div_3, () => model().sentenceHtml, true);
|
|
5739
6603
|
reset(div_3);
|
|
6604
|
+
template_effect(() => set_attribute(div_3, "aria-describedby", get(templateDescribedBy)));
|
|
5740
6605
|
append($$anchor, div_3);
|
|
5741
6606
|
};
|
|
5742
|
-
if_block(
|
|
5743
|
-
if (model()?.
|
|
6607
|
+
if_block(node_6, ($$render) => {
|
|
6608
|
+
if (model()?.sentenceHtml) $$render(consequent_4);
|
|
5744
6609
|
});
|
|
5745
|
-
var node_7 = sibling(
|
|
5746
|
-
var
|
|
5747
|
-
var div_4 =
|
|
5748
|
-
|
|
6610
|
+
var node_7 = sibling(node_6, 2);
|
|
6611
|
+
var consequent_5 = ($$anchor) => {
|
|
6612
|
+
var div_4 = root_7();
|
|
6613
|
+
var node_8 = child(div_4);
|
|
6614
|
+
html(node_8, () => get(templateParts).before);
|
|
6615
|
+
var node_9 = sibling(node_8, 2);
|
|
6616
|
+
ClozeMarker(node_9, {
|
|
6617
|
+
get choiceMode() {
|
|
6618
|
+
return get(choiceMode);
|
|
6619
|
+
},
|
|
6620
|
+
get displayChoice() {
|
|
6621
|
+
return get(displayChoice);
|
|
6622
|
+
},
|
|
6623
|
+
get displayChoiceLabelHtml() {
|
|
6624
|
+
return get(displayChoiceLabelHtml);
|
|
6625
|
+
},
|
|
6626
|
+
get isStandalone() {
|
|
6627
|
+
return get(isBlankOnlyTemplate);
|
|
6628
|
+
},
|
|
6629
|
+
get blankWidth() {
|
|
6630
|
+
return get(layout).blankWidth;
|
|
6631
|
+
},
|
|
6632
|
+
get blankBorderWidth() {
|
|
6633
|
+
return get(layout).blankBorderWidth;
|
|
6634
|
+
},
|
|
6635
|
+
get ariaLabel() {
|
|
6636
|
+
return get(uiText).selectedAnswerInSentence;
|
|
6637
|
+
}
|
|
6638
|
+
});
|
|
6639
|
+
html(sibling(node_9, 2), () => get(templateParts).after);
|
|
5749
6640
|
reset(div_4);
|
|
5750
6641
|
template_effect(() => set_attribute(div_4, "aria-describedby", get(templateDescribedBy)));
|
|
5751
6642
|
append($$anchor, div_4);
|
|
5752
6643
|
};
|
|
5753
6644
|
if_block(node_7, ($$render) => {
|
|
5754
|
-
if (
|
|
5755
|
-
});
|
|
5756
|
-
var node_8 = sibling(node_7, 2);
|
|
5757
|
-
var consequent_12 = ($$anchor) => {
|
|
5758
|
-
var div_5 = root_12();
|
|
5759
|
-
var node_9 = child(div_5);
|
|
5760
|
-
html(node_9, () => get(templateParts).before);
|
|
5761
|
-
var span_3 = sibling(node_9, 2);
|
|
5762
|
-
var node_10 = child(span_3);
|
|
5763
|
-
var consequent_10 = ($$anchor) => {
|
|
5764
|
-
var img_2 = root_13();
|
|
5765
|
-
template_effect(() => {
|
|
5766
|
-
set_attribute(img_2, "src", get(displayChoice).imageUrl);
|
|
5767
|
-
set_attribute(img_2, "alt", get(displayChoice).imageAlt || "Selected answer image");
|
|
5768
|
-
});
|
|
5769
|
-
append($$anchor, img_2);
|
|
5770
|
-
};
|
|
5771
|
-
var consequent_11 = ($$anchor) => {
|
|
5772
|
-
var span_4 = root_14();
|
|
5773
|
-
html(span_4, () => get(displayChoice).labelHtml, true);
|
|
5774
|
-
reset(span_4);
|
|
5775
|
-
append($$anchor, span_4);
|
|
5776
|
-
};
|
|
5777
|
-
var alternate_1 = ($$anchor) => {
|
|
5778
|
-
append($$anchor, root_15());
|
|
5779
|
-
};
|
|
5780
|
-
if_block(node_10, ($$render) => {
|
|
5781
|
-
if (get(choiceMode) === "image" && get(displayChoice)?.imageUrl) $$render(consequent_10);
|
|
5782
|
-
else if (get(displayChoice)?.labelHtml) $$render(consequent_11, 1);
|
|
5783
|
-
else $$render(alternate_1, -1);
|
|
5784
|
-
});
|
|
5785
|
-
reset(span_3);
|
|
5786
|
-
html(sibling(span_3, 2), () => get(templateParts).after);
|
|
5787
|
-
reset(div_5);
|
|
5788
|
-
template_effect(() => {
|
|
5789
|
-
set_attribute(div_5, "aria-describedby", get(templateDescribedBy));
|
|
5790
|
-
set_class(span_3, 1, `inline-flex items-center min-h-[1.5em] px-2 mx-1 border-b-2 border-gray-500 align-baseline blank-slot pie-blank-slot ${get(isBlankOnlyTemplate) ? "blank-slot-standalone pie-blank-slot-standalone" : ""}`, "svelte-6wlbb4");
|
|
5791
|
-
set_style(span_3, `width:${get(blankWidth)};border-bottom-width:${get(blankBorderWidth)};`);
|
|
5792
|
-
set_attribute(span_3, "aria-label", get(uiText).selectedAnswerInSentence);
|
|
5793
|
-
});
|
|
5794
|
-
append($$anchor, div_5);
|
|
5795
|
-
};
|
|
5796
|
-
if_block(node_8, ($$render) => {
|
|
5797
|
-
if (!get(isAudioOnlyMode)) $$render(consequent_12);
|
|
6645
|
+
if (!get(isAudioOnlyMode)) $$render(consequent_5);
|
|
5798
6646
|
});
|
|
5799
|
-
var
|
|
5800
|
-
var
|
|
5801
|
-
var
|
|
5802
|
-
var
|
|
5803
|
-
reset(
|
|
6647
|
+
var node_11 = sibling(node_7, 2);
|
|
6648
|
+
var consequent_6 = ($$anchor) => {
|
|
6649
|
+
var p_1 = root_8();
|
|
6650
|
+
var text_2 = child(p_1, true);
|
|
6651
|
+
reset(p_1);
|
|
5804
6652
|
template_effect(() => {
|
|
5805
|
-
set_attribute(
|
|
5806
|
-
set_text(
|
|
6653
|
+
set_attribute(p_1, "id", get(resultId));
|
|
6654
|
+
set_text(text_2, get(resultText));
|
|
5807
6655
|
});
|
|
5808
|
-
append($$anchor,
|
|
6656
|
+
append($$anchor, p_1);
|
|
5809
6657
|
};
|
|
5810
|
-
if_block(
|
|
5811
|
-
if (get(resultText)) $$render(
|
|
6658
|
+
if_block(node_11, ($$render) => {
|
|
6659
|
+
if (get(resultText)) $$render(consequent_6);
|
|
5812
6660
|
});
|
|
5813
|
-
var fieldset = sibling(
|
|
6661
|
+
var fieldset = sibling(node_11, 2);
|
|
5814
6662
|
var legend = child(fieldset);
|
|
5815
|
-
var
|
|
6663
|
+
var text_3 = child(legend, true);
|
|
5816
6664
|
reset(legend);
|
|
5817
|
-
var
|
|
5818
|
-
each(
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
set_attribute(input_1, "id", `${instanceId}-opt-${get(c).id}`);
|
|
5852
|
-
set_value(input_1, get(c).id);
|
|
5853
|
-
set_checked(input_1, (get(showCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id);
|
|
5854
|
-
input_1.disabled = model()?.disabled;
|
|
5855
|
-
});
|
|
5856
|
-
append($$anchor, label);
|
|
5857
|
-
};
|
|
5858
|
-
var alternate_4 = ($$anchor) => {
|
|
5859
|
-
var fragment_2 = root_21();
|
|
5860
|
-
var input_2 = first_child(fragment_2);
|
|
5861
|
-
remove_input_defaults(input_2);
|
|
5862
|
-
var label_1 = sibling(input_2, 2);
|
|
5863
|
-
var node_15 = child(label_1);
|
|
5864
|
-
var consequent_16 = ($$anchor) => {
|
|
5865
|
-
var img_4 = root_22();
|
|
5866
|
-
template_effect(() => {
|
|
5867
|
-
set_attribute(img_4, "src", get(c).imageUrl);
|
|
5868
|
-
set_attribute(img_4, "alt", get(c).imageAlt || `Choice ${get(c).id}`);
|
|
5869
|
-
});
|
|
5870
|
-
append($$anchor, img_4);
|
|
5871
|
-
};
|
|
5872
|
-
var alternate_3 = ($$anchor) => {
|
|
5873
|
-
var span_8 = root_23();
|
|
5874
|
-
html(span_8, () => get(c).labelHtml || "", true);
|
|
5875
|
-
reset(span_8);
|
|
5876
|
-
append($$anchor, span_8);
|
|
5877
|
-
};
|
|
5878
|
-
if_block(node_15, ($$render) => {
|
|
5879
|
-
if (get(choiceMode) === "image" && get(c).imageUrl) $$render(consequent_16);
|
|
5880
|
-
else $$render(alternate_3, -1);
|
|
5881
|
-
});
|
|
5882
|
-
reset(label_1);
|
|
5883
|
-
template_effect(() => {
|
|
5884
|
-
set_attribute(input_2, "name", get(radioGroupName));
|
|
5885
|
-
set_attribute(input_2, "id", `${instanceId}-opt-${get(c).id}`);
|
|
5886
|
-
set_value(input_2, get(c).id);
|
|
5887
|
-
set_checked(input_2, (get(showCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id);
|
|
5888
|
-
input_2.disabled = model()?.disabled;
|
|
5889
|
-
set_attribute(label_1, "for", `${instanceId}-opt-${get(c).id}`);
|
|
5890
|
-
});
|
|
5891
|
-
append($$anchor, fragment_2);
|
|
5892
|
-
};
|
|
5893
|
-
if_block(node_13, ($$render) => {
|
|
5894
|
-
if (get(isHorizontalChoices)) $$render(consequent_15);
|
|
5895
|
-
else $$render(alternate_4, -1);
|
|
5896
|
-
});
|
|
5897
|
-
var node_16 = sibling(node_13, 2);
|
|
5898
|
-
var consequent_17 = ($$anchor) => {
|
|
5899
|
-
var span_9 = root_24();
|
|
5900
|
-
var text_7 = child(span_9, true);
|
|
5901
|
-
reset(span_9);
|
|
5902
|
-
template_effect(() => {
|
|
5903
|
-
set_class(span_9, 1, `pie-choice-feedback-badge ${get(choiceCorrectness) === "correct" ? "pie-choice-feedback-correct" : "pie-choice-feedback-incorrect"}`, "svelte-6wlbb4");
|
|
5904
|
-
set_text(text_7, get(choiceCorrectness) === "correct" ? "✓" : "✕");
|
|
6665
|
+
var div_5 = sibling(legend, 2);
|
|
6666
|
+
each(div_5, 21, () => get(choices), (c) => c.id, ($$anchor, c) => {
|
|
6667
|
+
{
|
|
6668
|
+
let $0 = /* @__PURE__ */ user_derived(() => get(displayChoiceId) === get(c).id);
|
|
6669
|
+
let $1 = /* @__PURE__ */ user_derived(() => !!model()?.disabled);
|
|
6670
|
+
let $2 = /* @__PURE__ */ user_derived(() => get(choiceCorrectnessById).get(get(c).id));
|
|
6671
|
+
ChoiceRow($$anchor, {
|
|
6672
|
+
get choice() {
|
|
6673
|
+
return get(c);
|
|
6674
|
+
},
|
|
6675
|
+
get choiceMode() {
|
|
6676
|
+
return get(choiceMode);
|
|
6677
|
+
},
|
|
6678
|
+
get isHorizontal() {
|
|
6679
|
+
return get(isHorizontalChoices);
|
|
6680
|
+
},
|
|
6681
|
+
get isSelected() {
|
|
6682
|
+
return get($0);
|
|
6683
|
+
},
|
|
6684
|
+
get isDisabled() {
|
|
6685
|
+
return get($1);
|
|
6686
|
+
},
|
|
6687
|
+
get correctness() {
|
|
6688
|
+
return get($2);
|
|
6689
|
+
},
|
|
6690
|
+
get isEvaluateMode() {
|
|
6691
|
+
return get(isEvaluateMode);
|
|
6692
|
+
},
|
|
6693
|
+
get instanceId() {
|
|
6694
|
+
return instanceId;
|
|
6695
|
+
},
|
|
6696
|
+
get radioGroupName() {
|
|
6697
|
+
return get(radioGroupName);
|
|
6698
|
+
}
|
|
5905
6699
|
});
|
|
5906
|
-
|
|
5907
|
-
};
|
|
5908
|
-
if_block(node_16, ($$render) => {
|
|
5909
|
-
if (get(isEvaluateMode) && get(choiceCorrectness)) $$render(consequent_17);
|
|
5910
|
-
});
|
|
5911
|
-
reset(div_7);
|
|
5912
|
-
template_effect(() => set_class(div_7, 1, `flex items-start choice-row pie-choice ${get(isHorizontalChoices) ? "choice-row-horizontal pie-choice-horizontal" : ""} ${(get(showCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id ? "is-selected pie-choice-selected" : ""} ${get(choiceCorrectness) ? `choice-${get(choiceCorrectness)} pie-choice-${get(choiceCorrectness)}` : ""}`, "svelte-6wlbb4"));
|
|
5913
|
-
append($$anchor, div_7);
|
|
6700
|
+
}
|
|
5914
6701
|
});
|
|
5915
|
-
reset(
|
|
5916
|
-
bind_this(
|
|
6702
|
+
reset(div_5);
|
|
6703
|
+
bind_this(div_5, ($$value) => set(choicesGroupEl, $$value), () => get(choicesGroupEl));
|
|
5917
6704
|
reset(fieldset);
|
|
5918
6705
|
reset(div);
|
|
6706
|
+
bind_this(div, ($$value) => set(rootEl, $$value), () => get(rootEl));
|
|
5919
6707
|
template_effect(() => {
|
|
5920
|
-
set_class(div, 1, `p-4 mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${get(layoutProfile)} ${get(hasInlineSentenceAudioLayout) ? "has-inline-audio" : ""}`, "svelte-6wlbb4");
|
|
6708
|
+
set_class(div, 1, `p-4 mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${get(layoutProfile)} ${get(variantRootClass)} ${get(hasInlineSentenceAudioLayout) ? "has-inline-audio" : ""}`, "svelte-6wlbb4");
|
|
5921
6709
|
set_attribute(div, "lang", get(lang));
|
|
5922
|
-
set_style(div, get(rootStyle)
|
|
6710
|
+
set_style(div, get(layout).rootStyle);
|
|
5923
6711
|
fieldset.disabled = model()?.disabled;
|
|
5924
6712
|
set_attribute(legend, "id", get(legendId));
|
|
5925
|
-
set_text(
|
|
5926
|
-
set_class(
|
|
5927
|
-
set_attribute(
|
|
5928
|
-
set_attribute(
|
|
5929
|
-
set_attribute(
|
|
6713
|
+
set_text(text_3, get(legendText));
|
|
6714
|
+
set_class(div_5, 1, `pie-choices ${get(isHorizontalChoices) ? "flex flex-row flex-wrap items-start justify-center" : "flex flex-col"}`, "svelte-6wlbb4");
|
|
6715
|
+
set_attribute(div_5, "aria-labelledby", get(choicesGroupLabelledBy));
|
|
6716
|
+
set_attribute(div_5, "aria-label", get(choicesGroupAriaLabel));
|
|
6717
|
+
set_attribute(div_5, "aria-describedby", get(resultText) ? get(resultId) : void 0);
|
|
5930
6718
|
});
|
|
5931
6719
|
append($$anchor, div);
|
|
5932
6720
|
return pop($$exports);
|
|
5933
6721
|
}
|
|
5934
|
-
|
|
6722
|
+
create_custom_element(McPopulatedBlank, {
|
|
5935
6723
|
model: { type: "Object" },
|
|
5936
6724
|
session: { type: "Object" },
|
|
5937
6725
|
options: { type: "Object" }
|
|
5938
|
-
}, [], [])
|
|
5939
|
-
//#endregion
|
|
5940
|
-
//#region src/controller/index.ts
|
|
5941
|
-
var isComplete = (question, session, audioComplete = false) => {
|
|
5942
|
-
if (!session || !session.choiceId) return false;
|
|
5943
|
-
const autoplayAudioEnabled = !!question?.autoplayAudioEnabled;
|
|
5944
|
-
const completeAudioEnabled = !!question?.completeAudioEnabled;
|
|
5945
|
-
if (autoplayAudioEnabled && completeAudioEnabled && !!question?.hasAudio && !audioComplete) return false;
|
|
5946
|
-
return true;
|
|
5947
|
-
};
|
|
6726
|
+
}, [], []);
|
|
5948
6727
|
//#endregion
|
|
5949
6728
|
//#region src/delivery/index.ts
|
|
6729
|
+
function isComplete(model, session, audioComplete = false) {
|
|
6730
|
+
if (!session?.choiceId) return false;
|
|
6731
|
+
if (!!model?.autoplayAudioEnabled && !!model?.completeAudioEnabled && !!model?.hasAudio && !audioComplete) return false;
|
|
6732
|
+
return true;
|
|
6733
|
+
}
|
|
5950
6734
|
var SvelteElementClass = McPopulatedBlank.element;
|
|
5951
6735
|
var McPopulatedBlankElement = class extends SvelteElementClass {
|
|
5952
6736
|
constructor(..._args) {
|
|
@@ -5956,25 +6740,10 @@ var McPopulatedBlankElement = class extends SvelteElementClass {
|
|
|
5956
6740
|
_defineProperty(this, "_options", null);
|
|
5957
6741
|
_defineProperty(this, "audioComplete", false);
|
|
5958
6742
|
_defineProperty(this, "_dispatchModelSet", () => {
|
|
5959
|
-
this.dispatchEvent(new
|
|
5960
|
-
bubbles: true,
|
|
5961
|
-
composed: true,
|
|
5962
|
-
detail: {
|
|
5963
|
-
complete: this._isComplete(),
|
|
5964
|
-
component: this.tagName.toLowerCase(),
|
|
5965
|
-
hasModel: this._model !== void 0
|
|
5966
|
-
}
|
|
5967
|
-
}));
|
|
6743
|
+
this.dispatchEvent(new e(this.tagName.toLowerCase(), this._isComplete(), this._model !== void 0));
|
|
5968
6744
|
});
|
|
5969
6745
|
_defineProperty(this, "_dispatchSessionChanged", () => {
|
|
5970
|
-
this.dispatchEvent(new
|
|
5971
|
-
bubbles: true,
|
|
5972
|
-
composed: true,
|
|
5973
|
-
detail: {
|
|
5974
|
-
complete: this._isComplete(),
|
|
5975
|
-
component: this.tagName.toLowerCase()
|
|
5976
|
-
}
|
|
5977
|
-
}));
|
|
6746
|
+
this.dispatchEvent(new t$1(this.tagName.toLowerCase(), this._isComplete()));
|
|
5978
6747
|
});
|
|
5979
6748
|
_defineProperty(this, "onSessionChange", (updatedSession) => {
|
|
5980
6749
|
this._internalSession = updatedSession;
|
|
@@ -5984,14 +6753,14 @@ var McPopulatedBlankElement = class extends SvelteElementClass {
|
|
|
5984
6753
|
_defineProperty(this, "onAudioStarted", () => {
|
|
5985
6754
|
this._internalSession = {
|
|
5986
6755
|
...this._internalSession || {},
|
|
5987
|
-
audioStartTime:
|
|
6756
|
+
audioStartTime: Date.now()
|
|
5988
6757
|
};
|
|
5989
6758
|
});
|
|
5990
6759
|
_defineProperty(this, "onAudioEnded", () => {
|
|
5991
6760
|
this.audioComplete = true;
|
|
5992
6761
|
this._internalSession = {
|
|
5993
6762
|
...this._internalSession || {},
|
|
5994
|
-
audioEndTime:
|
|
6763
|
+
audioEndTime: Date.now()
|
|
5995
6764
|
};
|
|
5996
6765
|
this._dispatchSessionChanged();
|
|
5997
6766
|
});
|