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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,19 @@
1
- (function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var r={},i=Symbol(`uninitialized`),a=`http://www.w3.org/1999/xhtml`,o=`http://www.w3.org/2000/svg`,s=`http://www.w3.org/1998/Math/MathML`,c=Array.isArray,l=Array.prototype.indexOf,u=Array.prototype.includes,d=Array.from,f=Object.keys,p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyDescriptors,g=Object.prototype,_=Array.prototype,v=Object.getPrototypeOf,y=Object.isExtensible,b=()=>{};function x(e){for(var t=0;t<e.length;t++)e[t]()}function S(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var C=1024,w=2048,T=4096,ee=8192,te=16384,ne=32768,re=1<<25,ie=65536,ae=1<<19,oe=1<<20,se=1<<25,ce=65536,le=1<<21,ue=1<<22,de=1<<23,fe=Symbol(`$state`),pe=Symbol(`legacy props`),me=Symbol(``),he=Symbol(`attributes`),ge=Symbol(`class`),_e=Symbol(`style`),ve=Symbol(`text`),ye=Symbol(`form reset`),be=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},xe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function Se(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Ce(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function we(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Te(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Ee(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function De(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Oe(){throw Error(`https://svelte.dev/e/hydration_failed`)}function ke(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Ae(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function je(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Me(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ne(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function Pe(){console.warn(`https://svelte.dev/e/derived_inert`)}function Fe(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Ie(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var E=!1;function Le(e){E=e}var D;function O(e){if(e===null)throw Fe(),r;return D=e}function Re(){return O(ln(D))}function k(e){if(E){if(ln(D)!==null)throw Fe(),r;D=e}}function ze(e=1){if(E){for(var t=e,n=D;t--;)n=ln(n);D=n}}function Be(e=!0){for(var t=0,n=D;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ln(n);e&&n.remove(),n=i}}function Ve(e){if(!e||e.nodeType!==8)throw Fe(),r;return e.data}function He(e){return e===this.v}function Ue(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function We(e){return!Ue(e,this.v)}var Ge=!1,Ke=!1,A=null;function qe(e){A=e}function Je(e,t=!1,n){A={p:A,i:!1,c:null,e:null,s:e,x:null,r:W,l:Ke&&!t?{s:null,u:null,$:[]}:null}}function Ye(e){var t=A,n=t.e;if(n!==null){t.e=null;for(var r of n)wn(r)}return e!==void 0&&(t.x=e),t.i=!0,A=t.p,e??{}}function Xe(){return!Ke||A!==null&&A.l===null}var Ze=[];function Qe(){var e=Ze;Ze=[],x(e)}function $e(e){if(Ze.length===0&&!mt){var t=Ze;queueMicrotask(()=>{t===Ze&&Qe()})}Ze.push(e)}function et(){for(;Ze.length>0;)Qe()}function tt(e){var t=W;if(t===null)return U.f|=de,e;if(!(t.f&32768)&&!(t.f&4))throw e;nt(e,t)}function nt(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var rt=~(w|T|C);function j(e,t){e.f=e.f&rt|t}function it(e){e.f&512||e.deps===null?j(e,C):j(e,T)}function at(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ce,at(t.deps))}function ot(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),at(e.deps),j(e,C)}var st=!1,ct=!1;function lt(e){var t=ct;try{return ct=!1,[e(),ct]}finally{ct=t}}var ut=null,dt=null,M=null,ft=null,N=null,pt=null,mt=!1,ht=!1,gt=null,_t=null,vt=0,yt=1,bt=class e{id=yt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){dt===null?ut=dt=this:(dt.#n=this,this.#t=dt),dt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)j(r,w),t(r);for(r of n.m)j(r,T),t(r)}this.#p.add(e)}#g(){this.#e=!0,vt++>1e3&&(this.#S(),xt());for(let e of this.#u)this.#d.delete(e),j(e,w),this.schedule(e);for(let e of this.#d)j(e,T),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=gt=[],r=[],i=_t=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Ot(e),this.#h()||this.discard(),t}if(M=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(gt=null,_t=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Dt(e,t);i.length>0&&M.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),ft=this,Ct(r),Ct(n),ft=null,this.#s?.resolve();var s=M;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),Ge&&(this.#x(),M=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=C;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=C:i&4?t.push(r):Ge&&i&16777224?n.push(r):ar(r)&&(i&16&&this.#d.add(r),ur(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),j(i,w),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),M=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)ot(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==i&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),N?.set(e,t)),this.is_fork||(e.v=t)}activate(){M=this}deactivate(){M=null,N=null}flush(){try{ht=!0,M=this,this.#g()}finally{vt=0,pt=null,gt=null,_t=null,ht=!1,M=null,N=null,qt.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear(),this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let l=ut;l!==null;l=l.#n){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=l.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}if(l.#e){var r=[...l.current.keys()].filter(e=>!l.current.get(e)[1]&&!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){if(e)for(let e of this.#p)l.unskip_effect(e,e=>{e.f&4194320?l.schedule(e):l.#b([e])});l.activate();var i=new Set,a=new Map;for(var o of t)wt(o,r,i,a);a=new Map;var s=[...l.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(s.length>0)for(let e of this.#l)!(e.f&155648)&&Tt(e,s,a)&&(e.f&4194320?(j(e,w),l.schedule(e)):l.#u.add(e));if(l.#c.length>0&&!l.#m){l.apply();for(var c of l.#c)l.#_(c,[],[]);l.#c=[]}l.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,$e(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=S()).promise}static ensure(){if(M===null){let t=M=new e;!ht&&!mt&&$e(()=>{t.#e||t.flush()})}return M}apply(){if(!Ge||!this.is_fork&&this.#t===null&&this.#n===null){N=null;return}N=new Map;for(let[e,[t]]of this.current)N.set(e,t);for(let t=ut;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)N.has(e)||N.set(e,n)}}schedule(e){if(pt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(gt!==null&&t===W&&(Ge||(U===null||!(U.f&2))&&!st))return;if(n&96){if(!(n&1024))return;t.f^=C}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?ut=t:e.#n=t,t===null?dt=e:t.#t=e,this.linked=!1}}};function P(e){var t=mt;mt=!0;try{var n;for(e&&(M!==null&&!M.is_fork&&M.flush(),n=e());;){if(et(),M===null)return n;M.flush()}}finally{mt=t}}function xt(){try{De()}catch(e){nt(e,pt)}}var St=null;function Ct(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&ar(r)&&(St=new Set,ur(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&In(r),St?.size>0)){qt.clear();for(let e of St){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)St.has(n)&&(St.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||ur(n)}}St.clear()}}St=null}}function wt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?wt(i,t,n,r):e&4194320&&!(e&2048)&&Tt(i,t,r)&&(j(i,w),Et(i))}}function Tt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(u.call(t,r))return!0;if(r.f&2&&Tt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function Et(e){M.schedule(e)}function Dt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),j(e,C);for(var n=e.first;n!==null;)Dt(n,t),n=n.next}}function Ot(e){j(e,C);for(var t=e.first;t!==null;)Ot(t),t=t.next}function kt(e){let t=0,n=Yt(0),r;return()=>{xn()&&(K(n),kn(()=>(t===0&&(r=pr(()=>e(()=>$t(n)))),t+=1,()=>{$e(()=>{--t,t===0&&(r?.(),r=void 0,$t(n))})})))}}var At=ie|ae;function jt(e,t,n,r){new Mt(e,t,n,r)}var Mt=class{parent;is_pending=!1;transform_error;#e;#t=E?D:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=kt(()=>(this.#m=Yt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=W;t.b=this,t.f|=128,n(e)},this.parent=W.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=An(()=>{if(E){let e=this.#t;Re();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},At),E&&(this.#e=D)}#g(){try{this.#a=jn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=jn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=jn(()=>e(this.#e)),$e(()=>{var e=this.#c=document.createDocumentFragment(),t=cn();e.append(t),this.#a=this.#x(()=>jn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Ln(this.#o,()=>{this.#o=null}),this.#b(M))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=jn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Vn(this.#a,e);let t=this.#n.pending;this.#o=jn(()=>t(this.#e))}else this.#b(M)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){ot(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=W,n=U,r=A;Jn(this.#i),qn(this.#i),qe(this.#i.ctx);try{return bt.ensure(),e()}catch(e){return tt(e),null}finally{Jn(t),qn(n),qe(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Ln(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,$e(()=>{this.#d=!1,this.#m&&Zt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),K(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;M?.is_fork?(this.#a&&M.skip_effect(this.#a),this.#o&&M.skip_effect(this.#o),this.#s&&M.skip_effect(this.#s),M.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(H(this.#a),null),this.#o&&=(H(this.#o),null),this.#s&&=(H(this.#s),null),E&&(O(this.#t),ze(),O(Be()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){Ie();return}r=!0,i&&Ne(),this.#s!==null&&Ln(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){nt(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return jn(()=>{var t=W;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return nt(e,this.#i.parent),null}}))};$e(()=>{var t;try{t=this.transform_error(e)}catch(e){nt(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>nt(e,this.#i&&this.#i.parent)):o(t)})}};function Nt(e,t,n,r){let i=Xe()?Lt:Bt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=W,c=Pt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){nt(e,s)}Ft()}}var d=It();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>zt(e))).then(u).catch(e=>nt(e,s)).finally(d)}l?l.then(()=>{c(),f(),Ft()}):f()}function Pt(){var e=W,t=U,n=A,r=M;return function(i=!0){Jn(e),qn(t),qe(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Ft(e=!0){Jn(null),qn(null),qe(null),e&&M?.deactivate()}function It(){var e=W,t=e.b,n=M,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Lt(e){var t=2|w;return W!==null&&(W.f|=ae),{ctx:A,deps:null,effects:null,equals:He,f:t,fn:e,reactions:null,rv:0,v:i,wv:0,parent:W,ac:null}}var Rt=Symbol(`obsolete`);function zt(e,t,n){let r=W;r===null&&Se();var a=void 0,o=Yt(i),s=!U,c=new Set;return On(()=>{var t=W,n=S();a=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==be&&n.reject(e)}).finally(Ft)}catch(e){n.reject(e),Ft()}var i=M;if(s){if(t.f&32768)var l=It();if(r.b?.is_rendered())i.async_deriveds.get(t)?.reject(Rt);else for(let e of c.values())e.reject(Rt);c.add(n),i.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),c.delete(n),t!==Rt&&(i.activate(),t?(o.f|=de,Zt(o,t)):(o.f&8388608&&(o.f^=de),Zt(o,e)),i.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),Sn(()=>{for(let e of c)e.reject(Rt)}),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function F(e){let t=Lt(e);return Ge||Xn(t),t}function Bt(e){let t=Lt(e);return t.equals=We,t}function Vt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)H(t[n])}}function Ht(e){var t,n=W,r=e.parent;if(!Wn&&r!==null&&e.v!==i&&r.f&24576)return Pe(),e.v;Jn(r);try{e.f&=~ce,Vt(e),t=sr(e)}finally{Jn(n)}return t}function Ut(e){var t=Ht(e);if(!e.equals(t)&&(e.wv=ir(),(!M?.is_fork||e.deps===null)&&(M===null?e.v=t:(M.capture(e,t,!0),ft?.capture(e,t,!0)),e.deps===null))){j(e,C);return}Wn||(N===null?it(e):(xn()||M?.is_fork)&&N.set(e,t))}function Wt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(be),t.fn!==null&&(t.teardown=b),t.ac=null,lr(t,0),Nn(t))}function Gt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&ur(t)}var Kt=new Set,qt=new Map,Jt=!1;function Yt(e,t){return{f:0,v:e,reactions:null,equals:He,rv:0,wv:0}}function I(e,t){let n=Yt(e,t);return Xn(n),n}function Xt(e,t=!1,n=!0){let r=Yt(e);return t||(r.equals=We),Ke&&n&&A!==null&&A.l!==null&&(A.l.s??=[]).push(r),r}function L(e,t,n=!1){return U!==null&&(!Kn||U.f&131072)&&Xe()&&U.f&4325394&&(Yn===null||!Yn.has(e))&&Me(),Zt(e,n?tn(t):t,_t)}function Zt(e,t,n=null){if(!e.equals(t)){qt.set(e,Wn?t:e.v);var r=bt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Ht(t),N===null&&it(t)}e.wv=ir(),en(e,w,n),Xe()&&W!==null&&W.f&1024&&!(W.f&96)&&(Qn===null?$n([e]):Qn.push(e)),!r.is_fork&&Kt.size>0&&!Jt&&Qt()}return t}function Qt(){Jt=!1;for(let e of Kt){e.f&1024&&j(e,T);let t;try{t=ar(e)}catch{t=!0}t&&ur(e)}Kt.clear()}function $t(e){L(e,e.v+1)}function en(e,t,n){var r=e.reactions;if(r!==null)for(var i=Xe(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===W)){var l=(c&w)===0;if(l&&j(s,t),c&131072)Kt.add(s);else if(c&2){var u=s;N?.delete(u),c&65536||(c&512&&(W===null||!(W.f&2097152))&&(s.f|=ce),en(u,T,n))}else if(l){var d=s;c&16&&St!==null&&St.add(d),n===null?Et(d):n.push(d)}}}}function tn(e){if(typeof e!=`object`||!e||fe in e)return e;let t=v(e);if(t!==g&&t!==_)return e;var n=new Map,r=c(e),a=I(0),o=null,s=nr,l=e=>{if(nr===s)return e();var t=U,n=nr;qn(null),rr(s);var r=e();return qn(t),rr(n),r};return r&&n.set(`length`,I(e.length,o)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&Ae();var i=n.get(t);return i===void 0?l(()=>{var e=I(r.value,o);return n.set(t,e),e}):L(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=l(()=>I(i,o));n.set(t,e),$t(a)}}else L(r,i),$t(a);return!0},get(t,r,a){if(r===fe)return e;var s=n.get(r),c=r in t;if(s===void 0&&(!c||m(t,r)?.writable)&&(s=l(()=>I(tn(c?t[r]:i),o)),n.set(r,s)),s!==void 0){var u=K(s);return u===i?void 0:u}return Reflect.get(t,r,a)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var a=n.get(t);a&&(r.value=K(a))}else if(r===void 0){var o=n.get(t),s=o?.v;if(o!==void 0&&s!==i)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return r},has(e,t){if(t===fe)return!0;var r=n.get(t),a=r!==void 0&&r.v!==i||Reflect.has(e,t);return(r!==void 0||W!==null&&(!a||m(e,t)?.writable))&&(r===void 0&&(r=l(()=>I(a?tn(e[t]):i,o)),n.set(t,r)),K(r)===i)?!1:a},set(e,t,s,c){var u=n.get(t),d=t in e;if(r&&t===`length`)for(var f=s;f<u.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=l(()=>I(i,o)),n.set(f+``,p)):L(p,i)}if(u===void 0)(!d||m(e,t)?.writable)&&(u=l(()=>I(void 0,o)),L(u,tn(s)),n.set(t,u));else{d=u.v!==i;var h=l(()=>tn(s));L(u,h)}var g=Reflect.getOwnPropertyDescriptor(e,t);if(g?.set&&g.set.call(c,s),!d){if(r&&typeof t==`string`){var _=n.get(`length`),v=Number(t);Number.isInteger(v)&&v>=_.v&&L(_,v+1)}$t(a)}return!0},ownKeys(e){K(a);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==i});for(var[r,o]of n)o.v!==i&&!(r in e)&&t.push(r);return t},setPrototypeOf(){je()}})}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var nn,rn,an,on;function sn(){if(nn===void 0){nn=window,rn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;an=m(t,`firstChild`).get,on=m(t,`nextSibling`).get,y(e)&&(e[ge]=void 0,e[he]=null,e[_e]=void 0,e.__e=void 0),y(n)&&(n[ve]=void 0)}}function cn(e=``){return document.createTextNode(e)}function R(e){return an.call(e)}function ln(e){return on.call(e)}function z(e,t){if(!E)return R(e);var n=R(D);if(n===null)n=D.appendChild(cn());else if(t&&n.nodeType!==3){var r=cn();return n?.before(r),O(r),r}return t&&mn(n),O(n),n}function un(e,t=!1){if(!E){var n=R(e);return n instanceof Comment&&n.data===``?ln(n):n}if(t){if(D?.nodeType!==3){var r=cn();return D?.before(r),O(r),r}mn(D)}return D}function B(e,t=1,n=!1){let r=E?D:e;for(var i;t--;)i=r,r=ln(r);if(!E)return r;if(n){if(r?.nodeType!==3){var a=cn();return r===null?i?.after(a):r.before(a),O(a),a}mn(r)}return O(r),r}function dn(e){e.textContent=``}function fn(){return!Ge||St!==null?!1:(W.f&ne)!==0}function pn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function mn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}var hn=!1;function gn(){hn||(hn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[ye]?.()})},{capture:!0}))}function _n(e){var t=U,n=W;qn(null),Jn(null);try{return e()}finally{qn(t),Jn(n)}}function vn(e){W===null&&(U===null&&Ee(e),Te()),Wn&&we(e)}function yn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function bn(e,t){var n=W;n!==null&&n.f&8192&&(e|=ee);var r={ctx:A,deps:null,nodes:null,f:e|w|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};M?.register_created_effect(r);var i=r;if(e&4)gt===null?bt.ensure().schedule(r):gt.push(r);else if(t!==null){try{ur(r)}catch(e){throw H(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ie))}if(i!==null&&(i.parent=n,n!==null&&yn(i,n),U!==null&&U.f&2&&!(e&64))){var a=U;(a.effects??=[]).push(i)}return r}function xn(){return U!==null&&!Kn}function Sn(e){let t=bn(8,null);return j(t,C),t.teardown=e,t}function Cn(e){vn(`$effect`);var t=W.f;if(!U&&t&32&&A!==null&&!A.i){var n=A;(n.e??=[]).push(e)}else return wn(e)}function wn(e){return bn(4|oe,e)}function Tn(e){bt.ensure();let t=bn(64|ae,e);return()=>{H(t)}}function En(e){bt.ensure();let t=bn(64|ae,e);return(e={})=>new Promise(n=>{e.outro?Ln(t,()=>{H(t),n(void 0)}):(H(t),n(void 0))})}function Dn(e){return bn(4,e)}function On(e){return bn(ue|ae,e)}function kn(e,t=0){return bn(8|t,e)}function V(e,t=[],n=[],r=[]){Nt(r,t,n,t=>{bn(8,()=>{e(...t.map(K))})})}function An(e,t=0){return bn(16|t,e)}function jn(e){return bn(32|ae,e)}function Mn(e){var t=e.teardown;if(t!==null){let e=Wn,n=U;Gn(!0),qn(null);try{t.call(null)}finally{Gn(e),qn(n)}}}function Nn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&_n(()=>{e.abort(be)});var r=n.next;n.f&64?n.parent=null:H(n,t),n=r}}function Pn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||H(t),t=n}}function H(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Fn(e.nodes.start,e.nodes.end),n=!0),e.f|=re,Nn(e,t&&!n),lr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Mn(e),e.f^=re,e.f|=te;var i=e.parent;i!==null&&i.first!==null&&In(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Fn(e,t){for(;e!==null;){var n=e===t?null:ln(e);e.remove(),e=n}}function In(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Ln(e,t,n=!0){var r=[];Rn(e,r,!0);var i=()=>{n&&H(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Rn(e,t,n){if(!(e.f&8192)){e.f^=ee;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Rn(i,t,o?n:!1)}i=a}}}function zn(e){Bn(e,!0)}function Bn(e,t){if(e.f&8192){e.f^=ee,e.f&1024||(j(e,w),bt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Bn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Vn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:ln(n);t.append(n),n=i}}var Hn=null,Un=!1,Wn=!1;function Gn(e){Wn=e}var U=null,Kn=!1;function qn(e){U=e}var W=null;function Jn(e){W=e}var Yn=null;function Xn(e){U!==null&&(!Ge||U.f&2)&&(Yn??=new Set).add(e)}var G=null,Zn=0,Qn=null;function $n(e){Qn=e}var er=1,tr=0,nr=tr;function rr(e){nr=e}function ir(){return++er}function ar(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ce),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(ar(a)&&Ut(a),a.wv>e.wv)return!0}t&512&&N===null&&j(e,C)}return!1}function or(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Ge&&Yn!==null&&Yn.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?or(a,t,!1):t===a&&(n?j(a,w):a.f&1024&&j(a,T),Et(a))}}function sr(e){var t=G,n=Zn,r=Qn,i=U,a=Yn,o=A,s=Kn,c=nr,l=e.f;G=null,Zn=0,Qn=null,U=l&96?null:e,Yn=null,qe(e.ctx),Kn=!1,nr=++tr,e.ac!==null&&(_n(()=>{e.ac.abort(be)}),e.ac=null);try{e.f|=le;var u=e.fn,d=u();e.f|=ne;var f=e.deps,p=M?.is_fork;if(G!==null){var m;if(p||lr(e,Zn),f!==null&&Zn>0)for(f.length=Zn+G.length,m=0;m<G.length;m++)f[Zn+m]=G[m];else e.deps=f=G;if(xn()&&e.f&512)for(m=Zn;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Zn<f.length&&(lr(e,Zn),f.length=Zn);if(Xe()&&Qn!==null&&!Kn&&f!==null&&!(e.f&6146))for(m=0;m<Qn.length;m++)or(Qn[m],e);if(i!==null&&i!==e){if(tr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=tr;if(t!==null)for(let e of t)e.rv=tr;Qn!==null&&(r===null?r=Qn:r.push(...Qn))}return e.f&8388608&&(e.f^=de),d}catch(e){return tt(e)}finally{e.f^=le,G=t,Zn=n,Qn=r,U=i,Yn=a,qe(o),Kn=s,nr=c}}function cr(e,t){let n=t.reactions;if(n!==null){var r=l.call(n,e);if(r!==-1){var a=n.length-1;a===0?n=t.reactions=null:(n[r]=n[a],n.pop())}}if(n===null&&t.f&2&&(G===null||!u.call(G,t))){var o=t;o.f&512&&(o.f^=512,o.f&=~ce),o.v!==i&&it(o),Wt(o),lr(o,0)}}function lr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)cr(e,n[r])}function ur(e){var t=e.f;if(!(t&16384)){j(e,C);var n=W,r=Un;W=e,Un=!0;try{t&16777232?Pn(e):Nn(e),Mn(e);var i=sr(e);e.teardown=typeof i==`function`?i:null,e.wv=er}finally{Un=r,W=n}}}function K(e){var t=(e.f&2)!=0;if(Hn?.add(e),U!==null&&!Kn&&!(W!==null&&W.f&16384)&&(Yn===null||!Yn.has(e))){var n=U.deps;if(U.f&2097152)e.rv<tr&&(e.rv=tr,G===null&&n!==null&&n[Zn]===e?Zn++:G===null?G=[e]:G.push(e));else{U.deps??=[],u.call(U.deps,e)||U.deps.push(e);var r=e.reactions;r===null?e.reactions=[U]:u.call(r,U)||r.push(U)}}if(Wn&&qt.has(e))return qt.get(e);if(t){var i=e;if(Wn){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||fr(i))&&(a=Ht(i)),qt.set(i,a),a}var o=(i.f&512)==0&&!Kn&&U!==null&&(Un||(U.f&512)!=0),s=(i.f&ne)===0;ar(i)&&(o&&(i.f|=512),Ut(i)),o&&!s&&(Gt(i),dr(i))}if(N?.has(e))return N.get(e);if(e.f&8388608)throw e.v;return e.v}function dr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Gt(t),dr(t))}function fr(e){if(e.v===i)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(qt.has(t)||t.f&2&&fr(t))return!0;return!1}function pr(e){var t=Kn;try{return Kn=!0,e()}finally{Kn=t}}var mr=Symbol(`events`),hr=new Set,gr=new Set,_r=null;function vr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;_r=e;var o=0,s=_r===e&&e[mr];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[mr]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){p(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=U,d=W;qn(null),Jn(null);try{for(var f,m=[];a!==null&&a!==t;){try{var h=a[mr]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){f?m.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of m)queueMicrotask(()=>{throw e});throw f}}finally{e[mr]=t,delete e.currentTarget,qn(u),Jn(d)}}}var yr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function br(e){return yr?.createHTML(e)??e}function xr(e){var t=pn(`template`);return t.innerHTML=br(e.replaceAll(`<!>`,`<!---->`)),t.content}function Sr(e,t){var n=W;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function q(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(E)return Sr(D,null),D;i===void 0&&(i=xr(a?e:`<!>`+e),n||(i=R(i)));var t=r||rn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=R(t),s=t.lastChild;Sr(o,s)}else Sr(t,t);return t}}function Cr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(E)return Sr(D,null),D;if(!o){var e=R(xr(a));if(i)for(o=document.createDocumentFragment();R(e);)o.appendChild(R(e));else o=R(e)}var t=o.cloneNode(!0);if(i){var n=R(t),r=t.lastChild;Sr(n,r)}else Sr(t,t);return t}}function wr(e,t){return Cr(e,t,`svg`)}function Tr(){if(E)return Sr(D,null),D;var e=document.createDocumentFragment(),t=document.createComment(``),n=cn();return e.append(t,n),Sr(t,n),e}function J(e,t){if(E){var n=W;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=D),Re();return}e!==null&&e.before(t)}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var Er=[`touchstart`,`touchmove`];function Dr(e){return Er.includes(e)}function Or(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ve]??=e.nodeValue)&&(e[ve]=n,e.nodeValue=`${n}`)}function kr(e,t){return Mr(e,t)}function Ar(e,t){sn(),t.intro=t.intro??!1;let n=t.target,i=E,a=D;try{for(var o=R(n);o&&(o.nodeType!==8||o.data!==`[`);)o=ln(o);if(!o)throw r;Le(!0),O(o);let i=Mr(e,{...t,anchor:o});return Le(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
2
- `).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw i;return i!==r&&console.warn(`Failed to hydrate: `,i),t.recover===!1&&Oe(),sn(),dn(n),Le(!1),kr(e,t)}finally{Le(i),O(a)}}var jr=new Map;function Mr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){sn();var l=void 0,u=En(()=>{var s=n??t.appendChild(cn());jt(s,{pending:()=>{}},t=>{Je({});var n=A;if(o&&(n.c=o),a&&(i.$$events=a),E&&Sr(t,null),l=e(t,i)||{},E&&(W.nodes.end=D,D===null||D.nodeType!==8||D.data!==`]`))throw Fe(),r;Ye()},c);var u=new Set,f=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Dr(r);for(let e of[t,document]){var a=jr.get(e);a===void 0&&(a=new Map,jr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,vr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(d(hr)),gr.add(f),()=>{for(var e of u)for(let n of[t,document]){var r=jr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,vr),r.delete(e),r.size===0&&jr.delete(n)):r.set(e,i)}gr.delete(f),s!==n&&s.parentNode?.removeChild(s)}});return Nr.set(l,u),l}var Nr=new WeakMap;function Pr(e,t){let n=Nr.get(e);return n?(Nr.delete(e),n(t)):Promise.resolve()}var Fr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)zn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(zn(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(H(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Vn(r,t),t.append(cn()),this.#n.set(e,{effect:r,fragment:t})}else H(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Ln(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(H(n.effect),this.#n.delete(e))};ensure(e,t){var n=M,r=fn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=cn();i.append(a),this.#n.set(e,{effect:jn(()=>t(a)),fragment:i})}else this.#t.set(e,jn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else E&&(this.anchor=D),this.#a(n)}};function Y(e,t,n=!1){var r;E&&(r=D,Re());var i=new Fr(e),a=n?ie:0;function o(e,t){if(E){var n=Ve(r);if(e!==parseInt(n.substring(1))){var a=Be();O(a),i.anchor=a,Le(!1),i.ensure(e,t),Le(!0);return}}i.ensure(e,t)}An(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Ir(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Ln(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Lr(e,d(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var l=n,u=l.parentNode;dn(u),u.append(l),e.items.clear()}Lr(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Lr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=se,Vn(a,document.createDocumentFragment())):H(t[i],n)}}var Rr;function zr(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var l=e;o=E?O(R(l)):l.appendChild(cn())}E&&Re();var u=null,f=Bt(()=>{var e=n();return c(e)?e:e==null?[]:d(e)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=u,Vr(v,p,o,t,r),u!==null&&(p.length===0?u.f&33554432?(u.f^=se,Ur(u,null,o)):zn(u):Ln(u,()=>{u=null})))}function _(e){v.pending.delete(e)}var v={effect:An(()=>{p=K(f);var e=p.length;let c=!1;E&&Ve(o)===`[!`!=(e===0)&&(o=Be(),O(o),Le(!1),c=!0);for(var l=new Set,d=M,v=fn(),y=0;y<e;y+=1){E&&D.nodeType===8&&D.data===`]`&&(o=D,c=!0,Le(!1));var b=p[y],x=r(b,y),S=h?null:s.get(x);S?(S.v&&Zt(S.v,b),S.i&&Zt(S.i,y),v&&d.unskip_effect(S.e)):(S=Hr(s,h?o:Rr??=cn(),b,x,y,i,t,n),h||(S.e.f|=se),s.set(x,S)),l.add(x)}if(e===0&&a&&!u&&(h?u=jn(()=>a(o)):(u=jn(()=>a(Rr??=cn())),u.f|=se)),e>l.size&&Ce(``,``,``),E&&e>0&&O(Be()),!h)if(m.set(d,l),v){for(let[e,t]of s)l.has(e)||d.skip_effect(t.e);d.oncommit(g),d.ondiscard(_)}else g(d);c&&Le(!0),K(f)}),flags:t,items:s,pending:m,outrogroups:null,fallback:u};h=!1,E&&(o=D)}function Br(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Vr(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,c=Br(e.effect.first),l,u=null,f,p=[],m=[],h,g,_,v;if(a)for(v=0;v<o;v+=1)h=t[v],g=i(h,v),_=s.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<o;v+=1){if(h=t[v],g=i(h,v),_=s.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(zn(_),a&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=se,_===c)Ur(_,null,n);else{var y=u?u.next:c;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Wr(e,u,_),Wr(e,_,y),Ur(_,y,n),u=_,p=[],m=[],c=Br(u.next);continue}if(_!==c){if(l!==void 0&&l.has(_)){if(p.length<m.length){var b=m[0],x;u=b.prev;var S=p[0],C=p[p.length-1];for(x=0;x<p.length;x+=1)Ur(p[x],b,n);for(x=0;x<m.length;x+=1)l.delete(m[x]);Wr(e,S.prev,C.next),Wr(e,u,S),Wr(e,C,b),c=b,u=C,--v,p=[],m=[]}else l.delete(_),Ur(_,c,n),Wr(e,_.prev,_.next),Wr(e,_,u===null?e.effect.first:u.next),Wr(e,u,_),u=_;continue}for(p=[],m=[];c!==null&&c!==_;)(l??=new Set).add(c),m.push(c),c=Br(c.next);if(c===null)continue}_.f&33554432||p.push(_),u=_,c=Br(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Lr(e,d(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var w=[];if(l!==void 0)for(_ of l)_.f&8192||w.push(_);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&w.push(c),c=Br(c.next);var T=w.length;if(T>0){var ee=r&4&&o===0?n:null;if(a){for(v=0;v<T;v+=1)w[v].nodes?.a?.measure();for(v=0;v<T;v+=1)w[v].nodes?.a?.fix()}Ir(e,w,ee)}}a&&$e(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Hr(e,t,n,r,i,a,o,s){var c=o&1?o&16?Yt(n):Xt(n,!1,!1):null,l=o&2?Yt(i):null;return{v:c,i:l,e:jn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ur(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=ln(r);if(a.before(r),r===i)return;r=o}}function Wr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Gr(e,t,n=!1,i=!1,a=!1,c=!1){var l=e,u=``;if(n){var d=e;E&&(l=O(R(d)))}V(()=>{var e=W;if(u===(u=t()??``)){E&&Re();return}if(n&&!E){e.nodes=null,d.innerHTML=u,u!==``&&Sr(R(d),d.lastChild);return}if(e.nodes!==null&&(Fn(e.nodes.start,e.nodes.end),e.nodes=null),u!==``){if(E){for(var c=D.data,f=Re(),p=f;f!==null&&(f.nodeType!==8||f.data!==``);)p=f,f=ln(f);if(f===null)throw Fe(),r;Sr(D,p),l=O(f);return}var m=pn(i?`svg`:a?`math`:`template`,i?o:a?s:void 0);m.innerHTML=u;var h=i||a?m:m.content;if(Sr(R(h),h.lastChild),i||a)for(;R(h);)l.before(R(h));else l.before(h)}})}function Kr(e,t){Dn(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=pn(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}var qr=[...`
3
- \r\f\xA0\v`];function Jr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||qr.includes(r[o-1]))&&(s===r.length||qr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Yr(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Xr(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Zr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Xr)),i&&c.push(...Object.keys(i).map(Xr));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Xr(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Yr(r)),i&&(n+=Yr(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Qr(e,t,n,r,i,a){var o=e[ge];if(E||o!==n||o===void 0){var s=Jr(n,r,a);(!E||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[ge]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function $r(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function ei(e,t,n,r){var i=e[_e];if(E||i!==t){var a=Zr(t,r);(!E||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[_e]=t}else r&&(Array.isArray(r)?($r(e,n?.[0],r[0]),$r(e,n?.[1],r[1],`important`)):$r(e,n,r));return r}var ti=Symbol(`is custom element`),ni=Symbol(`is html`),ri=xe?`link`:`LINK`,ii=xe?`progress`:`PROGRESS`;function ai(e){if(E){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;X(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;X(e,`checked`,null),e.checked=r}}};e[ye]=n,$e(n),gn()}}function oi(e,t){var n=ci(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==ii)||(e.value=t??``)}function si(e,t){var n=ci(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function X(e,t,n,r){var i=ci(e);E&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ri)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[me]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ui(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ci(e){return e[he]??={[ti]:e.nodeName.includes(`-`),[ni]:e.namespaceURI===a}}var li=new Map;function ui(e){var t=e.getAttribute(`is`)||e.nodeName,n=li.get(t);if(n)return n;li.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=h(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.push(o);i=v(i)}return n}function di(e,t){return e===t||e?.[fe]===t}function fi(e={},t,n,r){var i=A.r,a=W;return Dn(()=>{var o,s;return kn(()=>{o=s,s=r?.()||[],pr(()=>{di(n(...s),e)||(t(e,...s),o&&di(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&di(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Z(e,t,n,r){var i=!Ke||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=void 0,u=()=>o&&i?(l??=Lt(r),K(l)):(c&&(c=!1,s=o?pr(r):r),s);let d;if(a){var f=fe in e||pe in e;d=m(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,h=!1;a?[p,h]=lt(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&ke(t),d(p)));var g=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return g;if(d){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&d(t?g():e),e):g()})}var v=!1,y=(n&1?Lt:Bt)(()=>(v=!1,g()));a&&K(y);var b=W;return(function(e,t){if(arguments.length>0){let n=t?K(y):i&&a?tn(e):e;return L(y,n),v=!0,s!==void 0&&(s=n),e}return Wn&&v||b.f&16384?y.v:K(y)})}function pi(e){return new mi(e)}var mi=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=Xt(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return K(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===pe?!0:(K(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return L(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?Ar:kr)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),!Ge&&(!e?.props?.$$host||e.sync===!1)&&P(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||p(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{Pr(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},hi;typeof HTMLElement==`function`&&(hi=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=pn(`slot`);e!=="default"&&(n.name=e),J(t,n)}}let t={},n=_i(this);for(let r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=gi(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=pi({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Tn(()=>{kn(()=>{this.$$r=!0;for(let e of f(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=gi(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=gi(e,n,this.$$p_d,`toProp`),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return f(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function gi(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`toAttribute`)switch(i){case`Object`:case`Array`:return t==null?null:JSON.stringify(t);case`Boolean`:return t?``:null;case`Number`:return t??null;default:return t}else switch(i){case`Object`:case`Array`:return t&&JSON.parse(t);case`Boolean`:return t;case`Number`:return t==null?t:+t;default:return t}}function _i(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function vi(e,t,n,r,i,a){let o=class extends hi{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return f(t).map(e=>(t[e].attribute||e).toLowerCase())}};return f(t).forEach(e=>{p(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=gi(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(m(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{p(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}var yi={50:`#e8f5e9`,500:`#4caf50`},bi={200:`#9fa8da`,500:`#3f51b5`,800:`#283593`},xi={500:`#ff9800`},Si={200:`#f48fb1`,900:`#880e4f`,A400:`#f50057`},Ci={50:`#ffebee`,700:`#d32f2f`},Q={TEXT:`black`,DISABLED:`grey`,DISABLED_SECONDARY:`#ABABAB`,CORRECT:yi[500],CORRECT_SECONDARY:yi[50],CORRECT_TERTIARY:`#0EA449`,CORRECT_WITH_ICON:`#087D38`,INCORRECT:xi[500],INCORRECT_SECONDARY:Ci[50],INCORRECT_WITH_ICON:`#BF0D00`,MISSING:Ci[700],MISSING_WITH_ICON:`#6A78A1`,PRIMARY:bi[500],PRIMARY_LIGHT:bi[200],PRIMARY_DARK:bi[800],SECONDARY:Si.A400,SECONDARY_LIGHT:Si[200],SECONDARY_DARK:Si[900],TERTIARY:`#146EB3`,TERTIARY_LIGHT:`#D0E2F0`,BACKGROUND:`rgba(255,255,255,0)`,BACKGROUND_DARK:`#ECEDF1`,DROPDOWN_BACKGROUND:`#E0E1E6`,SECONDARY_BACKGROUND:`rgba(241,241,241,1)`,BORDER:`#9A9A9A`,BORDER_LIGHT:`#D1D1D1`,BORDER_DARK:`#646464`,BORDER_GRAY:`#7E8494`,BLACK:`#000000`,WHITE:`#ffffff`,TRANSPARENT:`transparent`,FOCUS_CHECKED:`#BBDEFB`,FOCUS_CHECKED_BORDER:`#1565C0`,FOCUS_UNCHECKED:`#E0E0E0`,FOCUS_UNCHECKED_BORDER:`#757575`,BLUE_GREY100:`#F3F5F7`,BLUE_GREY300:`#C0C3CF`,BLUE_GREY600:`#7E8494`,BLUE_GREY900:`#152452`,FADED_PRIMARY:`#DCDAFB`};Object.freeze(Q);var $=(e=>(...t)=>{let n=t.pop();return t.reduceRight((t,n)=>`var(--${e}-${n}, ${t})`,n)})(`pie`),wi={text:()=>$(`text`,Q.TEXT),disabled:()=>$(`disabled`,Q.DISABLED),disabledSecondary:()=>$(`disabled-secondary`,Q.DISABLED_SECONDARY),correct:()=>$(`correct`,Q.CORRECT),correctSecondary:()=>$(`correct-secondary`,Q.CORRECT_SECONDARY),correctTertiary:()=>$(`correct-tertiary`,Q.CORRECT_TERTIARY),correctWithIcon:()=>$(`correct-icon`,Q.CORRECT_WITH_ICON),incorrect:()=>$(`incorrect`,Q.INCORRECT),incorrectWithIcon:()=>$(`incorrect-icon`,Q.INCORRECT_WITH_ICON),incorrectSecondary:()=>$(`incorrect-secondary`,Q.INCORRECT_SECONDARY),missing:()=>$(`missing`,Q.MISSING),missingWithIcon:()=>$(`missing-icon`,Q.MISSING_WITH_ICON),primary:()=>$(`primary`,Q.PRIMARY),primaryLight:()=>$(`primary-light`,Q.PRIMARY_LIGHT),primaryDark:()=>$(`primary-dark`,Q.PRIMARY_DARK),primaryText:()=>$(`primary-text`,`text`,Q.TEXT),fadedPrimary:()=>$(`faded-primary`,Q.FADED_PRIMARY),secondary:()=>$(`secondary`,Q.SECONDARY),secondaryLight:()=>$(`secondary-light`,Q.SECONDARY_LIGHT),secondaryDark:()=>$(`secondary-dark`,Q.SECONDARY_DARK),secondaryText:()=>$(`secondary-text`,`text`,Q.TEXT),background:()=>$(`background`,Q.BACKGROUND),backgroundDark:()=>$(`background-dark`,Q.BACKGROUND_DARK),secondaryBackground:()=>$(`secondary-background`,Q.SECONDARY_BACKGROUND),dropdownBackground:()=>$(`dropdown-background`,Q.DROPDOWN_BACKGROUND),tertiary:()=>$(`tertiary`,Q.TERTIARY),tertiaryLight:()=>$(`tertiary-light`,Q.TERTIARY_LIGHT),border:()=>$(`border`,Q.BORDER),borderLight:()=>$(`border-light`,Q.BORDER_LIGHT),borderDark:()=>$(`border-dark`,Q.BORDER_DARK),borderGray:()=>$(`border-gray`,Q.BORDER_GRAY),black:()=>$(`black`,Q.BLACK),white:()=>$(`white`,Q.WHITE),transparent:()=>Q.TRANSPARENT,focusChecked:()=>$(`focus-checked`,Q.FOCUS_CHECKED),focusCheckedBorder:()=>$(`focus-checked-border`,Q.FOCUS_CHECKED_BORDER),focusUnchecked:()=>$(`focus-unchecked`,Q.FOCUS_UNCHECKED),focusUncheckedBorder:()=>$(`focus-unchecked-border`,Q.FOCUS_UNCHECKED_BORDER),blueGrey100:()=>$(`blue-grey-100`,Q.BLUE_GREY100),blueGrey300:()=>$(`blue-grey-300`,Q.BLUE_GREY300),blueGrey600:()=>$(`blue-grey-600`,Q.BLUE_GREY600),blueGrey900:()=>$(`blue-grey-900`,Q.BLUE_GREY900)},Ti=class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}},Ei=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},Di=e=>{let t=e;return t?typeof t.onSessionChange==`function`||typeof t.onAudioStarted==`function`||typeof t.onAudioEnded==`function`:!1};function Oi(e,t={}){let n=t.hostPredicate??Di,r=e;for(;r;){if(n(r))return r;r=r.parentElement}if(typeof document<`u`&&t.fallbackSelector){let e=document.querySelector(t.fallbackSelector);if(n(e))return e}return null}function ki({sourceEl:e,fallbackSelector:t,component:n,complete:r,session:i}){let a=Oi(e,{fallbackSelector:t});return a?typeof a.onSessionChange==`function`?(a.onSessionChange(i),a):(a.dispatchEvent(new Ei(n,r)),a):null}function Ai(e){return e.hasAudio?e.audioUrl?e.useFeatureButtonAudio?`feature-button`:`controls`:`error`:`none`}var ji=q(`<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),Mi=q(`<button class="mt-2 text-sm underline pie-audio-autoplay-enable" type="button"> </button>`),Ni=q(`<audio controls="" class="w-full max-w-md pie-audio-player" preload="metadata"><track kind="captions"/></audio> <!>`,1),Pi=q(`<p class="text-sm text-red-700 pie-audio-error" role="alert"> </p>`),Fi=q(`<div class="mb-4 audio-container pie-audio-container"><!></div>`),Ii={hash:`svelte-ypdwb3`,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;}`};function Li(e,t){Je(t,!0),Kr(e,Ii);let n={IDLE:`idle`,PLAYING:`playing`,BLOCKED:`blocked`,PAUSED:`paused`},r=Z(t,`hasAudio`,7,!1),i=Z(t,`audioUrl`,7),a=Z(t,`useFeatureButtonAudio`,7,!1),o=Z(t,`autoplayEnabled`,7,!1),s=Z(t,`audioTranscript`,7),c=Z(t,`showVisibleTranscript`,7),l=Z(t,`transcriptId`,7),u=Z(t,`featureAudioSkin`,7),d=Z(t,`uiText`,7),f=Z(t,`locale`,7,``),p=Z(t,`onaudiostarted`,7),m=Z(t,`onaudioended`,7),h=I(null),g=I(null),_=I(null),v=I(tn(n.IDLE)),y=F(()=>Ai({hasAudio:r(),audioUrl:i(),useFeatureButtonAudio:a()})),b=F(()=>K(v)===n.PLAYING),x=F(()=>K(v)===n.BLOCKED),S=F(()=>K(y)===`error`?d().audioResourceUnavailable:``);Cn(()=>{i(),L(v,n.IDLE,!0)});function C(){K(y)!==`none`&&K(y)!==`error`&&K(h)&&K(h).play().catch(()=>{})}function w(){K(y)!==`none`&&K(y)!==`error`&&K(h)&&K(h).play().finally(()=>{K(v)===n.BLOCKED&&L(v,n.PAUSED,!0)})}function T(e,t,n){Cn(()=>{let r=e();if(r)return r.addEventListener(t,n),()=>r.removeEventListener(t,n)})}T(()=>K(h),`playing`,()=>{L(v,n.PLAYING,!0),p()?.()}),T(()=>K(h),`ended`,()=>{L(v,n.PAUSED,!0),m()?.()}),T(()=>K(g),`click`,()=>C()),T(()=>K(_),`click`,()=>w()),Cn(()=>{!o()||K(y)===`none`||K(y)===`error`||K(v)===n.IDLE&&K(h)&&i()&&(L(v,n.PAUSED,!0),K(h).play().catch(()=>{L(v,n.BLOCKED,!0)}))});function ee(e=``){return e.toLowerCase().startsWith(`es`)?`Escuchar`:`Listen`}function te(e=``){return e.toLowerCase().startsWith(`es`)?d().listenSilentAltEs??`Escuchar. Repetir las instrucciones.`:d().listenSilentAlt??`Repeat instructions`}function ne(e=``){return e.toLowerCase().startsWith(`es`)?d().listenPlayingAltEs??`Escuchar. Estas son las instrucciones.`:d().listenPlayingAlt??`Instructions are playing`}var re={get hasAudio(){return r()},set hasAudio(e=!1){r(e),P()},get audioUrl(){return i()},set audioUrl(e){i(e),P()},get useFeatureButtonAudio(){return a()},set useFeatureButtonAudio(e=!1){a(e),P()},get autoplayEnabled(){return o()},set autoplayEnabled(e=!1){o(e),P()},get audioTranscript(){return s()},set audioTranscript(e){s(e),P()},get showVisibleTranscript(){return c()},set showVisibleTranscript(e){c(e),P()},get transcriptId(){return l()},set transcriptId(e){l(e),P()},get featureAudioSkin(){return u()},set featureAudioSkin(e){u(e),P()},get uiText(){return d()},set uiText(e){d(e),P()},get locale(){return f()},set locale(e=``){f(e),P()},get onaudiostarted(){return p()},set onaudiostarted(e){p(e),P()},get onaudioended(){return m()},set onaudioended(e){m(e),P()}},ie=Tr(),ae=un(ie),oe=e=>{var t=Fi(),n=z(t),r=e=>{var t=ji(),n=un(t);fi(n,e=>L(h,e),()=>K(h));var r=B(n,2),a=z(r),o=B(a,2);k(r),fi(r,e=>L(g,e),()=>K(g)),V((e,t,s)=>{X(n,`src`,i()),X(r,`aria-label`,e),Qr(a,1,`listen-feature-icon pie-listen-icon rli-feature-listen ${K(b)?``:`listen-active`}`,`svelte-ypdwb3`),X(a,`src`,u().silentUrl),X(a,`alt`,t),Qr(o,1,`listen-feature-icon pie-listen-icon rli-feature-listen ${K(b)?`listen-active`:``}`,`svelte-ypdwb3`),X(o,`src`,u().playingUrl),X(o,`alt`,s)},[()=>ee(f()),()=>te(f()),()=>ne(f())]),J(e,t)},a=e=>{var t=Ni(),n=un(t);fi(n,e=>L(h,e),()=>K(h));var r=B(n,2),a=e=>{var t=Mi(),n=z(t,!0);k(t),fi(t,e=>L(_,e),()=>K(_)),V(()=>Or(n,d().clickToEnableAutoplay)),J(e,t)};Y(r,e=>{K(x)&&e(a)}),V(()=>{X(n,`src`,i()),X(n,`aria-describedby`,s()?l():void 0)}),J(e,t)},o=e=>{var t=Pi(),n=z(t,!0);k(t),V(()=>Or(n,K(S))),J(e,t)};Y(n,e=>{K(y)===`feature-button`?e(r):K(y)===`controls`?e(a,1):K(y)===`error`&&e(o,2)}),k(t),J(e,t)};return Y(ae,e=>{K(y)!==`none`&&e(oe)}),J(e,ie),Ye(re)}vi(Li,{hasAudio:{},audioUrl:{},useFeatureButtonAudio:{},autoplayEnabled:{},audioTranscript:{},showVisibleTranscript:{},transcriptId:{},featureAudioSkin:{},uiText:{},locale:{},onaudiostarted:{},onaudioended:{}},[],[],{mode:`open`});var Ri=q(`<img class="w-auto object-contain pie-blank-image" style="max-height:var(--mpb-selected-image-max-height, 4rem);"/>`),zi=q(`<span class="cloze-marker-value pie-blank-value svelte-d9l5tb"></span>`),Bi=q(`<span class="cloze-marker-empty svelte-d9l5tb" aria-hidden="true">&nbsp;</span>`),Vi=q(`<span role="status" aria-live="polite" aria-atomic="true"><!></span>`),Hi={hash:`svelte-d9l5tb`,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;}`};function Ui(e,t){Je(t,!0),Kr(e,Hi);let n=Z(t,`choiceMode`,7,`text`),r=Z(t,`displayChoice`,7,void 0),i=Z(t,`displayChoiceLabelHtml`,7,``),a=Z(t,`isStandalone`,7,!1),o=Z(t,`blankWidth`,7),s=Z(t,`blankBorderWidth`,7),c=Z(t,`ariaLabel`,7);var l={get choiceMode(){return n()},set choiceMode(e=`text`){n(e),P()},get displayChoice(){return r()},set displayChoice(e=void 0){r(e),P()},get displayChoiceLabelHtml(){return i()},set displayChoiceLabelHtml(e=``){i(e),P()},get isStandalone(){return a()},set isStandalone(e=!1){a(e),P()},get blankWidth(){return o()},set blankWidth(e){o(e),P()},get blankBorderWidth(){return s()},set blankBorderWidth(e){s(e),P()},get ariaLabel(){return c()},set ariaLabel(e){c(e),P()}},u=Vi(),d=z(u),f=e=>{var t=Ri();V(()=>{X(t,`src`,r().imageUrl),X(t,`alt`,r().imageAlt||`Selected answer image`)}),J(e,t)},p=e=>{var t=zi();Gr(t,i,!0),k(t),J(e,t)},m=e=>{J(e,Bi())};return Y(d,e=>{n()===`image`&&r()?.imageUrl?e(f):i()?e(p,1):e(m,-1)}),k(u),V(()=>{Qr(u,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 ${a()?`cloze-marker-standalone pie-blank-slot-standalone`:``}`,`svelte-d9l5tb`),ei(u,`width:${o()};border-bottom-width:${s()};`),X(u,`aria-label`,c())}),J(e,u),Ye(l)}vi(Ui,{choiceMode:{},displayChoice:{},displayChoiceLabelHtml:{},isStandalone:{},blankWidth:{},blankBorderWidth:{},ariaLabel:{}},[],[],{mode:`open`});var Wi=q(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`),Gi=q(`<span class="choice-html pie-choice-label svelte-8xu1pt"></span>`),Ki=q(`<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>`),qi=q(`<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),Ji=q(`<span aria-hidden="true"> </span>`),Yi=q(`<div style="gap:var(--mpb-choice-row-gap, 0.5rem);"><!> <!></div>`),Xi={hash:`svelte-8xu1pt`,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);}`};function Zi(e,t){Je(t,!0),Kr(e,Xi);let n=Z(t,`choice`,7),r=Z(t,`choiceMode`,7,`text`),i=Z(t,`isHorizontal`,7,!1),a=Z(t,`isSelected`,7,!1),o=Z(t,`isDisabled`,7,!1),s=Z(t,`correctness`,7,void 0),c=Z(t,`isEvaluateMode`,7,!1),l=Z(t,`instanceId`,7),u=Z(t,`radioGroupName`,7);var d={get choice(){return n()},set choice(e){n(e),P()},get choiceMode(){return r()},set choiceMode(e=`text`){r(e),P()},get isHorizontal(){return i()},set isHorizontal(e=!1){i(e),P()},get isSelected(){return a()},set isSelected(e=!1){a(e),P()},get isDisabled(){return o()},set isDisabled(e=!1){o(e),P()},get correctness(){return s()},set correctness(e=void 0){s(e),P()},get isEvaluateMode(){return c()},set isEvaluateMode(e=!1){c(e),P()},get instanceId(){return l()},set instanceId(e){l(e),P()},get radioGroupName(){return u()},set radioGroupName(e){u(e),P()}},f=Yi(),p=z(f),m=e=>{var t=Ki(),i=z(t),s=z(i),c=e=>{var t=Wi();V(()=>{X(t,`src`,n().imageUrl),X(t,`alt`,n().imageAlt||`Choice ${n().id}`)}),J(e,t)},d=e=>{var t=Gi();Gr(t,()=>n().labelHtml||``,!0),k(t),J(e,t)};Y(s,e=>{r()===`image`&&n().imageUrl?e(c):e(d,-1)}),k(i);var f=B(i,2);ai(f),k(t),V(()=>{X(t,`for`,`${l()}-opt-${n().id}`),X(f,`name`,u()),X(f,`id`,`${l()}-opt-${n().id}`),oi(f,n().id),si(f,a()),f.disabled=o()}),J(e,t)},h=e=>{var t=qi(),i=un(t);ai(i);var s=B(i,2),c=z(s),d=e=>{var t=Wi();V(()=>{X(t,`src`,n().imageUrl),X(t,`alt`,n().imageAlt||`Choice ${n().id}`)}),J(e,t)},f=e=>{var t=Gi();Gr(t,()=>n().labelHtml||``,!0),k(t),J(e,t)};Y(c,e=>{r()===`image`&&n().imageUrl?e(d):e(f,-1)}),k(s),V(()=>{X(i,`name`,u()),X(i,`id`,`${l()}-opt-${n().id}`),oi(i,n().id),si(i,a()),i.disabled=o(),X(s,`for`,`${l()}-opt-${n().id}`)}),J(e,t)};Y(p,e=>{i()?e(m):e(h,-1)});var g=B(p,2),_=e=>{var t=Ji(),n=z(t,!0);k(t),V(()=>{Qr(t,1,`pie-choice-feedback-badge ${s()===`correct`?`pie-choice-feedback-correct`:`pie-choice-feedback-incorrect`}`,`svelte-8xu1pt`),Or(n,s()===`correct`?`✓`:`✕`)}),J(e,t)};return Y(g,e=>{c()&&s()&&e(_)}),k(f),V(()=>Qr(f,1,`flex items-start choice-row pie-choice ${i()?`choice-row-horizontal pie-choice-horizontal`:``} ${a()?`is-selected pie-choice-selected`:``} ${s()?`choice-${s()} pie-choice-${s()}`:``}`,`svelte-8xu1pt`)),J(e,f),Ye(d)}vi(Zi,{choice:{},choiceMode:{},isHorizontal:{},isSelected:{},isDisabled:{},correctness:{},isEvaluateMode:{},instanceId:{},radioGroupName:{}},[],[],{mode:`open`});function Qi(e){let t=new Map,{isEvaluateMode:n,correctChoiceId:r,selectedId:i,showCorrectAnswer:a}=e;return!n||!r?t:a?(t.set(r,`correct`),t):i?i===r?(t.set(r,`correct`),t):(t.set(i,`incorrect`),t.set(r,`incorrect`),t):(t.set(r,`incorrect`),t)}var $i=`{{blank}}`,ea=new Set([`audio_blank_only`,`stimulus_image_blank`,`token_sequence`]);function ta(e){let{interactionMode:t=``,template:n=``,choiceLayout:r,layoutProfile:i=``,hasAudio:a=!1,useFeatureButtonAudio:o}=e,s=t===`audio_mc_only`,c=n?n.replace(/<[^>]+>/g,``).replace(/&nbsp;/g,` `).trim()===$i:!1,l=r===`horizontal`||r===`vertical`?r:s||c?`horizontal`:`vertical`;return{isAudioOnlyMode:s,isBlankOnlyTemplate:c,choiceLayout:l,isHorizontalChoices:l===`horizontal`,hasInlineSentenceAudioLayout:i===`inline_sentence`&&a,useFeatureButtonAudio:typeof o==`boolean`?o:a&&ea.has(i)}}var na={blankStandaloneWidthRem:7,blankWideWidthRem:10,blankUnderlineWidthPx:2,blankUnderlineWideWidthPx:4,horizontalChoiceWidthPx:170,horizontalChoiceWidthVw:30,horizontalChoiceTileMinHeightRem:11,horizontalChoiceContentMinHeightRem:7.5,selectedImageMaxHeightRem:4,choiceImageMaxHeightRem:5,listenButtonSizePx:128,stimulusMinColumnPx:210,textMinColumnPx:260,legendMaxChars:120,choiceGroupGapRem:.5,choiceRowGapRem:.5,toggleButtonGapRem:.5,horizontalChoiceRadioTopMarginRem:.5,audioBlankTemplateMarginTopRem:.8,audioBlankTemplateMarginBottomRem:1.8,audioInstructionsMaxWidthPx:875,narrowHorizontalChoiceMaxWidthPx:230,stimulusGridColumnGapRem:2,stimulusGridRowGapRem:.7,stimulusSentenceMarginTopRem:.2,stimulusChoicesMarginTopRem:.9,tokenGridColumnGapRem:1.5,tokenGridRowGapRem:.8,tokenTemplateMarginTopRem:.6,tokenInlineTokenGapRem:.35,tokenChoicesMarginTopRem:.2,inlineGridColumnGapRem:1.5,inlineGridRowGapRem:.65,inlineTemplateMarginTopRem:.45,inlineChoicesMarginTopRem:.25},ra={blankStandaloneWidthRem:{varName:`--mpb-blank-standalone-width`,unit:`rem`},blankWideWidthRem:{varName:`--mpb-blank-wide-width`,unit:`rem`},blankUnderlineWidthPx:{varName:`--mpb-blank-underline-width`,unit:`px`},blankUnderlineWideWidthPx:{varName:`--mpb-blank-underline-wide-width`,unit:`px`},horizontalChoiceWidthPx:{varName:`--mpb-choice-width-px`,unit:`px`},horizontalChoiceWidthVw:{varName:`--mpb-choice-width-vw`,unit:`vw`},horizontalChoiceTileMinHeightRem:{varName:`--mpb-choice-tile-min-height`,unit:`rem`},horizontalChoiceContentMinHeightRem:{varName:`--mpb-choice-content-min-height`,unit:`rem`},choiceImageMaxHeightRem:{varName:`--mpb-choice-image-max-height`,unit:`rem`},selectedImageMaxHeightRem:{varName:`--mpb-selected-image-max-height`,unit:`rem`},choiceGroupGapRem:{varName:`--mpb-choice-group-gap`,unit:`rem`},choiceRowGapRem:{varName:`--mpb-choice-row-gap`,unit:`rem`},horizontalChoiceRadioTopMarginRem:{varName:`--mpb-horizontal-choice-radio-top-margin`,unit:`rem`},narrowHorizontalChoiceMaxWidthPx:{varName:`--mpb-narrow-choice-max-width`,unit:`px`},toggleButtonGapRem:{varName:`--mpb-toggle-button-gap`,unit:`rem`},listenButtonSizePx:{varName:`--mpb-listen-button-size`,unit:`px`},audioBlankTemplateMarginTopRem:{varName:`--mpb-audio-blank-template-margin-top`,unit:`rem`},audioBlankTemplateMarginBottomRem:{varName:`--mpb-audio-blank-template-margin-bottom`,unit:`rem`},audioInstructionsMaxWidthPx:{varName:`--mpb-audio-instructions-max-width`,unit:`px`},stimulusMinColumnPx:{varName:`--mpb-stimulus-min-column`,unit:`px`},textMinColumnPx:{varName:`--mpb-text-min-column`,unit:`px`},stimulusGridColumnGapRem:{varName:`--mpb-stimulus-grid-column-gap`,unit:`rem`},stimulusGridRowGapRem:{varName:`--mpb-stimulus-grid-row-gap`,unit:`rem`},stimulusSentenceMarginTopRem:{varName:`--mpb-stimulus-sentence-margin-top`,unit:`rem`},stimulusChoicesMarginTopRem:{varName:`--mpb-stimulus-choices-margin-top`,unit:`rem`},tokenGridColumnGapRem:{varName:`--mpb-token-grid-column-gap`,unit:`rem`},tokenGridRowGapRem:{varName:`--mpb-token-grid-row-gap`,unit:`rem`},tokenTemplateMarginTopRem:{varName:`--mpb-token-template-margin-top`,unit:`rem`},tokenInlineTokenGapRem:{varName:`--mpb-token-inline-token-gap`,unit:`rem`},tokenChoicesMarginTopRem:{varName:`--mpb-token-choices-margin-top`,unit:`rem`},inlineGridColumnGapRem:{varName:`--mpb-inline-grid-column-gap`,unit:`rem`},inlineGridRowGapRem:{varName:`--mpb-inline-grid-row-gap`,unit:`rem`},inlineTemplateMarginTopRem:{varName:`--mpb-inline-template-margin-top`,unit:`rem`},inlineChoicesMarginTopRem:{varName:`--mpb-inline-choices-margin-top`,unit:`rem`}},ia={audio_blank_only:{blankWideWidthRem:10,blankUnderlineWideWidthPx:6,horizontalChoiceTileMinHeightRem:11.25,horizontalChoiceContentMinHeightRem:9.375,choiceGroupGapRem:1,audioBlankTemplateMarginBottomRem:1.875},stimulus_image_blank:{blankWideWidthRem:10,blankUnderlineWideWidthPx:6},token_sequence:{blankStandaloneWidthRem:7,blankUnderlineWideWidthPx:6}};function aa(e){let{layoutProfile:t,isBlankOnlyTemplate:n,correctAnswerStyleVars:r}=e,i=e.configuredLimits&&typeof e.configuredLimits==`object`?e.configuredLimits:{},a=e.customProfilePresets&&typeof e.customProfilePresets==`object`?e.customProfilePresets:{},o=a[t]&&typeof a[t]==`object`?a[t]:{},s={...ia[t]??{},...o},c={...na,...i,...s},l=[`audio_blank_only`,`stimulus_image_blank`],u=[`audio_blank_only`,`stimulus_image_blank`,`token_sequence`],d=l.includes(t)?`${c.blankWideWidthRem}rem`:n?`${c.blankStandaloneWidthRem}rem`:`auto`,f=u.includes(t)?`${c.blankUnderlineWideWidthPx}px`:`${c.blankUnderlineWidthPx}px`;return{rootStyle:[...Object.keys(ra).map(e=>`${ra[e].varName}:${c[e]}${ra[e].unit}`),r].join(`;`),blankWidth:d,blankBorderWidth:f,legendMaxChars:c.legendMaxChars}}var oa={default:{silentUrl:`https://assets.learnosity.com/organisations/844/0c9f2aa3-3cd5-4de7-93ef-541c24ca35da.svg`,playingUrl:`https://assets.learnosity.com/organisations/844/231dfdc2-c113-4be5-91fb-e75a0ca5994b.svg`},es:{silentUrl:`https://assets.learnosity.com/organisations/844/27a9d5b5-d873-4bd5-b9ba-22748782d8ba.svg`,playingUrl:`https://assets.learnosity.com/organisations/844/120f216d-96b7-4560-94b8-1d90710216b7.svg`}};function sa(e){let t=String(e.locale||``).toLowerCase(),n=t.slice(0,2),r=e.audioButtonSkinsByLocale&&typeof e.audioButtonSkinsByLocale==`object`?e.audioButtonSkinsByLocale:{},i=e.audioButtonSkin&&typeof e.audioButtonSkin==`object`?e.audioButtonSkin:null,a=t.startsWith(`es`)?oa.es:oa.default;return r[t]||r[n]||r.default||i||a}function ca(e){let{selectedId:t,isEvaluateMode:n,showCorrectAnswer:r,alwaysShowCorrect:i,correctChoiceId:a}=e;return i&&a||n&&r&&a?a:t}function la(e){let{isEvaluateMode:t,showCorrectAnswer:n,isCorrect:r,isIncorrect:i,selectedId:a}=e;return!t||n?``:r?`Correct answer selected`:i&&a?`Incorrect answer selected`:``}function ua(e){let{prompt:t,legendMaxChars:n,answerChoicesLabel:r}=e,i=t.replace(/<[^>]+>/g,` `).replace(/\s+/g,` `).trim(),a=Math.max(8,n);return i?i.length>a?`${i.slice(0,Math.max(1,a-1))}…`:i:r}var da=`/* Shared base styles for all sel_r1-*_plusggg variants.
1
+ (function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var r={},i=Symbol(`uninitialized`),a=`http://www.w3.org/1999/xhtml`,o=`http://www.w3.org/2000/svg`,s=`http://www.w3.org/1998/Math/MathML`,c=Array.isArray,l=Array.prototype.indexOf,u=Array.prototype.includes,d=Array.from,f=Object.keys,p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyDescriptors,g=Object.prototype,_=Array.prototype,v=Object.getPrototypeOf,y=Object.isExtensible,ee=()=>{};function b(e){for(var t=0;t<e.length;t++)e[t]()}function x(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var S=1024,C=2048,w=4096,te=8192,ne=16384,re=32768,ie=1<<25,ae=65536,oe=1<<19,se=1<<20,ce=1<<25,le=65536,ue=1<<21,de=1<<22,fe=1<<23,pe=Symbol(`$state`),me=Symbol(`legacy props`),he=Symbol(``),ge=Symbol(`attributes`),_e=Symbol(`class`),ve=Symbol(`style`),ye=Symbol(`text`),be=Symbol(`form reset`),xe=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Se=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function Ce(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function we(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Te(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ee(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function De(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Oe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ke(){throw Error(`https://svelte.dev/e/hydration_failed`)}function Ae(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function je(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Me(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ne(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Pe(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function Fe(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ie(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Le(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var T=!1;function Re(e){T=e}var E;function D(e){if(e===null)throw Ie(),r;return E=e}function ze(){return D(un(E))}function O(e){if(T){if(un(E)!==null)throw Ie(),r;E=e}}function Be(e=1){if(T){for(var t=e,n=E;t--;)n=un(n);E=n}}function Ve(e=!0){for(var t=0,n=E;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=un(n);e&&n.remove(),n=i}}function He(e){if(!e||e.nodeType!==8)throw Ie(),r;return e.data}function Ue(e){return e===this.v}function We(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ge(e){return!We(e,this.v)}var k=null;function Ke(e){k=e}function qe(e,t=!1,n){k={p:k,i:!1,c:null,e:null,s:e,x:null,r:W,l:null}}function Je(e){var t=k,n=t.e;if(n!==null){t.e=null;for(var r of n)Sn(r)}return e!==void 0&&(t.x=e),t.i=!0,k=t.p,e??{}}function Ye(){return!0}var Xe=[];function Ze(){var e=Xe;Xe=[],b(e)}function Qe(e){if(Xe.length===0&&!Mt){var t=Xe;queueMicrotask(()=>{t===Xe&&Ze()})}Xe.push(e)}function $e(){for(;Xe.length>0;)Ze()}function et(e){var t=W;if(t===null)return H.f|=fe,e;if(!(t.f&32768)&&!(t.f&4))throw e;tt(e,t)}function tt(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var nt=~(C|w|S);function A(e,t){e.f=e.f&nt|t}function rt(e){e.f&512||e.deps===null?A(e,S):A(e,w)}function it(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=le,it(t.deps))}function at(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),it(e.deps),A(e,S)}var ot=!1;function st(e){var t=ot;try{return ot=!1,[e(),ot]}finally{ot=t}}var ct=!1;function lt(){ct||(ct=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[be]?.()})},{capture:!0}))}function ut(e){var t=H,n=W;U(null),Wn(null);try{return e()}finally{U(t),Wn(n)}}function dt(e){let t=0,n=Xt(0),r;return()=>{yn()&&(J(n),Dn(()=>(t===0&&(r=sr(()=>e(()=>en(n)))),t+=1,()=>{Qe(()=>{--t,t===0&&(r?.(),r=void 0,en(n))})})))}}var ft=ae|oe;function pt(e,t,n,r){new mt(e,t,n,r)}var mt=class{parent;is_pending=!1;transform_error;#e;#t=T?E:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=dt(()=>(this.#m=Xt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=W;t.b=this,t.f|=128,n(e)},this.parent=W.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=On(()=>{if(T){let e=this.#t;ze();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#y():this.#g()}else this.#b()},ft),T&&(this.#e=E)}#g(){try{this.#a=B(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);Qe(r),t&&(this.#s=B(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{if(t){Le();return}t=!0,n&&Pe(),this.#s!==null&&Pn(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})};return{reset:r,invoke_onerror:()=>{try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){tt(e,this.#i&&this.#i.parent)}}}}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=B(()=>e(this.#e)),Qe(()=>{var e=this.#c=document.createDocumentFragment(),t=ln();e.append(t),this.#a=this.#S(()=>B(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Pn(this.#o,()=>{this.#o=null}),this.#x(M))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=B(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Rn(this.#a,e);let t=this.#n.pending;this.#o=B(()=>t(this.#e))}else this.#x(M)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){at(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=W,n=H,r=k;Wn(this.#i),U(this.#i),Ke(this.#i.ctx);try{return Rt.ensure(),e()}catch(e){return et(e),null}finally{Wn(t),U(n),Ke(r)}}#C(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#C(e,t);return}this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&Pn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Qe(()=>{this.#d=!1,this.#m&&Qt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),J(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;M?.is_fork?(this.#a&&M.skip_effect(this.#a),this.#o&&M.skip_effect(this.#o),this.#s&&M.skip_effect(this.#s),M.oncommit(()=>{this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(V(this.#a),null),this.#o&&=(V(this.#o),null),this.#s&&=(V(this.#s),null),T&&(D(this.#t),Be(),D(Ve()));let t=this.#n.failed,n=e=>{let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&(this.#s=this.#S(()=>{try{return B(()=>{var r=W;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return tt(e,this.#i.parent),null}}))};Qe(()=>{var t;try{t=this.transform_error(e)}catch(e){tt(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>tt(e,this.#i&&this.#i.parent)):n(t)})}};function ht(e,t,n,r){let i=Ye()?yt:St;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=W,c=gt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){tt(e,s)}_t()}}var d=vt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>xt(e))).then(u).catch(e=>tt(e,s)).finally(d)}l?l.then(()=>{c(),f(),_t()}):f()}function gt(){var e=W,t=H,n=k,r=M;return function(i=!0){Wn(e),U(t),Ke(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function _t(e=!0){Wn(null),U(null),Ke(null),e&&M?.deactivate()}function vt(){var e=W,t=e.b,n=M,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function yt(e){var t=2|C;return W!==null&&(W.f|=oe),{ctx:k,deps:null,effects:null,equals:Ue,f:t,fn:e,reactions:null,rv:0,v:i,wv:0,parent:W,ac:null}}var bt=Symbol(`obsolete`);function xt(e,t,n){let r=W;r===null&&Ce();var a=void 0,o=Xt(i),s=!H,c=new Set;return En(()=>{var t=W,n=x();a=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==xe&&n.reject(e)}).finally(_t)}catch(e){n.reject(e),_t()}var i=M;if(s){if(t.f&32768)var l=vt();if(r.b?.is_rendered())i.async_deriveds.get(t)?.reject(bt);else for(let e of c.values())e.reject(bt);c.add(n),i.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),c.delete(n),t!==bt&&(i.activate(),t?(o.f|=fe,Qt(o,t)):(o.f&8388608&&(o.f^=fe),Qt(o,e)),i.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),bn(()=>{for(let e of c)e.reject(bt)}),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function j(e){let t=yt(e);return Kn(t),t}function St(e){let t=yt(e);return t.equals=Ge,t}function Ct(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)V(t[n])}}function wt(e){var t,n=W,r=e.parent;if(!Vn&&r!==null&&e.v!==i&&r.f&24576)return Fe(),e.v;Wn(r);try{e.f&=~le,Ct(e),t=tr(e)}finally{Wn(n)}return t}function Tt(e){var t=wt(e);if(!e.equals(t)&&(e.wv=Qn(),(!M?.is_fork||e.deps===null)&&(M===null?e.v=t:(M.capture(e,t,!0),kt?.capture(e,t,!0)),e.deps===null))){A(e,S);return}Vn||(At===null?rt(e):(yn()||M?.is_fork)&&At.set(e,t))}function Et(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&ut(()=>{t.ac.abort(xe),t.ac=null}),t.fn!==null&&(t.teardown=ee),rr(t,0),An(t))}function Dt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&ir(t)}var Ot=null,M=null,kt=null,At=null,jt=null,Mt=!1,Nt=!1,Pt=null,Ft=null,It=0,Lt=1,Rt=class e{id=Lt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){Ot===null?Ot=this:(Ot.#n=this,this.#t=Ot),Ot=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)A(r,C),t(r);for(r of n.m)A(r,w),t(r)}this.#p.add(e)}#g(){this.#e=!0,It++>1e3&&(this.#x(),zt());for(let e of this.#u)this.#d.delete(e),A(e,C),this.schedule(e);for(let e of this.#d)A(e,w),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=Pt=[],r=[],i=Ft=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Kt(e),this.#h()||this.discard(),t}if(M=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Pt=null,Ft=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Gt(e,t);i.length>0&&M.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),kt=this,Vt(r),Vt(n),kt=null,this.#s?.resolve();var s=M;if(this.#a===0&&(this.#c.length===0||s!==null)&&this.#x(),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=S;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=S:i&4?t.push(r):$n(r)&&(i&16&&this.#d.add(r),ir(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),A(i,C),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#x(),M=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)at(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==i&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),At?.set(e,t)),this.is_fork||(e.v=t)}activate(){M=this}deactivate(){M=null,At=null}flush(){try{Nt=!0,M=this,this.#g()}finally{It=0,jt=null,Pt=null,Ft=null,Nt=!1,M=null,At=null,Jt.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(bt);this.#x(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,Qe(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=x()).promise}static ensure(){if(M===null){let t=M=new e;!Nt&&!Mt&&Qe(()=>{t.#e||t.flush()})}return M}apply(){At=null}schedule(e){if(jt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Pt!==null&&t===W&&(H===null||!(H.f&2)))return;if(n&96){if(!(n&1024))return;t.f^=S}}this.#c.push(t)}#x(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?Ot=e:t.#t=e,this.linked=!1}}};function N(e){var t=Mt;Mt=!0;try{var n;for(e&&(M!==null&&!M.is_fork&&M.flush(),n=e());;){if($e(),M===null)return n;M.flush()}}finally{Mt=t}}function zt(){try{Oe()}catch(e){tt(e,jt)}}var Bt=null;function Vt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&$n(r)&&(Bt=new Set,ir(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Nn(r),Bt?.size>0)){Jt.clear();for(let e of Bt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Bt.has(n)&&(Bt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||ir(n)}}Bt.clear()}}Bt=null}}function Ht(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Ht(i,t,n,r):e&4194320&&!(e&2048)&&Ut(i,t,r)&&(A(i,C),Wt(i))}}function Ut(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(u.call(t,r))return!0;if(r.f&2&&Ut(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function Wt(e){M.schedule(e)}function Gt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),A(e,S);for(var n=e.first;n!==null;)Gt(n,t),n=n.next}}function Kt(e){A(e,S);for(var t=e.first;t!==null;)Kt(t),t=t.next}var qt=new Set,Jt=new Map,Yt=!1;function Xt(e,t){return{f:0,v:e,reactions:null,equals:Ue,rv:0,wv:0}}function P(e,t){let n=Xt(e,t);return Kn(n),n}function Zt(e,t=!1,n=!0){let r=Xt(e);return t||(r.equals=Ge),r}function F(e,t,n=!1){return H!==null&&(!Un||H.f&131072)&&Ye()&&H.f&4325394&&(Gn===null||!Gn.has(e))&&Ne(),Qt(e,n?nn(t):t,Ft)}function Qt(e,t,n=null){if(!e.equals(t)){Jt.set(e,Vn?t:e.v);var r=Rt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&wt(t),At===null&&rt(t)}e.wv=Qn(),tn(e,C,n),Ye()&&W!==null&&W.f&1024&&!(W.f&96)&&(q===null?qn([e]):q.push(e)),!r.is_fork&&qt.size>0&&!Yt&&$t()}return t}function $t(){Yt=!1;for(let e of qt){e.f&1024&&A(e,w);let t;try{t=$n(e)}catch{t=!0}t&&ir(e)}qt.clear()}function en(e){F(e,e.v+1)}function tn(e,t,n){var r=e.reactions;if(r!==null)for(var i=Ye(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===W)){var l=(c&C)===0;if(l&&A(s,t),c&131072)qt.add(s);else if(c&2){var u=s;At?.delete(u),c&65536||(c&512&&(W===null||!(W.f&2097152))&&(s.f|=le),tn(u,w,n))}else if(l){var d=s;c&16&&Bt!==null&&Bt.add(d),n===null?Wt(d):n.push(d)}}}}function nn(e){if(typeof e!=`object`||!e||pe in e)return e;let t=v(e);if(t!==g&&t!==_)return e;var n=new Map,r=c(e),a=P(0),o=null,s=Xn,l=e=>{if(Xn===s)return e();var t=H,n=Xn;U(null),Zn(s);var r=e();return U(t),Zn(n),r};return r&&n.set(`length`,P(e.length,o)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&je();var i=n.get(t);return i===void 0?l(()=>{var e=P(r.value,o);return n.set(t,e),e}):F(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=l(()=>P(i,o));n.set(t,e),en(a)}}else F(r,i),en(a);return!0},get(t,r,a){if(r===pe)return e;var s=n.get(r),c=r in t;if(s===void 0&&(!c||m(t,r)?.writable)&&(s=l(()=>P(nn(c?t[r]:i),o)),n.set(r,s)),s!==void 0){var u=J(s);return u===i?void 0:u}return Reflect.get(t,r,a)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var a=n.get(t);a&&(r.value=J(a))}else if(r===void 0){var o=n.get(t),s=o?.v;if(o!==void 0&&s!==i)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return r},has(e,t){if(t===pe)return!0;var r=n.get(t),a=r!==void 0&&r.v!==i||Reflect.has(e,t);return(r!==void 0||W!==null&&(!a||m(e,t)?.writable))&&(r===void 0&&(r=l(()=>P(a?nn(e[t]):i,o)),n.set(t,r)),J(r)===i)?!1:a},set(e,t,s,c){var u=n.get(t),d=t in e;if(r&&t===`length`)for(var f=s;f<u.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=l(()=>P(i,o)),n.set(f+``,p)):F(p,i)}if(u===void 0)(!d||m(e,t)?.writable)&&(u=l(()=>P(void 0,o)),F(u,nn(s)),n.set(t,u));else{d=u.v!==i;var h=l(()=>nn(s));F(u,h)}var g=Reflect.getOwnPropertyDescriptor(e,t);if(g?.set&&g.set.call(c,s),!d){if(r&&typeof t==`string`){var _=n.get(`length`),v=Number(t);Number.isInteger(v)&&v>=_.v&&F(_,v+1)}en(a)}return!0},ownKeys(e){J(a);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==i});for(var[r,o]of n)o.v!==i&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Me()}})}var rn,an,on,sn;function cn(){if(rn===void 0){rn=window,an=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;on=m(t,`firstChild`).get,sn=m(t,`nextSibling`).get,y(e)&&(e[_e]=void 0,e[ge]=null,e[ve]=void 0,e.__e=void 0),y(n)&&(n[ye]=void 0)}}function ln(e=``){return document.createTextNode(e)}function I(e){return on.call(e)}function un(e){return sn.call(e)}function L(e,t){if(!T)return I(e);var n=I(E);if(n===null)n=E.appendChild(ln());else if(t&&n.nodeType!==3){var r=ln();return n?.before(r),D(r),r}return t&&hn(n),D(n),n}function dn(e,t=!1){if(!T){var n=I(e);return n instanceof Comment&&n.data===``?un(n):n}if(t){if(E?.nodeType!==3){var r=ln();return E?.before(r),D(r),r}hn(E)}return E}function R(e,t=1,n=!1){let r=T?E:e;for(var i;t--;)i=r,r=un(r);if(!T)return r;if(n){if(r?.nodeType!==3){var a=ln();return r===null?i?.after(a):r.before(a),D(a),a}hn(r)}return D(r),r}function fn(e){e.textContent=``}function pn(){return!1}function mn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function hn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function gn(e){W===null&&(H===null&&De(e),Ee()),Vn&&Te(e)}function _n(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function vn(e,t){var n=W;n!==null&&n.f&8192&&(e|=te);var r={ctx:k,deps:null,nodes:null,f:e|C|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};M?.register_created_effect(r);var i=r;if(e&4)Pt===null?Rt.ensure().schedule(r):Pt.push(r);else if(t!==null){try{ir(r)}catch(e){throw V(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ae))}if(i!==null&&(i.parent=n,n!==null&&_n(i,n),H!==null&&H.f&2&&!(e&64))){var a=H;(a.effects??=[]).push(i)}return r}function yn(){return H!==null&&!Un}function bn(e){let t=vn(8,null);return A(t,S),t.teardown=e,t}function xn(e){gn(`$effect`);var t=W.f;if(!H&&t&32&&k!==null&&!k.i){var n=k;(n.e??=[]).push(e)}else return Sn(e)}function Sn(e){return vn(4|se,e)}function Cn(e){Rt.ensure();let t=vn(64|oe,e);return()=>{V(t)}}function wn(e){Rt.ensure();let t=vn(64|oe,e);return(e={})=>new Promise(n=>{e.outro?Pn(t,()=>{V(t),n(void 0)}):(V(t),n(void 0))})}function Tn(e){return vn(4,e)}function En(e){return vn(de|oe,e)}function Dn(e,t=0){return vn(8|t,e)}function z(e,t=[],n=[],r=[]){ht(r,t,n,t=>{vn(8,()=>{e(...t.map(J))})})}function On(e,t=0){return vn(16|t,e)}function B(e){return vn(32|oe,e)}function kn(e){var t=e.teardown;if(t!==null){let e=Vn,n=H;Hn(!0),U(null);try{t.call(null)}finally{Hn(e),U(n)}}}function An(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&ut(()=>{e.abort(xe)});var r=n.next;n.f&64?n.parent=null:V(n,t),n=r}}function jn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||V(t),t=n}}function V(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Mn(e.nodes.start,e.nodes.end),n=!0),e.f|=ie,An(e,t&&!n),rr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();kn(e),e.f^=ie,e.f|=ne;var i=e.parent;i!==null&&i.first!==null&&Nn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Mn(e,t){for(;e!==null;){var n=e===t?null:un(e);e.remove(),e=n}}function Nn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Pn(e,t,n=!0){var r=[];Fn(e,r,!0);var i=()=>{n&&V(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Fn(e,t,n){if(!(e.f&8192)){e.f^=te;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Fn(i,t,o?n:!1)}i=a}}}function In(e){Ln(e,!0)}function Ln(e,t){if(e.f&8192){e.f^=te,e.f&1024||(A(e,C),Rt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Ln(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Rn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:un(n);t.append(n),n=i}}var zn=null,Bn=!1,Vn=!1;function Hn(e){Vn=e}var H=null,Un=!1;function U(e){H=e}var W=null;function Wn(e){W=e}var Gn=null;function Kn(e){H!==null&&(Gn??=new Set).add(e)}var G=null,K=0,q=null;function qn(e){q=e}var Jn=1,Yn=0,Xn=Yn;function Zn(e){Xn=e}function Qn(){return++Jn}function $n(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~le),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if($n(a)&&Tt(a),a.wv>e.wv)return!0}t&512&&At===null&&A(e,S)}return!1}function er(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Gn!==null&&Gn.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?er(a,t,!1):t===a&&(n?A(a,C):a.f&1024&&A(a,w),Wt(a))}}function tr(e){var t=G,n=K,r=q,i=H,a=Gn,o=k,s=Un,c=Xn,l=e.f;G=null,K=0,q=null,H=l&96?null:e,Gn=null,Ke(e.ctx),Un=!1,Xn=++Yn,e.ac!==null&&(ut(()=>{e.ac.abort(xe)}),e.ac=null);try{e.f|=ue;var u=e.fn,d=u();e.f|=re;var f=e.deps,p=M?.is_fork;if(G!==null){var m;if(p||rr(e,K),f!==null&&K>0)for(f.length=K+G.length,m=0;m<G.length;m++)f[K+m]=G[m];else e.deps=f=G;if(yn()&&e.f&512)for(m=K;m<f.length;m++)(f[m].reactions??=[]).push(e)}else!p&&f!==null&&K<f.length&&(rr(e,K),f.length=K);if(Ye()&&q!==null&&!Un&&f!==null&&!(e.f&6146))for(m=0;m<q.length;m++)er(q[m],e);if(i!==null&&i!==e){if(Yn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Yn;if(t!==null)for(let e of t)e.rv=Yn;q!==null&&(r===null?r=q:r.push(...q))}return e.f&8388608&&(e.f^=fe),d}catch(e){return et(e)}finally{e.f^=ue,G=t,K=n,q=r,H=i,Gn=a,Ke(o),Un=s,Xn=c}}function nr(e,t){let n=t.reactions;if(n!==null){var r=l.call(n,e);if(r!==-1){var a=n.length-1;a===0?n=t.reactions=null:(n[r]=n[a],n.pop())}}if(n===null&&t.f&2&&(G===null||!u.call(G,t))){var o=t;o.f&512&&(o.f^=512,o.f&=~le),o.v!==i&&rt(o),o.ac!==null&&ut(()=>{o.ac.abort(xe),o.ac=null,A(o,C)}),Et(o),rr(o,0)}}function rr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)nr(e,n[r])}function ir(e){var t=e.f;if(!(t&16384)){A(e,S);var n=W,r=Bn;W=e,Bn=(t&96)==0;try{t&16777232?jn(e):An(e),kn(e);var i=tr(e);e.teardown=typeof i==`function`?i:null,e.wv=Jn}finally{Bn=r,W=n}}}function J(e){var t=(e.f&2)!=0;if(zn?.add(e),H!==null&&!Un&&!(W!==null&&W.f&16384)&&(Gn===null||!Gn.has(e))){var n=H.deps;if(H.f&2097152)e.rv<Yn&&(e.rv=Yn,G===null&&n!==null&&n[K]===e?K++:G===null?G=[e]:G.push(e));else{H.deps??=[],u.call(H.deps,e)||H.deps.push(e);var r=e.reactions;r===null?e.reactions=[H]:u.call(r,H)||r.push(H)}}if(Vn&&Jt.has(e))return Jt.get(e);if(t){var i=e;if(Vn){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||or(i))&&(a=wt(i)),Jt.set(i,a),a}var o=(i.f&512)==0&&!Un&&H!==null&&(Bn||(H.f&512)!=0),s=(i.f&re)===0;$n(i)&&(o&&(i.f|=512),Tt(i)),o&&!s&&(Dt(i),ar(i))}if(At?.has(e))return At.get(e);if(e.f&8388608)throw e.v;return e.v}function ar(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Dt(t),ar(t))}function or(e){if(e.v===i)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Jt.has(t)||t.f&2&&or(t))return!0;return!1}function sr(e){var t=Un;try{return Un=!0,e()}finally{Un=t}}var cr=Symbol(`events`),lr=new Set,ur=new Set,dr=null;function fr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;dr=e;var o=0,s=dr===e&&e[cr];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[cr]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){p(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=H,d=W;U(null),Wn(null);try{for(var f,m=[];a!==null&&a!==t;){try{var h=a[cr]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){f?m.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of m)queueMicrotask(()=>{throw e});throw f}}finally{e[cr]=t,delete e.currentTarget,U(u),Wn(d)}}}var pr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function mr(e){return pr?.createHTML(e)??e}function hr(e){var t=mn(`template`);return t.innerHTML=mr(e.replaceAll(`<!>`,`<!---->`)),t.content}function gr(e,t){var n=W;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Y(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(T)return gr(E,null),E;i===void 0&&(i=hr(a?e:`<!>`+e),n||(i=I(i)));var t=r||an?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=I(t),s=t.lastChild;gr(o,s)}else gr(t,t);return t}}function _r(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(T)return gr(E,null),E;if(!o){var e=I(hr(a));if(i)for(o=document.createDocumentFragment();I(e);)o.appendChild(I(e));else o=I(e)}var t=o.cloneNode(!0);if(i){var n=I(t),r=t.lastChild;gr(n,r)}else gr(t,t);return t}}function vr(e,t){return _r(e,t,`svg`)}function yr(){if(T)return gr(E,null),E;var e=document.createDocumentFragment(),t=document.createComment(``),n=ln();return e.append(t,n),gr(t,n),e}function X(e,t){if(T){var n=W;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=E),ze();return}e!==null&&e.before(t)}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var br=[`touchstart`,`touchmove`];function xr(e){return br.includes(e)}function Sr(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ye]??=e.nodeValue)&&(e[ye]=n,e.nodeValue=`${n}`)}function Cr(e,t){return Er(e,t)}function wr(e,t){cn(),t.intro=t.intro??!1;let n=t.target,i=T,a=E;try{for(var o=I(n);o&&(o.nodeType!==8||o.data!==`[`);)o=un(o);if(!o)throw r;Re(!0),D(o);let i=Er(e,{...t,anchor:o});return Re(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
2
+ `).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw i;return i!==r&&console.warn(`Failed to hydrate: `,i),t.recover===!1&&ke(),cn(),fn(n),Re(!1),Cr(e,t)}finally{Re(i),D(a)}}var Tr=new Map;function Er(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){cn();var l=void 0,u=wn(()=>{var s=n??t.appendChild(ln());pt(s,{pending:()=>{}},t=>{qe({});var n=k;if(o&&(n.c=o),a&&(i.$$events=a),T&&gr(t,null),l=e(t,i)||{},T&&(W.nodes.end=E,E===null||E.nodeType!==8||E.data!==`]`))throw Ie(),r;Je()},c);var u=new Set,f=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=xr(r);for(let e of[t,document]){var a=Tr.get(e);a===void 0&&(a=new Map,Tr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,fr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(d(lr)),ur.add(f),()=>{for(var e of u)for(let n of[t,document]){var r=Tr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,fr),r.delete(e),r.size===0&&Tr.delete(n)):r.set(e,i)}ur.delete(f),s!==n&&s.parentNode?.removeChild(s)}});return Dr.set(l,u),l}var Dr=new WeakMap;function Or(e,t){let n=Dr.get(e);return n?(Dr.delete(e),n(t)):Promise.resolve()}var kr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)In(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(In(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(V(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Rn(r,t),t.append(ln()),this.#n.set(e,{effect:r,fragment:t})}else V(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Pn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(V(n.effect),this.#n.delete(e))};ensure(e,t){var n=M,r=pn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=ln();i.append(a),this.#n.set(e,{effect:B(()=>t(a)),fragment:i})}else this.#t.set(e,B(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else T&&(this.anchor=E),this.#a(n)}};function Z(e,t,n=!1){var r;T&&(r=E,ze());var i=new kr(e),a=n?ae:0;function o(e,t){if(T){var n=He(r);if(e!==parseInt(n.substring(1))){var a=Ve();D(a),i.anchor=a,Re(!1),i.ensure(e,t),Re(!0);return}}i.ensure(e,t)}On(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Ar(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Pn(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;jr(e,d(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var l=n,u=l.parentNode;fn(u),u.append(l),e.items.clear()}jr(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function jr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ce,Rn(a,document.createDocumentFragment())):V(t[i],n)}}var Mr;function Nr(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var l=e;o=T?D(I(l)):l.appendChild(ln())}T&&ze();var u=null,f=St(()=>{var e=n();return c(e)?e:e==null?[]:d(e)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=u,Fr(v,p,o,t,r),u!==null&&(p.length===0?u.f&33554432?(u.f^=ce,Lr(u,null,o)):In(u):Pn(u,()=>{u=null})))}function _(e){v.pending.delete(e)}var v={effect:On(()=>{p=J(f);var e=p.length;let c=!1;T&&He(o)===`[!`!=(e===0)&&(o=Ve(),D(o),Re(!1),c=!0);for(var l=new Set,d=M,v=pn(),y=0;y<e;y+=1){T&&E.nodeType===8&&E.data===`]`&&(o=E,c=!0,Re(!1));var ee=p[y],b=r(ee,y),x=h?null:s.get(b);x?(x.v&&Qt(x.v,ee),x.i&&Qt(x.i,y),v&&d.unskip_effect(x.e)):(x=Ir(s,h?o:Mr??=ln(),ee,b,y,i,t,n),h||(x.e.f|=ce),s.set(b,x)),l.add(b)}if(e===0&&a&&!u&&(h?u=B(()=>a(o)):(u=B(()=>a(Mr??=ln())),u.f|=ce)),e>l.size&&we(``,``,``),T&&e>0&&D(Ve()),!h)if(m.set(d,l),v){for(let[e,t]of s)l.has(e)||d.skip_effect(t.e);d.oncommit(g),d.ondiscard(_)}else g(d);c&&Re(!0),J(f)}),flags:t,items:s,pending:m,outrogroups:null,fallback:u};h=!1,T&&(o=E)}function Pr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Fr(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,c=Pr(e.effect.first),l,u=null,f,p=[],m=[],h,g,_,v;if(a)for(v=0;v<o;v+=1)h=t[v],g=i(h,v),_=s.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<o;v+=1){if(h=t[v],g=i(h,v),_=s.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(In(_),a&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=ce,_===c)Lr(_,null,n);else{var y=u?u.next:c;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Rr(e,u,_),Rr(e,_,y),Lr(_,y,n),u=_,p=[],m=[],c=Pr(u.next);continue}if(_!==c){if(l!==void 0&&l.has(_)){if(p.length<m.length){var ee=m[0],b;u=ee.prev;var x=p[0],S=p[p.length-1];for(b=0;b<p.length;b+=1)Lr(p[b],ee,n);for(b=0;b<m.length;b+=1)l.delete(m[b]);Rr(e,x.prev,S.next),Rr(e,u,x),Rr(e,S,ee),c=ee,u=S,--v,p=[],m=[]}else l.delete(_),Lr(_,c,n),Rr(e,_.prev,_.next),Rr(e,_,u===null?e.effect.first:u.next),Rr(e,u,_),u=_;continue}for(p=[],m=[];c!==null&&c!==_;)(l??=new Set).add(c),m.push(c),c=Pr(c.next);if(c===null)continue}_.f&33554432||p.push(_),u=_,c=Pr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(jr(e,d(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(_ of l)_.f&8192||C.push(_);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=Pr(c.next);var w=C.length;if(w>0){var te=r&4&&o===0?n:null;if(a){for(v=0;v<w;v+=1)C[v].nodes?.a?.measure();for(v=0;v<w;v+=1)C[v].nodes?.a?.fix()}Ar(e,C,te)}}a&&Qe(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Ir(e,t,n,r,i,a,o,s){var c=o&1?o&16?Xt(n):Zt(n,!1,!1):null,l=o&2?Xt(i):null;return{v:c,i:l,e:B(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Lr(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=un(r);if(a.before(r),r===i)return;r=o}}function Rr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function zr(e,t,n=!1,i=!1,a=!1,c=!1){var l=e,u=``;if(n){var d=e;T&&(l=D(I(d)))}z(()=>{var e=W;if(u===(u=t()??``)){T&&ze();return}if(n&&!T){e.nodes=null,d.innerHTML=u,u!==``&&gr(I(d),d.lastChild);return}if(e.nodes!==null&&(Mn(e.nodes.start,e.nodes.end),e.nodes=null),u!==``){if(T){for(var c=E.data,f=ze(),p=f;f!==null&&(f.nodeType!==8||f.data!==``);)p=f,f=un(f);if(f===null)throw Ie(),r;gr(E,p),l=D(f);return}var m=mn(i?`svg`:a?`math`:`template`,i?o:a?s:void 0);m.innerHTML=u;var h=i||a?m:m.content;if(gr(I(h),h.lastChild),i||a)for(;I(h);)l.before(I(h));else l.before(h)}})}function Br(e,t){Tn(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=mn(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}var Vr=[...`
3
+ \r\f\xA0\v`];function Hr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Vr.includes(r[o-1]))&&(s===r.length||Vr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Ur(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Wr(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Gr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Wr)),i&&c.push(...Object.keys(i).map(Wr));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Wr(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Ur(r)),i&&(n+=Ur(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Kr(e,t,n,r,i,a){var o=e[_e];if(T||o!==n||o===void 0){var s=Hr(n,r,a);(!T||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[_e]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function qr(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Jr(e,t,n,r){var i=e[ve];if(T||i!==t){var a=Gr(t,r);(!T||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[ve]=t}else r&&(Array.isArray(r)?(qr(e,n?.[0],r[0]),qr(e,n?.[1],r[1],`important`)):qr(e,n,r));return r}var Yr=Symbol(`is custom element`),Xr=Symbol(`is html`),Zr=Se?`link`:`LINK`,Qr=Se?`progress`:`PROGRESS`;function $r(e){if(T){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Q(e,`checked`,null),e.checked=r}}};e[be]=n,Qe(n),lt()}}function ei(e,t){var n=ni(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==Qr)||(e.value=t??``)}function ti(e,t){var n=ni(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Q(e,t,n,r){var i=ni(e);T&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Zr)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[he]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ii(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ni(e){return e[ge]??={[Yr]:e.nodeName.includes(`-`),[Xr]:e.namespaceURI===a}}var ri=new Map;function ii(e){var t=e.getAttribute(`is`)||e.nodeName,n=ri.get(t);if(n)return n;ri.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=h(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.push(o);i=v(i)}return n}function ai(e,t){return e===t||e?.[pe]===t}function oi(e={},t,n,r){var i=k.r,a=W;return Tn(()=>{var o,s;return Dn(()=>{o=s,s=r?.()||[],sr(()=>{ai(n(...s),e)||(t(e,...s),o&&ai(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ai(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function $(e,t,n,r){var i=!0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=void 0,u=()=>o&&i?(l??=yt(r),J(l)):(c&&(c=!1,s=o?sr(r):r),s);let d;if(a){var f=pe in e||me in e;d=m(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,h=!1;a?[p,h]=st(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&Ae(t),d(p)));var g=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return g;if(d){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&d(t?g():e),e):g()})}var v=!1,y=(n&1?yt:St)(()=>(v=!1,g()));a&&J(y);var ee=W;return(function(e,t){if(arguments.length>0){let n=t?J(y):i&&a?nn(e):e;return F(y,n),v=!0,s!==void 0&&(s=n),e}return Vn&&v||ee.f&16384?y.v:J(y)})}function si(e){return new ci(e)}var ci=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=Zt(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return J(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===me?!0:(J(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return F(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?wr:Cr)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),(!e?.props?.$$host||e.sync===!1)&&N(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||p(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{Or(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},li;typeof HTMLElement==`function`&&(li=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=mn(`slot`);e!=="default"&&(n.name=e),X(t,n)}}let t={},n=di(this);for(let r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=ui(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=si({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Cn(()=>{Dn(()=>{this.$$r=!0;for(let e of f(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=ui(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=ui(e,n,this.$$p_d,`toProp`),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return f(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function ui(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`toAttribute`)switch(i){case`Object`:case`Array`:return t==null?null:JSON.stringify(t);case`Boolean`:return t?``:null;case`Number`:return t??null;default:return t}else switch(i){case`Object`:case`Array`:return t&&JSON.parse(t);case`Boolean`:return t;case`Number`:return t==null?t:+t;default:return t}}function di(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function fi(e,t,n,r,i,a){let o=class extends li{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return f(t).map(e=>(t[e].attribute||e).toLowerCase())}};return f(t).forEach(e=>{p(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=ui(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(m(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{p(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}var pi=class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}},mi=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},hi=e=>{let t=e;return t?typeof t.onSessionChange==`function`||typeof t.onAudioStarted==`function`||typeof t.onAudioEnded==`function`:!1};function gi(e,t={}){let n=t.hostPredicate??hi,r=e;for(;r;){if(n(r))return r;r=r.parentElement}if(typeof document<`u`&&t.fallbackSelector){let e=document.querySelector(t.fallbackSelector);if(n(e))return e}return null}function _i({sourceEl:e,fallbackSelector:t,component:n,complete:r,session:i}){let a=gi(e,{fallbackSelector:t});return a?typeof a.onSessionChange==`function`?(a.onSessionChange(i),a):(a.dispatchEvent(new mi(n,r)),a):null}function vi(e){return e.hasAudio?e.audioUrl?e.useFeatureButtonAudio?`feature-button`:`controls`:`error`:`none`}var yi=Y(`<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),bi=Y(`<button class="mt-2 text-sm underline pie-audio-autoplay-enable" type="button"> </button>`),xi=Y(`<audio controls="" class="w-full max-w-md pie-audio-player" preload="metadata"><track kind="captions"/></audio> <!>`,1),Si=Y(`<p class="text-sm text-red-700 pie-audio-error" role="alert"> </p>`),Ci=Y(`<div class="mb-4 audio-container pie-audio-container"><!></div>`),wi={hash:`svelte-ypdwb3`,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;}`};function Ti(e,t){qe(t,!0),Br(e,wi);let n={IDLE:`idle`,PLAYING:`playing`,BLOCKED:`blocked`,PAUSED:`paused`},r=$(t,`hasAudio`,7,!1),i=$(t,`audioUrl`,7),a=$(t,`useFeatureButtonAudio`,7,!1),o=$(t,`autoplayEnabled`,7,!1),s=$(t,`featureAudioSkin`,7),c=$(t,`uiText`,7),l=$(t,`locale`,7,``),u=$(t,`onaudiostarted`,7),d=$(t,`onaudioended`,7),f=P(null),p=P(null),m=P(null),h=P(nn(n.IDLE)),g=j(()=>vi({hasAudio:r(),audioUrl:i(),useFeatureButtonAudio:a()})),_=j(()=>J(h)===n.PLAYING),v=j(()=>J(h)===n.BLOCKED),y=j(()=>J(g)===`error`?c().audioResourceUnavailable:``);xn(()=>{i(),F(h,n.IDLE,!0)});function ee(){J(g)!==`none`&&J(g)!==`error`&&J(f)&&J(f).play().catch(()=>{})}function b(){J(g)!==`none`&&J(g)!==`error`&&J(f)&&J(f).play().finally(()=>{J(h)===n.BLOCKED&&F(h,n.PAUSED,!0)})}function x(e,t,n){xn(()=>{let r=e();if(r)return r.addEventListener(t,n),()=>r.removeEventListener(t,n)})}x(()=>J(f),`playing`,()=>{F(h,n.PLAYING,!0),u()?.()}),x(()=>J(f),`ended`,()=>{F(h,n.PAUSED,!0),d()?.()}),x(()=>J(p),`click`,()=>ee()),x(()=>J(m),`click`,()=>b()),xn(()=>{!o()||J(g)===`none`||J(g)===`error`||J(h)===n.IDLE&&J(f)&&i()&&(F(h,n.PAUSED,!0),J(f).play().catch(()=>{F(h,n.BLOCKED,!0)}))});function S(e=``){return e.toLowerCase().startsWith(`es`)?`Escuchar`:`Listen`}function C(e=``){return e.toLowerCase().startsWith(`es`)?c().listenSilentAltEs??`Escuchar. Repetir las instrucciones.`:c().listenSilentAlt??`Repeat instructions`}function w(e=``){return e.toLowerCase().startsWith(`es`)?c().listenPlayingAltEs??`Escuchar. Estas son las instrucciones.`:c().listenPlayingAlt??`Instructions are playing`}var te={get hasAudio(){return r()},set hasAudio(e=!1){r(e),N()},get audioUrl(){return i()},set audioUrl(e){i(e),N()},get useFeatureButtonAudio(){return a()},set useFeatureButtonAudio(e=!1){a(e),N()},get autoplayEnabled(){return o()},set autoplayEnabled(e=!1){o(e),N()},get featureAudioSkin(){return s()},set featureAudioSkin(e){s(e),N()},get uiText(){return c()},set uiText(e){c(e),N()},get locale(){return l()},set locale(e=``){l(e),N()},get onaudiostarted(){return u()},set onaudiostarted(e){u(e),N()},get onaudioended(){return d()},set onaudioended(e){d(e),N()}},ne=yr(),re=dn(ne),ie=e=>{var t=Ci(),n=L(t),r=e=>{var t=yi(),n=dn(t);oi(n,e=>F(f,e),()=>J(f));var r=R(n,2),a=L(r),o=R(a,2);O(r),oi(r,e=>F(p,e),()=>J(p)),z((e,t,c)=>{Q(n,`src`,i()),Q(r,`aria-label`,e),Kr(a,1,`listen-feature-icon pie-listen-icon rli-feature-listen ${J(_)?``:`listen-active`}`,`svelte-ypdwb3`),Q(a,`src`,s().silentUrl),Q(a,`alt`,t),Kr(o,1,`listen-feature-icon pie-listen-icon rli-feature-listen ${J(_)?`listen-active`:``}`,`svelte-ypdwb3`),Q(o,`src`,s().playingUrl),Q(o,`alt`,c)},[()=>S(l()),()=>C(l()),()=>w(l())]),X(e,t)},a=e=>{var t=xi(),n=dn(t);oi(n,e=>F(f,e),()=>J(f));var r=R(n,2),a=e=>{var t=bi(),n=L(t,!0);O(t),oi(t,e=>F(m,e),()=>J(m)),z(()=>Sr(n,c().clickToEnableAutoplay)),X(e,t)};Z(r,e=>{J(v)&&e(a)}),z(()=>Q(n,`src`,i())),X(e,t)},o=e=>{var t=Si(),n=L(t,!0);O(t),z(()=>Sr(n,J(y))),X(e,t)};Z(n,e=>{J(g)===`feature-button`?e(r):J(g)===`controls`?e(a,1):J(g)===`error`&&e(o,2)}),O(t),X(e,t)};return Z(re,e=>{J(g)!==`none`&&e(ie)}),X(e,ne),Je(te)}fi(Ti,{hasAudio:{},audioUrl:{},useFeatureButtonAudio:{},autoplayEnabled:{},featureAudioSkin:{},uiText:{},locale:{},onaudiostarted:{},onaudioended:{}},[],[],{mode:`open`});var Ei=Y(`<img class="w-auto object-contain pie-blank-image" style="max-height:var(--mpb-selected-image-max-height, 4rem);"/>`),Di=Y(`<span class="cloze-marker-value pie-blank-value svelte-d9l5tb"></span>`),Oi=Y(`<span class="cloze-marker-empty svelte-d9l5tb" aria-hidden="true">&nbsp;</span>`),ki=Y(`<span role="status" aria-live="polite" aria-atomic="true"><!></span>`),Ai={hash:`svelte-d9l5tb`,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(--mpb-focus-ring, #1565c0);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;}`};function ji(e,t){qe(t,!0),Br(e,Ai);let n=$(t,`choiceMode`,7,`text`),r=$(t,`displayChoice`,7,void 0),i=$(t,`displayChoiceLabelHtml`,7,``),a=$(t,`isStandalone`,7,!1),o=$(t,`blankWidth`,7),s=$(t,`blankBorderWidth`,7),c=$(t,`ariaLabel`,7);var l={get choiceMode(){return n()},set choiceMode(e=`text`){n(e),N()},get displayChoice(){return r()},set displayChoice(e=void 0){r(e),N()},get displayChoiceLabelHtml(){return i()},set displayChoiceLabelHtml(e=``){i(e),N()},get isStandalone(){return a()},set isStandalone(e=!1){a(e),N()},get blankWidth(){return o()},set blankWidth(e){o(e),N()},get blankBorderWidth(){return s()},set blankBorderWidth(e){s(e),N()},get ariaLabel(){return c()},set ariaLabel(e){c(e),N()}},u=ki(),d=L(u),f=e=>{var t=Ei();z(()=>{Q(t,`src`,r().imageUrl),Q(t,`alt`,r().imageAlt||`Selected answer image`)}),X(e,t)},p=e=>{var t=Di();zr(t,i,!0),O(t),X(e,t)},m=e=>{X(e,Oi())};return Z(d,e=>{n()===`image`&&r()?.imageUrl?e(f):i()?e(p,1):e(m,-1)}),O(u),z(()=>{Kr(u,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 ${a()?`cloze-marker-standalone pie-blank-slot-standalone`:``}`,`svelte-d9l5tb`),Jr(u,`width:${o()};border-bottom-width:${s()};`),Q(u,`aria-label`,c())}),X(e,u),Je(l)}fi(ji,{choiceMode:{},displayChoice:{},displayChoiceLabelHtml:{},isStandalone:{},blankWidth:{},blankBorderWidth:{},ariaLabel:{}},[],[],{mode:`open`});var Mi=Y(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`),Ni=Y(`<span class="choice-html pie-choice-label svelte-8xu1pt"></span>`),Pi=Y(`<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>`),Fi=Y(`<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),Ii=Y(`<span aria-hidden="true"> </span>`),Li=Y(`<div style="gap:var(--mpb-choice-row-gap, 0.5rem);"><!> <!></div>`),Ri={hash:`svelte-8xu1pt`,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-background-dark, #ecedf1));}.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-secondary-background, rgba(241, 241, 241, 1)));}.choice-row-horizontal.is-selected.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-background-dark, #ecedf1);}.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-secondary-background, rgba(241, 241, 241, 1));border-radius:6px;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt:hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-secondary-background, rgba(241, 241, 241, 1));}.pie-choice.choice-correct.svelte-8xu1pt {border-left:3px solid var(--pie-correct-tertiary, #0ea449);}.pie-choice.choice-incorrect.svelte-8xu1pt {border-left:3px solid var(--pie-incorrect-icon, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-correct-secondary, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-incorrect-secondary, #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-white, #ffffff);}.pie-choice-feedback-correct.svelte-8xu1pt {background:var(--pie-correct-icon, #087d38);}.pie-choice-feedback-incorrect.svelte-8xu1pt {background:var(--pie-incorrect-icon, #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);}`};function zi(e,t){qe(t,!0),Br(e,Ri);let n=$(t,`choice`,7),r=$(t,`choiceMode`,7,`text`),i=$(t,`isHorizontal`,7,!1),a=$(t,`isSelected`,7,!1),o=$(t,`isDisabled`,7,!1),s=$(t,`correctness`,7,void 0),c=$(t,`isEvaluateMode`,7,!1),l=$(t,`instanceId`,7),u=$(t,`radioGroupName`,7);var d={get choice(){return n()},set choice(e){n(e),N()},get choiceMode(){return r()},set choiceMode(e=`text`){r(e),N()},get isHorizontal(){return i()},set isHorizontal(e=!1){i(e),N()},get isSelected(){return a()},set isSelected(e=!1){a(e),N()},get isDisabled(){return o()},set isDisabled(e=!1){o(e),N()},get correctness(){return s()},set correctness(e=void 0){s(e),N()},get isEvaluateMode(){return c()},set isEvaluateMode(e=!1){c(e),N()},get instanceId(){return l()},set instanceId(e){l(e),N()},get radioGroupName(){return u()},set radioGroupName(e){u(e),N()}},f=Li(),p=L(f),m=e=>{var t=Pi(),i=L(t),s=L(i),c=e=>{var t=Mi();z(()=>{Q(t,`src`,n().imageUrl),Q(t,`alt`,n().imageAlt||`Choice ${n().id}`)}),X(e,t)},d=e=>{var t=Ni();zr(t,()=>n().labelHtml||``,!0),O(t),X(e,t)};Z(s,e=>{r()===`image`&&n().imageUrl?e(c):e(d,-1)}),O(i);var f=R(i,2);$r(f),O(t),z(()=>{Q(t,`for`,`${l()}-opt-${n().id}`),Q(f,`name`,u()),Q(f,`id`,`${l()}-opt-${n().id}`),ei(f,n().id),ti(f,a()),f.disabled=o()}),X(e,t)},h=e=>{var t=Fi(),i=dn(t);$r(i);var s=R(i,2),c=L(s),d=e=>{var t=Mi();z(()=>{Q(t,`src`,n().imageUrl),Q(t,`alt`,n().imageAlt||`Choice ${n().id}`)}),X(e,t)},f=e=>{var t=Ni();zr(t,()=>n().labelHtml||``,!0),O(t),X(e,t)};Z(c,e=>{r()===`image`&&n().imageUrl?e(d):e(f,-1)}),O(s),z(()=>{Q(i,`name`,u()),Q(i,`id`,`${l()}-opt-${n().id}`),ei(i,n().id),ti(i,a()),i.disabled=o(),Q(s,`for`,`${l()}-opt-${n().id}`)}),X(e,t)};Z(p,e=>{i()?e(m):e(h,-1)});var g=R(p,2),_=e=>{var t=Ii(),n=L(t,!0);O(t),z(()=>{Kr(t,1,`pie-choice-feedback-badge ${s()===`correct`?`pie-choice-feedback-correct`:`pie-choice-feedback-incorrect`}`,`svelte-8xu1pt`),Sr(n,s()===`correct`?`✓`:`✕`)}),X(e,t)};return Z(g,e=>{c()&&s()&&e(_)}),O(f),z(()=>Kr(f,1,`flex items-start choice-row pie-choice ${i()?`choice-row-horizontal pie-choice-horizontal`:``} ${a()?`is-selected pie-choice-selected`:``} ${s()?`choice-${s()} pie-choice-${s()}`:``}`,`svelte-8xu1pt`)),X(e,f),Je(d)}fi(zi,{choice:{},choiceMode:{},isHorizontal:{},isSelected:{},isDisabled:{},correctness:{},isEvaluateMode:{},instanceId:{},radioGroupName:{}},[],[],{mode:`open`});function Bi(e){let t=new Map,{isEvaluateMode:n,correctChoiceId:r,selectedId:i,showCorrectAnswer:a}=e;return!n||!r?t:a?(t.set(r,`correct`),t):i?i===r?(t.set(r,`correct`),t):(t.set(i,`incorrect`),t.set(r,`incorrect`),t):(t.set(r,`incorrect`),t)}var Vi=`{{blank}}`,Hi=new Set([`audio_blank_only`,`stimulus_image_blank`,`token_sequence`]);function Ui(e){let{interactionMode:t=``,template:n=``,choiceLayout:r,layoutProfile:i=``,hasAudio:a=!1,useFeatureButtonAudio:o}=e,s=t===`audio_mc_only`,c=n?n.replace(/<[^>]+>/g,``).replace(/&nbsp;/g,` `).trim()===Vi:!1,l=r===`horizontal`||r===`vertical`?r:s||c?`horizontal`:`vertical`;return{isAudioOnlyMode:s,isBlankOnlyTemplate:c,choiceLayout:l,isHorizontalChoices:l===`horizontal`,hasInlineSentenceAudioLayout:i===`inline_sentence`&&a,useFeatureButtonAudio:typeof o==`boolean`?o:a&&Hi.has(i)}}var Wi={blankStandaloneWidthRem:7,blankWideWidthRem:10,blankUnderlineWidthPx:2,blankUnderlineWideWidthPx:4,horizontalChoiceWidthPx:170,horizontalChoiceWidthVw:30,horizontalChoiceTileMinHeightRem:11,horizontalChoiceContentMinHeightRem:7.5,selectedImageMaxHeightRem:4,choiceImageMaxHeightRem:5,listenButtonSizePx:128,stimulusMinColumnPx:210,textMinColumnPx:260,legendMaxChars:120,choiceGroupGapRem:.5,choiceRowGapRem:.5,toggleButtonGapRem:.5,horizontalChoiceRadioTopMarginRem:.5,audioBlankTemplateMarginTopRem:.8,audioBlankTemplateMarginBottomRem:1.8,audioInstructionsMaxWidthPx:875,narrowHorizontalChoiceMaxWidthPx:230,stimulusGridColumnGapRem:2,stimulusGridRowGapRem:.7,stimulusSentenceMarginTopRem:.2,stimulusChoicesMarginTopRem:.9,tokenGridColumnGapRem:1.5,tokenGridRowGapRem:.8,tokenTemplateMarginTopRem:.6,tokenInlineTokenGapRem:.35,tokenChoicesMarginTopRem:.2,inlineGridColumnGapRem:1.5,inlineGridRowGapRem:.65,inlineTemplateMarginTopRem:.45,inlineChoicesMarginTopRem:.25},Gi={blankStandaloneWidthRem:{varName:`--mpb-blank-standalone-width`,unit:`rem`},blankWideWidthRem:{varName:`--mpb-blank-wide-width`,unit:`rem`},blankUnderlineWidthPx:{varName:`--mpb-blank-underline-width`,unit:`px`},blankUnderlineWideWidthPx:{varName:`--mpb-blank-underline-wide-width`,unit:`px`},horizontalChoiceWidthPx:{varName:`--mpb-choice-width-px`,unit:`px`},horizontalChoiceWidthVw:{varName:`--mpb-choice-width-vw`,unit:`vw`},horizontalChoiceTileMinHeightRem:{varName:`--mpb-choice-tile-min-height`,unit:`rem`},horizontalChoiceContentMinHeightRem:{varName:`--mpb-choice-content-min-height`,unit:`rem`},choiceImageMaxHeightRem:{varName:`--mpb-choice-image-max-height`,unit:`rem`},selectedImageMaxHeightRem:{varName:`--mpb-selected-image-max-height`,unit:`rem`},choiceGroupGapRem:{varName:`--mpb-choice-group-gap`,unit:`rem`},choiceRowGapRem:{varName:`--mpb-choice-row-gap`,unit:`rem`},horizontalChoiceRadioTopMarginRem:{varName:`--mpb-horizontal-choice-radio-top-margin`,unit:`rem`},narrowHorizontalChoiceMaxWidthPx:{varName:`--mpb-narrow-choice-max-width`,unit:`px`},toggleButtonGapRem:{varName:`--mpb-toggle-button-gap`,unit:`rem`},listenButtonSizePx:{varName:`--mpb-listen-button-size`,unit:`px`},audioBlankTemplateMarginTopRem:{varName:`--mpb-audio-blank-template-margin-top`,unit:`rem`},audioBlankTemplateMarginBottomRem:{varName:`--mpb-audio-blank-template-margin-bottom`,unit:`rem`},audioInstructionsMaxWidthPx:{varName:`--mpb-audio-instructions-max-width`,unit:`px`},stimulusMinColumnPx:{varName:`--mpb-stimulus-min-column`,unit:`px`},textMinColumnPx:{varName:`--mpb-text-min-column`,unit:`px`},stimulusGridColumnGapRem:{varName:`--mpb-stimulus-grid-column-gap`,unit:`rem`},stimulusGridRowGapRem:{varName:`--mpb-stimulus-grid-row-gap`,unit:`rem`},stimulusSentenceMarginTopRem:{varName:`--mpb-stimulus-sentence-margin-top`,unit:`rem`},stimulusChoicesMarginTopRem:{varName:`--mpb-stimulus-choices-margin-top`,unit:`rem`},tokenGridColumnGapRem:{varName:`--mpb-token-grid-column-gap`,unit:`rem`},tokenGridRowGapRem:{varName:`--mpb-token-grid-row-gap`,unit:`rem`},tokenTemplateMarginTopRem:{varName:`--mpb-token-template-margin-top`,unit:`rem`},tokenInlineTokenGapRem:{varName:`--mpb-token-inline-token-gap`,unit:`rem`},tokenChoicesMarginTopRem:{varName:`--mpb-token-choices-margin-top`,unit:`rem`},inlineGridColumnGapRem:{varName:`--mpb-inline-grid-column-gap`,unit:`rem`},inlineGridRowGapRem:{varName:`--mpb-inline-grid-row-gap`,unit:`rem`},inlineTemplateMarginTopRem:{varName:`--mpb-inline-template-margin-top`,unit:`rem`},inlineChoicesMarginTopRem:{varName:`--mpb-inline-choices-margin-top`,unit:`rem`}},Ki={audio_blank_only:{blankWideWidthRem:10,blankUnderlineWideWidthPx:6,horizontalChoiceTileMinHeightRem:11.25,horizontalChoiceContentMinHeightRem:9.375,choiceGroupGapRem:1,audioBlankTemplateMarginBottomRem:1.875},stimulus_image_blank:{blankWideWidthRem:10,blankUnderlineWideWidthPx:6},token_sequence:{blankStandaloneWidthRem:7,blankUnderlineWideWidthPx:6}};function qi(e){let{layoutProfile:t,isBlankOnlyTemplate:n}=e,r=e.configuredLimits&&typeof e.configuredLimits==`object`?e.configuredLimits:{},i=e.customProfilePresets&&typeof e.customProfilePresets==`object`?e.customProfilePresets:{},a=i[t]&&typeof i[t]==`object`?i[t]:{},o={...Ki[t]??{},...a},s={...Wi,...r,...o},c=[`audio_blank_only`,`stimulus_image_blank`],l=[`audio_blank_only`,`stimulus_image_blank`,`token_sequence`],u=c.includes(t)?`${s.blankWideWidthRem}rem`:n?`${s.blankStandaloneWidthRem}rem`:`auto`,d=l.includes(t)?`${s.blankUnderlineWideWidthPx}px`:`${s.blankUnderlineWidthPx}px`;return{rootStyle:Object.keys(Gi).map(e=>`${Gi[e].varName}:${s[e]}${Gi[e].unit}`).join(`;`),blankWidth:u,blankBorderWidth:d,legendMaxChars:s.legendMaxChars}}var Ji={default:{silentUrl:`https://assets.learnosity.com/organisations/844/0c9f2aa3-3cd5-4de7-93ef-541c24ca35da.svg`,playingUrl:`https://assets.learnosity.com/organisations/844/231dfdc2-c113-4be5-91fb-e75a0ca5994b.svg`},es:{silentUrl:`https://assets.learnosity.com/organisations/844/27a9d5b5-d873-4bd5-b9ba-22748782d8ba.svg`,playingUrl:`https://assets.learnosity.com/organisations/844/120f216d-96b7-4560-94b8-1d90710216b7.svg`}};function Yi(e){let t=String(e.locale||``).toLowerCase(),n=t.slice(0,2),r=e.audioButtonSkinsByLocale&&typeof e.audioButtonSkinsByLocale==`object`?e.audioButtonSkinsByLocale:{},i=e.audioButtonSkin&&typeof e.audioButtonSkin==`object`?e.audioButtonSkin:null,a=t.startsWith(`es`)?Ji.es:Ji.default;return r[t]||r[n]||r.default||i||a}function Xi(e){let{selectedId:t,isEvaluateMode:n,showCorrectAnswer:r,alwaysShowCorrect:i,correctChoiceId:a}=e;return i&&a||n&&r&&a?a:t}function Zi(e){let{isEvaluateMode:t,showCorrectAnswer:n,isCorrect:r,isIncorrect:i,selectedId:a}=e;return!t||n?``:r?`Correct answer selected`:i&&a?`Incorrect answer selected`:``}function Qi(e){let{prompt:t,legendMaxChars:n,answerChoicesLabel:r}=e,i=t.replace(/<[^>]+>/g,` `).replace(/\s+/g,` `).trim(),a=Math.max(8,n);return i?i.length>a?`${i.slice(0,Math.max(1,a-1))}…`:i:r}var $i=`/* Shared base styles for all sel_r1-*_plusggg variants.
4
4
  Applied via the data-mpb-variant="sel-r1-base" style element.
5
5
  Uses [class*="variant-sel-r1-"] so it covers every r1 variant class.
6
6
  Source: web-ItemBankViewer/learnosity/templates/Renaissance/r1.scss */
7
7
 
8
- /* r1.scss: Starial font throughout */
8
+ /* r1.scss: Starial font throughout.
9
+ font-size 14px mirrors the Learnosity host root (.lrn_widget) which sets the
10
+ base for all em-scaled rules in r1.scss (e.g. .rli-r1-content-element { 1.9em })
11
+ and any em-based author content (e.g. <span style="font-size:1.8em">). Without
12
+ this base PIE inherits the 16px browser default and renders ~14% larger than
13
+ the LSY reference. See CONTOOL-2567. */
9
14
  [class*="variant-sel-r1-"] {
10
15
  font-family: Starial, Arial, sans-serif;
16
+ font-size: 14px;
11
17
  }
12
18
 
13
19
  /* r1.scss: .rli-r1-audio-transcript { font-family:Roboto; font-size:16px } */
@@ -26,13 +32,16 @@
26
32
 
27
33
  /* r1.scss: .rli-r1-stem { display:flex; flex-direction:row; justify-content:center }
28
34
  r1.scss: .rli-r1-content-element { margin-right:2px; margin-left:2px } — 4px total gap.
29
- column-gap:4px replicates the 2px+2px per-element margin. */
35
+ Apply the per-element margin to both classless tokens and the blank slot
36
+ (which is the cloze equivalent) so the gap stacks with whitespace text-nodes
37
+ between flex items the same way LSY does. Earlier this used column-gap:4px,
38
+ but flex column-gap accumulates with the cloze-side mx-1 and the implicit
39
+ whitespace, producing a wider gap than LSY shows. See CONTOOL-2569. */
30
40
  [class*="variant-sel-r1-"] .pie-template-line {
31
41
  display: flex;
32
42
  flex-direction: row;
33
43
  align-items: baseline;
34
44
  justify-content: center;
35
- column-gap: 4px;
36
45
  }
37
46
 
38
47
  [class*="variant-sel-r1-"] .pie-template-line p {
@@ -40,18 +49,44 @@
40
49
  display: flex;
41
50
  flex-direction: row;
42
51
  align-items: baseline;
43
- gap: 4px;
44
52
  }
45
53
 
46
54
  /* r1.scss: .rli-r1-content-element { min-width:150px; max-width:150px; min-height:150px;
47
- line-height:89px } — every stem token (blank slot and adjacent spans) is a 150px box.
48
- Scoped to token_sequence layout so the audio_blank_only standalone blank (160px) is unaffected. */
49
- [class*="variant-sel-r1-"].layout-token_sequence .pie-template-line span:not([class]),
55
+ line-height:89px; margin-right:2px; margin-left:2px } — wraps every stem token
56
+ (blank slot and adjacent inline spans) in LSY, giving each a 150px box with a
57
+ 2px per-side margin. Apply to inline tokens in all r1 variants so trailing
58
+ tokens in audio_blank_only (gplusggg) match the blank's height the way LSY does. */
59
+ [class*="variant-sel-r1-"] .pie-template-line span:not([class]) {
60
+ min-width: 150px;
61
+ max-width: 150px;
62
+ min-height: 150px;
63
+ line-height: 89px;
64
+ margin-left: 2px;
65
+ margin-right: 2px;
66
+ }
67
+
68
+ /* In token_sequence layouts the blank itself is also a content-element box (no
69
+ surrounding .rli-r1-cloze container at 160px). audio_blank_only / stimulus_image_blank
70
+ keep their own 160px min-height set on the blank slot in McPopulatedBlank.svelte to
71
+ mirror LSY's .rli-r1-cloze height. The 2px per-side margin matches LSY's
72
+ .rli-r1-content-element pattern (overriding the default Tailwind mx-1). */
50
73
  [class*="variant-sel-r1-"].layout-token_sequence .pie-template-line .pie-blank-slot {
51
74
  min-width: 150px;
52
75
  max-width: 150px;
53
76
  min-height: 150px;
54
77
  line-height: 89px;
78
+ margin-left: 2px;
79
+ margin-right: 2px;
80
+ }
81
+
82
+ /* audio_blank_only / stimulus_image_blank keep the 160px wide blank slot, but
83
+ still need the 2px per-side margin so the gap to the trailing token mirrors
84
+ LSY's .rli-r1-content-element rhythm. Without this, Tailwind's mx-1 (4px)
85
+ would dominate and the cloze→token gap diverges from LSY. See CONTOOL-2569. */
86
+ [class*="variant-sel-r1-"].layout-audio_blank_only .pie-template-line .pie-blank-slot,
87
+ [class*="variant-sel-r1-"].layout-stimulus_image_blank .pie-template-line .pie-blank-slot {
88
+ margin-left: 2px;
89
+ margin-right: 2px;
55
90
  }
56
91
 
57
92
  /* r1.scss: .rli-r1-content-element { font-size:1.9em; line-height:89px } on distractors */
@@ -59,7 +94,19 @@
59
94
  font-size: 1.9em;
60
95
  line-height: 89px;
61
96
  }
62
- `,fa={"sel_r1-_plusggg":{variantId:`sel-r1-plusggg`,variantClass:`variant-sel-r1-plusggg`,sourceUrl:`https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css`,cssText:`/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css */
97
+
98
+ /* r1.scss: .rli-r1-content-element { min-width:150px; max-width:150px;
99
+ min-height:150px } wraps every image (stem token + distractor) and forces
100
+ the content box to 150×150. LSY's host also rewrites <img width/height>
101
+ to 150 server-side. PIE keeps the authored attributes (typically 108×108),
102
+ so without an explicit override images render ~28% smaller than LSY.
103
+ See CONTOOL-2570. */
104
+ [class*="variant-sel-r1-"] .pie-template-line img,
105
+ [class*="variant-sel-r1-"] .pie-choice-label img {
106
+ width: 150px;
107
+ height: 150px;
108
+ }
109
+ `,ea={"sel_r1-_plusggg":{variantId:`sel-r1-plusggg`,variantClass:`variant-sel-r1-plusggg`,sourceUrl:`https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css`,cssText:`/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css */
63
110
  /* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */
64
111
  .mc-populated-blank-root.variant-sel-r1-plusggg {
65
112
  max-width: 875px;
@@ -100,6 +147,15 @@
100
147
  margin: 0;
101
148
  }
102
149
 
150
+ /* LSY .rli-vic-answer has no text-align rule and inherits start; PIE's
151
+ inline_sentence layout sets text-align:center on .template-line via a
152
+ Svelte-scoped selector with specificity (0,4,0), so we need to match or
153
+ exceed that. Pin sr-vic back to start so wrapped lines stay left-aligned.
154
+ Same root cause as sel-vic. See CONTOOL-2573. */
155
+ .mc-populated-blank-root.variant-sr-vic.layout-inline_sentence .pie-template-line.template-line {
156
+ text-align: start;
157
+ }
158
+
103
159
  /* vic.scss: .rli-vic-cloze > .rli-vic-content-element { color: #cc3333 } */
104
160
  .mc-populated-blank-root.variant-sr-vic .pie-blank-value {
105
161
  color: #cc3333;
@@ -143,15 +199,16 @@
143
199
  /* Reference layout: web-ItemBankViewer/learnosity/templates/Renaissance/sel_vic/scss/main.scss + vic.scss */
144
200
  .mc-populated-blank-root.variant-sel-vic {
145
201
  font-family: Starial, Arial, sans-serif;
146
- font-size: 1.5em;
202
+ /* LSY chain: .lrn_widget (14px host) → .sel-vic { 1.5em } = 21px.
203
+ PIE collapses both LSY layers into this single variant-root selector, so
204
+ the resolved value is set directly. See CONTOOL-2567. */
205
+ font-size: 21px;
147
206
  max-width: 800px;
148
207
  margin-inline: auto;
149
208
  --mpb-inline-grid-column-gap: 1rem;
150
209
  --mpb-inline-grid-row-gap: 0.5rem;
151
210
  --mpb-inline-template-margin-top: 0.2rem;
152
211
  --mpb-inline-choices-margin-top: 0.2rem;
153
- --pie-correct-answer-choice-hover-bg: #e2e2e2;
154
- --pie-correct-answer-choice-selected-bg: #fcfcd3;
155
212
  }
156
213
 
157
214
  .mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {
@@ -186,6 +243,26 @@
186
243
  margin: 0;
187
244
  }
188
245
 
246
+ /* LSY .rli-vic-answer has no text-align rule and inherits start; PIE's
247
+ inline_sentence layout sets text-align:center on .template-line via a
248
+ Svelte-scoped selector with specificity (0,4,0), so we need to match or
249
+ exceed that. Pin sel-vic back to start so wrapped lines stay left-aligned.
250
+ See CONTOOL-2573. */
251
+ .mc-populated-blank-root.variant-sel-vic.layout-inline_sentence .pie-template-line.template-line {
252
+ text-align: start;
253
+ }
254
+
255
+ /* vic.scss: .rli-vic-cloze { margin-left: 6px; margin-right: 6px } gives the
256
+ cloze breathing room from adjacent text or punctuation. The PIE markup uses
257
+ Tailwind-style mx-1 in the class list, but mc-populated-blank does not
258
+ compile Tailwind, so that class is a no-op. Set the inline margin
259
+ explicitly so the cloze→trailing-punctuation gap matches LSY. See
260
+ CONTOOL-2572. */
261
+ .mc-populated-blank-root.variant-sel-vic .pie-template-line .pie-blank-slot {
262
+ margin-left: 6px;
263
+ margin-right: 6px;
264
+ }
265
+
189
266
  /* vic.scss: .rli-vic-cloze > .rli-vic-content-element { color: #cc3333 } */
190
267
  .mc-populated-blank-root.variant-sel-vic .pie-blank-value {
191
268
  color: #cc3333;
@@ -301,11 +378,6 @@
301
378
  --mpb-choice-hover-bg: #f2f2f2;
302
379
  --mpb-choice-selected-bg: #fcfcd3;
303
380
  }
304
-
305
- /* In this variant, the blank appears before trailing tokens; avoid left-margin offset. */
306
- .mc-populated-blank-root.variant-sel-r1-ggplus.layout-token_sequence .pie-blank-slot {
307
- margin-left: 0;
308
- }
309
381
  `},"sel_r1-s3_plusggg":{variantId:`sel-r1-s3`,variantClass:`variant-sel-r1-s3`,sourceUrl:`https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css`,cssText:`/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css */
310
382
  /* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */
311
383
  .mc-populated-blank-root.variant-sel-r1-s3 {
@@ -325,12 +397,14 @@
325
397
  --mpb-blank-wide-width: 6.8rem;
326
398
  }
327
399
 
328
- /* s3 overrides base choice-label with font-weight:500 */
400
+ /* sel_r1-s3_plusggg/question.css does not set font-weight on distractors or
401
+ cloze content-element, so they inherit 400 from the host root. The earlier
402
+ font-weight:500 override caused PIE to render visibly heavier than LSY for
403
+ the same author content. See CONTOOL-2571. */
329
404
  .mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label,
330
405
  .mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label :is(span, p, div) {
331
406
  font-size: 1.9em;
332
407
  line-height: 89px;
333
- font-weight: 500;
334
408
  }
335
409
 
336
410
  .mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value,
@@ -391,19 +465,20 @@
391
465
  .mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-radio {
392
466
  transform: scale(0.85);
393
467
  }
394
- `}},pa=e=>String(e||``).trim().toLowerCase().replace(/v\d+\.\d+\.\d+$/i,``),ma=e=>fa[pa(e)],ha=e=>ma(e)?.variantClass||``,ga=new Set([`sel-r1-plusggg`,`sel-r1-gplusggg`,`sel-r1-g-stem`,`sel-r1-gg-plus`,`sel-r1-ggplus`,`sel-r1-s3`]),_a=(e,t,n)=>{let r=document.getElementById(e);if(r){r.textContent!==n&&(r.textContent=n);return}let i=document.createElement(`style`);i.id=e,i.setAttribute(`data-mpb-variant`,t),i.textContent=n,document.head.appendChild(i)},va=e=>{!e?.cssText||typeof document>`u`||(ga.has(e.variantId)&&_a(`mc-populated-blank-css-sel-r1-base`,`sel-r1-base`,da),_a(`mc-populated-blank-css-${e.variantId}`,e.variantId,e.cssText))},ya=q(`<div class="mb-4 prose pie-prompt"></div>`),ba=q(`<p> </p>`),xa=wr(`<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>`),Sa=wr(`<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>`),Ca=q(`<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>`),wa=q(`<div class="mb-3 prose prose-p:my-1 sentence-line pie-sentence-line svelte-6wlbb4"></div>`),Ta=q(`<div class="mb-4 template-line pie-template-line svelte-6wlbb4"><!> <!> <!></div>`),Ea=q(`<p class="sr-only pie-result-feedback svelte-6wlbb4" role="status" aria-live="polite"> </p>`),Da=q(`<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>`),Oa={hash:`svelte-6wlbb4`,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),
395
- .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,
468
+ `}},ta=e=>String(e||``).trim().toLowerCase().replace(/v\d+\.\d+\.\d+$/i,``),na=e=>ea[ta(e)],ra=e=>na(e)?.variantClass||``,ia=new Set([`sel-r1-plusggg`,`sel-r1-gplusggg`,`sel-r1-g-stem`,`sel-r1-gg-plus`,`sel-r1-ggplus`,`sel-r1-s3`]),aa=(e,t,n)=>{let r=document.getElementById(e);if(r){r.textContent!==n&&(r.textContent=n);return}let i=document.createElement(`style`);i.id=e,i.setAttribute(`data-mpb-variant`,t),i.textContent=n,document.head.appendChild(i)},oa=e=>{!e?.cssText||typeof document>`u`||(ia.has(e.variantId)&&aa(`mc-populated-blank-css-sel-r1-base`,`sel-r1-base`,$i),aa(`mc-populated-blank-css-${e.variantId}`,e.variantId,e.cssText))},sa=Y(`<div class="mb-4 prose pie-prompt"></div>`),ca=vr(`<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-tertiary-light, #d0e2f0)"></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-tertiary-light, #d0e2f0)"></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-tertiary, #146eb3)"></polygon></svg>`),la=vr(`<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-background-dark, #ecedf1)"></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-tertiary, #146eb3)"></polygon></svg>`),ua=Y(`<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>`),da=Y(`<div class="mb-3 prose prose-p:my-1 sentence-line pie-sentence-line svelte-6wlbb4"></div>`),fa=Y(`<div class="mb-4 template-line pie-template-line svelte-6wlbb4"><!><!><!></div>`),pa=Y(`<p class="sr-only pie-result-feedback svelte-6wlbb4" role="status" aria-live="polite"> </p>`),ma=Y(`<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>`),ha={hash:`svelte-6wlbb4`,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 {--mpb-focus-ring: var(
469
+ --pie-focus-outline,
470
+ var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))
471
+ );}.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-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),
472
+ .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;display:inline;}.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,
396
473
  .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),
397
474
  .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
398
475
  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,
399
- .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'
400
- 'sentence audio'
476
+ .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:'sentence audio'
401
477
  '. template'
402
- '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'
478
+ '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-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:'audio audio'
403
479
  'template template'
404
- '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'
405
- 'template audio'
406
- '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);}
480
+ '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-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:'template audio'
481
+ '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-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);}
407
482
 
408
483
  /* Match Learnosity responsive behavior for CQT audio-blank layouts:
409
484
  at smaller widths, audio control shifts left and answer tiles stack. */
@@ -417,4 +492,4 @@
417
492
  .layout-token_sequence.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),
418
493
  .layout-stimulus_image_blank.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),
419
494
  .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;}
420
- }`};function ka(e,t){Je(t,!0),Kr(e,Oa);let n={answerChoices:`Answer choices`,selectedAnswerInSentence:`Selected answer in sentence`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`,transcriptLabel:`Transcript`},r=Z(t,`model`,7),i=Z(t,`session`,7),a=I(``),o=I(null),s=I(null),c=I(null),l=I(!1),u=`mc-populated-blank-${Math.random().toString(36).slice(2,10)}`,d=F(()=>(r()?.mode||r()?.env?.mode||``).toString()),f=F(()=>K(d)===`evaluate`),p=F(()=>r()?.correctness),m=F(()=>typeof r()?.responseCorrect==`boolean`?r().responseCorrect:K(p)===`correct`),h=F(()=>K(p)===`correct`),g=F(()=>K(p)===`incorrect`),_=I(!1),v=F(()=>K(f)&&!K(m)&&!!r()?.correctChoiceId),y=F(()=>r()?.layoutProfile||``),b=F(()=>ta({interactionMode:r()?.interactionMode,template:r()?.template,choiceLayout:r()?.choiceLayout,layoutProfile:K(y),hasAudio:r()?.hasAudio,useFeatureButtonAudio:r()?.useFeatureButtonAudio})),x=F(()=>K(b).isAudioOnlyMode),S=F(()=>K(b).isBlankOnlyTemplate),C=F(()=>K(b).isHorizontalChoices),w=F(()=>K(b).hasInlineSentenceAudioLayout),T=F(()=>K(b).useFeatureButtonAudio),ee=F(()=>K(l)),te=F(()=>[`--pie-correct-answer-toggle-label-color:${wi.text()}`,`--pie-correct-answer-toggle-icon-open-bg:${wi.tertiaryLight()}`,`--pie-correct-answer-toggle-icon-closed-bg:${wi.backgroundDark()}`,`--pie-correct-answer-toggle-icon-glyph-color:${wi.tertiary()}`,`--pie-correct-answer-choice-hover-bg:${wi.backgroundDark()}`,`--pie-correct-answer-choice-selected-bg:${wi.secondaryBackground()}`,`--pie-correct-answer-choice-correct-bg:${wi.correctSecondary()}`,`--pie-correct-answer-choice-incorrect-bg:${wi.incorrectSecondary()}`,`--pie-correct-answer-choice-correct-border:${wi.correctTertiary()}`,`--pie-correct-answer-choice-incorrect-border:${wi.incorrectWithIcon()}`,`--pie-correct-answer-feedback-correct-bg:${wi.correctWithIcon()}`,`--pie-correct-answer-feedback-incorrect-bg:${wi.incorrectWithIcon()}`,`--pie-correct-answer-feedback-glyph-color:${wi.white()}`].join(`;`)),ne=F(()=>aa({layoutProfile:K(y),isBlankOnlyTemplate:K(S),configuredLimits:r()?.layoutLimits,customProfilePresets:r()?.layoutProfilePresets,correctAnswerStyleVars:K(te)})),re=F(()=>Array.isArray(r()?.choices)?r().choices:[]),ie=F(()=>r()?.choiceMode||`text`),ae=F(()=>i()?.choiceId||K(a)||``),oe=F(()=>`${u}-choice-group-${r()?.id||`1`}`),se=F(()=>ca({selectedId:K(ae),isEvaluateMode:K(f),showCorrectAnswer:K(_),alwaysShowCorrect:!!r()?.alwaysShowCorrect,correctChoiceId:String(r()?.correctChoiceId||``)})),ce=F(()=>K(re).find(e=>e.id===K(se))),le=F(()=>String(K(ce)?.labelHtml||``)),ue=F(()=>la({isEvaluateMode:K(f),showCorrectAnswer:K(_),isCorrect:K(h),isIncorrect:K(g),selectedId:K(ae)})),de=F(()=>Qi({isEvaluateMode:K(f),correctChoiceId:String(r()?.correctChoiceId||``),selectedId:String(K(ae)||``),showCorrectAnswer:K(_)})),fe=F(()=>({...n,...r()?.uiText||{}})),pe=F(()=>`${u}-prompt`),me=F(()=>`${u}-transcript`),he=F(()=>`${u}-choices-legend`),ge=F(()=>`${u}-result`),_e=F(()=>ua({prompt:r()?.prompt||``,legendMaxChars:K(ne).legendMaxChars,answerChoicesLabel:K(fe).answerChoices})),ve=F(()=>r()?.prompt?K(pe):void 0),ye=F(()=>r()?.prompt?void 0:String(r()?.choiceGroupLabel||``).trim()||K(_e)),be=F(()=>{let e=[];return r()?.prompt&&e.push(K(pe)),r()?.hasAudio&&r()?.audioTranscript&&e.push(K(me)),e.length?e.join(` `):void 0}),xe=F(()=>{let e=r()?.locale||``;return e?e.slice(0,2):`en`}),Se=F(()=>ma(r()?.customType)),Ce=F(()=>ha(r()?.customType)),we=F(()=>{let e=r()?.template||``,t=e.indexOf(`{{blank}}`);return t<0?{before:e,after:``}:{before:e.slice(0,t),after:e.slice(t+9)}});function Te(e,t){ki({sourceEl:t,fallbackSelector:`mc-populated-blank`,component:`mc-populated-blank`,session:e,complete:!!e?.choiceId})}function Ee(e){let t=e.target;if(!t.checked)return;let n=t.value;L(a,n,!0),Te({...i(),id:i()?.id||r()?.id||`1`,element:`mc-populated-blank`,choiceId:n},t)}function De(){K(v)&&L(_,!K(_))}Cn(()=>{(!K(f)||K(m))&&L(_,!1)});function Oe(e){if(r()?.disabled)return;let t=e.key;if(![`ArrowDown`,`ArrowRight`,`ArrowUp`,`ArrowLeft`].includes(t))return;e.preventDefault();let n=e.currentTarget,i=Array.from(n.querySelectorAll(`input[type="radio"]:not([disabled])`));if(i.length===0)return;let a=i.findIndex(e=>e.checked);a=t===`ArrowDown`||t===`ArrowRight`?a<0?0:(a+1)%i.length:a<0?i.length-1:(a-1+i.length)%i.length;let o=i[a];o.checked=!0,o.dispatchEvent(new Event(`change`,{bubbles:!0})),o.focus()}let ke=F(()=>sa({locale:r()?.locale,audioButtonSkin:r()?.audioButtonSkin,audioButtonSkinsByLocale:r()?.audioButtonSkinsByLocale}));function Ae(){Oi(K(c),{fallbackSelector:`mc-populated-blank`})?.onAudioStarted?.()}function je(){Oi(K(c),{fallbackSelector:`mc-populated-blank`})?.onAudioEnded?.()}Cn(()=>{i()?.choiceId&&L(a,i().choiceId,!0)}),Cn(()=>{let e=K(o);if(e)return e.addEventListener(`click`,De),()=>e.removeEventListener(`click`,De)}),Cn(()=>{let e=K(s);if(!e)return;let t=e=>{let t=e.target;!t||t.type!==`radio`||Ee(e)},n=e=>Oe(e);return e.addEventListener(`change`,t),e.addEventListener(`keydown`,n),()=>{e.removeEventListener(`change`,t),e.removeEventListener(`keydown`,n)}}),Cn(()=>{va(K(Se))}),Cn(()=>{let e=K(c);if(!e)return;let t=()=>{L(l,!!e.closest(`.rli-with-audio-transcript`))};t();let n=new MutationObserver(t),r=e.parentElement;for(;r;)n.observe(r,{attributes:!0,attributeFilter:[`class`]}),r=r.parentElement;return()=>n.disconnect()});var Me={get model(){return r()},set model(e){r(e),P()},get session(){return i()},set session(e){i(e),P()}},Ne=Da(),Pe=z(Ne),Fe=e=>{var t=ya();Gr(t,()=>r().prompt,!0),k(t),V(()=>X(t,`id`,K(pe))),J(e,t)};Y(Pe,e=>{r()?.prompt&&e(Fe)});var Ie=B(Pe,2),E=e=>{var t=ba(),n=z(t,!0);k(t),V(()=>{Qr(t,1,`text-sm mb-3 text-gray-700 text-center pie-audio-transcript ${K(ee)?``:`sr-only`}`,`svelte-6wlbb4`),X(t,`id`,K(me)),Or(n,r().audioTranscript)}),J(e,t)};Y(Ie,e=>{r()?.audioTranscript&&e(E)});var Le=B(Ie,2),D=e=>{var t=Ca(),n=z(t),r=z(n),i=z(r),a=z(i),s=e=>{J(e,xa())},c=e=>{J(e,Sa())};Y(a,e=>{K(_)?e(s):e(c,-1)}),k(i);var l=B(i,2),u=z(l,!0);k(l),k(r),k(n),fi(n,e=>L(o,e),()=>K(o)),k(t),V(()=>{X(n,`aria-pressed`,K(_)),Or(u,K(_)?K(fe).hideCorrectAnswer:K(fe).showCorrectAnswer)}),J(e,t)};Y(Le,e=>{K(v)&&e(D)});var O=B(Le,2);{let e=F(()=>!!r()?.hasAudio),t=F(()=>r()?.audioUrl),n=F(()=>!!r()?.autoplayAudioEnabled),i=F(()=>r()?.audioTranscript),a=F(()=>r()?.locale);Li(O,{get hasAudio(){return K(e)},get audioUrl(){return K(t)},get useFeatureButtonAudio(){return K(T)},get autoplayEnabled(){return K(n)},get audioTranscript(){return K(i)},get showVisibleTranscript(){return K(ee)},get transcriptId(){return K(me)},get featureAudioSkin(){return K(ke)},get uiText(){return K(fe)},get locale(){return K(a)},onaudiostarted:Ae,onaudioended:je})}var Re=B(O,2),ze=e=>{var t=wa();Gr(t,()=>r().sentenceHtml,!0),k(t),V(()=>X(t,`aria-describedby`,K(be))),J(e,t)};Y(Re,e=>{r()?.sentenceHtml&&e(ze)});var Be=B(Re,2),Ve=e=>{var t=Ta(),n=z(t);Gr(n,()=>K(we).before);var r=B(n,2);Ui(r,{get choiceMode(){return K(ie)},get displayChoice(){return K(ce)},get displayChoiceLabelHtml(){return K(le)},get isStandalone(){return K(S)},get blankWidth(){return K(ne).blankWidth},get blankBorderWidth(){return K(ne).blankBorderWidth},get ariaLabel(){return K(fe).selectedAnswerInSentence}}),Gr(B(r,2),()=>K(we).after),k(t),V(()=>X(t,`aria-describedby`,K(be))),J(e,t)};Y(Be,e=>{K(x)||e(Ve)});var He=B(Be,2),Ue=e=>{var t=Ea(),n=z(t,!0);k(t),V(()=>{X(t,`id`,K(ge)),Or(n,K(ue))}),J(e,t)};Y(He,e=>{K(ue)&&e(Ue)});var We=B(He,2),Ge=z(We),Ke=z(Ge,!0);k(Ge);var A=B(Ge,2);return zr(A,21,()=>K(re),e=>e.id,(e,t)=>{{let n=F(()=>K(se)===K(t).id),i=F(()=>!!r()?.disabled),a=F(()=>K(de).get(K(t).id));Zi(e,{get choice(){return K(t)},get choiceMode(){return K(ie)},get isHorizontal(){return K(C)},get isSelected(){return K(n)},get isDisabled(){return K(i)},get correctness(){return K(a)},get isEvaluateMode(){return K(f)},get instanceId(){return u},get radioGroupName(){return K(oe)}})}}),k(A),fi(A,e=>L(s,e),()=>K(s)),k(We),k(Ne),fi(Ne,e=>L(c,e),()=>K(c)),V(()=>{Qr(Ne,1,`p-4 mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${K(y)} ${K(Ce)} ${K(w)?`has-inline-audio`:``}`,`svelte-6wlbb4`),X(Ne,`lang`,K(xe)),ei(Ne,K(ne).rootStyle),We.disabled=r()?.disabled,X(Ge,`id`,K(he)),Or(Ke,K(_e)),Qr(A,1,`pie-choices ${K(C)?`flex flex-row flex-wrap items-start justify-center`:`flex flex-col`}`,`svelte-6wlbb4`),X(A,`aria-labelledby`,K(ve)),X(A,`aria-label`,K(ye)),X(A,`aria-describedby`,K(ue)?K(ge):void 0)}),J(e,Ne),Ye(Me)}vi(ka,{model:{type:`Object`},session:{type:`Object`},options:{type:`Object`}},[],[]);function Aa(e,t,n=!1){return!(!t?.choiceId||e?.autoplayAudioEnabled&&e?.completeAudioEnabled&&e?.hasAudio&&!n)}var ja=ka.element,Ma=class extends ja{_internalSession=null;_model=null;_options=null;audioComplete=!1;_dispatchModelSet=()=>{this.dispatchEvent(new Ti(this.tagName.toLowerCase(),this._isComplete(),this._model!==void 0))};_dispatchSessionChanged=()=>{this.dispatchEvent(new Ei(this.tagName.toLowerCase(),this._isComplete()))};set model(e){this._model=e,this.audioComplete=!1,super.model=e,this._dispatchModelSet()}get model(){return this._model}set session(e){this._internalSession=e,super.session=e,this._dispatchSessionChanged()}get session(){return this._internalSession}set options(e){this._options=e,super.options=e}get options(){return this._options}onSessionChange=e=>{this._internalSession=e,super.session=e,this._dispatchSessionChanged()};onAudioStarted=()=>{this._internalSession={...this._internalSession||{},audioStartTime:Date.now()}};onAudioEnded=()=>{this.audioComplete=!0,this._internalSession={...this._internalSession||{},audioEndTime:Date.now()},this._dispatchSessionChanged()};_isComplete=()=>Aa(this._model,this._internalSession,this.audioComplete);connectedCallback(){super.connectedCallback(),this.onSessionChange=this.onSessionChange,this.onAudioStarted=this.onAudioStarted,this.onAudioEnded=this.onAudioEnded}},Na=`{{blank}}`,Pa={model:{id:`1`,element:`mc-populated-blank`,prompt:`<p><strong>Demo prompt</strong></p>`,promptEnabled:!0,interactionMode:`populate_blank`,layoutProfile:``,choiceLayout:``,layoutProfilePresets:{},layoutLimits:{...na},audioButtonSkin:null,audioButtonSkinsByLocale:{},uiText:{answerChoices:`Answer choices`,selectedAnswerInSentence:`blank`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`,transcriptLabel:`Transcript`,listenLabelEn:`Listen`,listenLabelEs:`Escuchar`,listenSilentAlt:`Repeat instructions`,listenPlayingAlt:`Instructions are playing`,listenSilentAltEs:`Escuchar. Repetir las instrucciones.`,listenPlayingAltEs:`Escuchar. Estas son las instrucciones.`},sentenceHtml:``,template:`<p>The answer is ${Na}.</p>`,choiceMode:`text`,choices:[{id:`c1`,labelHtml:`<p>Option A</p>`},{id:`c2`,labelHtml:`<p>Option B</p>`},{id:`c3`,labelHtml:`<p>Option C</p>`}],correctChoiceId:`c2`,hasAudio:!1,autoplayAudioEnabled:!1,completeAudioEnabled:!1,audioUrl:``,audioTranscript:``,showVisibleTranscript:!1,locale:``,teacherInstructions:``,teacherInstructionsEnabled:!1},configuration:{prompt:{label:`Prompt`,settings:!0}}},Fa=n({countBlankTokens:()=>La,createCorrectResponseSession:()=>Za,createDefaultModel:()=>Va,getCorrectness:()=>Ra,getPartialScore:()=>za,model:()=>Xa,normalize:()=>Ha,normalizeSession:()=>Ua,outcome:()=>Ba,validate:()=>Qa}),Ia=e=>!!e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0;function La(e){return e?(e.match(/\{\{blank\}\}/g)||[]).length:0}var Ra=(e,t)=>{if(!t?.choiceId)return`unanswered`;let n=e?.correctChoiceId||``;return t.choiceId===n?`correct`:`incorrect`},za=(e,t)=>!t||Ia(t)||!t.choiceId?0:1,Ba=(e,t,n)=>new Promise(r=>{if(!t||Ia(t)){r({score:0,empty:!0,traceLog:[`Student did not select any answers. Score is 0.`]});return}t=Ua(t);let i=Ra(e,t);if(i===`unanswered`){r({score:0,empty:!0,traceLog:[`Student did not select any answers. Score is 0.`]});return}let a=+(i===`correct`);r({score:a,empty:!1,traceLog:[`Mode: ${n?.mode||`unknown`}.`,`Student selected choice: ${t.choiceId}.`,`Correct choice: ${e?.correctChoiceId||`none`}.`,`Final score: ${a}.`]})}),Va=(e={})=>({...Pa.model,...e,layoutLimits:{...na,...e?.layoutLimits||{}}}),Ha=(e={})=>Va(e),Ua=e=>({...e}),Wa=e=>!!e?.shuffle,Ga=(e,t)=>e?.lockChoiceOrder||t?.[`@pie-element`]?.lockChoiceOrder?!0:t?.role===`instructor`;function Ka(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var qa=e=>Array.isArray(e?.data?.shuffledValues)?e.data.shuffledValues:Array.isArray(e?.shuffledValues)?e.shuffledValues:[],Ja=(e,t,n)=>{let r=t.map(t=>e.find(e=>e?.[n]===t)).filter(e=>!!e);if(r.length===e.length)return r;let i=new Set(r.map(e=>e[n])),a=e.filter(e=>!i.has(e?.[n]));return[...r,...a]},Ya=async(e,t,n,r)=>{let i=Array.isArray(e?.choices)?[...e.choices]:[];if(!i.length||!Wa(e)||Ga(e,n||{}))return i;let a=qa(t);if(a.length)return Ja(i,a,`id`);let o=Ka(i);if(r&&typeof r==`function`&&t?.id&&t?.element){let e=o.map(e=>e?.id).filter(Boolean);e.length&&await r(t.id,t.element,{shuffledValues:e})}return o},Xa=async(e,t,n,r)=>{let i=t||{},a=n||{},o=Ha(e),s=await Ya(o,i,a,r),c={prompt:o.promptEnabled?o.prompt:null,interactionMode:o.interactionMode||`populate_blank`,layoutProfile:o.layoutProfile||``,choiceLayout:o.choiceLayout||``,layoutProfilePresets:o.layoutProfilePresets&&typeof o.layoutProfilePresets==`object`?o.layoutProfilePresets:{},layoutLimits:o.layoutLimits||{...na},audioButtonSkin:o.audioButtonSkin&&typeof o.audioButtonSkin==`object`?o.audioButtonSkin:null,audioButtonSkinsByLocale:o.audioButtonSkinsByLocale&&typeof o.audioButtonSkinsByLocale==`object`?o.audioButtonSkinsByLocale:{},uiText:o.uiText&&typeof o.uiText==`object`?o.uiText:{},sentenceHtml:o.sentenceHtml||null,template:o.template,choiceMode:o.choiceMode,choices:s,hasAudio:o.hasAudio,autoplayAudioEnabled:!!o.autoplayAudioEnabled,completeAudioEnabled:!!o.completeAudioEnabled,audioUrl:o.hasAudio?o.audioUrl:null,audioTranscript:o.hasAudio?o.audioTranscript:null,showVisibleTranscript:!!o.showVisibleTranscript,customType:o.customType||``,useFeatureButtonAudio:typeof o.useFeatureButtonAudio==`boolean`?o.useFeatureButtonAudio:void 0,locale:o.locale||``,disabled:a.mode!==`gather`,mode:a.mode};if(a.mode===`evaluate`){let e=Ra(o,i);c.correctness=e,c.responseCorrect=e===`correct`,c.correctChoiceId=o.correctChoiceId}return a.role===`instructor`&&(a.mode===`view`||a.mode===`evaluate`)?c.teacherInstructions=o.teacherInstructionsEnabled?o.teacherInstructions:null:c.teacherInstructions=null,c},Za=(e,t)=>new Promise(n=>{t.mode!==`evaluate`&&t.role===`instructor`?n({id:`1`,element:`mc-populated-blank`,choiceId:e?.correctChoiceId||``}):n(null)}),Qa=(e={},t={})=>{let n={};if(e.promptEnabled){let t=e.prompt?.trim()||``;(!t||t===`<p></p>`)&&(n.prompt=`Prompt is required when prompt is enabled`)}let r=e.interactionMode||`populate_blank`,i=La(e.template||``);r===`audio_mc_only`?i>0&&(n.template=`Template cannot contain ${Na} in audio-only mode`):r===`populate_blank`?i===0?n.template=`Template must contain exactly one ${Na} placeholder`:i>1&&(n.template=`Template must contain only one ${Na} placeholder`):n.interactionMode=`Unknown interaction mode`;let a=Array.isArray(e.choices)?e.choices:[];a.length<2&&(n.choices=`At least two choices are required`);let o=e.choiceMode||`text`;for(let e=0;e<a.length;e++){let t=a[e];if(!t?.id){n.choices=`Choice ${e+1} is missing an id`;break}if(o===`text`){let r=(t.labelHtml||``).trim();if(!r||r===`<p></p>`){n.choices=`Choice ${e+1} needs label text`;break}}else{if(!t.imageUrl?.trim()){n.choices=`Choice ${e+1} needs an image URL`;break}if(!t.imageAlt?.trim()){n.choices=`Choice ${e+1} needs image alt text`;break}}}let s=e.correctChoiceId;(!s||!a.some(e=>e.id===s))&&(n.correctChoiceId=`Correct choice must match one of the choice ids`),e.hasAudio&&(e.audioUrl?.trim()||(n.audioUrl=`A playable audio URL is required when audio is enabled`));let c=e?.layoutLimits;if(c&&typeof c==`object`)for(let e of`blankStandaloneWidthRem.blankWideWidthRem.blankUnderlineWidthPx.blankUnderlineWideWidthPx.horizontalChoiceWidthPx.horizontalChoiceWidthVw.horizontalChoiceTileMinHeightRem.horizontalChoiceContentMinHeightRem.selectedImageMaxHeightRem.choiceImageMaxHeightRem.listenButtonSizePx.stimulusMinColumnPx.textMinColumnPx.legendMaxChars.choiceGroupGapRem.choiceRowGapRem.toggleButtonGapRem.horizontalChoiceRadioTopMarginRem.audioBlankTemplateMarginTopRem.audioBlankTemplateMarginBottomRem.audioInstructionsMaxWidthPx.narrowHorizontalChoiceMaxWidthPx.stimulusGridColumnGapRem.stimulusGridRowGapRem.stimulusSentenceMarginTopRem.stimulusChoicesMarginTopRem.tokenGridColumnGapRem.tokenGridRowGapRem.tokenTemplateMarginTopRem.tokenInlineTokenGapRem.tokenChoicesMarginTopRem.inlineGridColumnGapRem.inlineGridRowGapRem.inlineTemplateMarginTopRem.inlineChoicesMarginTopRem`.split(`.`)){if(c[e]===void 0||c[e]===null)continue;let t=Number(c[e]);if(!Number.isFinite(t)||t<=0){n.layoutLimits=`${e} must be a positive number when provided`;break}}return n},$a={...Fa},eo=Ma;e.controller=$a,e.default=eo})(this.McPopulatedBlankElement=this.McPopulatedBlankElement||{});
495
+ }`};function ga(e,t){qe(t,!0),Br(e,ha);let n={answerChoices:`Answer choices`,selectedAnswerInSentence:`Selected answer in sentence`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`},r=$(t,`model`,7),i=$(t,`session`,7),a=P(``),o=P(null),s=P(null),c=P(null),l=`mc-populated-blank-${Math.random().toString(36).slice(2,10)}`,u=j(()=>(r()?.mode||r()?.env?.mode||``).toString()),d=j(()=>J(u)===`evaluate`),f=j(()=>r()?.correctness),p=j(()=>typeof r()?.responseCorrect==`boolean`?r().responseCorrect:J(f)===`correct`),m=j(()=>J(f)===`correct`),h=j(()=>J(f)===`incorrect`),g=P(!1),_=j(()=>J(d)&&!J(p)&&!!r()?.correctChoiceId),v=j(()=>r()?.layoutProfile||``),y=j(()=>Ui({interactionMode:r()?.interactionMode,template:r()?.template,choiceLayout:r()?.choiceLayout,layoutProfile:J(v),hasAudio:r()?.hasAudio,useFeatureButtonAudio:r()?.useFeatureButtonAudio})),ee=j(()=>J(y).isAudioOnlyMode),b=j(()=>J(y).isBlankOnlyTemplate),x=j(()=>J(y).isHorizontalChoices),S=j(()=>J(y).hasInlineSentenceAudioLayout),C=j(()=>J(y).useFeatureButtonAudio),w=j(()=>qi({layoutProfile:J(v),isBlankOnlyTemplate:J(b),configuredLimits:r()?.layoutLimits,customProfilePresets:r()?.layoutProfilePresets})),te=j(()=>Array.isArray(r()?.choices)?r().choices:[]),ne=j(()=>r()?.choiceMode||`text`),re=j(()=>i()?.choiceId||J(a)||``),ie=j(()=>`${l}-choice-group-${r()?.id||`1`}`),ae=j(()=>Xi({selectedId:J(re),isEvaluateMode:J(d),showCorrectAnswer:J(g),alwaysShowCorrect:!!r()?.alwaysShowCorrect,correctChoiceId:String(r()?.correctChoiceId||``)})),oe=j(()=>J(te).find(e=>e.id===J(ae))),se=j(()=>String(J(oe)?.labelHtml||``)),ce=j(()=>Zi({isEvaluateMode:J(d),showCorrectAnswer:J(g),isCorrect:J(m),isIncorrect:J(h),selectedId:J(re)})),le=j(()=>Bi({isEvaluateMode:J(d),correctChoiceId:String(r()?.correctChoiceId||``),selectedId:String(J(re)||``),showCorrectAnswer:J(g)})),ue=j(()=>({...n,...r()?.uiText||{}})),de=j(()=>`${l}-prompt`),fe=j(()=>`${l}-choices-legend`),pe=j(()=>`${l}-result`),me=j(()=>Qi({prompt:r()?.prompt||``,legendMaxChars:J(w).legendMaxChars,answerChoicesLabel:J(ue).answerChoices})),he=j(()=>r()?.prompt?J(de):void 0),ge=j(()=>r()?.prompt?void 0:String(r()?.choiceGroupLabel||``).trim()||J(me)),_e=j(()=>r()?.prompt?J(de):void 0),ve=j(()=>{let e=r()?.locale||``;return e?e.slice(0,2):`en`}),ye=j(()=>na(r()?.customType)),be=j(()=>ra(r()?.customType)),xe=j(()=>{let e=r()?.template||``,t=e.indexOf(`{{blank}}`);if(t<0)return{before:e,after:``};let n=e.slice(0,t),i=e.slice(t+9);return J(v)===`inline_sentence`&&(n=`${n.replace(/\s+$/,``)} `,i=` ${i.replace(/^\s+/,``)}`),{before:n,after:i}});function Se(e,t){_i({sourceEl:t,fallbackSelector:`mc-populated-blank`,component:`mc-populated-blank`,session:e,complete:!!e?.choiceId})}function Ce(e){let t=e.target;if(!t.checked)return;let n=t.value;F(a,n,!0),Se({...i(),id:i()?.id||r()?.id||`1`,element:`mc-populated-blank`,choiceId:n},t)}function we(){J(_)&&F(g,!J(g))}xn(()=>{(!J(d)||J(p))&&F(g,!1)});function Te(e){if(r()?.disabled)return;let t=e.key;if(![`ArrowDown`,`ArrowRight`,`ArrowUp`,`ArrowLeft`].includes(t))return;e.preventDefault();let n=e.currentTarget,i=Array.from(n.querySelectorAll(`input[type="radio"]:not([disabled])`));if(i.length===0)return;let a=i.findIndex(e=>e.checked);a=t===`ArrowDown`||t===`ArrowRight`?a<0?0:(a+1)%i.length:a<0?i.length-1:(a-1+i.length)%i.length;let o=i[a];o.checked=!0,o.dispatchEvent(new Event(`change`,{bubbles:!0})),o.focus()}let Ee=j(()=>Yi({locale:r()?.locale,audioButtonSkin:r()?.audioButtonSkin,audioButtonSkinsByLocale:r()?.audioButtonSkinsByLocale}));function De(){gi(J(c),{fallbackSelector:`mc-populated-blank`})?.onAudioStarted?.()}function Oe(){gi(J(c),{fallbackSelector:`mc-populated-blank`})?.onAudioEnded?.()}xn(()=>{i()?.choiceId&&F(a,i().choiceId,!0)}),xn(()=>{let e=J(o);if(e)return e.addEventListener(`click`,we),()=>e.removeEventListener(`click`,we)}),xn(()=>{let e=J(s);if(!e)return;let t=e=>{e.target?.type===`radio`&&Ce(e)},n=e=>Te(e);return e.addEventListener(`change`,t),e.addEventListener(`keydown`,n),()=>{e.removeEventListener(`change`,t),e.removeEventListener(`keydown`,n)}}),xn(()=>{oa(J(ye))});var ke={get model(){return r()},set model(e){r(e),N()},get session(){return i()},set session(e){i(e),N()}},Ae=ma(),je=L(Ae),Me=e=>{var t=sa();zr(t,()=>r().prompt,!0),O(t),z(()=>Q(t,`id`,J(de))),X(e,t)};Z(je,e=>{r()?.prompt&&e(Me)});var Ne=R(je,2),Pe=e=>{var t=ua(),n=L(t),r=L(n),i=L(r),a=L(i),s=e=>{X(e,ca())},c=e=>{X(e,la())};Z(a,e=>{J(g)?e(s):e(c,-1)}),O(i);var l=R(i,2),u=L(l,!0);O(l),O(r),O(n),oi(n,e=>F(o,e),()=>J(o)),O(t),z(()=>{Q(n,`aria-pressed`,J(g)),Sr(u,J(g)?J(ue).hideCorrectAnswer:J(ue).showCorrectAnswer)}),X(e,t)};Z(Ne,e=>{J(_)&&e(Pe)});var Fe=R(Ne,2);{let e=j(()=>!!r()?.hasAudio),t=j(()=>r()?.audioUrl),n=j(()=>!!r()?.autoplayAudioEnabled),i=j(()=>r()?.locale);Ti(Fe,{get hasAudio(){return J(e)},get audioUrl(){return J(t)},get useFeatureButtonAudio(){return J(C)},get autoplayEnabled(){return J(n)},get featureAudioSkin(){return J(Ee)},get uiText(){return J(ue)},get locale(){return J(i)},onaudiostarted:De,onaudioended:Oe})}var Ie=R(Fe,2),Le=e=>{var t=da();zr(t,()=>r().sentenceHtml,!0),O(t),z(()=>Q(t,`aria-describedby`,J(_e))),X(e,t)};Z(Ie,e=>{r()?.sentenceHtml&&e(Le)});var T=R(Ie,2),Re=e=>{var t=fa(),n=L(t);zr(n,()=>J(xe).before);var r=R(n);ji(r,{get choiceMode(){return J(ne)},get displayChoice(){return J(oe)},get displayChoiceLabelHtml(){return J(se)},get isStandalone(){return J(b)},get blankWidth(){return J(w).blankWidth},get blankBorderWidth(){return J(w).blankBorderWidth},get ariaLabel(){return J(ue).selectedAnswerInSentence}}),zr(R(r),()=>J(xe).after),O(t),z(()=>Q(t,`aria-describedby`,J(_e))),X(e,t)};Z(T,e=>{J(ee)||e(Re)});var E=R(T,2),D=e=>{var t=pa(),n=L(t,!0);O(t),z(()=>{Q(t,`id`,J(pe)),Sr(n,J(ce))}),X(e,t)};Z(E,e=>{J(ce)&&e(D)});var ze=R(E,2),Be=L(ze),Ve=L(Be,!0);O(Be);var He=R(Be,2);return Nr(He,21,()=>J(te),e=>e.id,(e,t)=>{{let n=j(()=>J(ae)===J(t).id),i=j(()=>!!r()?.disabled),a=j(()=>J(le).get(J(t).id));zi(e,{get choice(){return J(t)},get choiceMode(){return J(ne)},get isHorizontal(){return J(x)},get isSelected(){return J(n)},get isDisabled(){return J(i)},get correctness(){return J(a)},get isEvaluateMode(){return J(d)},get instanceId(){return l},get radioGroupName(){return J(ie)}})}}),O(He),oi(He,e=>F(s,e),()=>J(s)),O(ze),O(Ae),oi(Ae,e=>F(c,e),()=>J(c)),z(()=>{Kr(Ae,1,`p-4 mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${J(v)} ${J(be)} ${J(S)?`has-inline-audio`:``}`,`svelte-6wlbb4`),Q(Ae,`lang`,J(ve)),Jr(Ae,J(w).rootStyle),ze.disabled=r()?.disabled,Q(Be,`id`,J(fe)),Sr(Ve,J(me)),Kr(He,1,`pie-choices ${J(x)?`flex flex-row flex-wrap items-start justify-center`:`flex flex-col`}`,`svelte-6wlbb4`),Q(He,`aria-labelledby`,J(he)),Q(He,`aria-label`,J(ge)),Q(He,`aria-describedby`,J(ce)?J(pe):void 0)}),X(e,Ae),Je(ke)}fi(ga,{model:{type:`Object`},session:{type:`Object`},options:{type:`Object`}},[],[]);function _a(e,t,n=!1){return!(!t?.choiceId||e?.autoplayAudioEnabled&&e?.completeAudioEnabled&&e?.hasAudio&&!n)}var va=ga.element,ya=class extends va{_internalSession=null;_model=null;_options=null;audioComplete=!1;_dispatchModelSet=()=>{this.dispatchEvent(new pi(this.tagName.toLowerCase(),this._isComplete(),this._model!==void 0))};_dispatchSessionChanged=()=>{this.dispatchEvent(new mi(this.tagName.toLowerCase(),this._isComplete()))};set model(e){this._model=e,this.audioComplete=!1,super.model=e,this._dispatchModelSet()}get model(){return this._model}set session(e){this._internalSession=e,super.session=e,this._dispatchSessionChanged()}get session(){return this._internalSession}set options(e){this._options=e,super.options=e}get options(){return this._options}onSessionChange=e=>{this._internalSession=e,super.session=e,this._dispatchSessionChanged()};onAudioStarted=()=>{this._internalSession={...this._internalSession||{},audioStartTime:Date.now()}};onAudioEnded=()=>{this.audioComplete=!0,this._internalSession={...this._internalSession||{},audioEndTime:Date.now()},this._dispatchSessionChanged()};_isComplete=()=>_a(this._model,this._internalSession,this.audioComplete);connectedCallback(){super.connectedCallback(),this.onSessionChange=this.onSessionChange,this.onAudioStarted=this.onAudioStarted,this.onAudioEnded=this.onAudioEnded}},ba=`{{blank}}`,xa={model:{id:`1`,element:`mc-populated-blank`,prompt:`<p><strong>Demo prompt</strong></p>`,promptEnabled:!0,interactionMode:`populate_blank`,layoutProfile:``,choiceLayout:``,layoutProfilePresets:{},layoutLimits:{...Wi},audioButtonSkin:null,audioButtonSkinsByLocale:{},uiText:{answerChoices:`Answer choices`,selectedAnswerInSentence:`blank`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`,transcriptLabel:`Transcript`,listenLabelEn:`Listen`,listenLabelEs:`Escuchar`,listenSilentAlt:`Repeat instructions`,listenPlayingAlt:`Instructions are playing`,listenSilentAltEs:`Escuchar. Repetir las instrucciones.`,listenPlayingAltEs:`Escuchar. Estas son las instrucciones.`},sentenceHtml:``,template:`<p>The answer is ${ba}.</p>`,choiceMode:`text`,choices:[{id:`c1`,labelHtml:`<p>Option A</p>`},{id:`c2`,labelHtml:`<p>Option B</p>`},{id:`c3`,labelHtml:`<p>Option C</p>`}],correctChoiceId:`c2`,hasAudio:!1,autoplayAudioEnabled:!1,completeAudioEnabled:!1,audioUrl:``,audioTranscript:``,locale:``,teacherInstructions:``,teacherInstructionsEnabled:!1},configuration:{prompt:{label:`Prompt`,settings:!0}}},Sa=n({countBlankTokens:()=>wa,createCorrectResponseSession:()=>Ra,createDefaultModel:()=>Oa,getCorrectness:()=>Ta,getPartialScore:()=>Ea,model:()=>La,normalize:()=>ka,normalizeSession:()=>Aa,outcome:()=>Da,validate:()=>za}),Ca=e=>!!e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0;function wa(e){return e?(e.match(/\{\{blank\}\}/g)||[]).length:0}var Ta=(e,t)=>{if(!t?.choiceId)return`unanswered`;let n=e?.correctChoiceId||``;return t.choiceId===n?`correct`:`incorrect`},Ea=(e,t)=>!t||Ca(t)||!t.choiceId?0:1,Da=(e,t,n)=>new Promise(r=>{if(!t||Ca(t)){r({score:0,empty:!0,traceLog:[`Student did not select any answers. Score is 0.`]});return}t=Aa(t);let i=Ta(e,t);if(i===`unanswered`){r({score:0,empty:!0,traceLog:[`Student did not select any answers. Score is 0.`]});return}let a=+(i===`correct`);r({score:a,empty:!1,traceLog:[`Mode: ${n?.mode||`unknown`}.`,`Student selected choice: ${t.choiceId}.`,`Correct choice: ${e?.correctChoiceId||`none`}.`,`Final score: ${a}.`]})}),Oa=(e={})=>({...xa.model,...e,layoutLimits:{...Wi,...e?.layoutLimits||{}}}),ka=(e={})=>Oa(e),Aa=e=>({...e}),ja=e=>!!e?.shuffle,Ma=(e,t)=>e?.lockChoiceOrder||t?.[`@pie-element`]?.lockChoiceOrder?!0:t?.role===`instructor`;function Na(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var Pa=e=>Array.isArray(e?.data?.shuffledValues)?e.data.shuffledValues:Array.isArray(e?.shuffledValues)?e.shuffledValues:[],Fa=(e,t,n)=>{let r=t.map(t=>e.find(e=>e?.[n]===t)).filter(e=>!!e);if(r.length===e.length)return r;let i=new Set(r.map(e=>e[n])),a=e.filter(e=>!i.has(e?.[n]));return[...r,...a]},Ia=async(e,t,n,r)=>{let i=Array.isArray(e?.choices)?[...e.choices]:[];if(!i.length||!ja(e)||Ma(e,n||{}))return i;let a=Pa(t);if(a.length)return Fa(i,a,`id`);let o=Na(i);if(r&&typeof r==`function`&&t?.id&&t?.element){let e=o.map(e=>e?.id).filter(Boolean);e.length&&await r(t.id,t.element,{shuffledValues:e})}return o},La=async(e,t,n,r)=>{let i=t||{},a=n||{},o=ka(e),s=await Ia(o,i,a,r),c={prompt:o.promptEnabled?o.prompt:null,interactionMode:o.interactionMode||`populate_blank`,layoutProfile:o.layoutProfile||``,choiceLayout:o.choiceLayout||``,layoutProfilePresets:o.layoutProfilePresets&&typeof o.layoutProfilePresets==`object`?o.layoutProfilePresets:{},layoutLimits:o.layoutLimits||{...Wi},audioButtonSkin:o.audioButtonSkin&&typeof o.audioButtonSkin==`object`?o.audioButtonSkin:null,audioButtonSkinsByLocale:o.audioButtonSkinsByLocale&&typeof o.audioButtonSkinsByLocale==`object`?o.audioButtonSkinsByLocale:{},uiText:o.uiText&&typeof o.uiText==`object`?o.uiText:{},sentenceHtml:o.sentenceHtml||null,template:o.template,choiceMode:o.choiceMode,choices:s,hasAudio:o.hasAudio,autoplayAudioEnabled:!!o.autoplayAudioEnabled,completeAudioEnabled:!!o.completeAudioEnabled,audioUrl:o.hasAudio?o.audioUrl:null,audioTranscript:o.hasAudio?o.audioTranscript:null,customType:o.customType||``,useFeatureButtonAudio:typeof o.useFeatureButtonAudio==`boolean`?o.useFeatureButtonAudio:void 0,locale:o.locale||``,disabled:a.mode!==`gather`,mode:a.mode};if(a.mode===`evaluate`){let e=Ta(o,i);c.correctness=e,c.responseCorrect=e===`correct`,c.correctChoiceId=o.correctChoiceId}return a.role===`instructor`&&(a.mode===`view`||a.mode===`evaluate`)?c.teacherInstructions=o.teacherInstructionsEnabled?o.teacherInstructions:null:c.teacherInstructions=null,c},Ra=(e,t)=>new Promise(n=>{t.mode!==`evaluate`&&t.role===`instructor`?n({id:`1`,element:`mc-populated-blank`,choiceId:e?.correctChoiceId||``}):n(null)}),za=(e={},t={})=>{let n={};if(e.promptEnabled){let t=e.prompt?.trim()||``;(!t||t===`<p></p>`)&&(n.prompt=`Prompt is required when prompt is enabled`)}let r=e.interactionMode||`populate_blank`,i=wa(e.template||``);r===`audio_mc_only`?i>0&&(n.template=`Template cannot contain ${ba} in audio-only mode`):r===`populate_blank`?i===0?n.template=`Template must contain exactly one ${ba} placeholder`:i>1&&(n.template=`Template must contain only one ${ba} placeholder`):n.interactionMode=`Unknown interaction mode`;let a=Array.isArray(e.choices)?e.choices:[];a.length<2&&(n.choices=`At least two choices are required`);let o=e.choiceMode||`text`;for(let e=0;e<a.length;e++){let t=a[e];if(!t?.id){n.choices=`Choice ${e+1} is missing an id`;break}if(o===`text`){let r=(t.labelHtml||``).trim();if(!r||r===`<p></p>`){n.choices=`Choice ${e+1} needs label text`;break}}else{if(!t.imageUrl?.trim()){n.choices=`Choice ${e+1} needs an image URL`;break}if(!t.imageAlt?.trim()){n.choices=`Choice ${e+1} needs image alt text`;break}}}let s=e.correctChoiceId;(!s||!a.some(e=>e.id===s))&&(n.correctChoiceId=`Correct choice must match one of the choice ids`),e.hasAudio&&(e.audioUrl?.trim()||(n.audioUrl=`A playable audio URL is required when audio is enabled`));let c=e?.layoutLimits;if(c&&typeof c==`object`)for(let e of`blankStandaloneWidthRem.blankWideWidthRem.blankUnderlineWidthPx.blankUnderlineWideWidthPx.horizontalChoiceWidthPx.horizontalChoiceWidthVw.horizontalChoiceTileMinHeightRem.horizontalChoiceContentMinHeightRem.selectedImageMaxHeightRem.choiceImageMaxHeightRem.listenButtonSizePx.stimulusMinColumnPx.textMinColumnPx.legendMaxChars.choiceGroupGapRem.choiceRowGapRem.toggleButtonGapRem.horizontalChoiceRadioTopMarginRem.audioBlankTemplateMarginTopRem.audioBlankTemplateMarginBottomRem.audioInstructionsMaxWidthPx.narrowHorizontalChoiceMaxWidthPx.stimulusGridColumnGapRem.stimulusGridRowGapRem.stimulusSentenceMarginTopRem.stimulusChoicesMarginTopRem.tokenGridColumnGapRem.tokenGridRowGapRem.tokenTemplateMarginTopRem.tokenInlineTokenGapRem.tokenChoicesMarginTopRem.inlineGridColumnGapRem.inlineGridRowGapRem.inlineTemplateMarginTopRem.inlineChoicesMarginTopRem`.split(`.`)){if(c[e]===void 0||c[e]===null)continue;let t=Number(c[e]);if(!Number.isFinite(t)||t<=0){n.layoutLimits=`${e} must be a positive number when provided`;break}}return n},Ba={...Sa},Va=ya;e.controller=Ba,e.default=Va})(this.McPopulatedBlankElement=this.McPopulatedBlankElement||{});