@pie-element/mc-populated-blank 0.2.13 → 0.3.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +8 -5
  2. package/author.js +2 -0
  3. package/configure.js +2 -0
  4. package/dist/author/defaults.d.ts +74 -0
  5. package/dist/author/index.d.ts +0 -1
  6. package/dist/author/index.js +1732 -1553
  7. package/dist/author/index.js.map +1 -1
  8. package/dist/browser/author/index.js +41 -0
  9. package/dist/browser/author/index.js.map +1 -0
  10. package/dist/browser/client-6I83eQqA.js +2396 -0
  11. package/dist/browser/client-6I83eQqA.js.map +1 -0
  12. package/dist/browser/controller/index.js +209 -0
  13. package/dist/browser/controller/index.js.map +1 -0
  14. package/dist/browser/delivery/index.js +1131 -0
  15. package/dist/browser/delivery/index.js.map +1 -0
  16. package/dist/browser/i18n-CQZqUmjk.js +1542 -0
  17. package/dist/browser/i18n-CQZqUmjk.js.map +1 -0
  18. package/dist/browser/layoutLimits-Bp17YP2V.js +42 -0
  19. package/dist/browser/layoutLimits-Bp17YP2V.js.map +1 -0
  20. package/dist/browser/print/index.js +151 -0
  21. package/dist/browser/print/index.js.map +1 -0
  22. package/dist/controller/defaults.d.ts +8 -30
  23. package/dist/controller/index.d.ts +79 -63
  24. package/dist/controller/index.js +108 -85
  25. package/dist/controller/index.js.map +1 -1
  26. package/dist/delivery/computeAudioMode.d.ts +0 -1
  27. package/dist/delivery/computeChoiceCorrectness.d.ts +0 -1
  28. package/dist/delivery/computeDisplayState.d.ts +7 -8
  29. package/dist/delivery/computeLayoutProfile.d.ts +0 -1
  30. package/dist/delivery/computeLayoutStyle.d.ts +0 -2
  31. package/dist/delivery/i18n.d.ts +8 -0
  32. package/dist/delivery/index.d.ts +22 -1
  33. package/dist/delivery/index.js +5742 -3222
  34. package/dist/delivery/index.js.map +1 -1
  35. package/dist/delivery/variant-css-map.d.ts +15 -2
  36. package/dist/index.d.ts +0 -1
  37. package/dist/index.iife.d.ts +0 -156
  38. package/dist/index.iife.js +139 -38
  39. package/dist/index.js +5742 -3222
  40. package/dist/index.js.map +1 -1
  41. package/dist/print/index.d.ts +4 -1
  42. package/dist/print/index.js +5418 -2879
  43. package/dist/print/index.js.map +1 -1
  44. package/dist/runtime-support.d.ts +12 -0
  45. package/dist/runtime-support.js +14 -0
  46. package/dist/runtime-support.js.map +1 -0
  47. package/dist/shared/layoutLimits.d.ts +1 -2
  48. package/dist/shared/types.d.ts +20 -19
  49. package/module/print.js +3883 -0
  50. package/module/print.js.map +1 -0
  51. package/package.json +42 -13
  52. package/print.js +2 -0
  53. package/dist/author/index.d.ts.map +0 -1
  54. package/dist/controller/defaults.d.ts.map +0 -1
  55. package/dist/controller/index.d.ts.map +0 -1
  56. package/dist/delivery/computeAudioMode.d.ts.map +0 -1
  57. package/dist/delivery/computeChoiceCorrectness.d.ts.map +0 -1
  58. package/dist/delivery/computeDisplayState.d.ts.map +0 -1
  59. package/dist/delivery/computeLayoutProfile.d.ts.map +0 -1
  60. package/dist/delivery/computeLayoutStyle.d.ts.map +0 -1
  61. package/dist/delivery/index.d.ts.map +0 -1
  62. package/dist/delivery/variant-css-map.d.ts.map +0 -1
  63. package/dist/index.d.ts.map +0 -1
  64. package/dist/index.iife.d.ts.map +0 -1
  65. package/dist/print/index.d.ts.map +0 -1
  66. package/dist/shared/layoutLimits.d.ts.map +0 -1
  67. package/dist/shared/types.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["s","c","e"],"sources":["../../../../../shared/player-events/dist/index.js","../../../../../lib-svelte/delivery-events/dist/index2.js","../../../src/delivery/computeAudioMode.ts","../../../src/delivery/AudioPlayer.svelte","../../../src/delivery/ClozeMarker.svelte","../../../src/delivery/ChoiceRow.svelte","../../../src/delivery/TeacherInstructions.svelte","../../../src/delivery/computeChoiceCorrectness.ts","../../../src/delivery/computeLayoutProfile.ts","../../../src/delivery/computeLayoutStyle.ts","../../../src/delivery/computeDisplayState.ts","../../../src/delivery/variant-css-map.ts","../../../src/delivery/McPopulatedBlank.svelte","../../../src/delivery/index.ts"],"sourcesContent":["//#region src/session-notifier.ts\nvar e = \"commitPendingSession\", t = /* @__PURE__ */ new WeakMap();\nfunction n(e, n) {\n\tlet r = t.get(e);\n\tr || (r = /* @__PURE__ */ new Set(), t.set(e, r)), r.add(n);\n}\nfunction r(t) {\n\treturn Object.getOwnPropertyDescriptor(t, e) !== void 0;\n}\nfunction i(t) {\n\tif (r(t)) return;\n\tlet n = t[e];\n\tObject.defineProperty(t, e, {\n\t\tvalue: () => {\n\t\t\tif (typeof n == \"function\") try {\n\t\t\t\tn.call(t);\n\t\t\t} catch {}\n\t\t\to(t);\n\t\t},\n\t\tconfigurable: !0,\n\t\tenumerable: !1,\n\t\twritable: !0\n\t});\n}\nfunction a(e, t, r = {}) {\n\tlet a = r.delayMs, o = typeof a == \"function\" ? a : () => a ?? 0, s = r.maxWaitMs, c = null, l = null, u = !1, d = () => {\n\t\tc !== null && (clearTimeout(c), c = null), l !== null && (clearTimeout(l), l = null);\n\t}, f = () => {\n\t\td(), u && (u = !1, t());\n\t}, p = {\n\t\tnotify() {\n\t\t\tu = !0, c !== null && clearTimeout(c), c = setTimeout(f, Math.max(0, o())), s !== void 0 && l === null && (l = setTimeout(f, Math.max(0, s)));\n\t\t},\n\t\tflush() {\n\t\t\tif (!u) {\n\t\t\t\td();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tf();\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(\"[session-notifier] a committed session-changed dispatch threw\", e);\n\t\t\t}\n\t\t}\n\t};\n\treturn n(e, p), i(e), p;\n}\nfunction o(e) {\n\tlet n = t.get(e);\n\tif (n) for (let e of [...n]) e.flush();\n}\n//#endregion\n//#region src/index.ts\nvar s = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, c = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { s as ModelSetEvent, e as SESSION_COMMIT_METHOD, c as SessionChangedEvent, a as createSessionNotifier, o as flushSessionNotifiers };\n","import { SessionChangedEvent as e } from \"@pie-element/shared-player-events\";\n//#region src/session-bridge.ts\nvar t = (e) => {\n\tlet t = e;\n\treturn t ? typeof t.onSessionChange == \"function\" || typeof t.onAudioStarted == \"function\" || typeof t.onAudioEnded == \"function\" : !1;\n};\nfunction n(e) {\n\tif (e.parentElement) return e.parentElement;\n\tlet t = e.getRootNode();\n\treturn t instanceof ShadowRoot ? t.host : null;\n}\nfunction r(e, r = {}) {\n\tlet i = r.hostPredicate ?? t, a = e;\n\tfor (; a;) {\n\t\tif (i(a)) return a;\n\t\ta = n(a);\n\t}\n\treturn null;\n}\nfunction i(e) {\n\treturn !!e && typeof e == \"object\" && !Array.isArray(e);\n}\nfunction a(e, t) {\n\tif (e === t) return e;\n\tif (!i(e) || !i(t) || Object.isFrozen(e) || !Object.isExtensible(e)) return t;\n\ttry {\n\t\tfor (let n of Object.keys(e)) n in t || delete e[n];\n\t\tObject.assign(e, t);\n\t} catch {\n\t\treturn t;\n\t}\n\treturn e;\n}\nvar o = {}, s = /* @__PURE__ */ new WeakSet();\nfunction c(e) {\n\tlet t = e ?? o;\n\tif (s.has(t)) return;\n\ts.add(t);\n\tlet n = e ? `above <${e.tagName.toLowerCase()}>` : \"for an update with no source element\";\n\tconsole.warn(`[session-bridge] no delivery host ${n}; the session change was not forwarded to the player`);\n}\nfunction l({ sourceEl: t, complete: n, session: i }) {\n\tlet o = r(t);\n\tif (!o) return c(t), null;\n\tif (typeof o.onSessionChange == \"function\") return o.onSessionChange(i), o;\n\tlet s = a(o.session, i);\n\treturn s !== o.session && (o.session = s), o.dispatchEvent(new e(o.tagName.toLowerCase(), n)), o;\n}\n//#endregion\nexport { l as forwardSessionChange, r as resolveDeliveryHost, a as writeSessionInPlace };\n","export type AudioMode = 'feature-button' | 'controls' | 'error' | 'none';\n\nexport function computeAudioMode(params: {\n hasAudio: boolean;\n audioUrl: string | undefined;\n useFeatureButtonAudio: boolean;\n}): AudioMode {\n if (!params.hasAudio) return 'none';\n if (!params.audioUrl) return 'error';\n return params.useFeatureButtonAudio ? 'feature-button' : 'controls';\n}\n","<script lang=\"ts\">\nimport { computeAudioMode } from './computeAudioMode';\nimport { t } from './i18n';\n\ninterface AudioButtonSkin {\n silentUrl: string;\n playingUrl: string;\n}\n\nconst AUDIO_PLAYBACK = {\n IDLE: 'idle',\n PLAYING: 'playing',\n BLOCKED: 'blocked',\n PAUSED: 'paused',\n} as const;\ntype AudioPlaybackState = (typeof AUDIO_PLAYBACK)[keyof typeof AUDIO_PLAYBACK];\n\nlet {\n hasAudio = false,\n audioUrl,\n useFeatureButtonAudio = false,\n autoplayEnabled = false,\n featureAudioSkin,\n language,\n onaudiostarted,\n onaudioended,\n}: {\n hasAudio?: boolean;\n audioUrl?: string;\n useFeatureButtonAudio?: boolean;\n autoplayEnabled?: boolean;\n featureAudioSkin: AudioButtonSkin;\n language?: string;\n onaudiostarted?: () => void;\n onaudioended?: () => void;\n} = $props();\n\nlet audioEl = $state<HTMLAudioElement | null>(null);\nlet featureAudioButtonEl = $state<HTMLButtonElement | null>(null);\nlet autoplayEnableButtonEl = $state<HTMLButtonElement | null>(null);\nlet audioPlaybackState = $state<AudioPlaybackState>(AUDIO_PLAYBACK.IDLE);\n\nconst audioMode = $derived(computeAudioMode({ hasAudio, audioUrl, useFeatureButtonAudio }));\nconst isMediaPlaying = $derived(audioPlaybackState === AUDIO_PLAYBACK.PLAYING);\nconst autoPlayPromptOpen = $derived(audioPlaybackState === AUDIO_PLAYBACK.BLOCKED);\nconst audioErrorMessage = $derived(\n audioMode === 'error' ? t('audioResourceUnavailable', language) : ''\n);\n\n// Reset playback state when audioUrl changes so autoplay re-fires for a new question.\n$effect(() => {\n audioUrl;\n audioPlaybackState = AUDIO_PLAYBACK.IDLE;\n});\n\nfunction playFeatureAudio() {\n if (audioMode !== 'none' && audioMode !== 'error' && audioEl) {\n audioEl.play().catch(() => {});\n }\n}\n\nfunction handleEnableAutoplayClick() {\n if (audioMode !== 'none' && audioMode !== 'error' && audioEl) {\n audioEl.play().finally(() => {\n if (audioPlaybackState === AUDIO_PLAYBACK.BLOCKED) audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n });\n }\n}\n\nfunction useListener<K extends keyof HTMLElementEventMap>(\n getEl: () => EventTarget | null | undefined,\n event: K,\n handler: (e: HTMLElementEventMap[K]) => void\n) {\n $effect(() => {\n const el = getEl();\n if (!el) return;\n el.addEventListener(event, handler as EventListener);\n return () => el.removeEventListener(event, handler as EventListener);\n });\n}\n\nuseListener(\n () => audioEl,\n 'playing',\n () => {\n audioPlaybackState = AUDIO_PLAYBACK.PLAYING;\n onaudiostarted?.();\n }\n);\n\nuseListener(\n () => audioEl,\n 'ended',\n () => {\n audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n onaudioended?.();\n }\n);\n\nuseListener(\n () => featureAudioButtonEl,\n 'click',\n () => playFeatureAudio()\n);\nuseListener(\n () => autoplayEnableButtonEl,\n 'click',\n () => handleEnableAutoplayClick()\n);\n\n$effect(() => {\n if (!autoplayEnabled || audioMode === 'none' || audioMode === 'error') return;\n if (audioPlaybackState !== AUDIO_PLAYBACK.IDLE) return;\n if (audioEl && audioUrl) {\n audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n audioEl.play().catch(() => {\n audioPlaybackState = AUDIO_PLAYBACK.BLOCKED;\n });\n }\n});\n</script>\n\n{#if audioMode !== 'none'}\n <div class=\"audio-container pie-audio-container\">\n {#if audioMode === 'feature-button'}\n <audio\n bind:this={audioEl}\n class=\"sr-only pie-audio-player\"\n preload=\"metadata\"\n src={audioUrl}\n aria-hidden=\"true\"\n tabindex=\"-1\"\n ></audio>\n <button\n bind:this={featureAudioButtonEl}\n class=\"listen-button pie-listen-button rli-feature-audio\"\n type=\"button\"\n aria-label={t('listen', language)}\n >\n <img\n class={`listen-feature-icon pie-listen-icon rli-feature-listen ${isMediaPlaying ? '' : 'listen-active'}`}\n src={featureAudioSkin.silentUrl}\n alt={t('listenSilentAlt', language)}\n />\n <img\n class={`listen-feature-icon pie-listen-icon rli-feature-listen ${isMediaPlaying ? 'listen-active' : ''}`}\n src={featureAudioSkin.playingUrl}\n alt={t('listenPlayingAlt', language)}\n />\n </button>\n {:else if audioMode === 'controls'}\n <audio\n bind:this={audioEl}\n controls\n class=\"audio-controls pie-audio-player\"\n preload=\"metadata\"\n src={audioUrl}\n >\n <track kind=\"captions\" />\n </audio>\n {#if autoPlayPromptOpen}\n <button\n bind:this={autoplayEnableButtonEl}\n class=\"autoplay-enable pie-audio-autoplay-enable\"\n type=\"button\"\n >\n {t('clickToEnableAutoplay', language)}\n </button>\n {/if}\n {:else if audioMode === 'error'}\n <p class=\"audio-error pie-audio-error\" role=\"alert\">{audioErrorMessage}</p>\n {/if}\n </div>\n{/if}\n\n<style>\n .audio-container {\n margin-bottom: 1rem;\n }\n\n .audio-controls {\n display: block;\n width: 100%;\n max-width: 28rem;\n }\n\n .autoplay-enable {\n margin-top: 0.5rem;\n padding: 0;\n border: 0;\n background: transparent;\n font: inherit;\n font-size: 0.875rem;\n line-height: calc(1.25 / 0.875);\n color: inherit;\n text-decoration-line: underline;\n }\n\n .audio-error {\n margin: 0;\n font-size: 0.875rem;\n line-height: calc(1.25 / 0.875);\n color: var(--pie-incorrect-icon, #c10007);\n }\n\n .listen-button {\n width: var(--mpb-listen-button-size, 128px);\n height: var(--mpb-listen-button-size, 128px);\n border: 0;\n padding: 0;\n background-color: transparent;\n cursor: pointer;\n z-index: 1;\n }\n\n .listen-button:hover {\n background-color: #e2f1fe;\n }\n\n .listen-feature-icon {\n width: var(--mpb-listen-button-size, 128px);\n height: var(--mpb-listen-button-size, 128px);\n object-fit: contain;\n display: none;\n }\n\n .listen-feature-icon.listen-active {\n display: block;\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n</style>\n","<script lang=\"ts\">\nimport { t } from './i18n';\n\ninterface DisplayChoice {\n imageUrl?: string;\n imageAlt?: string;\n labelHtml?: string;\n}\n\nlet {\n choiceMode = 'text',\n displayChoice = undefined,\n displayChoiceLabelHtml = '',\n isStandalone = false,\n blankWidth,\n blankBorderWidth,\n ariaLabel,\n language,\n}: {\n choiceMode?: 'text' | 'image';\n displayChoice?: DisplayChoice;\n displayChoiceLabelHtml?: string;\n isStandalone?: boolean;\n blankWidth: string;\n blankBorderWidth: string;\n ariaLabel: string;\n language?: string;\n} = $props();\n</script>\n\n<span\n class={`cloze-marker pie-blank-slot ${isStandalone ? 'cloze-marker-standalone pie-blank-slot-standalone' : ''}`}\n style={`width:${blankWidth};border-bottom-width:${blankBorderWidth};`}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n aria-label={ariaLabel}\n>\n {#if choiceMode === 'image' && displayChoice?.imageUrl}\n <img\n src={displayChoice.imageUrl}\n alt={displayChoice.imageAlt || t('selectedAnswerImage', language)}\n class=\"cloze-marker-image pie-blank-image\"\n style=\"max-width:var(--mpb-choice-image-max-width, 9.375rem);max-height:var(--mpb-choice-image-max-height, 9.375rem);\"\n />\n {:else if displayChoiceLabelHtml}\n <span class=\"cloze-marker-value pie-blank-value\">{@html displayChoiceLabelHtml}</span>\n {:else}\n <span class=\"cloze-marker-empty\">\n <span aria-hidden=\"true\">&nbsp;</span>\n <span class=\"sr-only\">{t('emptyBlank', language)}</span>\n </span>\n {/if}\n</span>\n\n<style>\n /* The underline width comes from the inline style (layoutLimits); the colour\n follows the text. */\n .cloze-marker {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n vertical-align: baseline;\n padding-inline: 0.5rem;\n border-bottom: 2px solid currentColor;\n }\n\n .cloze-marker:focus-within {\n outline: 2px solid var(--mpb-focus-ring, #1565c0);\n outline-offset: 2px;\n }\n\n .cloze-marker-standalone {\n width: var(--mpb-blank-standalone-width, 7rem);\n }\n\n .cloze-marker-image {\n object-fit: contain;\n }\n\n .cloze-marker-empty {\n display: inline-block;\n min-width: 4ch;\n }\n\n .cloze-marker-value {\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n\n .cloze-marker-value :global(p) {\n margin: 0;\n }\n\n /* Same 150x150 content-element constraint as ChoiceRow.svelte's .choice-html\n img — the selected choice's raw labelHtml can carry an embedded <img> here\n too, regardless of customType. See CONTOOL-3159. */\n .cloze-marker-value :global(img) {\n width: 150px;\n height: 150px;\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n</style>\n","<script lang=\"ts\">\nimport { t } from './i18n';\n\ninterface Choice {\n id: string;\n labelHtml?: string;\n imageUrl?: string;\n imageAlt?: string;\n}\n\nlet {\n choice,\n choiceMode = 'text',\n isHorizontal = false,\n isSelected = false,\n isDisabled = false,\n correctness = undefined,\n isEvaluateMode = false,\n instanceId,\n radioGroupName,\n language,\n}: {\n choice: Choice;\n choiceMode?: 'text' | 'image';\n isHorizontal?: boolean;\n isSelected?: boolean;\n isDisabled?: boolean;\n correctness?: 'correct' | 'incorrect' | undefined;\n isEvaluateMode?: boolean;\n instanceId: string;\n radioGroupName: string;\n language?: string;\n} = $props();\n</script>\n\n<div\n class={`choice-row pie-choice ${isHorizontal ? 'choice-row-horizontal pie-choice-horizontal' : ''} ${isSelected ? 'is-selected pie-choice-selected' : ''} ${correctness ? `choice-${correctness} pie-choice-${correctness}` : ''}`}\n style=\"gap:var(--mpb-choice-row-gap, 0.5rem);\"\n>\n {#if isHorizontal}\n <label\n for={`${instanceId}-opt-${choice.id}`}\n class=\"choice-tile pie-choice-tile\"\n >\n <span class=\"choice-tile-content pie-choice-tile-content\">\n {#if choiceMode === 'image' && choice.imageUrl}\n <img\n src={choice.imageUrl}\n alt={choice.imageAlt || t('choiceImage', language, { id: choice.id })}\n class=\"choice-image pie-choice-image\"\n style=\"max-width:var(--mpb-choice-image-max-width, 9.375rem);max-height:var(--mpb-choice-image-max-height, 9.375rem);\"\n />\n {:else}\n <span class=\"choice-html pie-choice-label\">{@html choice.labelHtml || ''}</span>\n {/if}\n </span>\n <input\n type=\"radio\"\n name={radioGroupName}\n id={`${instanceId}-opt-${choice.id}`}\n value={choice.id}\n checked={isSelected}\n disabled={isDisabled}\n class=\"choice-radio-bottom pie-choice-radio pie-choice-radio-bottom\"\n />\n </label>\n {:else}\n <input\n type=\"radio\"\n name={radioGroupName}\n id={`${instanceId}-opt-${choice.id}`}\n value={choice.id}\n checked={isSelected}\n disabled={isDisabled}\n class=\"choice-radio-inline pie-choice-radio pie-choice-radio-inline\"\n />\n <label for={`${instanceId}-opt-${choice.id}`} class=\"choice-label-wrap pie-choice-label-wrap\">\n {#if choiceMode === 'image' && choice.imageUrl}\n <img\n src={choice.imageUrl}\n alt={choice.imageAlt || t('choiceImage', language, { id: choice.id })}\n class=\"choice-image pie-choice-image\"\n style=\"max-height:var(--mpb-choice-image-max-height, 5rem);\"\n />\n {:else}\n <span class=\"choice-html pie-choice-label\">{@html choice.labelHtml || ''}</span>\n {/if}\n </label>\n {/if}\n {#if isEvaluateMode && correctness}\n <span\n class={`pie-choice-feedback-badge ${correctness === 'correct' ? 'pie-choice-feedback-correct' : 'pie-choice-feedback-incorrect'}`}\n aria-hidden=\"true\"\n >\n {correctness === 'correct' ? '✓' : '✕'}\n </span>\n {/if}\n</div>\n\n<style>\n .choice-row {\n display: flex;\n align-items: flex-start;\n }\n\n .choice-row-horizontal {\n flex-direction: column;\n align-items: center;\n width: min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));\n min-height: var(--mpb-choice-tile-min-height, 11rem);\n gap: 0;\n }\n\n .choice-tile {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n min-height: var(--mpb-choice-tile-min-height, 11rem);\n padding: 0.8rem 0.65rem 0.5rem;\n border-radius: 8px;\n background: transparent;\n transition: background-color 120ms ease-in-out;\n cursor: pointer;\n text-align: center;\n }\n\n .choice-tile-content {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: var(--mpb-choice-content-min-height, 7.5rem);\n }\n\n .choice-image {\n display: block;\n object-fit: contain;\n }\n\n .choice-label-wrap {\n flex: 1 1 0%;\n cursor: pointer;\n }\n\n .choice-row-horizontal:hover .choice-tile {\n background: var(--mpb-choice-hover-bg, var(--pie-background-dark, #ecedf1));\n }\n\n .pie-choice-horizontal:not(.is-selected):not(:hover) .pie-choice-tile {\n background: transparent;\n }\n\n .choice-row-horizontal.is-selected .choice-tile {\n background: var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));\n }\n\n .choice-row-horizontal.is-selected:hover .choice-tile {\n background: var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));\n }\n\n .pie-choice:not(.pie-choice-horizontal):hover .pie-choice-label-wrap {\n background: var(--pie-background-dark, #ecedf1);\n }\n\n .pie-choice:not(.pie-choice-horizontal):not(.is-selected):not(:hover) .pie-choice-label-wrap {\n background: transparent;\n }\n\n .pie-choice:not(.pie-choice-horizontal).is-selected .pie-choice-label-wrap {\n background: var(--pie-secondary-background, rgba(241, 241, 241, 1));\n border-radius: 6px;\n }\n\n .pie-choice:not(.pie-choice-horizontal).is-selected:hover .pie-choice-label-wrap {\n background: var(--pie-secondary-background, rgba(241, 241, 241, 1));\n }\n\n .pie-choice.choice-correct {\n border-left: 3px solid var(--pie-correct-tertiary, #0ea449);\n }\n\n .pie-choice.choice-incorrect {\n border-left: 3px solid var(--pie-incorrect-icon, #bf0d00);\n }\n\n .pie-choice-horizontal.choice-correct .choice-tile {\n background: var(--pie-correct-secondary, #e8f5e9);\n }\n\n .pie-choice-horizontal.choice-incorrect .choice-tile {\n background: var(--pie-incorrect-secondary, #ffebee);\n }\n\n .pie-choice-feedback-badge {\n margin-left: auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.1rem;\n height: 1.1rem;\n border-radius: 9999px;\n font-size: 0.72rem;\n line-height: 1;\n font-weight: 700;\n color: var(--pie-white, #ffffff);\n }\n\n .pie-choice-feedback-correct {\n background: var(--pie-correct-icon, #087d38);\n }\n\n .pie-choice-feedback-incorrect {\n background: var(--pie-incorrect-icon, #bf0d00);\n }\n\n .choice-row-horizontal :global(p) {\n margin: 0;\n text-align: center;\n }\n\n .choice-html :global(p) {\n margin: 0;\n }\n\n .choice-html {\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n\n /* Choices carrying raw <img> markup in labelHtml (rather than the dedicated\n imageUrl/imageAlt fields) render unconstrained at their authored size\n otherwise — 3rd-party/CQT-sourced content is typically authored well above\n the platform's 150x150 content-element spec. Applies regardless of\n customType, unlike the r1-CQT-specific cqt-css overlays. See CONTOOL-3159. */\n .choice-html :global(img) {\n width: 150px;\n height: 150px;\n }\n\n /* Only the top margin is spaced; the browser's own radio side margins would\n otherwise offset the control from its label (the demo app's preflight zeroed them). */\n .choice-radio-bottom {\n margin: var(--mpb-horizontal-choice-radio-top-margin, 0.5rem) 0 0;\n padding: var(--mpb-choice-radio-padding, 0px);\n }\n\n .choice-radio-inline {\n margin: var(--mpb-horizontal-choice-radio-top-margin, 0.5rem) 0 0;\n }\n</style>\n","<script lang=\"ts\">\nimport { tCommon } from './i18n';\n\nlet { html, language }: { html: string; language?: string } = $props();\n\nlet expanded = $state(false);\nconst panelId = `mpb-teacher-instructions-${Math.random().toString(36).slice(2, 10)}`;\n</script>\n\n<!-- Collapsed by default, as multiple-choice shows them; the controller sends them to instructors only. -->\n<div class=\"teacher-instructions pie-teacher-instructions\">\n <button\n type=\"button\"\n class=\"teacher-instructions-toggle pie-teacher-instructions-toggle\"\n aria-expanded={expanded}\n aria-controls={panelId}\n onclick={() => (expanded = !expanded)}\n >\n {tCommon(expanded ? 'hideTeacherInstructions' : 'showTeacherInstructions', language)}\n </button>\n <div id={panelId} class=\"teacher-instructions-content pie-teacher-instructions-content\" hidden={!expanded}>\n {@html html}\n </div>\n</div>\n\n<style>\n .teacher-instructions {\n margin-bottom: 1rem;\n }\n\n .teacher-instructions-toggle {\n padding: 0;\n border: 0;\n border-bottom: 1px dotted currentColor;\n background: transparent;\n font: inherit;\n color: var(--pie-primary, #3f51b5);\n cursor: pointer;\n }\n\n .teacher-instructions-toggle:focus-visible {\n outline: 2px solid var(--mpb-focus-ring, var(--pie-focus-outline, #1565c0));\n outline-offset: 2px;\n }\n\n .teacher-instructions-content {\n padding-top: 1rem;\n }\n</style>\n","export interface ChoiceCorrectnessParams {\n isEvaluateMode: boolean;\n correctChoiceId: string;\n selectedId: string;\n showCorrectAnswer: boolean;\n}\n\n/**\n * Computes which choice ids should display a correctness badge and what kind.\n *\n * Reveal mode (showCorrectAnswer=true) shows only the canonical correct answer —\n * the student's wrong selection is deliberately suppressed so the UI only\n * highlights what to remember, not what to regret.\n *\n * Unanswered-in-evaluate (selectedId='') treats the correct choice as missed\n * (incorrect badge) rather than triggering the two-badge wrong-answer path.\n */\nexport function computeChoiceCorrectness(\n params: ChoiceCorrectnessParams\n): Map<string, 'correct' | 'incorrect'> {\n const map = new Map<string, 'correct' | 'incorrect'>();\n const { isEvaluateMode, correctChoiceId, selectedId, showCorrectAnswer } = params;\n\n if (!isEvaluateMode || !correctChoiceId) {\n return map;\n }\n if (showCorrectAnswer) {\n map.set(correctChoiceId, 'correct');\n return map;\n }\n if (!selectedId) {\n map.set(correctChoiceId, 'incorrect');\n return map;\n }\n if (selectedId === correctChoiceId) {\n map.set(correctChoiceId, 'correct');\n return map;\n }\n map.set(selectedId, 'incorrect');\n map.set(correctChoiceId, 'incorrect');\n return map;\n}\n","const BLANK_TOKEN = '{{blank}}';\n\nexport interface LayoutProfileParams {\n interactionMode?: string;\n template?: string;\n choiceLayout?: string;\n layoutProfile?: string;\n hasAudio?: boolean;\n useFeatureButtonAudio?: boolean | null;\n}\n\nexport interface LayoutProfileResult {\n isAudioOnlyMode: boolean;\n isBlankOnlyTemplate: boolean;\n choiceLayout: 'horizontal' | 'vertical';\n isHorizontalChoices: boolean;\n hasInlineSentenceAudioLayout: boolean;\n useFeatureButtonAudio: boolean;\n}\n\nconst FEATURE_BUTTON_PROFILES = new Set([\n 'audio_blank_only',\n 'stimulus_image_blank',\n 'token_sequence',\n]);\n\nexport function computeLayoutProfile(params: LayoutProfileParams): LayoutProfileResult {\n const {\n interactionMode = '',\n template = '',\n choiceLayout: configuredChoiceLayout,\n layoutProfile = '',\n hasAudio = false,\n useFeatureButtonAudio: configuredFeatureButton,\n } = params;\n\n const isAudioOnlyMode = interactionMode === 'audio_mc_only';\n\n const isBlankOnlyTemplate = (() => {\n if (!template) return false;\n const plain = template\n .replace(/<[^>]+>/g, '')\n .replace(/&nbsp;/g, ' ')\n .trim();\n return plain === BLANK_TOKEN;\n })();\n\n const choiceLayout: 'horizontal' | 'vertical' =\n configuredChoiceLayout === 'horizontal' || configuredChoiceLayout === 'vertical'\n ? (configuredChoiceLayout as 'horizontal' | 'vertical')\n : isAudioOnlyMode || isBlankOnlyTemplate\n ? 'horizontal'\n : 'vertical';\n\n const isHorizontalChoices = choiceLayout === 'horizontal';\n\n const hasInlineSentenceAudioLayout = layoutProfile === 'inline_sentence' && hasAudio;\n\n const useFeatureButtonAudio =\n typeof configuredFeatureButton === 'boolean'\n ? configuredFeatureButton\n : hasAudio && FEATURE_BUTTON_PROFILES.has(layoutProfile);\n\n return {\n isAudioOnlyMode,\n isBlankOnlyTemplate,\n choiceLayout,\n isHorizontalChoices,\n hasInlineSentenceAudioLayout,\n useFeatureButtonAudio,\n };\n}\n","import { type LayoutLimits, DEFAULT_LAYOUT_LIMITS } from '../shared/layoutLimits';\nexport type { LayoutLimits };\nexport { DEFAULT_LAYOUT_LIMITS };\n\n/**\n * Maps every LayoutLimits key (except legendMaxChars, which is a return value not a CSS var)\n * to its --mpb-* CSS variable name and CSS unit.\n * Add a single entry here when adding a new layout limit.\n */\nexport const CSS_VAR_SPEC: Record<\n Exclude<keyof LayoutLimits, 'legendMaxChars'>,\n { varName: string; unit: string }\n> = {\n blankStandaloneWidthRem: { varName: '--mpb-blank-standalone-width', unit: 'rem' },\n blankWideWidthRem: { varName: '--mpb-blank-wide-width', unit: 'rem' },\n blankUnderlineWidthPx: { varName: '--mpb-blank-underline-width', unit: 'px' },\n blankUnderlineWideWidthPx: { varName: '--mpb-blank-underline-wide-width', unit: 'px' },\n horizontalChoiceWidthPx: { varName: '--mpb-choice-width-px', unit: 'px' },\n horizontalChoiceWidthVw: { varName: '--mpb-choice-width-vw', unit: 'vw' },\n horizontalChoiceTileMinHeightRem: { varName: '--mpb-choice-tile-min-height', unit: 'rem' },\n horizontalChoiceContentMinHeightRem: { varName: '--mpb-choice-content-min-height', unit: 'rem' },\n choiceImageMaxHeightRem: { varName: '--mpb-choice-image-max-height', unit: 'rem' },\n choiceImageMaxWidthRem: { varName: '--mpb-choice-image-max-width', unit: 'rem' },\n choiceGroupGapRem: { varName: '--mpb-choice-group-gap', unit: 'rem' },\n choiceRowGapRem: { varName: '--mpb-choice-row-gap', unit: 'rem' },\n horizontalChoiceRadioTopMarginRem: {\n varName: '--mpb-horizontal-choice-radio-top-margin',\n unit: 'rem',\n },\n narrowHorizontalChoiceMaxWidthPx: { varName: '--mpb-narrow-choice-max-width', unit: 'px' },\n toggleButtonGapRem: { varName: '--mpb-toggle-button-gap', unit: 'rem' },\n listenButtonSizePx: { varName: '--mpb-listen-button-size', unit: 'px' },\n audioBlankTemplateMarginTopRem: { varName: '--mpb-audio-blank-template-margin-top', unit: 'rem' },\n audioBlankTemplateMarginBottomRem: {\n varName: '--mpb-audio-blank-template-margin-bottom',\n unit: 'rem',\n },\n audioInstructionsMaxWidthPx: { varName: '--mpb-audio-instructions-max-width', unit: 'px' },\n stimulusMinColumnPx: { varName: '--mpb-stimulus-min-column', unit: 'px' },\n textMinColumnPx: { varName: '--mpb-text-min-column', unit: 'px' },\n stimulusGridColumnGapRem: { varName: '--mpb-stimulus-grid-column-gap', unit: 'rem' },\n stimulusGridRowGapRem: { varName: '--mpb-stimulus-grid-row-gap', unit: 'rem' },\n stimulusSentenceMarginTopRem: { varName: '--mpb-stimulus-sentence-margin-top', unit: 'rem' },\n stimulusChoicesMarginTopRem: { varName: '--mpb-stimulus-choices-margin-top', unit: 'rem' },\n tokenGridColumnGapRem: { varName: '--mpb-token-grid-column-gap', unit: 'rem' },\n tokenGridRowGapRem: { varName: '--mpb-token-grid-row-gap', unit: 'rem' },\n tokenTemplateMarginTopRem: { varName: '--mpb-token-template-margin-top', unit: 'rem' },\n tokenInlineTokenGapRem: { varName: '--mpb-token-inline-token-gap', unit: 'rem' },\n tokenChoicesMarginTopRem: { varName: '--mpb-token-choices-margin-top', unit: 'rem' },\n inlineGridColumnGapRem: { varName: '--mpb-inline-grid-column-gap', unit: 'rem' },\n inlineGridRowGapRem: { varName: '--mpb-inline-grid-row-gap', unit: 'rem' },\n inlineTemplateMarginTopRem: { varName: '--mpb-inline-template-margin-top', unit: 'rem' },\n inlineChoicesMarginTopRem: { varName: '--mpb-inline-choices-margin-top', unit: 'rem' },\n};\n\nexport const DEFAULT_LAYOUT_PROFILE_PRESETS: Record<string, Partial<LayoutLimits>> = {\n audio_blank_only: {\n blankWideWidthRem: 10,\n blankUnderlineWideWidthPx: 6,\n horizontalChoiceTileMinHeightRem: 11.25,\n horizontalChoiceContentMinHeightRem: 9.375,\n choiceGroupGapRem: 1,\n audioBlankTemplateMarginBottomRem: 1.875,\n },\n stimulus_image_blank: {\n blankWideWidthRem: 10,\n blankUnderlineWideWidthPx: 6,\n },\n token_sequence: {\n blankStandaloneWidthRem: 7,\n blankUnderlineWideWidthPx: 6,\n },\n};\n\nexport interface LayoutStyleResult {\n rootStyle: string;\n blankWidth: string;\n blankBorderWidth: string;\n legendMaxChars: number;\n}\n\nexport function computeLayoutStyle(params: {\n layoutProfile: string;\n isBlankOnlyTemplate: boolean;\n configuredLimits: unknown;\n customProfilePresets: unknown;\n}): LayoutStyleResult {\n const { layoutProfile, isBlankOnlyTemplate } = params;\n\n const configured =\n params.configuredLimits && typeof params.configuredLimits === 'object'\n ? (params.configuredLimits as Partial<LayoutLimits>)\n : {};\n const customPresets =\n params.customProfilePresets && typeof params.customProfilePresets === 'object'\n ? (params.customProfilePresets as Record<string, unknown>)\n : {};\n const customForProfile =\n customPresets[layoutProfile] && typeof customPresets[layoutProfile] === 'object'\n ? (customPresets[layoutProfile] as Partial<LayoutLimits>)\n : {};\n const profilePreset: Partial<LayoutLimits> = {\n ...(DEFAULT_LAYOUT_PROFILE_PRESETS[layoutProfile] ?? {}),\n ...customForProfile,\n };\n const l: LayoutLimits = { ...DEFAULT_LAYOUT_LIMITS, ...configured, ...profilePreset };\n\n const wideBlankProfiles = ['audio_blank_only', 'stimulus_image_blank'];\n const wideUnderlineProfiles = ['audio_blank_only', 'stimulus_image_blank', 'token_sequence'];\n\n const blankWidth = wideBlankProfiles.includes(layoutProfile)\n ? `${l.blankWideWidthRem}rem`\n : isBlankOnlyTemplate\n ? `${l.blankStandaloneWidthRem}rem`\n : 'auto';\n\n const blankBorderWidth = wideUnderlineProfiles.includes(layoutProfile)\n ? `${l.blankUnderlineWideWidthPx}px`\n : `${l.blankUnderlineWidthPx}px`;\n\n const cssVars = (Object.keys(CSS_VAR_SPEC) as (keyof typeof CSS_VAR_SPEC)[]).map(\n (key) => `${CSS_VAR_SPEC[key].varName}:${l[key]}${CSS_VAR_SPEC[key].unit}`\n );\n const rootStyle = cssVars.join(';');\n\n return { rootStyle, blankWidth, blankBorderWidth, legendMaxChars: l.legendMaxChars };\n}\n","export type AudioButtonSkin = { silentUrl: string; playingUrl: string };\n\nexport const DEFAULT_AUDIO_BUTTON_SKINS: Record<string, AudioButtonSkin> = {\n default: {\n silentUrl:\n 'https://assets.learnosity.com/organisations/844/0c9f2aa3-3cd5-4de7-93ef-541c24ca35da.svg',\n playingUrl:\n 'https://assets.learnosity.com/organisations/844/231dfdc2-c113-4be5-91fb-e75a0ca5994b.svg',\n },\n es: {\n silentUrl:\n 'https://assets.learnosity.com/organisations/844/27a9d5b5-d873-4bd5-b9ba-22748782d8ba.svg',\n playingUrl:\n 'https://assets.learnosity.com/organisations/844/120f216d-96b7-4560-94b8-1d90710216b7.svg',\n },\n};\n\n/**\n * Resolves the audio button skin to display.\n * Priority: byLocale[exact] > byLocale[lang] > byLocale.default > customSingle > built-in default\n */\nexport function computeFeatureAudioSkin(params: {\n locale: unknown;\n audioButtonSkin: unknown;\n audioButtonSkinsByLocale: unknown;\n}): AudioButtonSkin {\n const locale = String(params.locale || '').toLowerCase();\n const lang = locale.slice(0, 2);\n const byLocale =\n params.audioButtonSkinsByLocale && typeof params.audioButtonSkinsByLocale === 'object'\n ? (params.audioButtonSkinsByLocale as Record<string, unknown>)\n : {};\n const customSingle =\n params.audioButtonSkin && typeof params.audioButtonSkin === 'object'\n ? (params.audioButtonSkin as AudioButtonSkin)\n : null;\n const defaultSkin = locale.startsWith('es')\n ? DEFAULT_AUDIO_BUTTON_SKINS.es\n : DEFAULT_AUDIO_BUTTON_SKINS.default;\n return (byLocale[locale] ||\n byLocale[lang] ||\n byLocale.default ||\n customSingle ||\n defaultSkin) as AudioButtonSkin;\n}\n\n/**\n * Returns the choice id that the ClozeMarker and selected-state highlight should display.\n * While the correct answer is revealed in evaluate mode it is the correct choice.\n * A player that shows the key outside evaluate hands over the correct-response\n * session from `createCorrectResponseSession`, which is displayed as the selection.\n */\nexport function computeDisplayChoiceId(params: {\n selectedId: string;\n isEvaluateMode: boolean;\n showCorrectAnswer: boolean;\n correctChoiceId: string;\n}): string {\n const { selectedId, isEvaluateMode, showCorrectAnswer, correctChoiceId } = params;\n if (isEvaluateMode && showCorrectAnswer && correctChoiceId) return correctChoiceId;\n return selectedId;\n}\n\n/**\n * Returns the result the screen-reader-only announcement reports after evaluate\n * mode scoring. Empty string means nothing is announced.\n */\nexport function computeResultStatus(params: {\n isEvaluateMode: boolean;\n showCorrectAnswer: boolean;\n isCorrect: boolean;\n isIncorrect: boolean;\n selectedId: string;\n}): 'correct' | 'incorrect' | '' {\n const { isEvaluateMode, showCorrectAnswer, isCorrect, isIncorrect, selectedId } = params;\n if (!isEvaluateMode || showCorrectAnswer) return '';\n if (isCorrect) return 'correct';\n if (isIncorrect && selectedId) return 'incorrect';\n return '';\n}\n\n/**\n * Returns the visible legend text for the choices fieldset.\n * Strips HTML, truncates to legendMaxChars with an ellipsis, falls back to answerChoicesLabel.\n */\nexport function computeLegendText(params: {\n prompt: string;\n legendMaxChars: number;\n answerChoicesLabel: string;\n}): string {\n const { prompt, legendMaxChars, answerChoicesLabel } = params;\n const plain = prompt\n .replace(/<[^>]+>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n const maxChars = Math.max(8, legendMaxChars);\n if (!plain) return answerChoicesLabel;\n return plain.length > maxChars ? `${plain.slice(0, Math.max(1, maxChars - 1))}…` : plain;\n}\n","import selR1BaseCss from './cqt-css/sel-r1-base.css?raw';\nimport selR1PlusgggCss from './cqt-css/sel-r1-plusggg.css?raw';\nimport srVicCss from './cqt-css/sr-vic.css?raw';\nimport selVicCss from './cqt-css/sel-vic.css?raw';\nimport selR1GplusgggCss from './cqt-css/sel-r1-gplusggg.css?raw';\nimport selR1GStemCss from './cqt-css/sel-r1-g-stem.css?raw';\nimport selR1GgPlusCss from './cqt-css/sel-r1-gg-plus.css?raw';\nimport selR1GgplusCss from './cqt-css/sel-r1-ggplus.css?raw';\nimport selR1S3Css from './cqt-css/sel-r1-s3.css?raw';\n\nexport type VariantCssConfig = {\n variantId: string;\n variantClass: string;\n sourceUrl: string;\n cssText: string;\n};\n\nconst VARIANT_BY_CUSTOM_TYPE: Record<string, VariantCssConfig> = {\n 'sel_r1-_plusggg': {\n variantId: 'sel-r1-plusggg',\n variantClass: 'variant-sel-r1-plusggg',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css',\n cssText: selR1PlusgggCss,\n },\n 'sr-vic': {\n variantId: 'sr-vic',\n variantClass: 'variant-sr-vic',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sr-vic/0.0.1/question.css',\n cssText: srVicCss,\n },\n sel_vic: {\n variantId: 'sel-vic',\n variantClass: 'variant-sel-vic',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css',\n cssText: selVicCss,\n },\n 'sel_r1-_gplusggg': {\n variantId: 'sel-r1-gplusggg',\n variantClass: 'variant-sel-r1-gplusggg',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_gplusggg/0.0.1/question.css',\n cssText: selR1GplusgggCss,\n },\n 'sel_r1-g_plusggg': {\n variantId: 'sel-r1-g-stem',\n variantClass: 'variant-sel-r1-g-stem',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-g_plusggg/0.0.1/question.css',\n cssText: selR1GStemCss,\n },\n 'sel_r1-gg_plusggg': {\n variantId: 'sel-r1-gg-plus',\n variantClass: 'variant-sel-r1-gg-plus',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-gg_plusggg/0.0.1/question.css',\n cssText: selR1GgPlusCss,\n },\n 'sel_r1-_ggplusggg': {\n variantId: 'sel-r1-ggplus',\n variantClass: 'variant-sel-r1-ggplus',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_ggplusggg/0.0.1/question.css',\n cssText: selR1GgplusCss,\n },\n 'sel_r1-s3_plusggg': {\n variantId: 'sel-r1-s3',\n variantClass: 'variant-sel-r1-s3',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css',\n cssText: selR1S3Css,\n },\n};\n\nconst normalizeCustomType = (value: unknown): string => {\n const normalized = String(value || '')\n .trim()\n .toLowerCase();\n // Accept both base custom types and version-suffixed tags like \"...v0.0.1\".\n return normalized.replace(/v\\d+\\.\\d+\\.\\d+$/i, '');\n};\n\nexport const getVariantCssConfig = (customType: unknown): VariantCssConfig | undefined => {\n const normalized = normalizeCustomType(customType);\n return VARIANT_BY_CUSTOM_TYPE[normalized];\n};\n\nexport const getVariantRootClass = (customType: unknown): string => {\n return getVariantCssConfig(customType)?.variantClass || '';\n};\n\nconst SEL_R1_VARIANT_IDS = new Set([\n 'sel-r1-plusggg',\n 'sel-r1-gplusggg',\n 'sel-r1-g-stem',\n 'sel-r1-gg-plus',\n 'sel-r1-ggplus',\n 'sel-r1-s3',\n]);\n\nconst ROOT_SELECTOR = /\\.mc-populated-blank-root(?![\\w-])/g;\n\n/** FNV-1a over the text, in base 36. */\nconst hashText = (text: string): string => {\n let hash = 0x811c9dc5;\n for (let i = 0; i < text.length; i++) {\n hash ^= text.charCodeAt(i);\n hash = Math.imul(hash, 0x01000193);\n }\n return (hash >>> 0).toString(36);\n};\n\n/**\n * Names this build's variant sheets. The sheets are global, so each selector is\n * narrowed to roots carrying the same key: two versions of the element on one\n * page then style only their own roots, and share a sheet only when the CSS is\n * identical.\n */\nexport const VARIANT_CSS_KEY = hashText(\n [selR1BaseCss, ...Object.values(VARIANT_BY_CUSTOM_TYPE).map((c) => c.cssText)].join('\\n')\n);\n\n/** `:where()` adds no specificity, so the variant sheets cascade exactly as written. */\nexport const keyVariantCss = (cssText: string): string =>\n cssText.replace(\n ROOT_SELECTOR,\n `.mc-populated-blank-root:where([data-mpb-css=\"${VARIANT_CSS_KEY}\"])`\n );\n\nconst injectStyleOnce = (target: Document | ShadowRoot, variantName: string, cssText: string) => {\n const id = `mc-populated-blank-css-${variantName}-${VARIANT_CSS_KEY}`;\n if (target.getElementById(id)) return;\n const style = document.createElement('style');\n style.id = id;\n style.setAttribute('data-mpb-variant', variantName);\n style.textContent = keyVariantCss(cssText);\n (target instanceof ShadowRoot ? target : target.head).appendChild(style);\n};\n\n/**\n * Adds the item's variant sheet where `root` renders: the document head, or the\n * shadow root of a host that placed the element inside one, which document\n * styles do not reach.\n */\nexport const ensureVariantCssInjected = (config: VariantCssConfig | undefined, root: Element) => {\n if (!config?.cssText || typeof document === 'undefined') {\n return;\n }\n const rootNode = root.getRootNode();\n const target = rootNode instanceof ShadowRoot ? rootNode : document;\n if (SEL_R1_VARIANT_IDS.has(config.variantId)) {\n injectStyleOnce(target, 'sel-r1-base', selR1BaseCss);\n }\n injectStyleOnce(target, config.variantId, config.cssText);\n};\n","<svelte:options\n customElement={{\n shadow: 'none',\n props: {\n model: { type: 'Object' },\n session: { type: 'Object' },\n options: { type: 'Object' },\n },\n }}\n/>\n\n<script lang=\"ts\">\nimport { forwardSessionChange, resolveDeliveryHost } from '@pie-lib/delivery-events-svelte';\nimport AudioPlayer from './AudioPlayer.svelte';\nimport ClozeMarker from './ClozeMarker.svelte';\nimport ChoiceRow from './ChoiceRow.svelte';\nimport TeacherInstructions from './TeacherInstructions.svelte';\nimport { computeChoiceCorrectness } from './computeChoiceCorrectness';\nimport { computeLayoutProfile } from './computeLayoutProfile';\nimport { computeLayoutStyle } from './computeLayoutStyle';\nimport {\n computeFeatureAudioSkin,\n computeDisplayChoiceId,\n computeResultStatus,\n computeLegendText,\n} from './computeDisplayState';\nimport {\n ensureVariantCssInjected,\n getVariantCssConfig,\n getVariantRootClass,\n VARIANT_CSS_KEY,\n} from './variant-css-map';\nimport { t as translate, tCommon } from './i18n';\n\nconst BLANK_TOKEN = '{{blank}}';\n\nlet { model, session } = $props<{ model?: any; session?: any; options?: any }>();\nconst t = (key: string) => translate(key, model?.language);\nlet localChoiceId = $state('');\nlet toggleCorrectAnswerButtonEl = $state<HTMLButtonElement | null>(null);\nlet choicesGroupEl = $state<HTMLDivElement | null>(null);\nlet rootEl = $state<HTMLDivElement | null>(null);\nconst instanceId = `mc-populated-blank-${Math.random().toString(36).slice(2, 10)}`;\n\n// ---------------------------------------------------------------------------\n// Cluster: modeFlags — delivery mode, correctness, and answer-reveal state\n// Feeds: shouldShowCorrectAnswerToggle, choiceState, a11y\n// ---------------------------------------------------------------------------\nconst deliveryMode = $derived((model?.mode || model?.env?.mode || '').toString());\nconst isEvaluateMode = $derived(deliveryMode === 'evaluate');\nconst correctness = $derived(model?.correctness);\nconst isResponseCorrect = $derived(\n typeof model?.responseCorrect === 'boolean' ? model.responseCorrect : correctness === 'correct'\n);\nconst isCorrect = $derived(correctness === 'correct');\nconst isIncorrect = $derived(correctness === 'incorrect');\n\nlet showCorrectAnswer = $state(false);\nconst shouldShowCorrectAnswerToggle = $derived(\n isEvaluateMode && !isResponseCorrect && !!model?.correctChoiceId\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: layoutConfig — profile limits, blank sizing, choice layout, audio mode\n// Feeds: layout (rootStyle, blankWidth, blankBorderWidth, legendMaxChars), audioMode, choiceState\n// ---------------------------------------------------------------------------\nconst layoutProfile = $derived(model?.layoutProfile || '');\nconst layoutProfileFlags = $derived(\n computeLayoutProfile({\n interactionMode: model?.interactionMode,\n template: model?.template,\n choiceLayout: model?.choiceLayout,\n layoutProfile,\n hasAudio: model?.hasAudio,\n useFeatureButtonAudio: model?.useFeatureButtonAudio,\n })\n);\nconst isAudioOnlyMode = $derived(layoutProfileFlags.isAudioOnlyMode);\nconst isBlankOnlyTemplate = $derived(layoutProfileFlags.isBlankOnlyTemplate);\nconst isHorizontalChoices = $derived(layoutProfileFlags.isHorizontalChoices);\nconst hasInlineSentenceAudioLayout = $derived(layoutProfileFlags.hasInlineSentenceAudioLayout);\nconst useFeatureButtonAudio = $derived(layoutProfileFlags.useFeatureButtonAudio);\nconst layout = $derived(\n computeLayoutStyle({\n layoutProfile,\n isBlankOnlyTemplate,\n configuredLimits: model?.layoutLimits,\n customProfilePresets: model?.layoutProfilePresets,\n })\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: choiceState — selection, display choice, per-choice correctness, result text\n// Feeds: template blank display, choice rendering, fieldset, result sr-only text\n// ---------------------------------------------------------------------------\nconst choices = $derived(Array.isArray(model?.choices) ? model.choices : []);\nconst choiceMode = $derived(model?.choiceMode || 'text');\nconst selectedId = $derived(session?.choiceId || localChoiceId || '');\nconst radioGroupName = $derived(`${instanceId}-choice-group-${model?.id || '1'}`);\nconst displayChoiceId = $derived(\n computeDisplayChoiceId({\n selectedId,\n isEvaluateMode,\n showCorrectAnswer,\n correctChoiceId: String(model?.correctChoiceId || ''),\n })\n);\nconst displayChoice = $derived.by(() => choices.find((c: any) => c.id === displayChoiceId));\nconst displayChoiceLabelHtml = $derived.by(() => String(displayChoice?.labelHtml || ''));\nconst resultStatus = $derived(\n computeResultStatus({ isEvaluateMode, showCorrectAnswer, isCorrect, isIncorrect, selectedId })\n);\nconst resultText = $derived(\n resultStatus === 'correct'\n ? t('correctAnswerSelected')\n : resultStatus === 'incorrect'\n ? t('incorrectAnswerSelected')\n : ''\n);\nconst choiceCorrectnessById = $derived(\n computeChoiceCorrectness({\n isEvaluateMode,\n correctChoiceId: String(model?.correctChoiceId || ''),\n selectedId: String(selectedId || ''),\n showCorrectAnswer,\n })\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: a11y — stable IDs, aria labelling, described-by relationships\n// Feeds: fieldset legend, radiogroup labelling, template described-by\n// ---------------------------------------------------------------------------\nconst promptId = $derived(`${instanceId}-prompt`);\nconst legendId = $derived(`${instanceId}-choices-legend`);\nconst resultId = $derived(`${instanceId}-result`);\nconst blankHintId = $derived(`${instanceId}-blank-hint`);\nconst legendText = $derived(\n computeLegendText({\n prompt: model?.prompt || '',\n legendMaxChars: layout.legendMaxChars,\n answerChoicesLabel: t('answerChoices'),\n })\n);\nconst choicesGroupLabelledBy = $derived(model?.prompt ? promptId : undefined);\nconst choicesGroupAriaLabel = $derived.by(() => {\n if (model?.prompt) return undefined;\n const explicit = String(model?.choiceGroupLabel || '').trim();\n if (explicit) return explicit;\n return legendText;\n});\n// The transcript is not among these: it is rendered by the player from the item's\n// accessibility catalog (PIE-902), so this element neither owns the node nor has\n// an id to point at. It is placed immediately before this content in reading\n// order instead, as a labelled region.\nconst templateDescribedBy = $derived.by(() => (model?.prompt ? promptId : undefined));\n\n// ---------------------------------------------------------------------------\n// Misc — locale, audio error, template parsing, variant CSS, style strings\n// ---------------------------------------------------------------------------\n// An item with no language gets no `lang`, so it inherits the host page's instead\n// of being announced as English. `es_MX` is written as the BCP 47 tag `es-MX`.\nconst lang = $derived.by(() => {\n const language = String(model?.language || model?.locale || '').trim();\n return language ? language.replace(/_/g, '-') : undefined;\n});\nconst variantCssConfig = $derived(getVariantCssConfig(model?.customType));\nconst variantRootClass = $derived(getVariantRootClass(model?.customType));\nconst templateParts = $derived.by(() => {\n const t = model?.template || '';\n const idx = t.indexOf(BLANK_TOKEN);\n if (idx < 0) return { before: t, after: '' };\n let before = t.slice(0, idx);\n let after = t.slice(idx + BLANK_TOKEN.length);\n // LSY's shared cloze renderer (Renaissance components/src/cloze.js) emits\n // literal `&nbsp;` on BOTH sides of the cloze span unconditionally:\n // `&nbsp;<span ... -cloze-blank></span><span ... -cloze>…</span>&nbsp;`.\n // Mirror that ONLY for inline_sentence layouts (sel-vic, sr-vic, plain\n // sentence). Token-sequence layouts arrange tokens in a grid with explicit\n // sibling-margin spacing, so injecting NBSP throws off those tuned gaps;\n // they don't suffer the wrap-leader symptom either because each token has\n // its own grid placement. This (a) keeps the cloze glued to its neighbors\n // so it doesn't dangle at the start of a wrapped line (CONTOOL-2574), and\n // (b) matches LSY's cloze→adjacent-text gap when the author wrote no\n // whitespace around {{blank}} (CONTOOL-2572: e.g. `…word: {{blank}}.`).\n if (layoutProfile === 'inline_sentence') {\n before = `${before.replace(/\\s+$/, '')} `;\n after = ` ${after.replace(/^\\s+/, '')}`;\n }\n return { before, after };\n});\n\n// The player owns the session's `id` and `element` (the versioned tag it\n// registered this element under), so neither is written here.\nfunction emitSession(updatedSession: any, sourceEl?: HTMLElement | null) {\n forwardSessionChange({\n sourceEl,\n session: updatedSession,\n complete: !!updatedSession?.choiceId,\n });\n}\n\nfunction onRadioChange(e: Event) {\n const input = e.target as HTMLInputElement;\n if (!input.checked) return;\n const choiceId = input.value;\n localChoiceId = choiceId;\n emitSession({ ...session, choiceId }, input);\n}\n\nfunction toggleCorrectAnswer() {\n if (!shouldShowCorrectAnswerToggle) return;\n showCorrectAnswer = !showCorrectAnswer;\n}\n\n$effect(() => {\n if (!isEvaluateMode || isResponseCorrect) {\n showCorrectAnswer = false;\n }\n});\n\nfunction onRadioGroupKeydown(e: KeyboardEvent) {\n if (model?.disabled) return;\n const key = e.key;\n if (!['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft'].includes(key)) return;\n e.preventDefault();\n const container = e.currentTarget as HTMLElement;\n const inputs = Array.from(\n container.querySelectorAll('input[type=\"radio\"]:not([disabled])')\n ) as HTMLInputElement[];\n if (inputs.length === 0) return;\n let idx = inputs.findIndex((i) => i.checked);\n if (key === 'ArrowDown' || key === 'ArrowRight') {\n idx = idx < 0 ? 0 : (idx + 1) % inputs.length;\n } else {\n idx = idx < 0 ? inputs.length - 1 : (idx - 1 + inputs.length) % inputs.length;\n }\n const next = inputs[idx];\n next.checked = true;\n next.dispatchEvent(new Event('change', { bubbles: true }));\n next.focus();\n}\n\nconst featureAudioSkin = $derived(\n computeFeatureAudioSkin({\n locale: model?.locale,\n audioButtonSkin: model?.audioButtonSkin,\n audioButtonSkinsByLocale: model?.audioButtonSkinsByLocale,\n })\n);\n\nfunction onAudioStarted() {\n resolveDeliveryHost(rootEl)?.onAudioStarted?.();\n}\n\nfunction onAudioEnded() {\n resolveDeliveryHost(rootEl)?.onAudioEnded?.();\n}\n\n// Follows the session both ways: a player that resets or replaces the session\n// clears the selection instead of leaving the previous pick on screen.\n$effect(() => {\n localChoiceId = session?.choiceId || '';\n});\n\n$effect(() => {\n const btn = toggleCorrectAnswerButtonEl;\n if (!btn) return;\n btn.addEventListener('click', toggleCorrectAnswer);\n return () => btn.removeEventListener('click', toggleCorrectAnswer);\n});\n\n// Delegated listeners on the choices group — two events with a radio-guard on change.\n$effect(() => {\n const group = choicesGroupEl;\n if (!group) return;\n const handleChange = (e: Event) => {\n const target = e.target as HTMLInputElement | null;\n if (target?.type !== 'radio') return;\n onRadioChange(e);\n };\n const handleKeydown = (e: KeyboardEvent) => onRadioGroupKeydown(e);\n group.addEventListener('change', handleChange);\n group.addEventListener('keydown', handleKeydown);\n return () => {\n group.removeEventListener('change', handleChange);\n group.removeEventListener('keydown', handleKeydown);\n };\n});\n\n$effect(() => {\n if (rootEl) ensureVariantCssInjected(variantCssConfig, rootEl);\n});\n</script>\n\n<div\n bind:this={rootEl}\n class={`mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${layoutProfile} ${variantRootClass} ${hasInlineSentenceAudioLayout ? 'has-inline-audio' : ''}`}\n lang={lang}\n style={layout.rootStyle}\n data-mpb-css={VARIANT_CSS_KEY}\n>\n {#if model?.teacherInstructions}\n <TeacherInstructions html={model.teacherInstructions} language={model?.language} />\n {/if}\n\n {#if model?.prompt}\n <div class=\"pie-prompt\" id={promptId}>{@html model.prompt}</div>\n {/if}\n\n {#if shouldShowCorrectAnswerToggle}\n <div class=\"pie-correct-answer-toggle-row\">\n <button\n bind:this={toggleCorrectAnswerButtonEl}\n type=\"button\"\n class=\"pie-toggle-correct-answer\"\n style=\"gap:var(--mpb-toggle-button-gap, 0.5rem);\"\n aria-pressed={showCorrectAnswer}\n data-testid=\"show-correct-answer\"\n >\n <span class=\"pie-correct-answer-toggle-content\">\n <span class=\"pie-correct-answer-toggle-icon-holder\" aria-hidden=\"true\">\n {#if showCorrectAnswer}\n <svg\n class=\"pie-correct-answer-toggle-svg\"\n preserveAspectRatio=\"xMinYMin meet\"\n version=\"1.1\"\n viewBox=\"-283 359 34 35\"\n >\n <circle cx=\"-266\" cy=\"375.9\" r=\"14\" fill=\"var(--pie-tertiary-light, #d0e2f0)\" />\n <path\n 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\"\n fill=\"var(--pie-tertiary-light, #d0e2f0)\"\n />\n <polygon\n 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\"\n fill=\"var(--pie-tertiary, #146eb3)\"\n />\n </svg>\n {:else}\n <svg\n class=\"pie-correct-answer-toggle-svg\"\n preserveAspectRatio=\"xMinYMin meet\"\n version=\"1.1\"\n viewBox=\"-129.5 127 34 35\"\n >\n <path\n 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\"\n fill=\"#D0CAC5\"\n stroke=\"#E6E3E0\"\n stroke-width=\"0.75\"\n />\n <path\n 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\"\n fill=\"#B3ABA4\"\n stroke=\"#CDC7C2\"\n stroke-width=\"0.5\"\n />\n <circle cx=\"-114.2\" cy=\"143.5\" r=\"14\" fill=\"white\" />\n <path\n 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\"\n fill=\"var(--pie-background-dark, #ecedf1)\"\n />\n <polygon\n points=\"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\"\n fill=\"var(--pie-tertiary, #146eb3)\"\n />\n </svg>\n {/if}\n </span>\n <span class=\"pie-correct-answer-toggle-label\">\n {tCommon(showCorrectAnswer ? 'hideCorrectAnswer' : 'showCorrectAnswer', model?.language)}\n </span>\n </span>\n </button>\n </div>\n {/if}\n\n <AudioPlayer\n hasAudio={!!model?.hasAudio}\n audioUrl={model?.audioUrl}\n {useFeatureButtonAudio}\n autoplayEnabled={!!model?.autoplayAudioEnabled}\n {featureAudioSkin}\n language={model?.language}\n onaudiostarted={onAudioStarted}\n onaudioended={onAudioEnded}\n />\n\n {#if model?.sentenceHtml}\n <div class=\"sentence-line pie-sentence-line\" aria-describedby={templateDescribedBy}>\n {@html model.sentenceHtml}\n </div>\n {/if}\n\n {#if !isAudioOnlyMode}\n <div class=\"template-line pie-template-line\" aria-describedby={templateDescribedBy}\n >{@html templateParts.before}<ClozeMarker\n {choiceMode}\n displayChoice={displayChoice}\n {displayChoiceLabelHtml}\n isStandalone={isBlankOnlyTemplate}\n blankWidth={layout.blankWidth}\n blankBorderWidth={layout.blankBorderWidth}\n ariaLabel={t('blankLabel')}\n language={model?.language}\n />{@html templateParts.after}</div>\n {/if}\n\n {#if resultText}\n <p id={resultId} class=\"sr-only pie-result-feedback\" role=\"status\" aria-live=\"polite\">{resultText}</p>\n {/if}\n\n <p id={blankHintId} class=\"sr-only pie-blank-hint\">{t('blankPreSelectionHint')}</p>\n\n <fieldset class=\"pie-choices-fieldset\" disabled={model?.disabled}>\n <legend class=\"sr-only pie-choices-legend\" id={legendId}>{legendText}</legend>\n <div\n bind:this={choicesGroupEl}\n class={`pie-choices ${isHorizontalChoices ? 'choices-horizontal' : 'choices-vertical'}`}\n style=\"gap:var(--mpb-choice-group-gap, 0.5rem);\"\n role=\"radiogroup\"\n tabindex=\"-1\"\n aria-labelledby={choicesGroupLabelledBy}\n aria-label={choicesGroupAriaLabel}\n aria-describedby={[blankHintId, resultText ? resultId : undefined].filter(Boolean).join(' ')}\n >\n {#each choices as c (c.id)}\n <ChoiceRow\n choice={c}\n {choiceMode}\n isHorizontal={isHorizontalChoices}\n isSelected={displayChoiceId === c.id}\n isDisabled={!!model?.disabled}\n correctness={choiceCorrectnessById.get(c.id)}\n {isEvaluateMode}\n {instanceId}\n {radioGroupName}\n language={model?.language}\n />\n {/each}\n </div>\n </fieldset>\n</div>\n\n<style>\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n /* Layout is self-contained: PIE players ship no Tailwind, so no utility class or\n preflight reset can be assumed. The blank slot, choice tiles and variant\n max-widths are sized for border-box. */\n .mc-populated-blank-root,\n .mc-populated-blank-root :global(*),\n .mc-populated-blank-root :global(*::before),\n .mc-populated-blank-root :global(*::after) {\n box-sizing: border-box;\n }\n\n /* An authored image on its own line (the sel_r1-s3 stimulus) would otherwise sit\n on the text baseline and add the descender gap below it. */\n .mc-populated-blank-root :global(img) {\n vertical-align: middle;\n }\n\n .mc-populated-blank-root {\n --mpb-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );\n padding: 1rem;\n }\n\n .pie-prompt {\n margin-bottom: 1rem;\n }\n\n /* Flush paragraphs, as the demo app's preflight reset rendered them. */\n .pie-prompt :global(p),\n .sentence-line :global(p) {\n margin: 0;\n }\n\n .sentence-line {\n margin-bottom: 0.75rem;\n }\n\n .pie-toggle-correct-answer {\n width: 100%;\n cursor: pointer;\n border: 0;\n background: transparent;\n padding: 0;\n margin-bottom: 0.75rem;\n display: flex;\n justify-content: center;\n text-align: center;\n font: inherit;\n color: var(--pie-text, black);\n }\n\n .pie-correct-answer-toggle-row {\n width: 100%;\n display: flex;\n justify-content: flex-end;\n }\n\n .pie-correct-answer-toggle-content {\n display: flex;\n margin: 0 auto;\n align-items: center;\n }\n\n .pie-correct-answer-toggle-icon-holder {\n width: 25px;\n margin-right: 5px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n .pie-correct-answer-toggle-svg {\n width: 25px;\n height: 25px;\n }\n\n .pie-correct-answer-toggle-label {\n width: fit-content;\n min-width: 140px;\n align-self: center;\n vertical-align: middle;\n font-weight: 400;\n user-select: none;\n }\n\n .pie-toggle-correct-answer:hover .pie-correct-answer-toggle-label,\n .pie-toggle-correct-answer:focus-visible .pie-correct-answer-toggle-label {\n text-decoration: underline;\n }\n\n .template-line {\n white-space: pre-wrap;\n margin-bottom: 1rem;\n }\n\n .template-line :global(p) {\n margin: 0;\n display: inline;\n }\n\n .pie-choices-fieldset {\n border: 0;\n padding: 0;\n margin: 0;\n }\n\n .pie-choices {\n display: flex;\n }\n\n .choices-horizontal {\n flex-direction: row;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: center;\n }\n\n .choices-vertical {\n flex-direction: column;\n }\n\n .layout-audio_blank_only :global(.pie-audio-container),\n .layout-stimulus_image_blank :global(.pie-audio-container) {\n display: flex;\n width: min(100%, var(--mpb-audio-instructions-max-width, 875px));\n margin-left: auto;\n margin-right: auto;\n justify-content: flex-end;\n }\n\n .layout-audio_blank_only .template-line,\n .layout-stimulus_image_blank .template-line {\n text-align: center;\n margin: var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);\n }\n\n .layout-audio_blank_only fieldset {\n display: flex;\n justify-content: center;\n }\n\n .layout-audio_blank_only :global(.pie-blank-slot),\n .layout-stimulus_image_blank :global(.pie-blank-slot) {\n width: var(--mpb-blank-wide-width, 10rem);\n border-bottom-width: var(--mpb-blank-underline-wide-width, 6px);\n min-height: 160px;\n padding-bottom: 4px;\n }\n\n .layout-stimulus_image_blank {\n display: grid;\n grid-template-columns: minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;\n grid-template-areas:\n 'sentence audio'\n '. template'\n 'choices choices';\n column-gap: var(--mpb-stimulus-grid-column-gap, 2rem);\n row-gap: var(--mpb-stimulus-grid-row-gap, 0.7rem);\n align-items: start;\n }\n\n .layout-stimulus_image_blank :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n }\n\n .layout-stimulus_image_blank .sentence-line {\n grid-area: sentence;\n margin: var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;\n }\n\n .layout-stimulus_image_blank .template-line {\n grid-area: template;\n margin: 0;\n text-align: center;\n justify-self: center;\n }\n\n .layout-stimulus_image_blank fieldset {\n grid-area: choices;\n margin-top: var(--mpb-stimulus-choices-margin-top, 0.9rem);\n }\n\n .layout-token_sequence {\n display: grid;\n grid-template-columns: 1fr auto;\n grid-template-areas:\n 'audio audio'\n 'template template'\n 'choices choices';\n column-gap: var(--mpb-token-grid-column-gap, 1.5rem);\n row-gap: var(--mpb-token-grid-row-gap, 0.8rem);\n align-items: start;\n }\n\n .layout-token_sequence :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n }\n\n .layout-token_sequence .template-line {\n grid-area: template;\n margin: var(--mpb-token-template-margin-top, 0.6rem) 0 0;\n justify-self: center;\n text-align: center;\n }\n\n .layout-token_sequence .template-line :global(span + span) {\n margin-left: var(--mpb-token-inline-token-gap, 0.35rem);\n }\n\n .layout-token_sequence :global(.pie-blank-slot) {\n width: var(--mpb-blank-standalone-width, 7rem);\n border-bottom-width: var(--mpb-blank-underline-wide-width, 4px);\n margin-left: var(--mpb-token-inline-token-gap, 0.35rem);\n }\n\n .layout-token_sequence fieldset {\n grid-area: choices;\n margin-top: var(--mpb-token-choices-margin-top, 0.2rem);\n }\n\n .layout-inline_sentence.has-inline-audio {\n display: grid;\n grid-template-columns: minmax(var(--mpb-text-min-column, 260px), 1fr) auto;\n grid-template-areas:\n 'template audio'\n 'choices choices';\n column-gap: var(--mpb-inline-grid-column-gap, 1.5rem);\n row-gap: var(--mpb-inline-grid-row-gap, 0.65rem);\n align-items: start;\n }\n\n .layout-inline_sentence.has-inline-audio :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n }\n\n .layout-inline_sentence.has-inline-audio .template-line {\n grid-area: template;\n margin: var(--mpb-inline-template-margin-top, 0.45rem) 0 0;\n text-align: center;\n justify-self: center;\n }\n\n .layout-inline_sentence.has-inline-audio fieldset {\n grid-area: choices;\n margin-top: var(--mpb-inline-choices-margin-top, 0.25rem);\n }\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) {\n .layout-audio_blank_only :global(.pie-audio-container),\n .layout-stimulus_image_blank :global(.pie-audio-container),\n .layout-token_sequence :global(.pie-audio-container),\n .layout-inline_sentence.has-inline-audio :global(.pie-audio-container) {\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n justify-content: flex-start;\n justify-self: start;\n }\n\n .layout-audio_blank_only .pie-choices,\n .layout-token_sequence .pie-choices,\n .layout-stimulus_image_blank .pie-choices,\n .layout-inline_sentence.has-inline-audio .pie-choices {\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n .layout-audio_blank_only .choice-row-horizontal,\n .layout-token_sequence .choice-row-horizontal,\n .layout-stimulus_image_blank .choice-row-horizontal,\n .layout-inline_sentence.has-inline-audio .choice-row-horizontal {\n width: min(100%, var(--mpb-narrow-choice-max-width, 230px));\n align-items: flex-start;\n }\n }\n</style>\n","import McPopulatedBlankComponent from './McPopulatedBlank.svelte';\nimport {\n ModelSetEvent,\n SessionChangedEvent,\n writeSessionInPlace,\n} from '@pie-lib/delivery-events-svelte';\n\nfunction isComplete(model: any, session: any, audioComplete = false): boolean {\n if (!session?.choiceId) return false;\n const requiresAudioCompletion =\n !!model?.autoplayAudioEnabled && !!model?.completeAudioEnabled && !!model?.hasAudio;\n if (requiresAudioCompletion && !audioComplete) return false;\n return true;\n}\n\nconst SvelteElementClass = (McPopulatedBlankComponent as any).element;\n\nclass McPopulatedBlankElement extends SvelteElementClass {\n _internalSession: any = null;\n /**\n * The session object the player handed us. A player reads the learner's\n * response back off this object, so every update is written into it as well\n * as into the copy the component renders from.\n */\n _playerSession: any = null;\n _model: any = null;\n _options: any = null;\n audioComplete = false;\n\n _dispatchModelSet = () => {\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this._isComplete(), this._model !== undefined)\n );\n };\n\n _dispatchSessionChanged = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this._isComplete()));\n };\n\n set model(m: any) {\n // Autoplay re-fires only for a new `audioUrl`, so a re-set of the same\n // model must keep a finished playback counted.\n if (m?.audioUrl !== this._model?.audioUrl) this.audioComplete = false;\n this._model = m;\n super.model = m;\n this._dispatchModelSet();\n }\n\n get model() {\n return this._model;\n }\n\n set session(s: any) {\n this._playerSession = s;\n this._internalSession = s;\n super.session = s;\n this._dispatchSessionChanged();\n }\n\n get session() {\n return this._internalSession;\n }\n\n set options(o: any) {\n this._options = o;\n super.options = o;\n }\n\n get options() {\n return this._options;\n }\n\n onSessionChange = (updatedSession: any) => {\n this._writeSession(updatedSession);\n this._dispatchSessionChanged();\n };\n\n onAudioStarted = () => {\n this._writeAudioTiming({ audioStartTime: Date.now() });\n };\n\n onAudioEnded = () => {\n this.audioComplete = true;\n this._writeAudioTiming({ audioEndTime: Date.now() });\n this._dispatchSessionChanged();\n };\n\n /**\n * The first playback's timing, as multiple-choice's `updateSessionMetadata`\n * records it: a replay does not move either timestamp, and `waitTime` is set\n * once both exist.\n */\n _writeAudioTiming = (timing: { audioStartTime?: number; audioEndTime?: number }) => {\n const session = this._internalSession || {};\n const audioStartTime = session.audioStartTime || timing.audioStartTime;\n const audioEndTime = session.audioEndTime || timing.audioEndTime;\n const next = {\n ...session,\n ...(audioStartTime ? { audioStartTime } : {}),\n ...(audioEndTime ? { audioEndTime } : {}),\n };\n if (!next.waitTime && audioStartTime && audioEndTime) {\n next.waitTime = audioEndTime - audioStartTime;\n }\n this._writeSession(next);\n };\n\n /**\n * The component builds its next update from the session it renders, and\n * `writeSessionInPlace` drops keys that update lacks, so every write reaches\n * the component too: audio timing written behind its back was erased by the\n * learner's next pick.\n */\n _writeSession = (updatedSession: any) => {\n writeSessionInPlace(this._playerSession, updatedSession);\n this._internalSession = updatedSession;\n super.session = updatedSession;\n };\n\n _isComplete = () => {\n return isComplete(this._model, this._internalSession, this.audioComplete);\n };\n\n connectedCallback() {\n super.connectedCallback();\n (this as any).onSessionChange = this.onSessionChange;\n (this as any).onAudioStarted = this.onAudioStarted;\n (this as any).onAudioEnded = this.onAudioEnded;\n }\n}\n\nexport default McPopulatedBlankElement;\n"],"mappings":";;;;AAqDA,IAAIA,IAAI,MAAM,UAAU,YAAY;CACnC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG,GAAG;EACpB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;IACX,UAAU;GACX;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD,GAAGC,IAAI,MAAM,UAAU,YAAY;CAClC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG;EACjB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;GACZ;EACD,CAAC,GA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