@citolab/qti-components 6.9.1-beta.6 → 6.9.1-beta.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,593 +1,4 @@
1
- var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnPropertyDescriptor,Hs=Object.getOwnPropertyDescriptors;var Lr=Object.getOwnPropertySymbols;var Ns=Object.prototype.hasOwnProperty,Ps=Object.prototype.propertyIsEnumerable;var Hr=(i,t,e)=>t in i?Nr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,q=(i,t)=>{for(var e in t||(t={}))Ns.call(t,e)&&Hr(i,e,t[e]);if(Lr)for(var e of Lr(t))Ps.call(t,e)&&Hr(i,e,t[e]);return i},T=(i,t)=>Ms(i,Hs(t));var l=(i,t,e,r)=>{for(var s=r>1?void 0:r?Ls(t,e):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(r?n(t,e,s):n(s))||s);return r&&s&&Nr(t,e,s),s};var te=class extends Event{constructor(t,e,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=r!=null?r:!1}};var xe=class{constructor(t,e,r,s){var o;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){let n=e;this.context=n.context,this.callback=n.callback,this.subscribe=(o=n.subscribe)!=null?o:!1}else this.context=e,this.callback=r,this.subscribe=s!=null?s:!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new te(this.context,this.t,this.subscribe))}};var ft=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){let r=e||!Object.is(t,this.o);this.o=t,r&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:r}]of this.subscriptions)e(this.o,r)},t!==void 0&&(this.value=t)}addCallback(t,e,r){if(!r)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});let{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}};var zt=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},Ee=class extends ft{constructor(t,e,r){var s,o;super(e.context!==void 0?e.initialValue:r),this.onContextRequest=n=>{let a=n.composedPath()[0];n.context===this.context&&a!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,a,n.subscribe))},this.onProviderRequest=n=>{let a=n.composedPath()[0];if(n.context!==this.context||a===this.host)return;let c=new Set;for(let[d,{consumerHost:h}]of this.subscriptions)c.has(d)||(c.add(d),h.dispatchEvent(new te(this.context,d,!0)));n.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(o=(s=this.host).addController)==null||o.call(s,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new zt(this.context))}};function Yt({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new Ee(this,{context:i}))}),{get(){return t.get.call(this)},set(s){var o;return(o=r.get(this))==null||o.setValue(s),t.set.call(this,s)},init(s){var o;return(o=r.get(this))==null||o.setValue(s),s}};{t.constructor.addInitializer(n=>{r.set(n,new Ee(n,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),o;if(s===void 0){let n=new WeakMap;o={get(){return n.get(this)},set(a){r.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{let n=s.set;o=T(q({},s),{set(a){r.get(this).setValue(a),n==null||n.call(this,a)}})}return void Object.defineProperty(t,e,o)}}}function K({context:i,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new xe(this,{context:i,callback:s=>{e.set.call(this,s)},subscribe:t})}):e.constructor.addInitializer(s=>{new xe(s,{context:i,callback:o=>{s[r]=o},subscribe:t})})}}var Pr=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var Vr=new WeakMap,Ve=i=>{let t=Vr.get(i);return t===void 0&&Vr.set(i,t=new Map),t},Ds=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Ve(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){Ve(this).set(t,String(e))}removeAttribute(t){Ve(this).delete(t)}toggleAttribute(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}hasAttribute(t){return Ve(this).has(t)}attachShadow(t){let e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new Pr(this);return this.__internals=t,t}getAttribute(t){let e=Ve(this).get(t);return e!=null?e:null}};var Os=class extends Ds{},Dr=Os;var Is=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},Us=Is;var Or=new Us;var De=globalThis,gt=De.ShadowRoot&&(De.ShadyCSS===void 0||De.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Wt=Symbol(),Ir=new WeakMap,Oe=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Wt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(gt&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Ir.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Ir.set(e,t))}return t}toString(){return this.cssText}},Ur=i=>new Oe(typeof i=="string"?i:i+"",void 0,Wt),b=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,s,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[o+1],i[0]);return new Oe(e,i,Wt)},Kt=(i,t)=>{if(gt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=De.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},bt=gt||De.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return Ur(e)})(i):i;var{is:Fs,defineProperty:Bs,getOwnPropertyDescriptor:js,getOwnPropertyNames:Xs,getOwnPropertySymbols:zs,getPrototypeOf:Ys}=Object,D=globalThis,jr;(jr=D.customElements)!=null||(D.customElements=Or);var Fr=D.trustedTypes,Ws=Fr?Fr.emptyScript:"",Jt=D.reactiveElementPolyfillSupport,Ie=(i,t)=>i,Ue={toAttribute(i,t){switch(t){case Boolean:i=i?Ws:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch(r){e=null}}return e}},vt=(i,t)=>!Fs(i,t),Br={attribute:!0,type:String,converter:Ue,reflect:!1,hasChanged:vt},Xr,zr;(Xr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(zr=D.litPropertyMetadata)!=null||(D.litPropertyMetadata=new WeakMap);var Yr,J=class extends((Yr=globalThis.HTMLElement)!=null?Yr:Dr){static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Br){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Bs(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var n;let{get:s,set:o}=(n=js(this.prototype,t))!=null?n:{get(){return this[e]},set(a){this[e]=a}};return{get(){return s==null?void 0:s.call(this)},set(a){let c=s==null?void 0:s.call(this);o.call(this,a),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:Br}static _$Ei(){if(this.hasOwnProperty(Ie("elementProperties")))return;let t=Ys(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ie("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ie("properties"))){let e=this.properties,r=[...Xs(e),...zs(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(bt(s))}else t!==void 0&&e.push(bt(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return Kt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EC(t,e){var o;let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let n=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:Ue).toAttribute(e,r.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){var o;let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let n=r.getPropertyOptions(s),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:Ue;this._$Em=s,this[s]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,r){var s;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((s=r.hasChanged)!=null?s:vt)(this[t],e))return;this.P(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,r){var s;this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&((s=this._$Ej)!=null?s:this._$Ej=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o)a.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(e)):this._$EU()}catch(o){throw t=!1,this._$EU(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}},Wr;J.elementStyles=[],J.shadowRootOptions={mode:"open"},J[Ie("elementProperties")]=new Map,J[Ie("finalized")]=new Map,Jt==null||Jt({ReactiveElement:J}),((Wr=D.reactiveElementVersions)!=null?Wr:D.reactiveElementVersions=[]).push("2.0.4");var _e=globalThis,yt=_e.trustedTypes,Kr=yt?yt.createPolicy("lit-html",{createHTML:i=>i}):void 0,Qt="$lit$",Z=`lit$${Math.random().toFixed(9).slice(2)}$`,er="?"+Z,Ks=`<${er}>`,fe=_e.document===void 0?{createTreeWalker:()=>({})}:document,Be=()=>fe.createComment(""),je=i=>i===null||typeof i!="object"&&typeof i!="function",tr=Array.isArray,rs=i=>tr(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Zt=`[
2
- \f\r]`,Fe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Jr=/-->/g,Zr=/>/g,he=RegExp(`>|${Zt}(?:([^\\s"'>=/]+)(${Zt}*=${Zt}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Gr=/'/g,Qr=/"/g,ss=/^(?:script|style|textarea|title)$/i,rr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),u=rr(1),sr=rr(2),po=rr(3),M=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),es=new WeakMap,me=fe.createTreeWalker(fe,129);function is(i,t){if(!tr(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Kr!==void 0?Kr.createHTML(t):t}var os=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?"<svg>":t===3?"<math>":"",n=Fe;for(let a=0;a<e;a++){let c=i[a],d,h,g=-1,y=0;for(;y<c.length&&(n.lastIndex=y,h=n.exec(c),h!==null);)y=n.lastIndex,n===Fe?h[1]==="!--"?n=Jr:h[1]!==void 0?n=Zr:h[2]!==void 0?(ss.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=he):h[3]!==void 0&&(n=he):n===he?h[0]===">"?(n=s!=null?s:Fe,g=-1):h[1]===void 0?g=-2:(g=n.lastIndex-h[2].length,d=h[1],n=h[3]===void 0?he:h[3]==='"'?Qr:Gr):n===Qr||n===Gr?n=he:n===Jr||n===Zr?n=Fe:(n=he,s=void 0);let v=n===he&&i[a+1].startsWith("/>")?" ":"";o+=n===Fe?c+Ks:g>=0?(r.push(d),c.slice(0,g)+Qt+c.slice(g)+Z+v):c+Z+(g===-2?a:v)}return[is(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},Xe=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,n=0,a=t.length-1,c=this.parts,[d,h]=os(t,e);if(this.el=i.createElement(d,r),me.currentNode=this.el.content,e===2||e===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(s=me.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let g of s.getAttributeNames())if(g.endsWith(Qt)){let y=h[n++],v=s.getAttribute(g).split(Z),C=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:C[2],strings:v,ctor:C[1]==="."?Et:C[1]==="?"?_t:C[1]==="@"?Ct:be}),s.removeAttribute(g)}else g.startsWith(Z)&&(c.push({type:6,index:o}),s.removeAttribute(g));if(ss.test(s.tagName)){let g=s.textContent.split(Z),y=g.length-1;if(y>0){s.textContent=yt?yt.emptyScript:"";for(let v=0;v<y;v++)s.append(g[v],Be()),me.nextNode(),c.push({type:2,index:++o});s.append(g[y],Be())}}}else if(s.nodeType===8)if(s.data===er)c.push({type:2,index:o});else{let g=-1;for(;(g=s.data.indexOf(Z,g+1))!==-1;)c.push({type:7,index:o}),g+=Z.length-1}o++}}static createElement(t,e){let r=fe.createElement("template");return r.innerHTML=t,r}};function ge(i,t,e=i,r){var n,a,c;if(t===M)return t;let s=r!==void 0?(n=e.o)==null?void 0:n[r]:e.l,o=je(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,e,r)),r!==void 0?((c=e.o)!=null?c:e.o=[])[r]=s:e.l=s),s!==void 0&&(t=ge(i,s._$AS(i,t.values),s,r)),t}var xt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var d;let{el:{content:e},parts:r}=this._$AD,s=((d=t==null?void 0:t.creationScope)!=null?d:fe).importNode(e,!0);me.currentNode=s;let o=me.nextNode(),n=0,a=0,c=r[0];for(;c!==void 0;){if(n===c.index){let h;c.type===2?h=new Ce(o,o.nextSibling,this,t):c.type===1?h=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(h=new qt(o,this,t)),this._$AV.push(h),c=r[++a]}n!==(c==null?void 0:c.index)&&(o=me.nextNode(),n++)}return me.currentNode=fe,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},Ce=class i{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this.v}constructor(t,e,r,s){var o;this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this.v=(o=s==null?void 0:s.isConnected)!=null?o:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ge(this,t,e),je(t)?t===_||t==null||t===""?(this._$AH!==_&&this._$AR(),this._$AH=_):t!==this._$AH&&t!==M&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):rs(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==_&&je(this._$AH)?this._$AA.nextSibling.data=t:this.T(fe.createTextNode(t)),this._$AH=t}$(t){var o;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Xe.createElement(is(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(e);else{let n=new xt(s,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=es.get(t.strings);return e===void 0&&es.set(t.strings,e=new Xe(t)),e}k(t){tr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let o of t)s===e.length?e.push(r=new i(this.O(Be()),this.O(Be()),this,this.options)):r=e[s],r._$AI(o),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}},be=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=_,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=_}_$AI(t,e=this,r,s){let o=this.strings,n=!1;if(o===void 0)t=ge(this,t,e,0),n=!je(t)||t!==this._$AH&&t!==M,n&&(this._$AH=t);else{let a=t,c,d;for(t=o[0],c=0;c<o.length-1;c++)d=ge(this,a[r+c],e,c),d===M&&(d=this._$AH[c]),n||(n=!je(d)||d!==this._$AH[c]),d===_?t=_:t!==_&&(t+=(d!=null?d:"")+o[c+1]),this._$AH[c]=d}n&&!s&&this.j(t)}j(t){t===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},Et=class extends be{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===_?void 0:t}},_t=class extends be{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==_)}},Ct=class extends be{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){var n;if((t=(n=ge(this,t,e,0))!=null?n:_)===M)return;let r=this._$AH,s=t===_&&r!==_||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==_&&(r===_||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;typeof this._$AH=="function"?this._$AH.call((r=(e=this.options)==null?void 0:e.host)!=null?r:this.element,t):this._$AH.handleEvent(t)}},qt=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){ge(this,t)}},ns={M:Qt,P:Z,A:er,C:1,L:os,R:xt,D:rs,V:ge,I:Ce,H:be,N:_t,U:Ct,B:Et,F:qt},Gt=_e.litHtmlPolyfillSupport,ts;Gt==null||Gt(Xe,Ce),((ts=_e.litHtmlVersions)!=null?ts:_e.litHtmlVersions=[]).push("3.2.0");var as=(i,t,e)=>{var o,n;let r=(o=e==null?void 0:e.renderBefore)!=null?o:t,s=r._$litPart$;if(s===void 0){let a=(n=e==null?void 0:e.renderBefore)!=null?n:null;r._$litPart$=s=new Ce(t.insertBefore(Be(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends J{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e,r;let t=super.createRenderRoot();return(r=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=as(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return M}},ls;f._$litElement$=!0,f.finalized=!0,(ls=globalThis.litElementHydrateSupport)==null||ls.call(globalThis,{LitElement:f});var ir=globalThis.litElementPolyfillSupport;ir==null||ir({LitElement:f});var cs;((cs=globalThis.litElementVersions)!=null?cs:globalThis.litElementVersions=[]).push("4.1.0");var m=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Js={attribute:!0,type:String,converter:Ue,reflect:!1,hasChanged:vt},Zs=(i=Js,t,e)=>{let{kind:r,metadata:s}=e,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(e.name,i),r==="accessor"){let{name:n}=e;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,c,i)},init(a){return a!==void 0&&this.P(n,void 0,i),a}}}if(r==="setter"){let{name:n}=e;return function(a){let c=this[n];t.call(this,a),this.requestUpdate(n,c,i)}}throw Error("Unsupported decorator location: "+r)};function p(i){return(t,e)=>typeof e=="object"?Zs(i,t,e):((r,s,o)=>{let n=s.hasOwnProperty(o);return s.constructor.createProperty(o,n?T(q({},r),{wrapped:!0}):r),n?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function E(i){return p(T(q({},i),{state:!0,attribute:!1}))}var re=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function ze(i,t){return(e,r,s)=>{let o=n=>{var a,c;return(c=(a=n.renderRoot)==null?void 0:a.querySelector(i))!=null?c:null};if(t){let{get:n,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let c=Symbol();return{get(){return this[c]},set(d){this[c]=d}}})();return re(e,r,{get(){let c=n.call(this);return c===void 0&&(c=o(this),(c!==null||this.hasUpdated)&&a.call(this,c)),c}})}return re(e,r,{get(){return o(this)}})}}function ps(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},o="slot"+(r?`[name=${r}]`:":not([name])");return re(t,e,{get(){var c,d;let n=(c=this.renderRoot)==null?void 0:c.querySelector(o),a=(d=n==null?void 0:n.assignedElements(i))!=null?d:[];return s===void 0?a:a.filter(h=>h.matches(s))}})}}function S(i,t){let e=q({waitUntilFirstUpdate:!1},t);return(r,s)=>{let{update:o}=r,n=Array.isArray(i)?i:[i];r.update=function(a){n.forEach(c=>{let d=c;if(a.has(d)){let h=a.get(d),g=this[d];h!==g&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,g)}}),o.call(this,a)}}}var ds=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],O="item";var L=class extends f{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent=null;this._handleDisabledChange=(e,r)=>{this._interactionElements.forEach(s=>s.disabled=r)};this._handleReadonlyChange=(e,r)=>this._interactionElements.forEach(s=>s.readonly=r);this._context={identifier:this.getAttribute("identifier"),variables:ds};this._initialContext=T(q({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",e=>{this._context=T(q({},this._context),{variables:[...this._context.variables,e.detail.variable]}),this._initialContext=this._context,e.stopPropagation()}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let r=e.detail;this._feedbackElements.push(r),r.checkShowFeedback(r.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:r,countAttempt:s}=e.detail;this.updateResponseVariable(r,"true"),this.processResponse(s)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:r,value:s}=e.detail;this.updateOutcomeVariable(r,s),e.stopPropagation()}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>q({identifier:e.identifier,value:e.value,type:e.type},e.type==="outcome"&&e.identifier==="SCORE"?{externalScored:e.externalScored}:{}))}set variables(e){if(!Array.isArray(e)||e.some(r=>!("identifier"in r))){console.warn("variables property should be an array of VariableDeclaration");return}this._context=T(q({},this._context),{variables:this._context.variables.map(r=>{let s=e.find(o=>o.identifier===r.identifier);return s?q(q({},r),s):r})}),this._context.variables.forEach(r=>{if(r.type==="response"){let s=this._interactionElements.find(o=>o.responseIdentifier===r.identifier);s&&(s.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(s=>s.checkShowFeedback(r.identifier))})}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this._emit("qti-assessment-item-connected",this)}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let o=this._interactionElements.find(n=>n.getAttribute("response-identifier")===r.responseIdentifier);o&&(o.response=r.response)}}render(){return u`<slot></slot>`}showCorrectResponse(e){let s=this._context.variables.filter(o=>"correctResponse"in o&&o.correctResponse).map(o=>({responseIdentifier:o.identifier,response:o.correctResponse}));for(let o of s){let n=this._interactionElements.find(a=>a.getAttribute("response-identifier")===o.responseIdentifier);n&&(n.correctResponse=e?o.response:"")}}processResponse(e=!0){var s;let r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((s=this._context.variables.find(o=>o.identifier==="numAttempts"))==null?void 0:s.value)+1).toString()),this._emit("qti-response-processed"),!0)}resetResponses(){this._context=this._initialContext}getResponse(e){return this.getVariable(e)}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._context.variables.find(r=>r.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:r,response:s}=e.detail;this.updateResponseVariable(r,s)}updateResponseVariable(e,r){this._context=T(q({},this._context),{variables:this._context.variables.map(s=>s.identifier!==e?s:T(q({},s),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:Array.isArray(r)?[...r]:r}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(e,r){var o;let s=this.getOutcome(e);if(!s){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=T(q({},this._context),{variables:this._context.variables.map(n=>n.identifier!==e?n:T(q({},n),{value:s.cardinality==="single"?r:[...n.value,r]}))}),this._feedbackElements.forEach(n=>n.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(o=this._context.variables.find(n=>n.identifier===e))==null?void 0:o.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};l([p({type:String})],L.prototype,"title",2),l([p({type:String})],L.prototype,"identifier",2),l([p({type:String})],L.prototype,"adaptive",2),l([p({type:String})],L.prototype,"timeDependent",2),l([p({type:Boolean})],L.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],L.prototype,"_handleDisabledChange",2),l([p({type:Boolean})],L.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],L.prototype,"_handleReadonlyChange",2),l([Yt({context:O})],L.prototype,"_context",2),L=l([m("qti-assessment-item")],L);var Gs=String.raw,us=()=>{let i,t={async load(e,r=!1){return new Promise((s,o)=>{nr(e,r).then(n=>(i=n,s(t)))})},parse(e){return i=ar(e),t},path:e=>(ti(i,e),t),fn(e){return e(i),t},pciHooks(e){let r=["hook","module"],s=e.substring(0,e.lastIndexOf("/"));for(let o of r)i.querySelectorAll("["+o+"]").forEach(a=>{let c=a.getAttribute(o);!c.startsWith("data:")&&!c.startsWith("http")&&(a.setAttribute("base-url",e),a.setAttribute("module",s+"/"+encodeURIComponent(c+(c.endsWith(".js")?"":".js"))))});return t},customInteraction(e,r){let s=i.querySelector("qti-custom-interaction"),o=s.querySelector("object");return s.setAttribute("data-base-ref",e),s.setAttribute("data-base-item",e+r),s.setAttribute("data",o.getAttribute("data")),s.setAttribute("width",o.getAttribute("width")),s.setAttribute("height",o.getAttribute("height")),s.removeChild(o),t},convertCDATAtoComment(){return ri(i),t},stripStyleSheets(){return si(i),t},html(){return new XMLSerializer().serializeToString(At(i))},xml(){return new XMLSerializer().serializeToString(i)},htmldoc(){return At(i)},xmldoc(){return i}};return t},un=()=>{let i,t={async load(e){return new Promise((r,s)=>{nr(e).then(o=>(i=o,r(t)))})},parse(e){i=ar(e)},assessmentTest(){let e=i.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return t},hn=()=>{let i,t={async load(e){return new Promise((r,s)=>{nr(e).then(o=>(i=o,r(t)))})},parse(e){return i=ar(e),t},fn(e){return e(i),t},items(){return ei(i)},html(){return new XMLSerializer().serializeToString(At(i))},xml(){return new XMLSerializer().serializeToString(i)},htmldoc(){return At(i)},xmldoc(){return i}};return t},Qs=Gs`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
- <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
5
- <xsl:template match="@*|node()">
6
- <xsl:copy>
7
- <xsl:apply-templates select="@*|node()"/>
8
- </xsl:copy>
9
- </xsl:template>
10
-
11
- <!-- remove existing namespaces -->
12
- <xsl:template match="*">
13
- <!-- remove element prefix -->
14
- <xsl:element name="{local-name()}">
15
- <!-- process attributes -->
16
- <xsl:for-each select="@*">
17
- <!-- remove attribute prefix -->
18
- <xsl:attribute name="{local-name()}">
19
- <xsl:value-of select="."/>
20
- </xsl:attribute>
21
- </xsl:for-each>
22
- <xsl:apply-templates/>
23
- </xsl:element>
24
- </xsl:template>
25
- </xsl:stylesheet>`;function ei(i){let t=[];return i.querySelectorAll("qti-assessment-item-ref").forEach(e=>{let r=e.getAttribute("identifier"),s=e.getAttribute("href"),o=e.getAttribute("category");t.push({identifier:r,href:s,category:o})}),t}var or=null;function nr(i,t=!0){return t&&or!==null&&or.abort(),new Promise((e,r)=>{let s=new XMLHttpRequest;or=s,s.open("GET",i,!0),s.responseType="document",s.onload=()=>{s.status>=200&&s.status<300?e(s.responseXML):r(s.statusText)},s.onerror=()=>{r(s.statusText)},s.send()})}function ar(i){return new DOMParser().parseFromString(i,"text/xml")}function At(i){let t=new XSLTProcessor,e=new DOMParser().parseFromString(Qs,"text/xml");return t.importStylesheet(e),t.transformToFragment(i,document)}function ti(i,t){t.endsWith("/")||(t+="/"),i.querySelectorAll("[src],[href],[primary-path]").forEach(e=>{var o;let r="";e.getAttribute("src")&&(r="src"),e.getAttribute("href")&&(r="href"),e.getAttribute("primary-path")&&(r="primary-path");let s=(o=e.getAttribute(r))==null?void 0:o.trim();if(!s.startsWith("data:")&&!s.startsWith("http")){let n=t+encodeURI(s);e.setAttribute(r,n)}})}function ri(i){i.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(e=>{let r=document.createComment(e.textContent);e.replaceChild(r,e.firstChild)})}function si(i){i.querySelectorAll("qti-stylesheet").forEach(t=>t.remove())}var qe=class extends f{constructor(){super(...arguments);this.identifier="";this.href=""}async connectedCallback(){super.connectedCallback();let e=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0});if(this.dispatchEvent(e)){let o=this.closest("qti-assessment-item").querySelector(`[data-stimulus-idref=${this.identifier}]`);o?await this.loadAndAppendStimulus(o):console.warn(`Stimulus with data-stimulus-idref ${this.identifier} not found`)}}async loadAndAppendStimulus(e){var o;let r=this.href.substring(0,this.href.lastIndexOf("/")),s=await us().load(this.href).then(n=>n.path(r).htmldoc());if(s){let n=s.querySelectorAll("qti-stimulus-body, qti-stylesheet");e.append(...n),((o=s.querySelector("qti-assessment-stimulus"))==null?void 0:o.title).includes("(lijst)")&&e.classList.add("qti-stimulus-list")}}};l([p({type:String})],qe.prototype,"identifier",2),l([p({type:String})],qe.prototype,"href",2),qe=l([m("qti-assessment-stimulus-ref")],qe);var ii={SPACE:32},k=class extends f{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,r){r?(this.tabindex=void 0,this.blur()):this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-register-choice",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-loose-choice",{bubbles:!0,cancelable:!1,composed:!0}))}reset(){this.checked=!1,this.disabled=!1}_onKeyUp(e){if(!e.altKey)switch(e.keyCode){case ii.SPACE:e.preventDefault(),this._toggleChecked();break;default:}}_onClick(){this._toggleChecked()}_toggleChecked(){this.disabled||this.readonly||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("qti-choice-element-selected",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier,checked:this.checked}})))}render(){return u` <slot></slot> `}};l([p({type:String})],k.prototype,"identifier",2),l([p({type:Number,reflect:!0})],k.prototype,"tabindex",2),l([p({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:e=>e}})],k.prototype,"disabled",2),l([p({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:e=>e}})],k.prototype,"readonly",2),l([p({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:e=>e}})],k.prototype,"checked",2),l([S("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"handleDisabledChange",1);var hs=b`
26
- :host {
27
- display: block;
28
- }
29
- `;var Ae=class extends f{render(){return u`<slot name="qti-rubric-block"></slot><slot></slot>`}};Ae.styles=hs,Ae=l([m("qti-item-body")],Ae);var wt=class extends f{render(){return u`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};wt=l([m("qti-prompt")],wt);var St=class extends f{firstUpdated(t){super.firstUpdated(t);let e=this,r=this.getAttribute("href");if(r!==null){let s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.media="screen",s.href=r,e.appendChild(s),this.styleLink=s}if(this.textContent!==null){let s=document.createElement("style");s.media="screen",s.textContent=this.textContent,e.appendChild(s),this.styleLink=s}}disconnectedCallback(){if(this.styleLink)try{this.styleLink.remove()}catch(t){console.log("could not remove stylesheet")}}};St=l([m("qti-stylesheet")],St);var se=class extends f{render(){return u`<slot></slot>`}defaultValues(t){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let r=e.map(s=>s.innerHTML);return r.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?r:r[0]}};se=l([m("qti-variabledeclaration")],se);var I=class extends se{constructor(){super(...arguments);this.externalScored=null}render(){var r,s;let e=(s=(r=this.itemContext)==null?void 0:r.variables.find(o=>o.identifier===this.identifier))==null?void 0:s.value;return u`${JSON.stringify(e,null,2)}`}get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let r=new Map;for(let s of e.querySelectorAll("qti-interpolation-table-entry")){!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let o=parseInt(s.getAttribute("source-value")),n=parseInt(s.getAttribute("target-value"));(isNaN(o)||isNaN(n))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),r.set(o,n)}return r}return null}connectedCallback(){super.connectedCallback();let e={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};I.styles=[b`
30
- :host {
31
- display: none;
32
- }
33
- `],l([p({type:String,attribute:"base-type"})],I.prototype,"baseType",2),l([p({type:String,attribute:"external-scored"})],I.prototype,"externalScored",2),l([p({type:String})],I.prototype,"identifier",2),l([p({type:String})],I.prototype,"cardinality",2),l([K({context:O,subscribe:!0}),E()],I.prototype,"itemContext",2),I=l([m("qti-outcome-declaration")],I);var G=class extends se{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(s=>s.identifier===this.identifier))==null?void 0:r.value;return u`${JSON.stringify(t,null,2)}`}connectedCallback(){super.connectedCallback();let t={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}get correctResponse(){let t,e=this.querySelector("qti-correct-response");if(e){let r=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&r.length>0)t=r[0].textContent,r[0].remove();else if(this.cardinality!=="single"){t=[];for(let s=0;s<r.length;s++)t.push(r[s].textContent),r[s].remove()}}return t}get mapping(){return this.querySelector("qti-mapping")}};G.styles=[b`
34
- :host {
35
- display: none;
36
- }
37
- `],l([p({type:String,attribute:"base-type"})],G.prototype,"baseType",2),l([p({type:String})],G.prototype,"identifier",2),l([p({type:String})],G.prototype,"cardinality",2),l([K({context:O,subscribe:!0}),E()],G.prototype,"itemContext",2),G=l([m("qti-response-declaration")],G);var Tt=class extends f{};Tt=l([m("qti-companion-materials-info")],Tt);var Rt=class extends f{render(){return u`<slot></slot>`}};Rt=l([m("qti-content-body")],Rt);var U=class extends f{handleclassNamesChange(t,e){this.classNames.split(" ").forEach(s=>{switch(s){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return u`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};U.styles=b`
38
- :host {
39
- display: block;
40
- }
41
- `,l([p({type:String})],U.prototype,"id",2),l([p({type:String})],U.prototype,"use",2),l([p({type:String})],U.prototype,"view",2),l([p({type:String,attribute:"class"})],U.prototype,"classNames",2),l([S("classNames",{waitUntilFirstUpdate:!0})],U.prototype,"handleclassNamesChange",1),U=l([m("qti-rubric-block")],U);var oi=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),Ye=i=>{if(typeof i=="string")return i;let t=oi();return t==="."?i.toLocaleString():i.toString().replace(".","").replace(t,".")};function lr(i){return i==null}function We(i){return i.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}var H=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(t){let e=this.closest("qti-assessment-item").getOutcome(t);if(this.outcomeIdentifier!==t||!e)return;let r=!1;Array.isArray(e.value)?r=e.value.includes(this.identifier):r=!lr(this.identifier)&&!lr(e==null?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(r)}showFeedback(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}};l([p({type:String,attribute:"show-hide"})],H.prototype,"showHide",2),l([p({type:String,attribute:"outcome-identifier"})],H.prototype,"outcomeIdentifier",2),l([p({type:String})],H.prototype,"identifier",2),l([p({type:String,attribute:!1})],H.prototype,"showStatus",2);var Ke=class extends H{render(){return u` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `}firstUpdated(t){this.checkShowFeedback(this.outcomeIdentifier)}};Ke.styles=b`
42
- :host {
43
- display: block;
44
- }
45
- .on {
46
- display: block;
47
- }
48
- .off {
49
- display: none;
50
- }
51
- `,Ke=l([m("qti-feedback-block")],Ke);var Je=class extends H{constructor(){super(...arguments);this.render=()=>u` <slot part="feedback" class="${this.showStatus}"></slot> `}};Je.styles=b`
52
- .on {
53
- display: inline-block;
54
- }
55
- .off {
56
- display: none;
57
- }
58
- `,Je=l([m("qti-feedback-inline")],Je);var Ze=class extends H{constructor(){super(...arguments);this.render=()=>u` <slot part="feedback" class="${this.showStatus}"></slot> `}};Ze.styles=b`
59
- .on {
60
- display: inline-block;
61
- }
62
- .off {
63
- display: none;
64
- }
65
- `,Ze=l([m("qti-modal-feedback")],Ze);var F=i=>i!=null?i:_;var A=class extends f{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}set correctResponse(e){console.warn("correctResponse is not implemented")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(e)?[...e]:e}}))}};l([p({attribute:"response-identifier"})],A.prototype,"responseIdentifier",2),l([p({reflect:!0,type:Boolean})],A.prototype,"disabled",2),l([p({reflect:!0,type:Boolean})],A.prototype,"readonly",2);var{I:ni}=ns;var fs=i=>i.strings===void 0,ms=()=>document.createComment(""),we=(i,t,e)=>{var o;let r=i._$AA.parentNode,s=t===void 0?i._$AB:t._$AA;if(e===void 0){let n=r.insertBefore(ms(),s),a=r.insertBefore(ms(),s);e=new ni(n,a,i,i.options)}else{let n=e._$AB.nextSibling,a=e._$AM,c=a!==i;if(c){let d;(o=e._$AQ)==null||o.call(e,i),e._$AM=i,e._$AP!==void 0&&(d=i._$AU)!==a._$AU&&e._$AP(d)}if(n!==s||c){let d=e._$AA;for(;d!==n;){let h=d.nextSibling;r.insertBefore(d,s),d=h}}}return e},ie=(i,t,e=i)=>(i._$AI(t,e),i),ai={},gs=(i,t=ai)=>i._$AH=t,bs=i=>i._$AH,$t=i=>{var r;(r=i._$AP)==null||r.call(i,!1,!0);let t=i._$AA,e=i._$AB.nextSibling;for(;t!==e;){let s=t.nextSibling;t.remove(),t=s}};var oe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Q=i=>(...t)=>({_$litDirective$:i,values:t}),B=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this.t=t,this._$AM=e,this.i=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var Ge=(i,t)=>{var r;let e=i._$AN;if(e===void 0)return!1;for(let s of e)(r=s._$AO)==null||r.call(s,t,!1),Ge(s,t);return!0},kt=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},vs=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),pi(t)}};function li(i){this._$AN!==void 0?(kt(this),this._$AM=i,vs(this)):this._$AM=i}function ci(i,t=!1,e=0){let r=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(r))for(let o=e;o<r.length;o++)Ge(r[o],!1),kt(r[o]);else r!=null&&(Ge(r,!1),kt(r));else Ge(this,i)}var pi=i=>{var t,e;i.type==oe.CHILD&&((t=i._$AP)!=null||(i._$AP=ci),(e=i._$AQ)!=null||(i._$AQ=li))},Mt=class extends B{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),vs(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,s;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(s=this.disconnected)==null||s.call(this)),e&&(Ge(this,t),kt(this))}setValue(t){if(fs(this.t))this.t._$AI(t,this);else{let e=[...this.t._$AH];e[this.i]=t,this.t._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Lt=()=>new pr,pr=class{},cr=new WeakMap,ys=Q(class extends Mt{render(i){return _}update(i,[t]){var r;let e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(r=i.options)==null?void 0:r.host,this.rt(this.ct=i.element)),_}rt(i){var t;if(this.isConnected||(i=void 0),typeof this.Y=="function"){let e=(t=this.ht)!=null?t:globalThis,r=cr.get(e);r===void 0&&(r=new WeakMap,cr.set(e,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,t,e;return typeof this.Y=="function"?(t=cr.get((i=this.ht)!=null?i:globalThis))==null?void 0:t.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var j=class extends A{constructor(){super(...arguments);this.textareaRef=Lt();this._value=""}handleclassNamesChange(e,r){this.classNames.split(" ").forEach(o=>{if(o.startsWith("qti-height-lines")){let n=o.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(n))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
66
- /* PK: display host as block, else design will be collapsed */
67
- :host {
68
- display: block;
69
- }
70
- textarea {
71
- box-sizing: border-box;
72
- width: 100%;
73
- height: 100%;
74
- border: 0;
75
- }
76
- `]}render(){return u`<slot name="prompt"></slot
77
- ><textarea
78
- part="textarea"
79
- ${ys(this.textareaRef)}
80
- spellcheck="false"
81
- autocomplete="off"
82
- @keydown="${e=>e.stopImmediatePropagation()}"
83
- @keyup="${this.textChanged}"
84
- @change="${this.textChanged}"
85
- @blur="${e=>{let r=e.target;r.checkValidity()?r.setCustomValidity(""):(r.setCustomValidity(this.dataset.patternmaskMessage||"Invalid input"),r.reportValidity())}}"
86
- placeholder="${F(this.placeholderText?this.placeholderText:void 0)}"
87
- maxlength="${F(this.expectedLength?this.expectedLength:void 0)}"
88
- pattern="${F(this.patternMask?this.patternMask:void 0)}"
89
- ?disabled="${this.disabled}"
90
- ?readonly="${this.readonly}"
91
- .value=${this._value}
92
- ></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([p({type:Number,attribute:"expected-length"})],j.prototype,"expectedLength",2),l([p({type:String,attribute:"pattern-mask"})],j.prototype,"patternMask",2),l([p({type:String,attribute:"placeholder-text"})],j.prototype,"placeholderText",2),l([E()],j.prototype,"_value",2),l([p({type:String,attribute:"class"})],j.prototype,"classNames",2),l([S("classNames",{waitUntilFirstUpdate:!0})],j.prototype,"handleclassNamesChange",1),j=l([m("qti-extended-text-interaction")],j);function xs(i,t){let e,r=q({},t);return(s,o)=>{let{connectedCallback:n,disconnectedCallback:a}=s;s.connectedCallback=function(){var h;n.call(this);let c=g=>{let y=Array.from(this.querySelectorAll(i));for(let v of g){let C=Array.from(v.addedNodes).map(R=>R),w=Array.from(v.addedNodes).map(R=>R);v.type==="childList"&&C.find(R=>y.includes(R))&&this[o](C,w)}};e=new MutationObserver(c),e.observe(this,{childList:!0,subtree:!0});let d=(h=this.querySelectorAll(i))!=null?h:[];this[o](Array.from(d),[])},s.disconnectedCallback=function(){a.call(this),e.disconnect()}}}var N=class extends A{constructor(){super(...arguments);this._value="";this._correctValue="";this._size=5;this.inputRef=Lt()}handleclassNamesChange(e,r){r.split(" ").forEach(o=>{if(o.startsWith("qti-input-width")){let n=o.replace("qti-input-width-","");this._size=parseInt(n)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
93
- [part='correct'] {
94
- position: absolute;
95
- width: 100%;
96
- }
97
- `]}set correctResponse(e){this._correctValue=e}render(){return u`
98
- <input
99
- part="input"
100
- spellcheck="false"
101
- autocomplete="off"
102
- @blur="${e=>{let r=e.target;r.checkValidity()?r.setCustomValidity(""):(r.setCustomValidity(this.dataset.patternmaskMessage||"Invalid input"),r.reportValidity())}}"
103
- @keydown="${e=>e.stopImmediatePropagation()}"
104
- @keyup="${this.textChanged}"
105
- @change="${this.textChanged}"
106
- type="${this.patternMask=="[0-9]*"?"number":"text"}"
107
- placeholder="${F(this.placeholderText?this.placeholderText:void 0)}"
108
- .value="${this._value}"
109
- size="${this._size}"
110
- pattern="${F(this.patternMask?this.patternMask:void 0)}"
111
- ?disabled="${this.disabled}"
112
- ?readonly="${this.readonly}"
113
- />
114
- <div part="correct">${this._correctValue}</div>
115
- `}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([p({type:Number,attribute:"expected-length"})],N.prototype,"expectedLength",2),l([p({type:String,attribute:"pattern-mask"})],N.prototype,"patternMask",2),l([p({type:String,attribute:"placeholder-text"})],N.prototype,"placeholderText",2),l([E()],N.prototype,"_value",2),l([E()],N.prototype,"_correctValue",2),l([E()],N.prototype,"_size",2),l([p({type:String,attribute:"class"})],N.prototype,"classNames",2),l([S("classNames")],N.prototype,"handleclassNamesChange",1),N=l([m("qti-text-entry-interaction")],N);var ne=(i,t)=>{class e extends i{constructor(...o){super(...o);this._choiceElements=[];this.responseIdentifier="";this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(o,n)=>this._choiceElements.forEach(a=>a.disabled=n);this._handleReadonlyChange=(o,n)=>this._choiceElements.forEach(a=>a.readonly=n);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}validate(){return this._choiceElements.reduce((n,a)=>n+(a.checked?1:0),0)>=this.minChoices}set response(o){let n=Array.isArray(o)?o:[o];this._choiceElements.forEach(a=>{a.checked=!!n.find(c=>c===a.identifier)})}set correctResponse(o){let n=Array.isArray(o)?o:[o];if(o==""){this._choiceElements.forEach(a=>{a.removeAttribute("data-correct-response")});return}this._choiceElements.forEach(a=>{a.setAttribute("data-correct-response",n.find(c=>c===a.identifier)?"true":"false")})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(o){o.stopPropagation();let n=o.target;this._choiceElements.push(n),this._setInputType(n)}_looseChoiceElement(o){o.stopPropagation();let n=o.target;this._choiceElements.push(n),this._choiceElements=this._choiceElements.filter(a=>a!==n)}_determineInputType(){this._choiceElements.forEach(o=>{this._setInputType(o)})}_setInputType(o){this.maxChoices===1?o.setAttribute("role","radio"):o.setAttribute("role","checkbox")}_choiceElementSelectedHandler(o){this.maxChoices===1&&this._choiceElements.filter(n=>n.identifier!==o.detail.identifier).forEach(n=>{n.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let o=this._choiceElements.filter(a=>a.checked).map(a=>a.identifier);this.maxChoices>1&&(this.maxChoices===o.length?this._choiceElements.forEach(a=>a.disabled=!a.checked):this._choiceElements.forEach(a=>a.disabled=!1));let n;this.maxChoices===1?n=o.length>0?o[0]:void 0:n=o,this.saveResponse(n)}saveResponse(o){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:o}}))}}return l([p({attribute:"response-identifier"})],e.prototype,"responseIdentifier",2),l([p({type:Number,attribute:"min-choices"})],e.prototype,"minChoices",2),l([p({type:Number,attribute:"max-choices"})],e.prototype,"maxChoices",2),l([S("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"_handleDisabledChange",2),l([S("readonly",{waitUntilFirstUpdate:!0})],e.prototype,"_handleReadonlyChange",2),l([S("maxChoices",{waitUntilFirstUpdate:!0})],e.prototype,"_handleMaxChoicesChange",2),e};var Ht=class extends ne(f,"qti-hottext"){constructor(){super(...arguments);this.render=()=>u`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};Ht=l([m("qti-hottext-interaction")],Ht);var Qe=class extends B{constructor(t){if(super(t),this.it=_,t.type!==oe.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===_||t==null)return this._t=void 0,this.it=t;if(t===M)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Qe.directiveName="unsafeHTML",Qe.resultType=1;var ae=Q(Qe);var le=class extends A{constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
116
- :host {
117
- display: inline-block;
118
- }
119
- slot {
120
- display: flex;
121
- flex-direction: column;
122
- }
123
- [role='menu'] {
124
- position: absolute;
125
- z-index: 1000;
126
- }
127
- .anchor {
128
- /* anchor-name: --infobox; */
129
- width: fit-content;
130
- }
131
-
132
- .positionedElement {
133
- position: absolute;
134
- /* position-anchor: --infobox; */
135
- /* top: anchor(bottom); */
136
- }
137
- `]}render(){return u`
138
- <select part="select" @change="${this.choiceSelected}" ?disabled="${this.disabled}" ?readonly="${this.readonly}">
139
- ${this.options.map(e=>u`
140
- <option value="${e.value}" ?selected="${e.selected}">${ae(e.textContent)}</option>
141
- `)}
142
- </select>
143
-
144
- ${ae(this.correctOption)}
145
- `}connectedCallback(){super.connectedCallback(),this.addEventListener("on-dropdown-selected",this.choiceSelected);let e=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...e.map(r=>({textContent:r.innerHTML,value:r.getAttribute("identifier"),selected:!1}))]}disconnectedCallback(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}validate(){let e=this.options.find(r=>r.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,r)=>T(q({},e),{selected:r===0}))}set response(e){this.options=this.options.map(r=>(e===r.value&&(r.selected=!0),r))}set correctResponse(e){if(e===""){this.correctOption="";return}this.correctOption=`<span part="correct-option">${this.options.find(r=>e===r.value).textContent}</span>`}choiceSelected(e){let r=e.target.value;this.options=this.options.map(s=>T(q({},s),{selected:s.value===r})),this.saveResponse(r)}};le.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],l([E()],le.prototype,"options",2),l([E()],le.prototype,"correctOption",2),l([p({attribute:"data-prompt",type:String})],le.prototype,"dataPrompt",2),le=l([m("qti-inline-choice-interaction")],le);var Nt=(i,t)=>{class e extends i{constructor(){super(...arguments);this._shuffle=!1}set shuffle(o){let n=this._shuffle;this._shuffle=o,o?this._shuffleChoices():this._resetShuffleChoices(),this.requestUpdate("shuffle",n)}get shuffle(){return this._shuffle}connectedCallback(){super.connectedCallback(),this.shuffle?this._shuffleChoices():this._resetShuffleChoices()}_shuffleChoices(){let o=Array.from(this.querySelectorAll(t)),n=[],a=[];if(o.forEach((y,v)=>{y.hasAttribute("fixed")?n.push({element:y,index:v}):a.push(y)}),a.length<=1)throw new Error("Shuffling is not possible with fewer than 2 non-fixed elements.");let c=!1,d=10,h=0;for(;!c&&h<d;){h++;for(let y=a.length-1;y>0;y--){let v=Math.floor(Math.random()*(y+1));[a[y],a[v]]=[a[v],a[y]]}if(c=a.some((y,v)=>o.indexOf(y)!==v),c)break}if(!c)throw new Error("Failed to shuffle the choices after multiple attempts.");let g=1;o.forEach((y,v)=>{y.hasAttribute("fixed")?y.style.setProperty("order",String(g++)):a.shift().style.setProperty("order",String(g++))})}_resetShuffleChoices(){Array.from(this.querySelectorAll("qti-simple-choice")).forEach((n,a)=>{n.style.setProperty("order","initial")})}}return l([p({type:String,reflect:!0,converter:di})],e.prototype,"shuffle",1),e},di={fromAttribute(i){return i==="true"},toAttribute(i){return i?"true":"false"}};var Es=(i,t)=>{class e extends i{constructor(){super(...arguments);this._classes=[];this._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];this._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"]}set class(o){o&&(this._classes=o.split(" "),this._addLabels())}get class(){var o;return((o=this._classes)==null?void 0:o.join(" "))||""}updated(o){super.updated(o),o.has("shuffle")&&this._addLabels()}_addLabels(){let o=this._classes.some(a=>this._allLabels.includes(a)||this._allLabelSuffixes.includes(a)),n=a=>!isNaN(+a);if(o){let c=Array.from(this.querySelectorAll("qti-simple-choice")).map(d=>d).map((d,h)=>({el:d,order:n(d.style.order)?+d.style.order:h+1})).sort((d,h)=>d.order-h.order).map(d=>d.el);for(let d=0;d<c.length;d++)c[d].marker=this._getLabel(d+1)}}_getLabel(o){let n=this._classes.filter(d=>this._allLabels.includes(d)).pop(),a=this._classes.filter(d=>this._allLabelSuffixes.includes(d)).pop();!n&&a&&(n="qti-labels-upper-alpha");let c="";switch(n){case"qti-labels-decimal":c=`${o}`;break;case"qti-labels-lower-alpha":c=`${String.fromCharCode(97+o-1)}`;break;case"qti-labels-upper-alpha":c=`${String.fromCharCode(65+o-1)}`;break}return a==="qti-labels-suffix-period"?c+=".":a==="qti-labels-suffix-parenthesis"&&(c+=")"),c}}return l([p({type:String,reflect:!0})],e.prototype,"class",1),e};var _s=b`
146
- :host {
147
- display: flex;
148
- flex-direction: column;
149
- // align-items: flex-start;
150
- }
151
- `;var Se=class extends Es(Nt(ne(f,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"){render(){return u` <slot name="prompt"></slot><slot part="slot"></slot>`}};Se.styles=_s,l([p({type:String})],Se.prototype,"orientation",2),Se=l([m("qti-choice-interaction")],Se);var et=class extends f{render(){return u`<slot></slot>`}process(){let t=new dr,e=[...this.children];t.process(e)}};et.styles=[b`
152
- :host {
153
- display: none;
154
- }
155
- `],et=l([m("qti-outcome-processing")],et);var dr=class{process(t){for(let e of t)e.process()}};var Cs=`<qti-response-processing>
156
- <qti-response-condition>
157
- <qti-response-if>
158
- <qti-match>
159
- <qti-variable identifier="RESPONSE"></qti-variable>
160
- <qti-correct identifier="RESPONSE"></qti-correct>
161
- </qti-match>
162
- <qti-set-outcome-value identifier="SCORE">
163
- <qti-base-value base-type="float">1</qti-base-value>
164
- </qti-set-outcome-value>
165
- </qti-response-if>
166
- <qti-response-else>
167
- <qti-set-outcome-value identifier="SCORE">
168
- <qti-base-value base-type="float">0</qti-base-value>
169
- </qti-set-outcome-value>
170
- </qti-response-else>
171
- </qti-response-condition>
172
- </qti-response-processing>`,qs=`<qti-response-processing>
173
- <qti-response-condition>
174
- <qti-response-if>
175
- <qti-is-null>
176
- <qti-variable identifier="RESPONSE"></qti-variable>
177
- </qti-is-null>
178
- <qti-set-outcome-value identifier="SCORE">
179
- <qti-base-value base-type="float">0.0</qti-base-value>
180
- </qti-set-outcome-value>
181
- </qti-response-if>
182
- <qti-response-else>
183
- <qti-set-outcome-value identifier="SCORE">
184
- <qti-map-response identifier="RESPONSE"> </qti-map-response>
185
- </qti-set-outcome-value>
186
- </qti-response-else>
187
- </qti-response-condition>
188
- </qti-response-processing>`,As=`<qti-response-processing>
189
- <qti-response-condition>
190
- <qti-response-if>
191
- <qti-is-null>
192
- <qti-variable identifier="RESPONSE"></qti-variable>
193
- </qti-is-null>
194
- <qti-set-outcome-value identifier="SCORE">
195
- <qti-base-value base-type="float">0</qti-base-value>
196
- </qti-set-outcome-value>
197
- </qti-response-if>
198
- <qti-response-else>
199
- <qti-set-outcome-value identifier="SCORE">
200
- <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>
201
- </qti-set-outcome-value>
202
- </qti-response-else>
203
- </qti-response-condition>
204
- </qti-response-processing>`;var ve=class extends f{render(){return u`<slot></slot>`}process(){let t=[...this.children];for(let e of t)e.process()}firstUpdated(t){if(this.getAttribute("template")){let e=this.getAttribute("template").split("/"),r=e[e.length-1].replace(".xml","");switch(this.innerHTML="",r){case"map_response":{this.appendChild(this.fragmentFromString(qs).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(As).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(Cs).firstElementChild.firstElementChild);break}}}fragmentFromString(t){return document.createRange().createContextualFragment(t)}};ve.styles=[b`
205
- :host {
206
- display: none;
207
- }
208
- `],ve=l([m("qti-response-processing")],ve);var X=class extends f{render(){return u`<slot></slot>`}process(){throw new Error("Not implemented")}};X=l([m("qti-rule")],X);var Pt=class extends X{get childExpression(){return this.firstElementChild}process(){let t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),r;return e.interpolationTable&&(r=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),r==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:Ye(r)}})),r)}};l([p({type:String})],Pt.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Pt);var ur=class extends X{render(){return u`<slot></slot>`}process(){let t=[...this.children];for(let e=0;e<t.length;e++){let r=t[e];if(r.calculate()){r.process();return}}}};customElements.define("qti-response-condition",ur);var hr=class extends X{process(){let t=this.getAttribute("identifier"),e=this.firstElementChild,s=new mr(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(s)?s.map(o=>Ye(o)):Ye(s)}}))}},mr=class{constructor(t){this.expression=t}process(){let t=this.expression?this.expression.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}return t}};customElements.define("qti-set-outcome-value",hr);var tt=class extends f{render(){return u`<slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let t=this.getSubRules();for(let e=0;e<t.length;e++)t[e].process()}};customElements.define("qti-response-else",tt);var rt=class extends tt{calculate(){return this.firstElementChild.calculate()}getSubRules(){let t=[];for(let e=1;e<this.children.length;e++)t.push(this.children[e]);return t}};customElements.define("qti-response-if",rt);var fr=class extends rt{render(){return u`${super.render()}`}};customElements.define("qti-response-else-if",fr);var x=class extends f{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(e=>{switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent,cardinality:"single"};case"qti-variable":{let r=e.getAttribute("identifier")||"";return this.assessmentItem.getVariable(r)}case"qti-multiple":{let s=e.getResult();return s.length>0?{identifier:"",baseType:s[0].baseType,value:s.map(o=>o.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let r=e.getAttribute("identifier")||"",s=this.assessmentItem.getResponse(r);return{baseType:s.baseType,value:s.correctResponse,cardinality:s.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(r){console.warn("default not sufficient")}return null}}}).filter(e=>e!==null)}render(){return u`<pre>${JSON.stringify(this.result,null,2)}</pre>
209
- <slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}get assessmentItem(){return this.closest("qti-assessment-item")}};x.styles=b`
210
- slot {
211
- display: none;
212
- }
213
- `,l([E()],x.prototype,"result",2);var P=class extends x{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var Vt=class extends ui(P){calculate(){return this.calculateChildren(Array.from(this.children))}};function ui(i){return class extends i{calculateChildren(e){return e.map(s=>{let o=s;if(!o.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let n=o.calculate();if(typeof n=="string")if(n==="true")n=!0;else if(n==="false")n=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return n}).every(s=>typeof s=="boolean"&&s)}}}customElements.define("qti-and",Vt);var Dt=class extends x{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent}};l([p({type:String,attribute:"base-type"})],Dt.prototype,"baseType",2);customElements.define("qti-base-value",Dt);var gr=class extends P{getResult(){let t=this.getVariables();if(this.children.length===2){let e=t[0],r=t[1];if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="multiple"){let s=e.value,o=r.value;return s.filter(c=>o.includes(c)).length>0}else if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="single"){let s=e.value;return r.value.includes(s)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}};customElements.define("qti-contains",gr);var br=class extends x{get interpretation(){return this.getAttribute("interpretation")||""}getResult(){let t=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(t);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",br);var Ot=class extends x{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let r=parseInt(this.getAttribute("figures")||"0");return isNaN(r)?(console.error("figures attribute is not a number"),null):r<0?(console.error("figures attribute is negative"),null):r<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):r}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(this.roundingMode===null)return null;if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let o=parseFloat(r.value),n=parseFloat(s.value);if(!isNaN(o)&&!isNaN(n))return this.roundingMode==="significantFigures"?o.toPrecision(this.figures)===n.toPrecision(this.figures):Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${o}, ${n}`);break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}};l([p({type:String})],Ot.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",Ot);var V=class{static compareSingleValues(t,e,r){switch(r){case"identifier":case"string":return t===e;case"integer":{let s=parseInt(t,10),o=parseInt(e,10);if(!isNaN(s)&&!isNaN(o))return s===o;console.error(`Cannot convert ${t} and/or ${e} to int.`);break}case"float":{let s=parseFloat(t),o=parseFloat(e);if(!isNaN(s)&&!isNaN(o))return s===o;console.error(`couldn't convert ${t} and/or ${e} to float.`);break}case"pair":case"directedPair":{let s=t.split(" ").sort(),o=e.split(" ").sort();if(s.length===2&&o.length===2)return r==="pair"&&(s.sort(),o.sort()),s.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${t} 2: ${e}`);break}}return!1}};var It=class extends x{constructor(){super(...arguments);this.toleranceMode="exact"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value)?(console.error("unexpected cardinality in qti equal"),!1):V.compareSingleValues(r.value,s.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};l([p({type:String})],It.prototype,"toleranceMode",2);customElements.define("qti-equal",It);var vr=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+r.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",vr);var yr=class extends P{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+r.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",yr);var xr=class extends x{getResult(){if(this.children.length===1){let t=this.getVariables();if(!t)return!0;let e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",xr);var Er=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+r.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",Er);var _r=class extends P{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+r.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",_r);var Ut=class extends x{getResult(){let t=this.assessmentItem.getResponse(this.identifier);if(!t)return console.warn(`Response ${this.identifier} can not be found`),null;let e=t.mapping,r=Array.isArray(t.value)?t.value:[t.value],s=0;for(let o of r){let n=e.mapEntries.find(a=>V.compareSingleValues(a.mapKey,o,t.baseType));n==null||n.mappedValue==null?s+=e.defaultValue:s+=n.mappedValue}return e.lowerBound!=null&&(s=Math.max(e.lowerBound,s)),e.upperBound!=null&&(s=Math.min(e.upperBound,s)),s}};l([p({type:String})],Ut.prototype,"identifier",2);customElements.define("qti-map-response",Ut);var Te=class extends f{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};l([p({attribute:"default-value",type:Number})],Te.prototype,"defaultValue",2),l([p({attribute:"lower-bound",type:Number})],Te.prototype,"lowerBound",2),l([p({attribute:"upper-bound",type:Number})],Te.prototype,"upperBound",2);customElements.define("qti-mapping",Te);var Cr=class i extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return i.match(e,r)}return console.error("unexpected number of children in match"),null}static match(t,e){var r;switch(e.cardinality){case"single":return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):V.compareSingleValues((r=t.value)==null?void 0:r.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;for(let s=0;s<t.value.length;s++)if(!V.compareSingleValues(e.value[s],t.value[s],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;let s=0;for(let o of e.value){let n=null,a=[...t.value];for(let c of a)if(V.compareSingleValues(o,c,e.baseType)){n=c;break}if(n!==null)a.splice(a.indexOf(n),1);else return!1;s++}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}};customElements.define("qti-match",Cr);var qr=class extends x{getResult(){let t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");let[e,r]=t;if(e.baseType!==r.baseType&&console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(e.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),e.value===null||r.value===null)return null;let s=e.value;return r.value.includes(s)}};customElements.define("qti-member",qr);var Ar=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return t}};customElements.define("qti-multiple",Ar);var wr=class extends x{render(){return u`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",wr);var Sr=class extends P{getResult(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let s=r.calculate();if(typeof s=="string")if(s==="true")s=!0;else if(s==="false")s=!1;else return console.error("unexpected value in qti-or, expected boolean"),null;return s}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",Sr);var Tr=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return t}};customElements.define("qti-ordered",Tr);var st=class extends f{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(s=>s.identifier===this.identifier))==null?void 0:r.value;return u`${JSON.stringify(t,null,2)}`}calculate(){let t=this.closest("qti-assessment-item"),e=this.identifier;return t.getVariable(e).value}};l([p({type:String})],st.prototype,"identifier",2),l([K({context:O,subscribe:!0}),E()],st.prototype,"itemContext",2);customElements.define("qti-printed-variable",st);var Rr=class extends x{getResult(){return this.getVariables().reduce((r,s)=>{if(s.baseType=="float"||s.baseType=="integer")try{return r*parseInt(s.value.toString())}catch(o){console.warn("can not convert to number")}else console.warn(`has another baseType ${s.baseType}`);return r},1)}};customElements.define("qti-product",Rr);var Ft=class extends x{constructor(){super(...arguments);this.caseSensitive="true"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti string-match"),!1;let o=this.caseSensitive==="true"?r.value:r.value.toLowerCase(),n=this.caseSensitive==="true"?s.value:s.value.toLowerCase();return V.compareSingleValues(o,n,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};l([p({type:String,attribute:"case-sensitive"})],Ft.prototype,"caseSensitive",2);customElements.define("qti-string-match",Ft);var $r=class extends x{constructor(){super(),this._expression=new kr(Array.from(this.children))}getResult(){return this._expression.calculate()}},kr=class{constructor(t){this.expressions=t}calculate(){return this.expressions.map(e=>{if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=e.calculate();return Number.isNaN(r)?(console.error("unexpected value in qti-sum, expected number"),null):Number(r)}).reduce((e,r)=>e+r,0)}};customElements.define("qti-sum",$r);var Mr=class extends x{getResult(){let t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}};customElements.define("qti-variable",Mr);var ce=class extends A{constructor(){super(...arguments);this._errorMessage=null;this.loadConfig=async(e,r)=>{e=this.removeDoubleSlashes(e);try{let s=await fetch(e);if(s.ok){let n=await s.json();for(let a in n.paths)r&&(n.paths[a]=this.getResolvablePath(n.paths[a],r));return n}}catch(s){}return null};this.getResolvablePathString=(e,r)=>(e=e.replace(/\.js$/,""),e!=null&&e.toLocaleLowerCase().startsWith("http")||!r?e:this.removeDoubleSlashes(`${r}/${e}`));this.getResolvablePath=(e,r)=>Array.isArray(e)?e.map(s=>this.getResolvablePathString(s,r)):this.getResolvablePathString(e,r)}convertQtiVariableJSON(e){for(let r in e)if(e.hasOwnProperty(r)){let s=e[r];if(s){for(let o in s)if(s.hasOwnProperty(o)){let n=s[o];if(Array.isArray(n))return n.map(String);if(n!=null)return String(n)}}}return null}startChecking(){this.intervalId=setInterval(()=>{let e=this.pci.getResponse(),r=this.pci.getResponse(),s=JSON.stringify(e);if(s!==this.rawResponse){this.rawResponse=s;let o=this.convertQtiVariableJSON(r);this.response=o,this.saveResponse(o)}},200)}stopChecking(){this.intervalId!==void 0&&clearInterval(this.intervalId)}validate(){return!0}set response(e){}getTAOConfig(e){let r=e.querySelectorAll("properties"),s={},o=a=>{let c={},d=a.getAttribute("key");if(d){let h=Array.from(a.children),g=h.map(v=>v.getAttribute("key"));g.length>0&&!g.find(v=>!Number.isInteger(+v))?c[d]=h.map(v=>n(v)):c[d]=a.textContent}return c},n=a=>{if(a){let c={};for(let d of a.children)c=q(q({},c),o(d));return c}};for(let a of r)return a.getAttribute("key")||(s=q(q({},s),n(a))),s;return console.log("Can not find qti-custom-interaction config"),null}register(e){this.pci=e;let r=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",s=r=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");s.classList.add("qti-customInteraction"),r=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let o=r=="IMS"?{properties:this.dataset,onready:()=>{console.log("onready")}}:this.getTAOConfig(this);r=="IMS"?e.getInstance(s,o,void 0):e.initialize(this.customInteractionTypeIdentifier,s.firstElementChild,o),r=="TAO"&&Array.from(this.querySelectorAll("link")).map(a=>a.getAttribute("href")).forEach(a=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=a,s.appendChild(c)}),this.startChecking()}connectedCallback(){super.connectedCallback(),define("qtiCustomInteractionContext",()=>({register:s=>{this.register(s)},notifyReady:()=>{}}));let e=this.buildRequireConfig();requirejs.config(e)(["require"],s=>{s([this.module])})}disconnectedCallback(){super.disconnectedCallback(),requirejs.undef(this.customInteractionTypeIdentifier);let e=requirejs.s.contexts;delete e[this.customInteractionTypeIdentifier],this.stopChecking()}buildRequireConfig(){let e={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;let r=this.getAttribute("data-base-url"),s=this.querySelector("qti-interaction-modules");if(s){let o=s.querySelectorAll("qti-interaction-module");for(let n of o){let a=n.getAttribute("id"),c=n.getAttribute("primary-path"),d=n.getAttribute("fallback-path");if(a&&c){let h=d?this.combineRequireResolvePaths(this.getResolvablePath(c,r),this.getResolvablePath(d,r)):this.getResolvablePath(c,r),g=e.paths[a]||[];e.paths[a]=this.combineRequireResolvePaths(g,h)}}}return e}combineRequireResolvePaths(e,r){let s=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];return s.concat(o)}removeDoubleSlashes(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}render(){return u`<slot></slot>${this._errorMessage&&u`<div style="color:red">
214
- <h1>Error</h1>
215
- ${this._errorMessage}
216
- </div>`}`}};l([p({type:String,attribute:"response-identifier"})],ce.prototype,"responseIdentifier",2),l([p({type:String,attribute:"module"})],ce.prototype,"module",2),l([p({type:String,attribute:"custom-interaction-type-identifier"})],ce.prototype,"customInteractionTypeIdentifier",2),l([E()],ce.prototype,"_errorMessage",2),ce=l([m("qti-portable-custom-interaction")],ce);var Bt=class i{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(t,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let r=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let s of r)this._dragCopy.style[s]=r.getPropertyValue(s);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let r=this;requestAnimationFrame(function(){r._touchEndCalled||r._dragCopy===null||(r._dragCopy.style.top=e.clientY-r._copyOffset.y+"px",r._dragCopy.style.left=e.clientX-r._copyOffset.x+"px")});let s=this._findDroppable(t);s!=this._lastTarget&&(this._dispatchEvent(s,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=s),this._currentDropContainer=s,this._currentDropContainer&&this._dispatchEvent(s,"dragover")}};return i._instance?i._instance:(i._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(t){t.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(t){this._touchBegin=Date.now();let{x:e,y:r}=this._getPoint(t);if(this._touchDown={x:e,y:r},this._dragSrc=t.currentTarget,this._canDrag=!0,this.dragOnClick){let s={clientX:e,clientY:r};this._dragRunning=!0,this._createDragCopy(t,s)}t.preventDefault()}_touchMove(t){if(this._canDrag&&this._dragSrc){let{x:e,y:r}=this._getPoint(t),s={clientX:e,clientY:r};this._getDelta(s)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(t,s),t.preventDefault()}}_touchEnd(t){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(r)}this._reset()}_touchCancel(t){this._reset()}_findDroppable(t){let e=this._getPoint(t),r=new Set;return this.getElementWithDropzone(document,e.x,e.y,r)}getElementWithDropzone(t,e,r,s){let o=t.elementFromPoint(e,r);if(o){if(s.has(o))return null;if(s.add(o),o.hasAttribute("dropzone"))return o;if(o.shadowRoot){let n=this.getElementWithDropzone(o.shadowRoot,e,r,s);if(n)return n}return o}return null}_getPoint(t,e){return t&&t.touches&&(t=t.touches[0]),{x:e?t.pageX:t.clientX,y:e?t.pageY:t.clientY}}_calculateDragCopyPosition(t){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=t.clientX-e.left,this._copyOffset.y=t.clientY-e.top}_getDelta(t){let e=Math.abs(t.clientX-this._touchDown.x),r=Math.abs(t.clientY-this._touchDown.y);return e+r}_dispatchEvent(t,e,r=!0){if(!t)return!1;let s=new CustomEvent(e,{bubbles:r,cancelable:!0});return s.dataTransfer=this._dataTransfer,t.dispatchEvent(s),s.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};var ws=(i,t,e)=>{class r extends i{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(n);let a=Array.from(t?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),a.forEach(c=>{c.setAttribute("dropzone","move"),c.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(c)});for(let c of a)this.observer=new MutationObserver(d=>{d.forEach(h=>{if(h.type==="attributes")switch(h.attributeName){case"disabled":{c.hasAttribute("disabled")?this.removeHandler(c):this.attachHandler(c);break}}})}),this.observer.observe(c,{attributes:!0})}attachHandler(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeHandler(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var n;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(n=this.observer)==null||n.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){return n.preventDefault(),n.currentTarget.setAttribute("active",""),n.dataTransfer.dropEffect="move",!1}dropHandler(n){n.preventDefault();let a=n.currentTarget,c=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),d=c||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return a?d.parentElement.getAttribute("identifier")!==a.getAttribute("identifier")&&a.appendChild(d):console.error(`cannot find droppable, target: ${n.target?JSON.stringify(n.target):"null"}`),a.removeAttribute("active"),!1}dragleaveHandler(n){return n.preventDefault(),n.currentTarget.removeAttribute("active"),n.dataTransfer.dropEffect="none",!1}}return l([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var Ss=(i,t,e)=>{class r extends i{}return r};var z=(i,t,e,r)=>{class s extends Ss(ws(i,e,r),r,t){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1;this.handleDragStart=a=>{a.dataTransfer.setData("text",a.currentTarget.getAttribute("identifier")),a.currentTarget.setAttribute("dragging",""),this.droppables.forEach(c=>c.setAttribute("enabled",""))};this.handleDragEnd=a=>{a.preventDefault(),this.droppables.forEach(d=>d.removeAttribute("enabled"));let c=a.currentTarget;c.removeAttribute("over"),c.removeAttribute("dragging"),(a.dataTransfer.dropEffect==="none"||a.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack&&this.placeDraggableBack(c),a.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())}}reInitDragAndDrop(a,c){if(this.classList.contains("qti-match-tabular"))return;a.filter(h=>!this.draggables||!this.draggables.get(h)).length>0&&(this.dragDropApi.addDraggables(a),a.forEach(h=>{this.draggables.set(h,{parent:h.parentElement,index:Array.from(h.parentNode.children).indexOf(h)}),h.setAttribute("qti-draggable","true"),h.addEventListener("dragstart",this.handleDragStart),h.addEventListener("dragend",this.handleDragEnd)}))}handleDragOptionsChanged(a,c){this.dragDropApi.copyStylesDragClone=c.copyStylesDragClone,this.dragDropApi.dragOnClick=c.dragOnClick}handleDisabledChange(a,c){this.draggables.forEach((d,h)=>{c?h.setAttribute("disabled",""):h.removeAttribute("disabled"),c?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}handleReadonlyChange(a,c){this.draggables.forEach((d,h)=>{c?h.setAttribute("readonly",""):h.removeAttribute("readonly"),c?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}firstUpdated(a){super.firstUpdated(a),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new Bt,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}placeDraggableBack(a){let c=this.draggables.get(a),d=c.index<=c.parent.children.length?c.index:c.parent.children.length-1,h=c.parent,g=c.parent.children[d];h.insertBefore(a,g),this.saveResponse(),this.checkMaxMatchAssociations()}reset(a=!0){this.draggables.forEach((c,d)=>{let h=c.parent.children,g=c.index<h.length?c.index:h.length;c.parent.insertBefore(d,h[g])}),a&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(a=>{let d=+(a.getAttribute("match-max")||1)<=(a.querySelectorAll('[qti-draggable="true"]').length||0);d?a.setAttribute("disabled",""):a.removeAttribute("disabled"),d?a.removeAttribute("dropzone"):a.setAttribute("dropzone","move")})}set response(a){this.classList.contains("qti-match-tabular")||(this.reset(!1),a!==null&&Array.isArray(a)&&a.forEach(c=>{let[d,...h]=c.split(" ").reverse();if(d){let g=this.droppables.find(y=>y.getAttribute("identifier")===d);h.forEach(y=>{let v=this.querySelector(`[identifier=${y}]`);g?v?(g.appendChild(v),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${y}`):console.error(`cannot find droppable with identifier: ${d}`)})}}))}validate(){let c=(e?Array.from(this.shadowRoot.querySelectorAll(r)):Array.from(this.querySelectorAll(r))).filter(d=>d.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=c}saveResponse(){let a;typeof this.getResponse=="function"?a=this.getResponse():a=this.droppables.map(c=>{let d=c.querySelectorAll('[qti-draggable="true"]'),h=Array.from(d).map(y=>y.getAttribute("identifier")),g=c.getAttribute("identifier");return[...h,g].join(" ")}),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}}return l([xs(t)],s.prototype,"reInitDragAndDrop",1),l([p({type:String,attribute:"response-identifier"})],s.prototype,"responseIdentifier",2),l([p({attribute:!1,type:Object})],s.prototype,"configuration",2),l([S("configuration")],s.prototype,"handleDragOptionsChanged",1),l([p({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([p({type:Boolean,reflect:!0})],s.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],s.prototype,"handleReadonlyChange",1),l([p({type:Number,reflect:!0,attribute:"min-associations"})],s.prototype,"minAssociations",2),l([p({type:Number,reflect:!0,attribute:"max-associations"})],s.prototype,"maxAssociations",2),s};var Re=class extends z(f,"qti-simple-associable-choice",!0,".dl"){render(){return u` <slot name="prompt"></slot>
217
- <slot name="qti-simple-associable-choice"></slot>
218
- ${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((t,e)=>u`<div part="associables-container">
219
- <div name="left${e}" part="drop-list" class="dl" identifier="droplist${e}_left"></div>
220
- <div name="right${e}" part="drop-list" class="dl" identifier="droplist${e}_right"></div>
221
- </div>`)}`}connectedCallback(){super.connectedCallback(),this._childrenMap=Array.from(this.querySelectorAll("qti-simple-associable-choice"))}};Re.styles=b`
222
- :host {
223
- display: block; /* necessary to calculate scaling position */
224
- }
225
- slot[name='qti-simple-associable-choice'] {
226
- display: flex;
227
- flex-wrap: wrap;
228
- gap: 0.5rem;
229
- }
230
- `,l([E()],Re.prototype,"_childrenMap",2),Re=l([m("qti-associate-interaction")],Re);var Y=class extends A{constructor(){super();this._errorMessage=null;this.handlePostMessage=this.handlePostMessage.bind(this)}connectedCallback(){super.connectedCallback();let e=this.data.startsWith("http")?this.data:We(this.baseItemUrl+"/"+this.data);fetch(e).then(r=>r.json()).then(r=>{this.manifest=r,this.setupCES()}).catch(r=>{this._errorMessage=r})}setupCES(){let e=this.shadowRoot.querySelector("#pciContainer"),r=e.contentWindow||e,s=e.contentDocument;window.addEventListener("message",this.handlePostMessage),s.open(),s.write(`
231
- <html>
232
- <head>
233
- <link href='${We(`${this.baseRefUrl}/${this.manifest.style[0]}`)}' rel="stylesheet" />
234
- <script src='${We(`${this.baseRefUrl}/${this.manifest.script[0]}`)}'></script>
235
- </head>
236
- <body></body>
237
- </html>
238
- `),s.close()}getIFrames(){let e=this.shadowRoot.querySelectorAll("iframe"),r=this.querySelectorAll("iframe"),s=[...e,...r];for(let o of s){let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;c&&this.getInnerIFrames(c,s)}catch(c){console.error("Error accessing nested iframe:",c)}}return s.forEach((o,n)=>{s.indexOf(o)!==n&&s.splice(n,1)}),s}getInnerIFrames(e,r=[]){return e.querySelectorAll("iframe").forEach(o=>{r.push(o);let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;this.getInnerIFrames(c,r)}catch(c){console.error("Error accessing nested iframe:",c)}else console.warn("Skipped cross-origin iframe:",n)}),r}postToWindowAndIframes(e,r){window.postMessage({type:e,data:r},"*");let s=this.getIFrames();for(let o of s)o.contentWindow&&o.contentWindow.postMessage({type:e,data:r},"*")}handlePostMessage(e){let{type:r,data:s}=e.data;switch(r){case"setResponse":this.rawResponse=s,this.saveResponse(s);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{let o=this.manifest.media.map(n=>n.startsWith("http")?n:We(this.baseRefUrl+"/"+n));this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}validate(){return this.rawResponse!==""}set response(e){this.rawResponse=e}disconnectedCallback(){window.removeEventListener("message",this.handlePostMessage),super.disconnectedCallback()}render(){return u`<iframe
239
- width=${this.getAttribute("width")}
240
- height=${this.getAttribute("height")}
241
- frameborder="0"
242
- title="pciContainer"
243
- id="pciContainer"
244
- >
245
- </iframe>
246
- ${this._errorMessage&&u`<div style="color:red">
247
- <h1>Error</h1>
248
- ${this._errorMessage}
249
- </div>`}`}};l([p({type:String,attribute:"response-identifier"})],Y.prototype,"responseIdentifier",2),l([p({type:String,attribute:"data"})],Y.prototype,"data",2),l([p({type:String,attribute:"data-base-item"})],Y.prototype,"baseItemUrl",2),l([p({type:String,attribute:"data-base-ref"})],Y.prototype,"baseRefUrl",2),l([p({type:String,attribute:"id"})],Y.prototype,"id",2),l([E()],Y.prototype,"_errorMessage",2),Y=l([m("qti-custom-interaction")],Y);var $e=class extends A{constructor(){super(...arguments);this.countAttempt="true"}validate(){return!0}set response(e){}render(){return u`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`}endAttempt(e){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}};l([p({type:String,attribute:"count-attempt"})],$e.prototype,"countAttempt",2),l([p({type:String})],$e.prototype,"title",2),$e=l([m("qti-end-attempt-interaction")],$e);var it=class extends z(f,"qti-gap-text",!1,"qti-gap"){render(){return u` <slot part="drags" name="qti-gap-text"></slot>
250
- <slot part="drops"></slot>`}set correctResponse(t){let e=[],r=Array.isArray(t)?t:[t];r&&(e=r.map(o=>{let n=o.split(" ");return{text:n[0],gap:n[1]}})),this.querySelectorAll("qti-gap").forEach((o,n)=>{var h,g,y,v;let a=o.getAttribute("identifier"),c=(h=e.find(C=>C.gap===a))==null?void 0:h.text,d=(g=this.querySelector(`qti-gap-text[identifier="${c}"]`))==null?void 0:g.textContent.trim();if(c&&d){if(!((y=o.nextElementSibling)!=null&&y.classList.contains("correct-option"))){let C=document.createElement("span");C.classList.add("correct-option"),C.textContent=d,o.insertAdjacentElement("afterend",C)}}else(v=o.nextElementSibling)!=null&&v.classList.contains("correct-option")&&o.nextElementSibling.remove()})}};it.styles=[b`
251
- :host {
252
- display: flex;
253
- align-items: flex-start;
254
- flex-direction: column;
255
- gap: 0.5rem;
256
- }
257
-
258
- :host(.qti-choices-top) {
259
- flex-direction: column;
260
- }
261
- :host(.qti-choices-bottom) {
262
- flex-direction: column-reverse;
263
- }
264
- :host(.qti-choices-left) {
265
- flex-direction: row;
266
- }
267
- :host(.qti-choices-right) {
268
- flex-direction: row-reverse;
269
- }
270
- /* [part='drops'] , */
271
- [part='drags'] {
272
- display: flex;
273
- align-items: flex-start;
274
- flex: 1;
275
- gap: 0.5rem;
276
- }
277
- `],it=l([m("qti-gap-match-interaction")],it);var Ts=(i,t,e)=>{let r=new Map;for(let s=t;s<=e;s++)r.set(i[s],s);return r},jt=Q(class extends B{constructor(i){if(super(i),i.type!==oe.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);let s=[],o=[],n=0;for(let a of i)s[n]=r?r(a,n):n,o[n]=e(a,n),n++;return{values:o,keys:s}}render(i,t,e){return this.dt(i,t,e).values}update(i,[t,e,r]){var w;let s=bs(i),{values:o,keys:n}=this.dt(t,e,r);if(!Array.isArray(s))return this.ut=n,o;let a=(w=this.ut)!=null?w:this.ut=[],c=[],d,h,g=0,y=s.length-1,v=0,C=o.length-1;for(;g<=y&&v<=C;)if(s[g]===null)g++;else if(s[y]===null)y--;else if(a[g]===n[v])c[v]=ie(s[g],o[v]),g++,v++;else if(a[y]===n[C])c[C]=ie(s[y],o[C]),y--,C--;else if(a[g]===n[C])c[C]=ie(s[g],o[C]),we(i,c[C+1],s[g]),g++,C--;else if(a[y]===n[v])c[v]=ie(s[y],o[v]),we(i,s[g],s[y]),y--,v++;else if(d===void 0&&(d=Ts(n,v,C),h=Ts(a,g,y)),d.has(a[g]))if(d.has(a[y])){let R=h.get(n[v]),ye=R!==void 0?s[R]:null;if(ye===null){let mt=we(i,s[g]);ie(mt,o[v]),c[v]=mt}else c[v]=ie(ye,o[v]),we(i,s[g],ye),s[R]=null;v++}else $t(s[y]),y--;else $t(s[g]),g++;for(;v<=C;){let R=we(i,c[C+1]);ie(R,o[v]),c[v++]=R}for(;g<=y;){let R=s[g++];R!==null&&$t(R)}return this.ut=n,gs(i,c),M}});function ke(i,t,e,r){switch(i){case"circle":{let[s,o,n]=t,a=s/e.width*100,c=o/e.height*100,d=n/e.width*100;r.style.left=a-d+"%",r.style.top=c-d+"%",r.style.width=r.style.height=4*d+"px",r.style.borderRadius="9999px"}break;case"rect":{let[s,o,n,a]=t,c=s/e.width*100,d=o/e.height*100,h=n/e.width*100,g=a/e.height*100;r.style.left=c+"%",r.style.top=d+"%",r.style.width=h-c+"%",r.style.height=g-d+"%"}break;case"poly":{let s=t.reduce((w,R,ye,mt)=>{if(ye%2===1){let ks=w.pop();w[w.length]={x:ks,y:mt[ye]}}else w.push(R);return w},[]),o=Math.min(...s.map(w=>w.x)),n=Math.max(...s.map(w=>w.x)),a=Math.min(...s.map(w=>w.y)),c=Math.max(...s.map(w=>w.y)),d=o/e.width*100,h=a/e.height*100,g=n/e.width*100,y=c/e.height*100;r.style.left=o/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=g-d+"%",r.style.height=y-h+"%";let C=s.map(w=>({x:(w.x-o)/(n-o)*100,y:(w.y-a)/(c-a)*100})).map(w=>Math.round(w.x)+"% "+Math.round(w.y)+"%").join(",");r.style.clipPath=`polygon(${C})`}break;default:break}}var W=class extends A{constructor(){super();this.startPoint=null;this.endPoint=null;this._lines=[];this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}reset(){this._lines=[]}validate(){return this._lines.length>0}set response(e){Array.isArray(e)&&(this._lines=e)}render(){var e,r,s,o;return u`<slot name="prompt"></slot>
278
- <line-container>
279
- <svg
280
- width=${F((e=this.grImage[0])==null?void 0:e.width)}
281
- height=${F((r=this.grImage[0])==null?void 0:r.height)}
282
- viewbox="0 0 ${(s=this.grImage[0])==null?void 0:s.width} ${(o=this.grImage[0])==null?void 0:o.height}"
283
- >
284
- ${jt(this._lines,n=>n,(n,a)=>sr`
285
- <line
286
- part="line"
287
- x1=${parseInt(this.querySelector("[identifier="+n.split(" ")[0]+"]").style.left)}
288
- y1=${parseInt(this.querySelector("[identifier="+n.split(" ")[0]+"]").style.top)}
289
- x2=${parseInt(this.querySelector("[identifier="+n.split(" ")[1]+"]").style.left)}
290
- y2=${parseInt(this.querySelector("[identifier="+n.split(" ")[1]+"]").style.top)}
291
- stroke="red"
292
- stroke-width="3"
293
- @click=${c=>{c.stopPropagation(),this._lines=this._lines.filter((d,h)=>h!==a),this.saveResponse(this._lines)}}
294
- />
295
- `)}
296
- ${this.startPoint&&sr`<line
297
- part="point"
298
- x1=${this.startCoord.x}
299
- y1=${this.startCoord.y}
300
- x2=${this.mouseCoord.x}
301
- y2=${this.mouseCoord.y}
302
- stroke="red"
303
- stroke-width="3"
304
- />`}
305
- </svg>
306
- <slot></slot>
307
- </line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,o=s.getAttribute("coords"),n=s.getAttribute("shape"),a=o.split(",").map(c=>parseInt(c));ke(n,a,r,s)}firstUpdated(e){super.firstUpdated(e),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",r=>{this.mouseCoord={x:r.clientX-this.grImage[0].getBoundingClientRect().left,y:r.clientY-this.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(r=>{r.style.left=r.getAttribute("coords").split(",")[0]+"px",r.style.top=r.getAttribute("coords").split(",")[1]+"px",r.addEventListener("click",s=>{this.startPoint?this.endPoint||(this.endPoint=s.target,this._lines=[...this._lines,this.startPoint.getAttribute("identifier")+" "+this.endPoint.getAttribute("identifier")],this.saveResponse(this._lines),this.startPoint=null,this.endPoint=null):(this.startPoint=s.target,this.startCoord={x:this.startPoint.getAttribute("coords").split(",")[0],y:this.startPoint.getAttribute("coords").split(",")[1]})})})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};W.styles=[b`
308
- slot:not([name='prompt']) {
309
- // position: relative; /* qti-hotspot-choice relative to the slot */
310
- display: block;
311
- width: fit-content; /* hotspots not stretching further if image is at max size */
312
- }
313
- ::slotted(img) {
314
- /* image not selectable anymore */
315
- pointer-events: none;
316
- user-select: none;
317
- }
318
- ::slotted(qti-associable-hotspot) {
319
- transform: translate(-50%, -50%);
320
- }
321
- line-container {
322
- display: block;
323
- position: relative;
324
- }
325
- svg {
326
- position: absolute;
327
- top: 0px;
328
- left: 0px;
329
- }
330
- `],l([E()],W.prototype,"_lines",2),l([E()],W.prototype,"startCoord",2),l([E()],W.prototype,"mouseCoord",2),l([ze("svg")],W.prototype,"svgContainer",2),l([ps({selector:"img"})],W.prototype,"grImage",2),W=l([m("qti-graphic-associate-interaction")],W);var ot=class extends z(f,"qti-gap-img",!1,"qti-associable-hotspot"){render(){return u` <slot></slot>
331
- <slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),o=r.getAttribute("shape"),n=s.split(",").map(a=>parseInt(a));switch(o){case"circle":{let[a,c,d]=n;r.style.left=a-d+"px",r.style.top=c-d+"px",r.style.width=r.style.height=2*d+"px"}break;case"rect":{let[a,c,d,h]=n;r.style.left=a+"px",r.style.top=c+"px",r.style.width=d-a+"px",r.style.height=h-c+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};ot.styles=b`
332
- :host {
333
- display: inline-block;
334
- position: relative;
335
- }
336
- slot[name='qti-gap-img'] {
337
- display: flex;
338
- gap: 1rem;
339
- }
340
- `,ot=l([m("qti-graphic-gap-match-interaction")],ot);var nt=class extends ne(f,"qti-hotspot-choice"){render(){return u`
341
- <slot name="prompt"></slot>
342
- <!-- slot for the prompt -->
343
- <slot></slot>
344
- <!-- slot for the image and hotspots -->
345
- `}setHotspotOrder(t){let{identifier:e}=t.detail,r=this._choiceElements.find(o=>o.getAttribute("identifier")===e),s=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(o=>o.order>0).length>=s){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(o=>!!o.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(o=>(o.order>o.order&&o.order--,o)),r.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),o=r.getAttribute("shape"),n=s.split(",").map(a=>parseInt(a));ke(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this.setHotspotOrder),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this.setHotspotOrder),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};nt.styles=[b`
346
- slot:not([name='prompt']) {
347
- position: relative; /* qti-hotspot-choice relative to the slot */
348
- display: block;
349
- width: fit-content; /* hotspots not stretching further if image is at max size */
350
- }
351
- ::slotted(img) {
352
- /* image not selectable anymore */
353
- pointer-events: none;
354
- user-select: none;
355
- }
356
- `],nt=l([m("qti-graphic-order-interaction")],nt);var at=class extends ne(f,"qti-hotspot-choice"){render(){return u`
357
- <slot name="prompt"></slot>
358
- <!-- slot for the prompt -->
359
- <slot></slot>
360
- <!-- slot for the image and hotspots -->
361
- `}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),o=r.getAttribute("shape"),n=s.split(",").map(a=>parseInt(a));ke(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};at.styles=[b`
362
- slot:not([name='prompt']) {
363
- position: relative; /* qti-hotspot-choice relative to the slot */
364
- display: block;
365
- width: fit-content; /* hotspots not stretching further if image is at max size */
366
- }
367
- ::slotted(img) {
368
- /* image not selectable anymore */
369
- pointer-events: none;
370
- user-select: none;
371
- /* width:100%; */
372
- }
373
- `],at=l([m("qti-hotspot-interaction")],at);var pe=class extends f{constructor(){super(...arguments);this.matchMin=0;this.matchMax=1;this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return u`
374
- <slot></slot>
375
- <slot name="qti-simple-associable-choice"></slot>
376
- `}};pe.styles=b`
377
- :host {
378
- display: flex;
379
- user-select: none;
380
- }
381
- slot {
382
- width: 100%;
383
- display: block;
384
- }
385
- slot[name='qti-simple-associable-choice'] {
386
- width: 100%;
387
- }
388
- `,l([p({type:Number,attribute:"match-min"})],pe.prototype,"matchMin",2),l([p({type:Number,attribute:"match-max"})],pe.prototype,"matchMax",2),l([p({type:Boolean,attribute:"fixed"})],pe.prototype,"fixed",2),pe=l([m("qti-simple-associable-choice")],pe);var de=class extends z(f,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.lastCheckedRadio=null;this.response=[];this.correctOptions=[];this.responseIdentifier="";this.handleRadioClick=e=>{let r=e.target;this.lastCheckedRadio===r?(r.checked=!1,this.lastCheckedRadio=null,this.handleRadioChange(e)):this.lastCheckedRadio=r};this.handleRadioChange=e=>{let r=e.target,s=r.value,o=r.name,n=r.type;r.checked?(this.response?this.response.indexOf(s)===-1&&(n==="radio"&&(this.response=this.response.filter(a=>a.indexOf(o)===-1)),this.response=[...this.response,s]):this.response=[s],this.lastCheckedRadio=r):(this.response=this.response.filter(a=>a!==s),this.lastCheckedRadio=null),this.requestUpdate(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(this.response)?[...this.response]:this.response}}))}}connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[]}set correctResponse(e){if(e===""){this.correctOptions=[];return}else Array.isArray(e)&&(this.correctOptions=e)}render(){return this.classList.contains("qti-match-tabular")?u`
389
- <slot name="prompt"></slot>
390
- <table>
391
- <tr>
392
- <td></td>
393
- ${this.cols.map((e,r)=>u`<th part="r-header">${ae(e.innerHTML)}</th>`)}
394
- </tr>
395
-
396
- ${this.rows.map((e,r)=>u`<tr>
397
- <td part="c-header">${ae(e.innerHTML)}</td>
398
- ${this.cols.map((s,o)=>{let n=e.getAttribute("identifier"),a=s.getAttribute("identifier"),c=`${n} ${a}`,d=this.response.filter(v=>v.split(" ")[0]===n).length||0,h=this.response.includes(c),g=`rb ${h?"rb-checked":""} ${this.correctOptions.includes(c)?"rb-correct":""}`,y=this.correctOptions.length>0?!0:e.matchMax===1?!1:d>=e.matchMax&&!h;return u`<td>
399
- <input
400
- type=${e.matchMax===1?"radio":"checkbox"}
401
- part=${g}
402
- name=${n}
403
- value=${c}
404
- .disabled=${y}
405
- @change=${v=>this.handleRadioChange(v)}
406
- @click=${v=>e.matchMax===1?this.handleRadioClick(v):null}
407
- />
408
- </td>`})}
409
- </tr>`)}
410
- </table>
411
- `:u`<slot name="prompt"></slot> <slot></slot>`}};de.styles=[b`
412
- :host {
413
- display: flex;
414
- flex-direction: column;
415
- gap: 0.5rem;
416
- }
417
-
418
- /* :host(.qti-choices-top) {
419
- flex-direction: column;
420
- } */
421
- :host(.qti-choices-bottom) {
422
- flex-direction: column-reverse;
423
- }
424
- :host(.qti-choices-left) {
425
- flex-direction: row;
426
- }
427
- :host(.qti-choices-right) {
428
- flex-direction: row-reverse;
429
- }
430
- `],l([E()],de.prototype,"response",2),l([E()],de.prototype,"correctOptions",2),l([p({type:String,attribute:"response-identifier"})],de.prototype,"responseIdentifier",2),de=l([m("qti-match-interaction")],de);var lt=class extends A{constructor(){super();this.value=0}reset(){}validate(){return!0}set response(e){}static get properties(){return T(q({},A.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return u` <slot name="prompt"></slot>
431
- <slot></slot>`}connectedCallback(){super.connectedCallback();let e=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");e&&e.addEventListener("ended",()=>{this.value++,this.saveResponse(this.value.toString())})}};lt.styles=[b``],lt=l([m("qti-media-interaction")],lt);var ee=class extends Nt(z(f,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"){constructor(){super(...arguments);this.nrChoices=0;this.correctResponses=[];this.showCorrectResponses=!1}render(){let e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),u` <slot name="prompt"> </slot>
432
- <div part="container">
433
- <slot part="drags"> </slot>
434
- <div part="drops">
435
- ${Array.from(Array(this.nrChoices)).map((r,s)=>u`<drop-list part="drop-list" identifier="droplist${s}"></drop-list>${this.showCorrectResponses&&this.correctResponses.length>s?ae(`<span part='correct-response'>${this.correctResponses[s]}</span>`):""}`)}
436
- </div>
437
- </div>`}set correctResponse(e){if(e===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(e)?e:[e]).forEach((s,o)=>{let n=this.querySelector(`qti-simple-choice[identifier="${s}"]`);n||(n=this.shadowRoot.querySelector(`qti-simple-choice[identifier="${s}"]`));let a=n==null?void 0:n.textContent.trim();this.correctResponses=[...this.correctResponses,a]}),this.showCorrectResponses=!0}getResponse(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(s=>{let o=s.querySelectorAll('[qti-draggable="true"]');return[...Array.from(o).map(a=>a.getAttribute("identifier"))].join(" ")})}async firstUpdated(e){super.firstUpdated(e),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(r=>r.setAttribute("part","qti-simple-choice"))}};ee.styles=[b`
438
- [part='drags'] {
439
- display: flex;
440
- align-items: flex-start;
441
- flex: 1;
442
- }
443
-
444
- [part='drops'] {
445
- flex: 1;
446
- display: grid;
447
- grid-auto-flow: column;
448
- grid-auto-columns: 1fr;
449
- }
450
-
451
- :host([orientation='horizontal']) [part='drags'] {
452
- flex-direction: row;
453
- }
454
- :host([orientation='horizontal']) [part='drops'] {
455
- grid-auto-flow: column;
456
- }
457
- :host([orientation='vertical']) [part='drags'] {
458
- flex-direction: column;
459
- }
460
- :host([orientation='vertical']) [part='drops'] {
461
- grid-auto-flow: row;
462
- }
463
-
464
- [part='drop-list'] {
465
- display: block;
466
- flex: 1;
467
- }
468
-
469
- [part='container'] {
470
- display: flex;
471
- gap: 0.5rem;
472
- }
473
- :host(.qti-choices-top) [part='container'] {
474
- flex-direction: column;
475
- }
476
- :host(.qti-choices-bottom) [part='container'] {
477
- flex-direction: column-reverse;
478
- }
479
- :host(.qti-choices-left) [part='container'] {
480
- flex-direction: row;
481
- }
482
- :host(.qti-choices-right) [part='container'] {
483
- flex-direction: row-reverse;
484
- }
485
- `],l([E()],ee.prototype,"nrChoices",2),l([E()],ee.prototype,"correctResponses",2),l([E()],ee.prototype,"showCorrectResponses",2),l([p({type:String})],ee.prototype,"orientation",2),ee=l([m("qti-order-interaction")],ee);var Xt=class extends f{render(){return u`<slot></slot>`}};Xt.styles=[b`
486
- :host {
487
- display: block;
488
- }
489
- ::slotted(img) {
490
- position: absolute;
491
- cursor: move;
492
- user-select: none;
493
- left: 50%;
494
- transform: translateX(-50%);
495
- }
496
- `];customElements.define("qti-position-object-interaction",Xt);var ct=class extends f{render(){return u`<slot></slot>`}constructor(){super(),this.removeMoveListener=this.removeMoveListener.bind(this),this.dragElementHandler=this.dragElementHandler.bind(this)}dragElementHandler(t){t.preventDefault();let e=t.clientX-this.startX,r=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+r+"px",this.startX=t.clientX,this.startY=t.clientY}firstUpdated(t){super.firstUpdated(t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",e=>{this.startX=e.clientX,this.startY=e.clientY,document.addEventListener("mousemove",this.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}removeMoveListener(t){document.removeEventListener("mousemove",this.dragElementHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}};ct.styles=[b`
497
- :host {
498
- display: inline-block;
499
- position: relative;
500
- }
501
- `],ct=l([m("qti-position-object-stage")],ct);var Rs="important",hi=" !"+Rs,$s=Q(class extends B{constructor(i){var t;if(super(i),i.type!==oe.ATTRIBUTE||i.name!=="style"||((t=i.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,e)=>{let r=i[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(i,[t]){let{style:e}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(let r in t){let s=t[r];if(s!=null){this.ft.add(r);let o=typeof s=="string"&&s.endsWith(hi);r.includes("-")||o?e.setProperty(r,o?s.slice(0,-11):s,o?Rs:""):e[r]=s}}return M}});var ue=class extends A{constructor(){super(...arguments);this.maxChoices=1/0;this.minChoices=0;this._points=[];this._imgElement=null;this._onImageClick=e=>{if(this._points.length<this.maxChoices){let r=e.offsetX,s=e.offsetY;this._points=[...this._points,`${r} ${s}`],this.saveResponse(this._points)}}}render(){return u` <slot name="prompt"></slot>
502
- <point-container>
503
- ${jt(this._points,e=>e,(e,r)=>u`
504
- <button
505
- part="point"
506
- style=${$s({position:"absolute",transform:"translate(-50%, -50%)",left:`${e.split(" ")[0]}px`,top:`${e.split(" ")[1]}px`})}
507
- aria-label="Remove point at ${e}"
508
- @click=${s=>{s.stopPropagation(),this._points=this._points.filter((o,n)=>n!==r),this.saveResponse(this._points)}}
509
- ></button>
510
- `)}
511
- <slot></slot>
512
- </point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set response(e){this._points=Array.isArray(e)?e:[e]}firstUpdated(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}disconnectedCallback(){super.disconnectedCallback(),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}};ue.styles=[b`
513
- :host {
514
- display: block;
515
- }
516
- point-container {
517
- display: block;
518
- position: relative;
519
- }
520
- `],l([p({type:Number,attribute:"max-choices"})],ue.prototype,"maxChoices",2),l([p({type:Number,attribute:"min-choices"})],ue.prototype,"minChoices",2),l([E()],ue.prototype,"_points",2),ue=l([m("qti-select-point-interaction")],ue);var $=class extends A{constructor(){super();this.stepLabel=!1;this.reverse=!1;this._handleDisabledChange=(e,r)=>{};this._handleReadonlyChange=(e,r)=>{};this.csLive=getComputedStyle(this)}set min(e){this._min=e,this.value=e,this.style.setProperty("--min",`${this._min}`)}get min(){return this._min}set max(e){this._max=e,this.style.setProperty("--max",`${this._max}`)}get max(){return this._max}set step(e){this._step=e,this.style.setProperty("--step",`${this._step}`)}get step(){return this._step}reset(){}validate(){return!0}set response(e){if(Array.isArray(e)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}let r=parseInt(e);if(Number.isNaN(r)){console.error("QtiSliderInteraction: response is not a number");return}this.value=r}render(){this.value<this.min&&(this.value=this.min),this.value>this.max&&(this.value=this.max);let e=(this.value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage",`${e}%`),this.setAttribute("aria-valuenow",this.value.toString()),u`<slot name="prompt"></slot>
521
- <div id="slider" part="slider">
522
- ${this.csLive.getPropertyValue("--show-bounds")=="true"?u`<div id="bounds" part="bounds">
523
- <div>${this._min}</div>
524
- <div>${this._max}</div>
525
- </div>`:_}
526
- ${this.csLive.getPropertyValue("--show-ticks")=="true"?u`<div id="ticks" part="ticks"></div>`:_}
527
- <div id="rail" part="rail" @mousedown=${this._onMouseDown} @touchstart=${this._onTouchMove}>
528
- <div id="knob" part="knob">
529
- ${this.csLive.getPropertyValue("--show-value")=="true"?u`<div id="value" part="value">${this.value}</div>`:_}
530
- </div>
531
- </div>
532
- </div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let r=a=>{let{x:c}=this.getPositionFromEvent(a),d=c-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(d),a.stopPropagation()},s=()=>{document.removeEventListener("touchmove",r),document.removeEventListener("touchend",s),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",r),document.addEventListener("touchend",s);let{x:o}=this.getPositionFromEvent(e),n=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),e.stopPropagation()}_onMouseDown(e){let r=n=>{let a=n.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),n.preventDefault(),n.stopPropagation()},s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s);let o=e.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),e.preventDefault(),e.stopPropagation()}calculateValue(e){let r=this.min+(this.max-this.min)*e/this._rail.getBoundingClientRect().width,s=this.min+Math.round((r-this.min)/this._step)*this._step;this.value=s}getPositionFromEvent(e){let r;if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){let s=typeof e.originalEvent=="undefined"?e:e.originalEvent,o=s.touches[0]||s.changedTouches[0];r={x:o.pageX,y:o.pageY}}else(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave")&&(r={x:e.clientX,y:e.clientY});return r}};$.styles=[b``],l([ze("#knob")],$.prototype,"_knob",2),l([ze("#rail")],$.prototype,"_rail",2),l([p({type:Number})],$.prototype,"value",2),l([p({type:Boolean,attribute:"step-label"})],$.prototype,"stepLabel",2),l([p({type:Boolean})],$.prototype,"reverse",2),l([p({type:Number,attribute:"lower-bound"})],$.prototype,"min",1),l([p({type:Number,attribute:"upper-bound"})],$.prototype,"max",1),l([p({type:Number,attribute:"step"})],$.prototype,"step",1),l([S("disabled",{waitUntilFirstUpdate:!0})],$.prototype,"_handleDisabledChange",2),l([S("readonly",{waitUntilFirstUpdate:!0})],$.prototype,"_handleReadonlyChange",2),$=l([m("qti-slider-interaction")],$);var pt=class extends f{render(){return u`<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(t){var r,s,o;let e=Array.from((s=(r=this.firstElementChild)==null?void 0:r.childNodes)!=null?s:[]).find(n=>n.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","fn","item",(o=e.textContent)!=null?o:"")}catch(n){console.error("custom-operator contains invalid javascript code",n)}}calculate(){let t={variable:r=>{var s,o,n;return(n=(o=(s=this._context)==null?void 0:s.variables.find(a=>a.identifier===r))==null?void 0:o.value)!=null?n:""},correct:r=>{var s,o,n;return(n=(o=(s=this._context)==null?void 0:s.variables.find(a=>a.identifier===r))==null?void 0:o.correctResponse)!=null?n:""}},e={getVariable:r=>{var s;return(s=this._context)==null?void 0:s.variables.find(o=>o.identifier===r)},updateOutcomeVariable:(r,s)=>{this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:r,value:s}}))},updateResponseVariable:(r,s)=>{this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:r,response:s}}))}};return this.operatorFunction(this._context,t,e)}};l([K({context:O,subscribe:!0}),E()],pt.prototype,"_context",2),pt=l([m("qti-custom-operator")],pt);var dt=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,cancelable:!1,composed:!0}))}render(){return u` <slot name="qti-gap-img"></slot> `}};dt.styles=b`
533
- :host {
534
- display: flex;
535
- user-select: none;
536
- position: absolute;
537
- }
538
- `,dt=l([m("qti-associable-hotspot")],dt);var Me=class extends f{constructor(){super(...arguments);this.tabindex=0}render(){return u` <slot name="qti-gap-text"></slot>`}};Me.styles=b`
539
- :host {
540
- display: flex;
541
- user-select: none;
542
- }
543
- `,l([p({type:Number,reflect:!0})],Me.prototype,"tabindex",2),Me=l([m("qti-gap")],Me);var Le=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};Le.styles=b`
544
- :host {
545
- display: flex;
546
- user-select: none;
547
- }
548
- `,l([p({type:Number,reflect:!0})],Le.prototype,"tabindex",2),Le=l([m("qti-gap-img")],Le);var He=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return u`<slot></slot>`}};He.styles=b`
549
- :host {
550
- display: inline-flex;
551
- user-select: none;
552
- }
553
- `,l([p({type:Number,reflect:!0})],He.prototype,"tabindex",2),He=l([m("qti-gap-text")],He);var Ne=class extends k{};Ne.styles=b`
554
- :host {
555
- display: flex;
556
- user-select: none;
557
- position: absolute;
558
- }
559
- `,l([p({attribute:"aria-ordervalue",type:Number,reflect:!0})],Ne.prototype,"order",2),Ne=l([m("qti-hotspot-choice")],Ne);var ut=class extends k{render(){return u`<div part="ch"><div part="cha"></div></div>
560
- <slot></slot> `}};ut.styles=b`
561
- :host {
562
- display: flex;
563
- user-select: none;
564
- }
565
- `,ut=l([m("qti-hottext")],ut);var ht=class extends f{static get styles(){return[b`
566
- :host {
567
- display: block;
568
- cursor: pointer;
569
- }
570
- `]}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("click",this._onSelectInlineChoice)}render(){return u` <slot></slot> `}_onSelectInlineChoice(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}};l([p({type:String})],ht.prototype,"identifier",2),ht=l([m("qti-inline-choice")],ht);var Pe=class extends k{render(){return u`<div part="ch">
571
- <div part="cha"></div>
572
- </div>
573
- ${this.marker?u`<div id="label">${this.marker}</div>`:_}
574
- <slot part="slot"></slot> `}};Pe.styles=b`
575
- :host {
576
- display: flex;
577
- user-select: none;
578
- }
579
- slot {
580
- width: 100%;
581
- display: block;
582
- }
583
- [part='ch'] {
584
- display: flex;
585
- flex-shrink: 0;
586
- align-items: center;
587
- justify-content: center;
588
- }
589
- `,l([p({type:String,attribute:!1})],Pe.prototype,"marker",2),Pe=l([m("qti-simple-choice")],Pe);console.log("%cC\xBFTO%cLab%c: qti-components loaded","font-weight:bold; color:green",'font-family: "PT Sans", font-weight:bold; color:green; font-size: smaller;vertical-align: sub',"font-weight:unset");export{A as Interaction,st as QtPrintedVariable,Vt as QtiAnd,L as QtiAssessmentItem,qe as QtiAssessmentStimulusRef,dt as QtiAssociableHotspot,Re as QtiAssociateInteraction,Dt as QtiBaseValue,k as QtiChoice,Se as QtiChoiceInteraction,Tt as QtiCompanionMaterialsInfo,P as QtiConditionExpression,gr as QtiContains,Rt as QtiContentBody,br as QtiCorrect,Y as QtiCustomInteraction,pt as QtiCustomOperator,$e as QtiEndAttemptInteraction,It as QtiEqual,Ot as QtiEqualRounded,x as QtiExpression,j as QtiExtendedTextInteraction,Ke as QtiFeedbackBlock,Je as QtiFeedbackInline,Me as QtiGap,Le as QtiGapImg,it as QtiGapMatchInteraction,He as QtiGapText,W as QtiGraphicAssociateInteraction,ot as QtiGraphicGapMatchInteraction,nt as QtiGraphicOrderInteraction,vr as QtiGt,yr as QtiGte,Ne as QtiHotspotChoice,at as QtiHotspotInteraction,ut as QtiHottext,Ht as QtiHottextInteraction,ht as QtiInlineChoice,le as QtiInlineChoiceInteraction,xr as QtiIsNull,Pt as QtiLookupOutcomeValue,Er as QtiLt,_r as QtiLte,Ut as QtiMapResponse,Te as QtiMapping,Cr as QtiMatch,de as QtiMatchInteraction,lt as QtiMediaInteraction,qr as QtiMember,Ze as QtiModalFeedback,Ar as QtiMultiple,wr as QtiNot,Sr as QtiOr,ee as QtiOrderInteraction,Tr as QtiOrdered,I as QtiOutcomeDeclaration,et as QtiOutcomeProcessing,dr as QtiOutcomeProcessingProcessor,ce as QtiPortableCustomInteraction,ct as QtiPositionObjectStage,Rr as QtiProduct,wt as QtiPrompt,ur as QtiResponseCondition,G as QtiResponseDeclaration,tt as QtiResponseElse,fr as QtiResponseElseIf,rt as QtiResponseIf,ve as QtiResponseProcessing,U as QtiRubricBlock,X as QtiRule,Xt as QtiSPositionObjectInteraction,ue as QtiSelectPointInteraction,hr as QtiSetOutcomeValue,mr as QtiSetOutcomeValueRule,pe as QtiSimpleAssociableChoice,Pe as QtiSimpleChoice,$ as QtiSliderInteraction,Ft as QtiStringMatch,St as QtiStylesheet,$r as QtiSum,kr as QtiSumExpression,N as QtiTextEntryInteraction,Mr as QtiVariable,O as itemContext,ds as itemContextVariables,ui as qtiAndMixin,us as qtiTransformItem,un as qtiTransformManifest,hn as qtiTransformTest};
590
- /*! Bundled license information:
1
+ function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function r(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function i(t,e,n,r,i,o,a){try{var s=t[o](a);var u=s.value}catch(t){n(t);return}if(s.done){e(u)}else{Promise.resolve(u).then(r,i)}}function o(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,u,"next",t)}function u(t){i(a,r,o,s,u,"throw",t)}s(undefined)})}}function a(t,e,n){e=f(e);return x(t,I()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function s(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function u(t,e,n){if(I()){u=Reflect.construct}else{u=function t(t,e,n){var r=[null];r.push.apply(r,e);var i=Function.bind.apply(t,r);var o=new i;if(n)S(o,n.prototype);return o}}return u.apply(null,arguments)}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,r.key,r)}}function c(t,e,n){if(e)l(t.prototype,e);if(n)l(t,n);return t}function h(t,e,n){if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t}function d(t,e,n){if(typeof Reflect!=="undefined"&&Reflect.get){d=Reflect.get}else{d=function t(t,e,n){var r=R(t,e);if(!r)return;var i=Object.getOwnPropertyDescriptor(r,e);if(i.get){return i.get.call(n||t)}return i.value}}return d(t,e,n||t)}function f(t){f=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return f(t)}function p(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}});if(e)S(t,e)}function v(t,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](t)}else{return t instanceof e}}function y(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function m(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function g(t,e){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,s;try{for(n=n.call(t);!(i=(a=n.next()).done);i=true){r.push(a.value);if(e&&r.length===e)break}}catch(t){o=true;s=t}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw s}}return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}r.forEach(function(e){h(t,e,n[e])})}return t}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);if(e){r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})}n.push.apply(n,r)}return n}function w(t,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}else{E(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function x(t,e){if(e&&(D(e)==="object"||typeof e==="function")){return e}return r(t)}function C(t,e,n,r){if(typeof Reflect!=="undefined"&&Reflect.set){C=Reflect.set}else{C=function t(t,e,n,r){var i=R(t,e);var o;if(i){o=Object.getOwnPropertyDescriptor(i,e);if(o.set){o.set.call(r,n);return true}else if(!o.writable){return false}}o=Object.getOwnPropertyDescriptor(r,e);if(o){if(!o.writable){return false}o.value=n;Object.defineProperty(r,e,o)}else{h(r,e,n)}return true}}return C(t,e,n,r)}function A(t,e,n,r,i){var o=C(t,e,n,r||t);if(!o&&i){throw new Error("failed to set property")}return n}function S(t,e){S=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return S(t,e)}function q(t,n){return e(t)||g(t,n)||U(t,n)||b()}function R(t,e){while(!Object.prototype.hasOwnProperty.call(t,e)){t=f(t);if(t===null)break}return t}function P(t,e){if(!e){e=t.slice(0)}return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function T(t){return e(t)||m(t)||U(t)||b()}function $(t){return n(t)||m(t)||U(t)||_()}function D(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function U(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}function M(t){var e=typeof Map==="function"?new Map:undefined;M=function t(t){if(t===null||!y(t))return t;if(typeof t!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof e!=="undefined"){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,f(this).constructor)}n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return S(n,t)};return M(t)}function I(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(I=function(){return!!t})()}function O(t,e){var n,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t];r=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}function L(){var t=P(["<slot></slot>"]);L=function e(){return t};return t}function N(){var t=P(['<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />\n <xsl:template match="@*|node()">\n <xsl:copy>\n <xsl:apply-templates select="@*|node()"/>\n </xsl:copy>\n </xsl:template>\n\n <!-- remove existing namespaces -->\n <xsl:template match="*">\n <!-- remove element prefix -->\n <xsl:element name="{local-name()}">\n <!-- process attributes -->\n <xsl:for-each select="@*">\n <!-- remove attribute prefix -->\n <xsl:attribute name="{local-name()}">\n <xsl:value-of select="."/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>']);N=function e(){return t};return t}function V(){var t=P(["<slot></slot>"]);V=function e(){return t};return t}function H(){var t=P(["\n :host {\n display: block;\n }\n"]);H=function e(){return t};return t}function j(){var t=P(['<slot name="qti-rubric-block"></slot><slot></slot>']);j=function e(){return t};return t}function Q(){var t=P(["<slot></slot>"]);Q=function e(){return t};return t}function B(){var t=P(["<slot></slot>"]);B=function e(){return t};return t}function F(){var t=P(["",""]);F=function e(){return t};return t}function z(){var t=P(["\n :host {\n display: none;\n }\n "]);z=function e(){return t};return t}function W(){var t=P(["",""]);W=function e(){return t};return t}function Y(){var t=P(["\n :host {\n display: none;\n }\n "]);Y=function e(){return t};return t}function X(){var t=P(["<slot></slot>"]);X=function e(){return t};return t}function Z(){var t=P(["<slot></slot>"]);Z=function e(){return t};return t}function G(){var t=P(["\n :host {\n display: block;\n }\n "]);G=function e(){return t};return t}function K(){var t=P([' <slot part="feedback" class="feedback ','"></slot> ']);K=function e(){return t};return t}function J(){var t=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);J=function e(){return t};return t}function tt(){var t=P([' <slot part="feedback" class="','"></slot> ']);tt=function e(){return t};return t}function te(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);te=function e(){return t};return t}function tn(){var t=P([' <slot part="feedback" class="','"></slot> ']);tn=function e(){return t};return t}function tr(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);tr=function e(){return t};return t}function ti(){var t=P(["\n /* PK: display host as block, else design will be collapsed */\n :host {\n display: block;\n }\n textarea {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 0;\n }\n "]);ti=function e(){return t};return t}function to(){var t=P(['<slot name="prompt"></slot\n ><textarea\n part="textarea"\n name="','"\n spellcheck="false"\n autocomplete="off"\n maxlength="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n @blur="','"\n placeholder="','"\n rows="','"\n ?disabled="','"\n ?readonly="','"\n .value=',"\n ></textarea>"]);to=function e(){return t};return t}function ta(){var t=P(["\n :host {\n display: inline-block;\n }\n [part='correct'] {\n position: absolute;\n width: 100%;\n }\n :host(.qti-input-width-1) [part='input'] {\n width: 1.1rem;\n min-width: 1.1rem;\n }\n\n :host(.qti-input-width-2) [part='input'] {\n width: 2.3rem;\n min-width: 2.3rem;\n }\n\n :host(.qti-input-width-3) [part='input'] {\n width: 3.3rem;\n min-width: 3.3rem;\n }\n\n :host(.qti-input-width-4) [part='input'] {\n width: 4.2rem;\n min-width: 4.2rem;\n }\n\n :host(.qti-input-width-6) [part='input'] {\n width: 6.6rem;\n min-width: 6.6rem;\n }\n\n :host(.qti-input-width-10) [part='input'] {\n width: 8rem;\n min-width: 8rem;\n }\n\n :host(.qti-input-width-15) [part='input'] {\n width: 12rem;\n min-width: 12rem;\n }\n\n :host(.qti-input-width-20) [part='input'] {\n width: 17rem;\n min-width: 17rem;\n }\n\n :host(.qti-input-width-25) [part='input'] {\n width: 20rem;\n min-width: 20rem;\n }\n\n :host(.qti-input-width-30) [part='input'] {\n width: 24rem;\n min-width: 24rem;\n }\n\n :host(.qti-input-width-35) [part='input'] {\n width: 28rem;\n min-width: 28rem;\n }\n\n :host(.qti-input-width-40) [part='input'] {\n width: 32rem;\n min-width: 32rem;\n }\n\n :host(.qti-input-width-45) [part='input'] {\n width: 36rem;\n min-width: 36rem;\n }\n\n :host(.qti-input-width-50) [part='input'] {\n width: 40rem;\n min-width: 40rem;\n }\n\n :host(.qti-input-width-72) [part='input'] {\n width: 57rem;\n min-width: 57rem;\n }\n"]);ta=function e(){return t};return t}function ts(){var t=P(['\n <input\n part="input"\n name="','"\n spellcheck="false"\n autocomplete="off"\n @blur="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n type="','"\n placeholder="','"\n .value="','"\n pattern="','"\n maxlength=','\n ?disabled="','"\n ?readonly="','"\n />\n <div part="correct">',"</div>\n "]);ts=function e(){return t};return t}function tu(){var t=P(["<slot></slot>"]);tu=function e(){return t};return t}function tl(){var t=P(["\n :host {\n display: inline-block;\n }\n slot {\n display: flex;\n flex-direction: column;\n }\n [role='menu'] {\n position: absolute;\n z-index: 1000;\n }\n .anchor {\n /* anchor-name: --infobox; */\n width: fit-content;\n }\n\n .positionedElement {\n position: absolute;\n /* position-anchor: --infobox; */\n /* top: anchor(bottom); */\n }\n "]);tl=function e(){return t};return t}function tc(){var t=P(['\n <option value="','" ?selected="','">',"</option>\n "]);tc=function e(){return t};return t}function th(){var t=P(['\n <select part="select" @change="','" ?disabled="','" ?readonly="','">\n ',"\n </select>\n\n ","\n "]);th=function e(){return t};return t}function td(){var t=P(["\n [part='slot'] {\n display: flex;\n flex-direction: column;\n gap: var(--qti-gap-size);\n flex-wrap: wrap;\n }\n\n ::slotted(qti-simple-choice) {\n flex: 0 0\n calc((100% - (var(--qti-gap-size) * var(--choice-interactions-stacking))) / var(--choice-interactions-stacking)) !important;\n box-sizing: border-box !important;\n }\n\n :host(.qti-choices-stacking-1) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 1;\n }\n\n :host(.qti-choices-stacking-2) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 2;\n }\n :host(.qti-choices-stacking-3) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 3;\n }\n :host(.qti-choices-stacking-4) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 4;\n }\n :host(.qti-choices-stacking-5) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 5;\n }\n :host([orientation='horizontal']) [part='slot'] {\n flex-direction: row;\n }\n"]);td=function e(){return t};return t}function tf(){var t=P(['\n <slot name="prompt"></slot><slot part="slot"></slot>\n <div role="alert" id="validationMessage"></div>\n ']);tf=function e(){return t};return t}function tp(){var t=P(["<slot></slot>"]);tp=function e(){return t};return t}function tv(){var t=P(["\n :host {\n display: none;\n }\n "]);tv=function e(){return t};return t}function ty(){var t=P(["<slot></slot>"]);ty=function e(){return t};return t}function tm(){var t=P(["\n :host {\n display: none;\n }\n "]);tm=function e(){return t};return t}function tg(){var t=P(["<slot></slot>"]);tg=function e(){return t};return t}function tb(){var t=P(["<slot></slot>"]);tb=function e(){return t};return t}function t_(){var t=P(["<slot></slot>"]);t_=function e(){return t};return t}function tk(){var t=P(["",""]);tk=function e(){return t};return t}function tE(){var t=P(["<pre>","</pre>\n <slot></slot>"]);tE=function e(){return t};return t}function tw(){var t=P(["\n slot {\n display: none;\n }\n "]);tw=function e(){return t};return t}function tx(){var t=P(["",""]);tx=function e(){return t};return t}function tC(){var t=P(["",""]);tC=function e(){return t};return t}function tA(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);tA=function e(){return t};return t}function tS(){var t=P(["<slot></slot>",""]);tS=function e(){return t};return t}function tq(){var t=P(["\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n slot[name='qti-simple-associable-choice'] {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host::part(associables-container) {\n display: flex;\n justify-content: space-between;\n background: linear-gradient(\n 180deg,\n rgb(0 0 0 / 0%) calc(50% - 1px),\n var(--qti-border-color-gray) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);tq=function e(){return t};return t}function tR(){var t=P(['<div part="associables-container">\n <div name="left','" part="drop-list" class="dl" identifier="droplist','_left"></div>\n <div name="right','" part="drop-list" class="dl" identifier="droplist','_right"></div>\n </div>']);tR=function e(){return t};return t}function tP(){var t=P([' <slot name="prompt"></slot>\n <slot name="qti-simple-associable-choice"></slot>\n <div part="drop-container">\n ',"\n </div>"]);tP=function e(){return t};return t}function tT(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);tT=function e(){return t};return t}function t$(){var t=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);t$=function e(){return t};return t}function tD(){var t=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);tD=function e(){return t};return t}function tU(){var t=P(['<slot name="prompt"> </slot><slot part="drags" name="qti-gap-text"></slot> <slot part="drops"></slot>']);tU=function e(){return t};return t}function tM(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) {\n flex-direction: row;\n }\n :host(.qti-choices-right) {\n flex-direction: row-reverse;\n }\n /* [part='drops'] , */\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n gap: 0.5rem;\n }\n "]);tM=function e(){return t};return t}function tI(){var t=P(['\n <line\n part="line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n @click=',"\n />\n "]);tI=function e(){return t};return t}function tO(){var t=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n />']);tO=function e(){return t};return t}function tL(){var t=P(['<slot name="prompt"></slot>\n <line-container>\n <svg\n width=',"\n height=",'\n viewbox="0 0 '," ",'"\n >\n ',"\n ","\n </svg>\n <slot></slot>\n </line-container>"]);tL=function e(){return t};return t}function tN(){var t=P(["\n slot:not([name='prompt']) {\n // position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n ::slotted(qti-associable-hotspot) {\n transform: translate(-50%, -50%);\n }\n line-container {\n display: block;\n position: relative;\n }\n svg {\n position: absolute;\n top: 0px;\n left: 0px;\n }\n "]);tN=function e(){return t};return t}function tV(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>\n <slot name="qti-gap-img"></slot>']);tV=function e(){return t};return t}function tH(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n slot[name='qti-gap-img'] {\n display: flex;\n gap: 1rem;\n }\n "]);tH=function e(){return t};return t}function tj(){var t=P(['\n <slot name="prompt"></slot>\n <!-- slot for the prompt -->\n <slot></slot>\n <!-- slot for the image and hotspots -->\n ']);tj=function e(){return t};return t}function tQ(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n "]);tQ=function e(){return t};return t}function tB(){var t=P(['\n <slot name="prompt"></slot>\n <!-- slot for the prompt -->\n <slot></slot>\n <!-- slot for the image and hotspots -->\n ']);tB=function e(){return t};return t}function tF(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n "]);tF=function e(){return t};return t}function tz(){var t=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);tz=function e(){return t};return t}function tW(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n slot {\n width: 100%;\n display: block;\n }\n slot[name='qti-simple-associable-choice'] {\n width: 100%;\n }\n "]);tW=function e(){return t};return t}function tY(){var t=P(["\n slot {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n align-items: flex-start; /* prevents the drag and drop container slots having the same height */\n }\n :host(.qti-choices-top) slot {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) slot {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) slot {\n flex-direction: row;\n }\n :host(.qti-choices-right) slot {\n flex-direction: row-reverse;\n }\n slot[name='prompt'] {\n display: block;\n }\n ::slotted(qti-simple-match-set) {\n /* Make sure the drag and drop container slots have the same width */\n flex: 1;\n }\n"]);tY=function e(){return t};return t}function tX(){var t=P(['<th part="r-header">',"</th>"]);tX=function e(){return t};return t}function tZ(){var t=P(["<td>\n <input\n type=","\n part=","\n name=","\n value=","\n .disabled=","\n @change=","\n @click=","\n />\n </td>"]);tZ=function e(){return t};return t}function tG(){var t=P(['<tr>\n <td part="c-header">',"</td>\n ","\n </tr>"]);tG=function e(){return t};return t}function tK(){var t=P(['\n <slot name="prompt"></slot>\n <table>\n <tr>\n <td></td>\n ',"\n </tr>\n\n ","\n </table>\n "]);tK=function e(){return t};return t}function tJ(){var t=P(['<slot name="prompt"></slot> <slot></slot>']);tJ=function e(){return t};return t}function t0(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>']);t0=function e(){return t};return t}function t1(){var t=P([""]);t1=function e(){return t};return t}function t2(){var t=P(['<drop-list part="drop-list" identifier="droplist','"></drop-list>',""]);t2=function e(){return t};return t}function t3(){var t=P([' <slot name="prompt"> </slot>\n <div part="container">\n <slot part="drags"> </slot>\n <div part="drops">\n ',"\n </div>\n </div>"]);t3=function e(){return t};return t}function t4(){var t=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n }\n\n [part='drops'] {\n flex: 1;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n }\n\n :host([orientation='horizontal']) [part='drags'] {\n flex-direction: row;\n }\n :host([orientation='horizontal']) [part='drops'] {\n grid-auto-flow: column;\n }\n :host([orientation='vertical']) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'] {\n grid-auto-flow: row;\n }\n\n [part='drop-list'] {\n display: block;\n flex: 1;\n }\n\n [part='container'] {\n display: flex;\n gap: 0.5rem;\n }\n :host(.qti-choices-top) [part='container'] {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) [part='container'] {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) [part='container'] {\n flex-direction: row;\n }\n :host(.qti-choices-right) [part='container'] {\n flex-direction: row-reverse;\n }\n "]);t4=function e(){return t};return t}function t5(){var t=P(["<slot></slot>"]);t5=function e(){return t};return t}function t6(){var t=P(["\n :host {\n display: block;\n }\n ::slotted(img) {\n position: absolute;\n cursor: move;\n user-select: none;\n left: 50%;\n transform: translateX(-50%);\n }\n "]);t6=function e(){return t};return t}function t9(){var t=P(["<slot></slot>"]);t9=function e(){return t};return t}function t7(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);t7=function e(){return t};return t}function t8(){var t=P(['\n <button\n part="point"\n style=','\n aria-label="Remove point at ','"\n @click=',"\n ></button>\n "]);t8=function e(){return t};return t}function et(){var t=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n <slot></slot>\n </point-container>"]);et=function e(){return t};return t}function ee(){var t=P(["\n :host {\n display: block;\n }\n point-container {\n display: block;\n position: relative;\n }\n "]);ee=function e(){return t};return t}function en(){var t=P(['<div id="bounds" part="bounds">\n <div>',"</div>\n <div>","</div>\n </div>"]);en=function e(){return t};return t}function er(){var t=P(['<div id="ticks" part="ticks"></div>']);er=function e(){return t};return t}function ei(){var t=P(['<div id="value" part="value">',"</div>"]);ei=function e(){return t};return t}function eo(){var t=P(['<slot name="prompt"></slot>\n <div id="slider" part="slider">\n ',"\n ",'\n <div id="rail" part="rail" @mousedown='," @touchstart=",'>\n <div id="knob" part="knob">\n ',"\n </div>\n </div>\n </div>"]);eo=function e(){return t};return t}function ea(){var t=P([""]);ea=function e(){return t};return t}function es(){var t=P(["<slot @slotchange=","></slot>"]);es=function e(){return t};return t}function eu(){var t=P([' <slot name="qti-gap-img"></slot> ']);eu=function e(){return t};return t}function el(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);el=function e(){return t};return t}function ec(){var t=P([' <slot name="qti-gap-text"></slot>']);ec=function e(){return t};return t}function eh(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);eh=function e(){return t};return t}function ed(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ed=function e(){return t};return t}function ef(){var t=P(["<slot></slot>"]);ef=function e(){return t};return t}function ep(){var t=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);ep=function e(){return t};return t}function ev(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);ev=function e(){return t};return t}function ey(){var t=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);ey=function e(){return t};return t}function em(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);em=function e(){return t};return t}function eg(){var t=P(["\n :host {\n display: block;\n cursor: pointer;\n }\n "]);eg=function e(){return t};return t}function eb(){var t=P([" <slot></slot> "]);eb=function e(){return t};return t}function e_(){var t=P(['<div id="label">',"</div>"]);e_=function e(){return t};return t}function ek(){var t=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot> ']);ek=function e(){return t};return t}function eE(){var t=P(["\n :host {\n display: flex;\n align-items: center;\n user-select: none;\n }\n slot {\n width: 100%;\n display: flex;\n align-items: center;\n }\n [part='ch'] {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n "]);eE=function e(){return t};return t}function ew(){var t=P(["",""]);ew=function e(){return t};return t}var ex,eC;var eA=Object.defineProperty;var eS=Object.getOwnPropertyDescriptor;var eq=function(t,e,n,r){for(var i=r>1?void 0:r?eS(e,n):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(i=(r?a(e,n,i):a(i))||i);return r&&i&&eA(e,n,i),i};var eR=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r){s(this,e);var i;i=a(this,e,["context-request",{bubbles:!0,composed:!0}]),i.context=t,i.callback=n,i.subscribe=r!==null&&r!==void 0?r:!1;return i}return e}(M(Event));var eP=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){var o=this;s(this,t);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(t,e){o.unsubscribe&&(o.unsubscribe!==e&&(o.provided=!1,o.unsubscribe()),o.subscribe||o.unsubscribe()),o.value=t,o.host.requestUpdate(),o.provided&&!o.subscribe||(o.provided=!0,o.callback&&o.callback(t,e)),o.unsubscribe=e},this.host=e,n.context!==void 0){var a=n;var u;this.context=a.context,this.callback=a.callback,this.subscribe=(u=a.subscribe)!==null&&u!==void 0?u:!1}else this.context=n,this.callback=r,this.subscribe=i!==null&&i!==void 0?i:!1;this.host.addController(this)}c(t,[{key:"hostConnected",value:function t(){this.dispatchRequest()}},{key:"hostDisconnected",value:function t(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}},{key:"dispatchRequest",value:function t(){this.host.dispatchEvent(new eR(this.context,this.t,this.subscribe))}}]);return t}();var eT=/*#__PURE__*/function(){"use strict";function t(e){var n=this;s(this,t);this.subscriptions=new Map,this.updateObservers=function(){var t=true,e=false,r=undefined;try{for(var i=n.subscriptions[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=q(o.value,2),s=a[0],u=a[1],l=u.disposer;s(n.o,l)}}catch(t){e=true;r=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw r}}}},e!==void 0&&(this.value=e)}c(t,[{key:"value",get:function t(){return this.o},set:function t(t){this.setValue(t)}},{key:"setValue",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e||!Object.is(t,this.o);this.o=t,n&&this.updateObservers()}},{key:"addCallback",value:function t(t,e,n){var r=this;if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:function(){r.subscriptions.delete(t)},consumerHost:e});var i=this.subscriptions.get(t),o=i.disposer;t(this.value,o)}},{key:"clearCallbacks",value:function t(){this.subscriptions.clear()}}]);return t}();var e$=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;n=a(this,e,["context-provider",{bubbles:!0,composed:!0}]),n.context=t;return n}return e}(M(Event)),eD=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r){s(this,e);var i;var o,u;i=a(this,e,[n.context!==void 0?n.initialValue:r]),i.onContextRequest=function(t){var e=t.composedPath()[0];t.context===i.context&&e!==i.host&&(t.stopPropagation(),i.addCallback(t.callback,e,t.subscribe))},i.onProviderRequest=function(t){var e=t.composedPath()[0];if(t.context!==i.context||e===i.host)return;var n=new Set;var r=true,o=false,a=undefined;try{for(var s=i.subscriptions[Symbol.iterator](),u;!(r=(u=s.next()).done);r=true){var l=q(u.value,2),c=l[0],h=l[1],d=h.consumerHost;n.has(c)||(n.add(c),d.dispatchEvent(new eR(i.context,c,!0)))}}catch(t){o=true;a=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}t.stopPropagation()},i.host=t,n.context!==void 0?i.context=n.context:i.context=n,i.attachListeners(),(o=(u=i.host).addController)===null||o===void 0?void 0:o.call(u,i);return i}c(e,[{key:"attachListeners",value:function t(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}},{key:"hostConnected",value:function t(){this.host.dispatchEvent(new e$(this.context))}}]);return e}(eT);function eU(t){var e=t.context;return function(t,n){var r=new WeakMap;if((typeof n==="undefined"?"undefined":D(n))=="object")return n.addInitializer(function(){r.set(this,new eD(this,{context:e}))}),{get:function e(){return t.get.call(this)},set:function e(e){var n;return(n=r.get(this))===null||n===void 0?void 0:n.setValue(e),t.set.call(this,e)},init:function t(t){var e;return(e=r.get(this))===null||e===void 0?void 0:e.setValue(t),t}};{t.constructor.addInitializer(function(t){r.set(t,new eD(t,{context:e}))});var i=Object.getOwnPropertyDescriptor(t,n),o;if(i===void 0){var a=new WeakMap;o={get:function t(){return a.get(this)},set:function t(t){r.get(this).setValue(t),a.set(this,t)},configurable:!0,enumerable:!0}}else{var s=i.set;o=w(k({},i),{set:function t(t){r.get(this).setValue(t),s===null||s===void 0?void 0:s.call(this,t)}})}return void Object.defineProperty(t,n,o)}}}function eM(t){var e=t.context,n=t.subscribe;return function(t,r){(typeof r==="undefined"?"undefined":D(r))=="object"?r.addInitializer(function(){var r=this;new eP(this,{context:e,callback:function(e){t.set.call(r,e)},subscribe:n})}):t.constructor.addInitializer(function(t){new eP(t,{context:e,callback:function(e){t[r]=e},subscribe:n})})}}var eI=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}c(t,[{key:"shadowRoot",get:function t(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function t(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function t(){return!0}},{key:"setFormValue",value:function t(){}},{key:"setValidity",value:function t(){}}]);return t}();var eO=new WeakMap,eL=function(t){var e=eO.get(t);return e===void 0&&eO.set(t,e=new Map),e},eN=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}c(t,[{key:"attributes",get:function t(){return Array.from(eL(this)).map(function(t){var e=q(t,2),n=e[0],r=e[1];return{name:n,value:r}})}},{key:"shadowRoot",get:function t(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}},{key:"localName",get:function t(){return this.constructor.__localName}},{key:"tagName",get:function t(){var t;return(t=this.localName)===null||t===void 0?void 0:t.toUpperCase()}},{key:"setAttribute",value:function t(t,e){eL(this).set(t,String(e))}},{key:"removeAttribute",value:function t(t){eL(this).delete(t)}},{key:"toggleAttribute",value:function t(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}},{key:"hasAttribute",value:function t(t){return eL(this).has(t)}},{key:"attachShadow",value:function t(t){var e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}},{key:"attachInternals",value:function t(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var t=new eI(this);return this.__internals=t,t}},{key:"getAttribute",value:function t(t){var e;return(e=eL(this).get(t))!==null&&e!==void 0?e:null}}]);return t}();var eV=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(eN),eH=eV;var ej=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__definitions=new Map}c(t,[{key:"define",value:function t(t,e){if(this.__definitions.has(t))throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the name \"".concat(t,'" has already been used with this registry'));var n;e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:(n=e.observedAttributes)!==null&&n!==void 0?n:[]})}},{key:"get",value:function t(t){var e;return(e=this.__definitions.get(t))===null||e===void 0?void 0:e.ctor}}]);return t}(),eQ=ej;var eB=new eQ;var eF=globalThis,ez=eF.ShadowRoot&&(eF.ShadyCSS===void 0||eF.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,eW=Symbol(),eY=new WeakMap,eX=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);if(this._$cssResult$=!0,r!==eW)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}c(t,[{key:"styleSheet",get:function t(){var t=this.o,e=this.t;if(ez&&t===void 0){var n=e!==void 0&&e.length===1;n&&(t=eY.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&eY.set(e,t))}return t}},{key:"toString",value:function t(){return this.cssText}}]);return t}(),eZ=function(t){return new eX(typeof t=="string"?t:t+"",void 0,eW)},eG=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}var i=t.length===1?t[0]:n.reduce(function(e,n,r){return e+function(t){if(t._$cssResult$===!0)return t.cssText;if(typeof t=="number")return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")}(n)+t[r+1]},t[0]);return new eX(i,t,eW)},eK=function(t,e){var n=true,r=false,i=undefined;if(ez)t.adoptedStyleSheets=e.map(function(t){return v(t,CSSStyleSheet)?t:t.styleSheet});else try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;var u=document.createElement("style"),l=eF.litNonce;l!==void 0&&u.setAttribute("nonce",l),u.textContent=s.cssText,t.appendChild(u)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}},eJ=ez||eF.CSSStyleSheet===void 0?function(t){return t}:function(t){return v(t,CSSStyleSheet)?function(t){var e="";var n=true,r=false,i=undefined;try{for(var o=t.cssRules[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;e+=s.cssText}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return eZ(e)}(t):t};var e0=Object.is,e1=Object.defineProperty,e2=Object.getOwnPropertyDescriptor,e3=Object.getOwnPropertyNames,e4=Object.getOwnPropertySymbols,e5=Object.getPrototypeOf,e6=globalThis;var e9;(e9=e6.customElements)!==null&&e9!==void 0?e9:e6.customElements=eB;var e7=e6.trustedTypes,e8=e7?e7.emptyScript:"",nt=e6.reactiveElementPolyfillSupport,ne=function(t,e){return t},nn={toAttribute:function t(t,e){switch(e){case Boolean:t=t?e8:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute:function t(t,e){var n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},nr=function(t,e){return!e0(t,e)},ni={attribute:!0,type:String,converter:nn,reflect:!1,hasChanged:nr};var no,na;(no=Symbol.metadata)!==null&&no!==void 0?no:Symbol.metadata=Symbol("metadata"),(na=e6.litPropertyMetadata)!==null&&na!==void 0?na:e6.litPropertyMetadata=new WeakMap;var ns;var nu=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev();return t}c(e,[{key:"_$Ev",value:function t(){var t=this;var e;this._$ES=new Promise(function(e){return t.enableUpdating=e}),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0?void 0:e.forEach(function(e){return e(t)})}},{key:"addController",value:function t(t){var e;var n;((n=this._$EO)!==null&&n!==void 0?n:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)===null||e===void 0?void 0:e.call(t))}},{key:"removeController",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.delete(t)}},{key:"_$E_",value:function t(){var t=new Map,e=this.constructor.elementProperties;var n=true,r=false,i=undefined;try{for(var o=e.keys()[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function t(){var t;var e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return eK(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function t(){var t;var e;(e=this.renderRoot)!==null&&e!==void 0?e:this.renderRoot=this.createRenderRoot(),this.enableUpdating(!0),(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostConnected)===null||e===void 0?void 0:e.call(t)})}},{key:"enableUpdating",value:function t(t){}},{key:"disconnectedCallback",value:function t(){var t;(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostDisconnected)===null||e===void 0?void 0:e.call(t)})}},{key:"attributeChangedCallback",value:function t(t,e,n){this._$AK(t,n)}},{key:"_$EC",value:function t(t,e){var n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(r!==void 0&&n.reflect===!0){var i;var o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:nn).toAttribute(e,n.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}},{key:"_$AK",value:function t(t,e){var n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){var i;var o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:nn;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}},{key:"requestUpdate",value:function t(t,e,n){if(t!==void 0){var r;if(n!==null&&n!==void 0?n:n=this.constructor.getPropertyOptions(t),!((r=n.hasChanged)!==null&&r!==void 0?r:nr)(this[t],e))return;this.P(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}},{key:"P",value:function t(t,e,n){var r;this._$AL.has(t)||this._$AL.set(t,e),n.reflect===!0&&this._$Em!==t&&((r=this._$Ej)!==null&&r!==void 0?r:this._$Ej=new Set).add(t)}},{key:"_$ET",value:function t(){var t=this;return o(function(){var e,n,r;return O(this,function(i){switch(i.label){case 0:t.isUpdatePending=!0;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,t._$ES];case 2:i.sent();return[3,4];case 3:e=i.sent();Promise.reject(e);return[3,4];case 4:n=t.scheduleUpdate();r=n!=null;if(!r)return[3,6];return[4,n];case 5:r=i.sent();i.label=6;case 6:return[2,(r,!t.isUpdatePending)]}})})()}},{key:"scheduleUpdate",value:function t(){return this.performUpdate()}},{key:"performUpdate",value:function t(){if(!this.isUpdatePending)return;if(!this.hasUpdated){var t;if((t=this.renderRoot)!==null&&t!==void 0?t:this.renderRoot=this.createRenderRoot(),this._$Ep){var e=true,n=false,r=undefined;try{for(var i=this._$Ep[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=q(o.value,2),s=a[0],u=a[1];this[s]=u}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}this._$Ep=void 0}var l=this.constructor.elementProperties;var c=true,h=false,d=undefined;if(l.size>0)try{for(var f=l[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=q(p.value,2),y=v[0],m=v[1];m.wrapped!==!0||this._$AL.has(y)||this[y]===void 0||this.P(y,this[y],m)}}catch(t){h=true;d=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(h){throw d}}}}var g=!1,b=this._$AL;try{var _;g=this.shouldUpdate(b),g?(this.willUpdate(b),(_=this._$EO)===null||_===void 0?void 0:_.forEach(function(t){var e;return(e=t.hostUpdate)===null||e===void 0?void 0:e.call(t)}),this.update(b)):this._$EU()}catch(t){throw g=!1,this._$EU(),t}g&&this._$AE(b)}},{key:"willUpdate",value:function t(t){}},{key:"_$AE",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.forEach(function(t){var e;return(e=t.hostUpdated)===null||e===void 0?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}},{key:"_$EU",value:function t(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function t(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function t(){return this._$ES}},{key:"shouldUpdate",value:function t(t){return!0}},{key:"update",value:function t(t){var e=this;this._$Ej&&(this._$Ej=this._$Ej.forEach(function(t){return e._$EC(t,e[t])})),this._$EU()}},{key:"updated",value:function t(t){}},{key:"firstUpdated",value:function t(t){}}],[{key:"addInitializer",value:function t(t){var e;this._$Ei(),((e=this.l)!==null&&e!==void 0?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function t(){return this.finalize(),this._$Eh&&$(this._$Eh.keys())}},{key:"createProperty",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ni;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(t,n,e);r!==void 0&&e1(this.prototype,t,r)}}},{key:"getPropertyDescriptor",value:function t(t,e,n){var r;var i=(r=e2(this.prototype,t))!==null&&r!==void 0?r:{get:function t(){return this[e]},set:function t(t){this[e]=t}},o=i.get,a=i.set;return{get:function t(){return o===null||o===void 0?void 0:o.call(this)},set:function e(e){var r=o===null||o===void 0?void 0:o.call(this);a.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function t(t){var e;return(e=this.elementProperties.get(t))!==null&&e!==void 0?e:ni}},{key:"_$Ei",value:function t(){if(this.hasOwnProperty(ne("elementProperties")))return;var t=e5(this);t.finalize(),t.l!==void 0&&(this.l=$(t.l)),this.elementProperties=new Map(t.elementProperties)}},{key:"finalize",value:function t(){if(this.hasOwnProperty(ne("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ne("properties"))){var t=this.properties,e=$(e3(t)).concat($(e4(t)));var n=true,r=false,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.createProperty(s,t[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}var u=this[Symbol.metadata];if(u!==null){var l=litPropertyMetadata.get(u);var c=true,h=false,d=undefined;if(l!==void 0)try{for(var f=l[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=q(p.value,2),y=v[0],m=v[1];this.elementProperties.set(y,m)}}catch(t){h=true;d=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(h){throw d}}}}this._$Eh=new Map;var g=true,b=false,_=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),E;!(g=(E=k.next()).done);g=true){var w=q(E.value,2),x=w[0],C=w[1];var A=this._$Eu(x,C);A!==void 0&&this._$Eh.set(A,x)}}catch(t){b=true;_=t}finally{try{if(!g&&k.return!=null){k.return()}}finally{if(b){throw _}}}this.elementStyles=this.finalizeStyles(this.styles)}},{key:"finalizeStyles",value:function t(t){var e=[];if(Array.isArray(t)){var n=new Set(t.flat(1/0).reverse());var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;e.unshift(eJ(u))}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}else t!==void 0&&e.push(eJ(t));return e}},{key:"_$Eu",value:function t(t,e){var n=e.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}}]);return e}((ns=globalThis.HTMLElement)!==null&&ns!==void 0?ns:eH);var nl;nu.elementStyles=[],nu.shadowRootOptions={mode:"open"},nu[ne("elementProperties")]=new Map,nu[ne("finalized")]=new Map,nt===null||nt===void 0?void 0:nt({ReactiveElement:nu}),((nl=e6.reactiveElementVersions)!==null&&nl!==void 0?nl:e6.reactiveElementVersions=[]).push("2.0.4");var nc=globalThis,nh=nc.trustedTypes,nd=nh?nh.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,nf="$lit$",np="lit$".concat(Math.random().toFixed(9).slice(2),"$"),nv="?"+np,ny="<".concat(nv,">"),nm=nc.document===void 0?{createTreeWalker:function(){return{}}}:document,ng=function(){return nm.createComment("")},nb=function(t){return t===null||(typeof t==="undefined"?"undefined":D(t))!="object"&&typeof t!="function"},n_=Array.isArray,nk=function(t){return n_(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},nE="[ \n\f\r]",nw=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nx=/-->/g,nC=/>/g,nA=RegExp(">|".concat(nE,"(?:([^\\s\"'>=/]+)(").concat(nE,"*=").concat(nE,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),nS=/'/g,nq=/"/g,nR=/^(?:script|style|textarea|title)$/i,nP=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return{_$litType$:t,strings:e,values:r}}},nT=nP(1),n$=nP(2),nD=nP(3),nU=Symbol.for("lit-noChange"),nM=Symbol.for("lit-nothing"),nI=new WeakMap,nO=nm.createTreeWalker(nm,129);function nL(t,e){if(!n_(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return nd!==void 0?nd.createHTML(e):e}var nN=function(t,e){var n=t.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",a=nw;for(var s=0;s<n;s++){var u=t[s],l=void 0,c=void 0,h=-1,d=0;for(;d<u.length&&(a.lastIndex=d,c=a.exec(u),c!==null);)d=a.lastIndex,a===nw?c[1]==="!--"?a=nx:c[1]!==void 0?a=nC:c[2]!==void 0?(nR.test(c[2])&&(i=RegExp("</"+c[2],"g")),a=nA):c[3]!==void 0&&(a=nA):a===nA?c[0]===">"?(a=i!==null&&i!==void 0?i:nw,h=-1):c[1]===void 0?h=-2:(h=a.lastIndex-c[2].length,l=c[1],a=c[3]===void 0?nA:c[3]==='"'?nq:nS):a===nq||a===nS?a=nA:a===nx||a===nC?a=nw:(a=nA,i=void 0);var f=a===nA&&t[s+1].startsWith("/>")?" ":"";o+=a===nw?u+ny:h>=0?(r.push(l),u.slice(0,h)+nf+u.slice(h)+np+f):u+np+(h===-2?s:f)}return[nL(t,o+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},nV=/*#__PURE__*/function(){"use strict";function t(e,n){var r=e.strings,i=e._$litType$;s(this,t);var o;this.parts=[];var a=0,u=0,l=r.length-1,c=this.parts,h=q(nN(r,i),2),d=h[0],f=h[1];if(this.el=t.createElement(d,n),nO.currentNode=this.el.content,i===2||i===3){var p;var v=this.el.content.firstChild;(p=v).replaceWith.apply(p,$(v.childNodes))}for(;(o=nO.nextNode())!==null&&c.length<l;){if(o.nodeType===1){var y=true,m=false,g=undefined;if(o.hasAttributes())try{for(var b=o.getAttributeNames()[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var k=_.value;if(k.endsWith(nf)){var E=f[u++],w=o.getAttribute(k).split(np),x=/([.?@])?(.*)/.exec(E);c.push({type:1,index:a,name:x[2],strings:w,ctor:x[1]==="."?nF:x[1]==="?"?nz:x[1]==="@"?nW:nB}),o.removeAttribute(k)}else k.startsWith(np)&&(c.push({type:6,index:a}),o.removeAttribute(k))}}catch(t){m=true;g=t}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}if(nR.test(o.tagName)){var C=o.textContent.split(np),A=C.length-1;if(A>0){o.textContent=nh?nh.emptyScript:"";for(var S=0;S<A;S++)o.append(C[S],ng()),nO.nextNode(),c.push({type:2,index:++a});o.append(C[A],ng())}}}else if(o.nodeType===8)if(o.data===nv)c.push({type:2,index:a});else{var R=-1;for(;(R=o.data.indexOf(np,R+1))!==-1;)c.push({type:7,index:a}),R+=np.length-1}a++}}c(t,null,[{key:"createElement",value:function t(t,e){var n=nm.createElement("template");return n.innerHTML=t,n}}]);return t}();function nH(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=arguments.length>3?arguments[3]:void 0;var i,o;if(e===nU)return e;var a=r!==void 0?(i=n._$Co)===null||i===void 0?void 0:i[r]:n._$Cl,s=nb(e)?void 0:e._$litDirective$;var u;return(a===null||a===void 0?void 0:a.constructor)!==s&&(a===null||a===void 0?void 0:(o=a._$AO)===null||o===void 0?void 0:o.call(a,!1),s===void 0?a=void 0:(a=new s(t),a._$AT(t,n,r)),r!==void 0?((u=n._$Co)!==null&&u!==void 0?u:n._$Co=[])[r]=a:n._$Cl=a),a!==void 0&&(e=nH(t,a._$AS(t,e.values),a,r)),e}var nj=/*#__PURE__*/function(){"use strict";function t(e,n){s(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}c(t,[{key:"parentNode",get:function t(){return this._$AM.parentNode}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"u",value:function t(t){var e;var n=this._$AD,r=n.el,i=r.content,o=n.parts,a=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:nm).importNode(i,!0);nO.currentNode=a;var s=nO.nextNode(),u=0,l=0,c=o[0];for(;c!==void 0;){if(u===c.index){var h=void 0;c.type===2?h=new nQ(s,s.nextSibling,this,t):c.type===1?h=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(h=new nY(s,this,t)),this._$AV.push(h),c=o[++l]}u!==(c===null||c===void 0?void 0:c.index)&&(s=nO.nextNode(),u++)}return nO.currentNode=nm,a}},{key:"p",value:function t(t){var e=0;var n=true,r=false,i=undefined;try{for(var o=this._$AV[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}}]);return t}(),nQ=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){s(this,t);var o;this.type=2,this._$AH=nM,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(o=i===null||i===void 0?void 0:i.isConnected)!==null&&o!==void 0?o:!0}c(t,[{key:"_$AU",get:function t(){var t;var e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cv}},{key:"parentNode",get:function t(){var t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t===null||t===void 0?void 0:t.nodeType)===11&&(t=e.parentNode),t}},{key:"startNode",get:function t(){return this._$AA}},{key:"endNode",get:function t(){return this._$AB}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;t=nH(this,t,e),nb(t)?t===nM||t==null||t===""?(this._$AH!==nM&&this._$AR(),this._$AH=nM):t!==this._$AH&&t!==nU&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):nk(t)?this.k(t):this._(t)}},{key:"O",value:function t(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"T",value:function t(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}},{key:"_",value:function t(t){this._$AH!==nM&&nb(this._$AH)?this._$AA.nextSibling.data=t:this.T(nm.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var e;var n=t.values,r=t._$litType$,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=nV.createElement(nL(r.h,r.h[0]),this.options)),r);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===i)this._$AH.p(n);else{var o=new nj(i,this),a=o.u(this.options);o.p(n),this.T(a),this._$AH=o}}},{key:"_$AC",value:function t(t){var e=nI.get(t.strings);return e===void 0&&nI.set(t.strings,e=new nV(t)),e}},{key:"k",value:function e(e){n_(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,r,i=0;var o=true,a=false,s=undefined;try{for(var u=e[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;i===n.length?n.push(r=new t(this.O(ng()),this.O(ng()),this,this.options)):r=n[i],r._$AI(c),i++}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}},{key:"_$AR",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var n,r;for((n=(r=this)._$AP)===null||n===void 0?void 0:n.call(r,!1,!0,e);t&&t!==this._$AB;){var i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function t(t){var e,n;this._$AM===void 0&&(this._$Cv=t,(e=(n=this)._$AP)===null||e===void 0?void 0:e.call(n,t))}}]);return t}(),nB=/*#__PURE__*/function(){"use strict";function t(e,n,r,i,o){s(this,t);this.type=1,this._$AH=nM,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=nM}c(t,[{key:"tagName",get:function t(){return this.element.tagName}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=this.strings,o=!1;if(i===void 0)t=nH(this,t,e,0),o=!nb(t)||t!==this._$AH&&t!==nU,o&&(this._$AH=t);else{var a=t,s,u;for(t=i[0],s=0;s<i.length-1;s++)u=nH(this,a[n+s],e,s),u===nU&&(u=this._$AH[s]),o||(o=!nb(u)||u!==this._$AH[s]),u===nM?t=nM:t!==nM&&(t+=(u!==null&&u!==void 0?u:"")+i[s+1]),this._$AH[s]=u}o&&!r&&this.j(t)}},{key:"j",value:function t(t){t===nM?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),nF=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=3;return t}c(e,[{key:"j",value:function t(t){this.element[this.name]=t===nM?void 0:t}}]);return e}(nB),nz=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=4;return t}c(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==nM)}}]);return e}(nB),nW=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r,i,o){s(this,e);var u;u=a(this,e,[t,n,r,i,o]),u.type=5;return u}c(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=nH(this,t,e,0))!==null&&n!==void 0?n:nM)===nU)return;var r=this._$AH,i=t===nM&&r!==nM||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==nM&&(r===nM||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}},{key:"handleEvent",value:function t(t){var e;var n;typeof this._$AH=="function"?this._$AH.call((n=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&n!==void 0?n:this.element,t):this._$AH.handleEvent(t)}}]);return e}(nB),nY=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){nH(this,t)}}]);return t}(),nX={M:nf,P:np,A:nv,C:1,L:nN,R:nj,D:nk,V:nH,I:nQ,H:nB,N:nz,U:nW,B:nF,F:nY},nZ=nc.litHtmlPolyfillSupport;var nG;nZ===null||nZ===void 0?void 0:nZ(nV,nQ),((nG=nc.litHtmlVersions)!==null&&nG!==void 0?nG:nc.litHtmlVersions=[]).push("3.2.1");var nK=function(t,e,n){var r;var i=(r=n===null||n===void 0?void 0:n.renderBefore)!==null&&r!==void 0?r:e,o=i._$litPart$;if(o===void 0){var a;var s=(a=n===null||n===void 0?void 0:n.renderBefore)!==null&&a!==void 0?a:null;i._$litPart$=o=new nQ(e.insertBefore(ng(),s),s,void 0,n!==null&&n!==void 0?n:{})}return o._$AI(t),o};var nJ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.renderOptions={host:t},t._$Do=void 0;return t}c(e,[{key:"createRenderRoot",value:function t(){var t;var n=d(f(e.prototype),"createRenderRoot",this).call(this);var r;return(r=(t=this.renderOptions).renderBefore)!==null&&r!==void 0?r:t.renderBefore=n.firstChild,n}},{key:"update",value:function t(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),d(f(e.prototype),"update",this).call(this,t),this._$Do=nK(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function t(){var t;d(f(e.prototype),"connectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!0)}},{key:"disconnectedCallback",value:function t(){var t;d(f(e.prototype),"disconnectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!1)}},{key:"render",value:function t(){return nU}}]);return e}(nu);nJ._$litElement$=!0,nJ.finalized=!0,(ex=(eC=globalThis).litElementHydrateSupport)===null||ex===void 0?void 0:ex.call(eC,{LitElement:nJ});var n0=globalThis.litElementPolyfillSupport;n0===null||n0===void 0?void 0:n0({LitElement:nJ});var n1;((n1=globalThis.litElementVersions)!==null&&n1!==void 0?n1:globalThis.litElementVersions=[]).push("4.1.1");var n2=function(t){return function(e,n){n!==void 0?n.addInitializer(function(){customElements.define(t,e)}):customElements.define(t,e)}};var n3={attribute:!0,type:String,converter:nn,reflect:!1,hasChanged:nr},n4=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n3,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var r=n.kind,i=n.metadata,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(n.name,t),r==="accessor"){var a=n.name;return{set:function n(n){var r=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,r,t)},init:function e(e){return e!==void 0&&this.P(a,void 0,t),e}}}if(r==="setter"){var s=n.name;return function n(n){var r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+r)};function n5(t){return function(e,n){return(typeof n==="undefined"?"undefined":D(n))=="object"?n4(t,e,n):function(t,e,n){var r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?w(k({},t),{wrapped:!0}):t),r?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}}function n6(t){return n5(w(k({},t),{state:!0,attribute:!1}))}var n9=function(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof e==="undefined"?"undefined":D(e))!="object"&&Object.defineProperty(t,e,n),n};function n7(t,e){return function(n,r,i){var o=function(e){var n;var r;return(r=(n=e.renderRoot)===null||n===void 0?void 0:n.querySelector(t))!==null&&r!==void 0?r:null};if(e){var a=(typeof r==="undefined"?"undefined":D(r))=="object"?n:i!==null&&i!==void 0?i:function(){var t=Symbol();return{get:function e(){return this[t]},set:function e(e){this[t]=e}}}(),s=a.get,u=a.set;return n9(n,r,{get:function t(){var t=s.call(this);return t===void 0&&(t=o(this),(t!==null||this.hasUpdated)&&u.call(this,t)),t}})}return n9(n,r,{get:function t(){return o(this)}})}}function n8(t){return function(e,n){var r=t!==null&&t!==void 0?t:{},i=r.slot,o=r.selector,a="slot"+(i?"[name=".concat(i,"]"):":not([name])");return n9(e,n,{get:function e(){var e;var n;var r=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector(a),i=(n=r===null||r===void 0?void 0:r.assignedElements(t))!==null&&n!==void 0?n:[];return o===void 0?i:i.filter(function(t){return t.matches(o)})}})}}function rt(t,e){var n=k({waitUntilFirstUpdate:!1},e);return function(e,r){var i=e.update,o=Array.isArray(t)?t:[t];e.update=function(t){var e=this;o.forEach(function(i){var o=i;if(t.has(o)){var a=t.get(o),s=e[o];a!==s&&(!n.waitUntilFirstUpdate||e.hasUpdated)&&e[r](a,s)}}),i.call(this,t)}}}var re=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],rn="item";var rr=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.identifier="";t.adaptive="false";t.timeDependent=null;t._handleDisabledChange=function(e,n){t._interactionElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){return t._interactionElements.forEach(function(t){return t.readonly=n})};t._context={identifier:t.getAttribute("identifier"),variables:re};t._initialContext=w(k({},t._context),{variables:t._context.variables});t._feedbackElements=[];t._interactionElements=[];t.addEventListener("qti-register-variable",function(e){t._context=w(k({},t._context),{variables:$(t._context.variables).concat([e.detail.variable])}),t._initialContext=t._context,e.stopPropagation()}),t.addEventListener("qti-register-feedback",function(e){e.stopPropagation();var n=e.detail;t._feedbackElements.push(n),n.checkShowFeedback(n.outcomeIdentifier)}),t.addEventListener("qti-register-interaction",function(e){e.stopPropagation(),t._interactionElements.push(e.target)}),t.addEventListener("end-attempt",function(e){var n=e.detail,r=n.responseIdentifier,i=n.countAttempt;t.updateResponseVariable(r,"true"),t.processResponse(i)}),t.addEventListener("qti-set-outcome-value",function(e){var n=e.detail,r=n.outcomeIdentifier,i=n.value;t.updateOutcomeVariable(r,i),e.stopPropagation()}),t.addEventListener("qti-interaction-response",t.handleUpdateResponseVariable);return t}c(e,[{key:"variables",get:function t(){return this._context.variables.map(function(t){return k({identifier:t.identifier,value:t.value,type:t.type},t.type==="outcome"&&t.identifier==="SCORE"?{externalScored:t.externalScored}:{})})},set:function t(t){var e=this;if(!Array.isArray(t)||t.some(function(t){return!("identifier"in t)})){console.warn("variables property should be an array of VariableDeclaration");return}this._context=w(k({},this._context),{variables:this._context.variables.map(function(e){var n=t.find(function(t){return t.identifier===e.identifier});return n?k({},e,n):e})}),this._context.variables.forEach(function(t){if(t.type==="response"){var n=e._interactionElements.find(function(e){return e.responseIdentifier===t.identifier});n&&(n.value=t.value)}t.type==="outcome"&&e._feedbackElements.forEach(function(e){return e.checkShowFeedback(t.identifier)})})}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){switch(t.label){case 0:r().call(n);return[4,n.updateComplete];case 1:t.sent(),n._emit("qti-assessment-item-connected",n);return[2]}})})()}},{key:"responses",set:function t(t){var e=true,n=false,r=undefined;if(t)try{var i,o=function(){var t=s.value;i.getResponse(t.responseIdentifier)&&i.updateResponseVariable(t.responseIdentifier,t.response);var e=i._interactionElements.find(function(e){return e.getAttribute("response-identifier")===t.responseIdentifier});e&&(e.value=t.response)};for(var a=t[Symbol.iterator](),s;!(e=(s=a.next()).done);e=true)i=this,o()}catch(t){n=true;r=t}finally{try{if(!e&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"render",value:function t(){return nT(L())}},{key:"showCorrectResponse",value:function t(t){var e=this._context.variables.filter(function(t){return"correctResponse"in t&&t.correctResponse}).map(function(t){return{responseIdentifier:t.identifier,response:t.correctResponse}});var n=true,r=false,i=undefined;try{var o,a=function(){var e=u.value;var n=o._interactionElements.find(function(t){return t.getAttribute("response-identifier")===e.responseIdentifier});n&&(n.correctResponse=t?e.response:"")};for(var s=e[Symbol.iterator](),u;!(n=(u=s.next()).done);n=true)o=this,a()}catch(t){r=true;i=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw i}}}}},{key:"processResponse",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var e;var n=this.querySelector("qti-response-processing");return!n||!n.process?!1:(n.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),t&&this.updateOutcomeVariable("numAttempts",(+((e=this._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||e===void 0?void 0:e.value)+1).toString()),this._emit("qti-response-processed"),!0)}},{key:"resetResponses",value:function t(){this._context=this._initialContext}},{key:"getResponse",value:function t(t){return this.getVariable(t)}},{key:"getOutcome",value:function t(t){return this.getVariable(t)}},{key:"getVariable",value:function t(t){return this._context.variables.find(function(e){return e.identifier===t})||null}},{key:"handleUpdateResponseVariable",value:function t(t){var e=t.detail,n=e.responseIdentifier,r=e.response;this.updateResponseVariable(n,r)}},{key:"updateResponseVariable",value:function t(t,e){this._context=w(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:w(k({},n),{value:e})})}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:t,response:Array.isArray(e)?$(e):e}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var r=this.getOutcome(t);if(!r){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this._context=w(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:w(k({},n),{value:r.cardinality==="single"?e:$(n.value).concat([e])})})}),this._feedbackElements.forEach(function(e){return e.checkShowFeedback(t)}),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:t,value:(n=this._context.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.value})}},{key:"_getCompletionStatus",value:function t(){return this._interactionElements.every(function(t){return t.validate()})?"completed":this._interactionElements.some(function(t){return t.validate()})?"incomplete":"not_attempted"}},{key:"_emit",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}}]);return e}(nJ);eq([n5({type:String})],rr.prototype,"title",2),eq([n5({type:String})],rr.prototype,"identifier",2),eq([n5({type:String})],rr.prototype,"adaptive",2),eq([n5({type:String})],rr.prototype,"timeDependent",2),eq([n5({type:Boolean})],rr.prototype,"disabled",2),eq([rt("disabled",{waitUntilFirstUpdate:!0})],rr.prototype,"_handleDisabledChange",2),eq([n5({type:Boolean})],rr.prototype,"readonly",2),eq([rt("readonly",{waitUntilFirstUpdate:!0})],rr.prototype,"_handleReadonlyChange",2),eq([eU({context:rn})],rr.prototype,"_context",2),rr=eq([n2("qti-assessment-item")],rr);var ri=String.raw,ro=ri(N());function ra(t,e,n){t.querySelectorAll(e).forEach(function(t){var r="".concat(e,"-").concat(n),i=ru(t,r);t.replaceWith(i)})}function rs(t,e){t.querySelectorAll("*").forEach(function(t){var n=t.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(e,":"))){var r=n.slice("".concat(e,":").length),i="".concat(t.nodeName,"-").concat(r),o=ru(t,i);t.replaceWith(o)}})})}function ru(t,e){var n=document.createElement(e);var r=true,i=false,o=undefined;try{for(var a=t.attributes[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;n.setAttribute(u.name,u.value)}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}for(;t.firstChild;)n.appendChild(t.firstChild);return n}function rl(t){var e=[];return t.querySelectorAll("qti-assessment-item-ref").forEach(function(t){var n=t.getAttribute("identifier"),r=t.getAttribute("href"),i=t.getAttribute("category");e.push({identifier:n,href:r,category:i})}),e}var rc=null;function rh(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return e&&rc!==null&&rc.abort(),new Promise(function(e,n){var r=new XMLHttpRequest;rc=r,r.open("GET",t,!0),r.responseType="document",r.onload=function(){r.status>=200&&r.status<300?e(r.responseXML):n(r.statusText)},r.onerror=function(){n(r.statusText)},r.send()})}function rd(t){return new DOMParser().parseFromString(t,"text/xml")}function rf(t){var e=new XSLTProcessor,n=new DOMParser().parseFromString(ro,"text/xml");return e.importStylesheet(n),e.transformToFragment(t,document)}function rp(t,e){e.endsWith("/")||(e+="/"),t.querySelectorAll("[src],[href],[primary-path]").forEach(function(t){var n;var r="";t.getAttribute("src")&&(r="src"),t.getAttribute("href")&&(r="href"),t.getAttribute("primary-path")&&(r="primary-path");var i=(n=t.getAttribute(r))===null||n===void 0?void 0:n.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){var o=e+encodeURI(i);t.setAttribute(r,o)}})}function rv(t){t.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(function(t){var e=document.createComment(t.textContent);t.replaceChild(e,t.firstChild)})}function ry(t){t.querySelectorAll("qti-stylesheet").forEach(function(t){return t.remove()})}var rm=function(){var t,e={load:function n(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return o(function(){return O(this,function(i){return[2,new Promise(function(i,o){rh(n,r).then(function(r){return t=r,e.path(n.substring(0,n.lastIndexOf("/"))),i(e)})})]})})()},parse:function n(n){return t=rd(n),e},path:function(n){return rp(t,n),e},fn:function n(n){return n(t),e},pciHooks:function n(n){var r=["hook","module"],i=n.substring(0,n.lastIndexOf("/"));var o=true,a=false,s=undefined;try{var u=function(){var e=c.value;t.querySelectorAll("["+e+"]").forEach(function(t){var r=t.getAttribute(e);!r.startsWith("data:")&&!r.startsWith("http")&&(t.setAttribute("base-url",n),t.setAttribute("module",i+"/"+encodeURI(r+(r.endsWith(".js")?"":".js"))))})};for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)u()}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return e},extendElementName:function(n,r){return ra(t,n,r),e},extendElementsWithClass:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return rs(t,n),e},customInteraction:function n(n,r){var i=t.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",n),i.setAttribute("data-base-item",n+r),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),e},convertCDATAtoComment:function n(){return rv(t),e},stripStyleSheets:function n(){return ry(t),e},html:function e(){return new XMLSerializer().serializeToString(rf(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return rf(t)},xmlDoc:function e(){return t}};return e};var rg=function(){var t,e={load:function n(n){return o(function(){return O(this,function(r){return[2,new Promise(function(r,i){rh(n).then(function(n){return t=n,r(e)})})]})})()},parse:function e(e){t=rd(e)},assessmentTest:function e(){var e=t.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return e};var rb=function(){var t,e={load:function n(n){return o(function(){return O(this,function(r){return[2,new Promise(function(r,i){rh(n).then(function(n){return t=n,r(e)})})]})})()},parse:function n(n){return t=rd(n),e},fn:function n(n){return n(t),e},items:function e(){return rl(t)},html:function e(){return new XMLSerializer().serializeToString(rf(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return rf(t)},xmlDoc:function e(){return t}};return e};var r_=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.identifier="";t.href="";return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){var t,e,i;return O(this,function(o){switch(o.label){case 0:r().call(n);t=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0});if(!n.dispatchEvent(t))return[3,4];e=n.closest("qti-assessment-item").querySelector("[data-stimulus-idref=".concat(n.identifier,"]"));if(!e)return[3,2];return[4,n.updateStimulusRef(e)];case 1:i=o.sent();return[3,3];case 2:i=console.warn("Stimulus with data-stimulus-idref ".concat(n.identifier," not found"));o.label=3;case 3:i;o.label=4;case 4:return[2]}})})()}},{key:"updateStimulusRef",value:function t(t){var e=this;return o(function(){var n,r,i,o;return O(this,function(a){switch(a.label){case 0:n=e.href.substring(0,e.href.lastIndexOf("/"));return[4,rm().load(e.href).then(function(t){return t.path(n).htmlDoc()})];case 1:r=a.sent();if(r){;o=r.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",(i=t).append.apply(i,$(o))}return[2]}})})()}}]);return e}(nJ);eq([n5({type:String})],r_.prototype,"identifier",2),eq([n5({type:String})],r_.prototype,"href",2),r_=eq([n2("qti-assessment-stimulus-ref")],r_);var rk={toAttribute:function(t){return t?"true":"false"},fromAttribute:function(t){return t==="true"}};function rE(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}s(this,n);var i;i=a(this,n,$(e));i.identifier="";i.tabIndex=0;i.disabled=!1;i.readonly=!1;i.internals=i.attachInternals();return i}c(n,[{key:"handleDisabledChange",value:function t(t,e){this.tabIndex=e?-1:0,e&&this.blur()}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("register-".concat(e),{bubbles:!0,composed:!0}))}},{key:"disconnectedCallback",value:function t(){d(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("unregister-".concat(e),{bubbles:!0,composed:!0}))}},{key:"_onKeyUp",value:function t(t){t.altKey||t.code==="Space"&&(t.preventDefault(),this._activate())}},{key:"_onClick",value:function t(){this.disabled||this.readonly||(this.focus(),this._activate())}},{key:"_activate",value:function t(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent("activate-".concat(e),{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}},{key:"render",value:function t(){return nT(V())}}]);return n}(t);return eq([n5({type:String})],n.prototype,"identifier",2),eq([n5({type:Number,reflect:!0,attribute:"tabindex"})],n.prototype,"tabIndex",2),eq([n5({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:rk})],n.prototype,"disabled",2),eq([n5({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:rk})],n.prototype,"readonly",2),eq([rt("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"handleDisabledChange",1),n}var rw=eG(H());var rx=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(j())}}]);return e}(nJ);rx.styles=rw,rx=eq([n2("qti-item-body")],rx);var rC=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(Q())}},{key:"connectedCallback",value:function t(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return e}(nJ);rC=eq([n2("qti-prompt")],rC);var rA=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.styleElement=null;return t}c(e,[{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t);var r=this.getAttribute("href");if(r!==null&&fetch(r).then(function(t){return t.text()}).then(function(t){var e=n.minifyCss(t);n.styleElement=document.createElement("style"),n.styleElement.media="screen",n.styleElement.textContent="@scope {".concat(e,"}"),n.parentElement?n.parentElement.appendChild(n.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}).catch(function(t){console.error("Failed to load stylesheet:",t)}),this.textContent!==null&&this.textContent.trim()!==""){var i=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent="@scope {".concat(i,"}"),this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"minifyCss",value:function t(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}},{key:"disconnectedCallback",value:function t(){if(this.styleElement)try{this.styleElement.remove()}catch(t){console.error("Could not remove stylesheet:",t)}d(f(e.prototype),"disconnectedCallback",this).call(this)}}]);return e}(nJ);rA=eq([n2("qti-stylesheet")],rA);var rS=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(B())}},{key:"defaultValues",value:function t(t){var e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;var n=e.map(function(t){return t.innerHTML.trim()});return n.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?n:n[0]}}]);return e}(nJ);rS=eq([n2("qti-variabledeclaration")],rS);var rq=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.externalScored=null;return t}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nT(F(),JSON.stringify(r,null,2))}},{key:"interpolationTable",get:function t(){var t=this.querySelector("qti-interpolation-table");if(t){var e=new Map;var n=true,r=false,i=undefined;try{for(var o=t.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var u=parseInt(s.getAttribute("source-value")),l=parseInt(s.getAttribute("target-value"));(isNaN(u)||isNaN(l))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),e.set(u,l)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e}return null}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this);var t={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}}]);return e}(rS);rq.styles=[eG(z())],eq([n5({type:String,attribute:"base-type"})],rq.prototype,"baseType",2),eq([n5({type:String,attribute:"external-scored"})],rq.prototype,"externalScored",2),eq([n5({type:String})],rq.prototype,"identifier",2),eq([n5({type:String})],rq.prototype,"cardinality",2),eq([eM({context:rn,subscribe:!0}),n6()],rq.prototype,"itemContext",2),rq=eq([n2("qti-outcome-declaration")],rq);var rR=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nT(W(),JSON.stringify(r,null,2))}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this);var t={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}},{key:"correctResponse",get:function t(){var t,e=this.querySelector("qti-correct-response");if(e){var n=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&n.length>0)t=n[0].textContent,n[0].remove();else if(this.cardinality!=="single"){t=[];for(var r=0;r<n.length;r++)t.push(n[r].textContent),n[r].remove()}}return t}},{key:"mapping",get:function t(){return this.querySelector("qti-mapping")}}]);return e}(rS);rR.styles=[eG(Y())],eq([n5({type:String,attribute:"base-type"})],rR.prototype,"baseType",2),eq([n5({type:String})],rR.prototype,"identifier",2),eq([n5({type:String})],rR.prototype,"cardinality",2),eq([eM({context:rn,subscribe:!0}),n6()],rR.prototype,"itemContext",2),rR=eq([n2("qti-response-declaration")],rR);var rP=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(nJ);rP=eq([n2("qti-companion-materials-info")],rP);var rT=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(X())}}]);return e}(nJ);rT=eq([n2("qti-content-body")],rT);var r$=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;this.classNames.split(" ").forEach(function(t){switch(t){case"qti-rubric-discretionary-placement":n.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":n.setAttribute("slot","");break;default:break}})}},{key:"render",value:function t(){return nT(Z())}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-rubric-block")}}]);return e}(nJ);r$.styles=eG(G()),eq([n5({type:String})],r$.prototype,"id",2),eq([n5({type:String})],r$.prototype,"use",2),eq([n5({type:String})],r$.prototype,"view",2),eq([n5({type:String,attribute:"class"})],r$.prototype,"classNames",2),eq([rt("classNames",{waitUntilFirstUpdate:!0})],r$.prototype,"handleclassNamesChange",1),r$=eq([n2("qti-rubric-block")],r$);var rD=function(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},rU=function(t){if(typeof t=="string")return t;var e=rD();return e==="."?t.toLocaleString():t.toString().replace(".","").replace(e,".")};function rM(t){return t==null}function rI(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}var rO=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}},{key:"checkShowFeedback",value:function t(t){var e=this.closest("qti-assessment-item").getOutcome(t);if(this.outcomeIdentifier!==t||!e)return;var n=!1;Array.isArray(e.value)?n=e.value.includes(this.identifier):n=!rM(this.identifier)&&!rM(e===null||e===void 0?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(n)}},{key:"showFeedback",value:function t(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}}]);return e}(nJ);eq([n5({type:String,attribute:"show-hide"})],rO.prototype,"showHide",2),eq([n5({type:String,attribute:"outcome-identifier"})],rO.prototype,"outcomeIdentifier",2),eq([n5({type:String})],rO.prototype,"identifier",2),eq([n5({type:String,attribute:!1})],rO.prototype,"showStatus",2);var rL=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(K(),this.showStatus)}},{key:"firstUpdated",value:function t(t){this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(rO);rL.styles=eG(J()),rL=eq([n2("qti-feedback-block")],rL);var rN=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nT(tt(),t.showStatus)};return t}return e}(rO);rN.styles=eG(te()),rN=eq([n2("qti-feedback-inline")],rN);var rV=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nT(tn(),t.showStatus)};return t}return e}(rO);rV.styles=eG(tr()),rV=eq([n2("qti-modal-feedback")],rV);var rH=function(t){return t!==null&&t!==void 0?t:nM};var rj=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.responseIdentifier="";t.disabled=!1;t.readonly=!1;t._correctResponse="";t._internals=t.attachInternals();return t}c(e,[{key:"reportValidity",value:function t(){return this._internals.reportValidity()}},{key:"reset",value:function t(){this.value=""}},{key:"correctResponse",get:function t(){return this._correctResponse},set:function t(t){this._correctResponse=t}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}},{key:"saveResponse",value:function t(t){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?$(t):t}}))}}]);return e}(nJ);rj.formAssociated=!0,eq([n5({type:String,attribute:"response-identifier"})],rj.prototype,"responseIdentifier",2),eq([n5({reflect:!0,type:Boolean})],rj.prototype,"disabled",2),eq([n5({reflect:!0,type:Boolean})],rj.prototype,"readonly",2),eq([n6()],rj.prototype,"_correctResponse",2);var rQ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._rows=5;t._value="";return t}c(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;var r=e.split(" "),i=!1;if(r.forEach(function(t){if(t.startsWith("qti-height-lines-")){var e=t.replace("qti-height-lines-","");n._rows=parseInt(e),i=!0}}),!i&&this.expectedLength){var o=Math.ceil(this.expectedLength/50);this._rows=o}}},{key:"value",get:function t(){return this._value},set:function t(t){if(typeof t=="string"){this._value=t;var e=new FormData;e.append(this.responseIdentifier,t),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),t.setCustomValidity("");var e=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:"^".concat(this.patternMask,"$"),n=new RegExp(e);t.checkValidity()&&n.test(t.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage))}else{var r=t.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"render",value:function t(){var t=this;return nT(to(),this.responseIdentifier,5e3,function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,function(e){t.reportValidity()},rH(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this._value)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;if(this.setEmptyAttribute(e.value),this._value!==e.value){this.value=e.value;var n=this.validate();this.saveResponse(e.value)}}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}],[{key:"styles",get:function t(){return[eG(ti())]}}]);return e}(rj);eq([n6()],rQ.prototype,"_rows",2),eq([n5({type:Number,attribute:"expected-length"})],rQ.prototype,"expectedLength",2),eq([n5({type:String,attribute:"pattern-mask"})],rQ.prototype,"patternMask",2),eq([n5({type:String,attribute:"placeholder-text"})],rQ.prototype,"placeholderText",2),eq([n5({type:String,attribute:"data-patternmask-message"})],rQ.prototype,"dataPatternmaskMessage",2),eq([n6()],rQ.prototype,"_value",2),eq([n5({type:String,attribute:"class"})],rQ.prototype,"classNames",2),eq([rt("classNames")],rQ.prototype,"handleclassNamesChange",1),rQ=eq([n2("qti-extended-text-interaction")],rQ);var rB=nX.I;var rF=function(t){return t.strings===void 0},rz=function(){return document.createComment("")},rW=function(t,e,n){var r=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){var o=r.insertBefore(rz(),i),a=r.insertBefore(rz(),i);n=new rB(o,a,t,t.options)}else{var s=n._$AB.nextSibling,u=n._$AM,l=u!==t;if(l){var c;var h;(c=n._$AQ)===null||c===void 0?void 0:c.call(n,t),n._$AM=t,n._$AP!==void 0&&(h=t._$AU)!==u._$AU&&n._$AP(h)}if(s!==i||l){var d=n._$AA;for(;d!==s;){var f=d.nextSibling;r.insertBefore(d,i),d=f}}}return n},rY=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;return t._$AI(e,n),t},rX={},rZ=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rX;return t._$AH=e},rG=function(t){return t._$AH},rK=function(t){var e;(e=t._$AP)===null||e===void 0?void 0:e.call(t,!1,!0);var n=t._$AA,r=t._$AB.nextSibling;for(;n!==r;){var i=n.nextSibling;n.remove(),n=i}};var rJ={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r0=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}return{_$litDirective$:t,values:n}}},r1=/*#__PURE__*/function(){"use strict";function t(e){s(this,t)}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AT",value:function t(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}},{key:"_$AS",value:function t(t,e){return this.update(t,e)}},{key:"update",value:function t(t,e){return this.render.apply(this,$(e))}}]);return t}();var r2=function(t,e){var n;var r=t._$AN;if(r===void 0)return!1;var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true){var l=u.value;(n=l._$AO)===null||n===void 0?void 0:n.call(l,e,!1),r2(l,e)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return!0},r3=function(t){var e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n===null||n===void 0?void 0:n.size)===0)},r4=function(t){for(var e;e=t._$AM;t=e){var n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),r9(e)}};function r5(t){this._$AN!==void 0?(r3(this),this._$AM=t,r4(this)):this._$AM=t}function r6(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;var r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(var o=n;o<r.length;o++)r2(r[o],!1),r3(r[o]);else r!=null&&(r2(r,!1),r3(r));else r2(this,t)}var r9=function(t){var e,n;t.type==rJ.CHILD&&((e=t._$AP)!==null&&e!==void 0?e:t._$AP=r6,(n=t._$AQ)!==null&&n!==void 0?n:t._$AQ=r5)},r7=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t._$AN=void 0;return t}c(e,[{key:"_$AT",value:function t(t,n,r){d(f(e.prototype),"_$AT",this).call(this,t,n,r),r4(this),this.isConnected=t._$AU}},{key:"_$AO",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n,r,i,o;t!==this.isConnected&&(this.isConnected=t,t?(n=(r=this).reconnected)===null||n===void 0?void 0:n.call(r):(i=(o=this).disconnected)===null||i===void 0?void 0:i.call(o)),e&&(r2(this,t),r3(this))}},{key:"setValue",value:function t(t){if(rF(this._$Ct))this._$Ct._$AI(t,this);else{var e=$(this._$Ct._$AH);e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}},{key:"disconnected",value:function t(){}},{key:"reconnected",value:function t(){}}]);return e}(r1);var r8=function(){return new it},it=function t(){"use strict";s(this,t)},ie=new WeakMap,ir=r0(/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(t){return nM}},{key:"update",value:function t(t,e){var n=q(e,1),r=n[0];var i;var o=r!==this.Y;return o&&this.Y!==void 0&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=t.options)===null||i===void 0?void 0:i.host,this.rt(this.ct=t.element)),nM}},{key:"rt",value:function t(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){var e;var n=(e=this.ht)!==null&&e!==void 0?e:globalThis,r=ie.get(n);r===void 0&&(r=new WeakMap,ie.set(n,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}},{key:"lt",get:function t(){var t,e;var n;return typeof this.Y=="function"?(t=ie.get((n=this.ht)!==null&&n!==void 0?n:globalThis))===null||t===void 0?void 0:t.get(this.Y):(e=this.Y)===null||e===void 0?void 0:e.value}},{key:"disconnected",value:function t(){this.lt===this.ct&&this.rt(void 0)}},{key:"reconnected",value:function t(){this.rt(this.ct)}}]);return e}(r7));var ii=eG(ta());var io=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._value="";t.inputRef=r8();return t}c(e,[{key:"value",get:function t(){return this._value},set:function t(t){if(typeof t=="string"){this._value=t;var e=new FormData;e.append(this.responseIdentifier,t),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),t.setCustomValidity(""),t.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage));else{var e=t.checkValidity();this._internals.setValidity(e?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"render",value:function t(){var t=this;return nT(ts(),this.responseIdentifier,function(e){t.reportValidity()},function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",rH(this.placeholderText?this.placeholderText:void 0),this._value,rH(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;if(this.setEmptyAttribute(e.value),this._value!==e.value){this.value=e.value;var n=this.validate();this.saveResponse(e.value)}}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"reset",value:function t(){this._value=""}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(rj);io.styles=ii,eq([n5({type:Number,attribute:"expected-length"})],io.prototype,"expectedLength",2),eq([n5({type:String,attribute:"pattern-mask"})],io.prototype,"patternMask",2),eq([n5({type:String,attribute:"placeholder-text"})],io.prototype,"placeholderText",2),eq([n5({type:String,attribute:"data-patternmask-message"})],io.prototype,"dataPatternmaskMessage",2),eq([n6()],io.prototype,"_value",2),io=eq([n2("qti-text-entry-interaction")],io);var ia=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t._choiceElements=[];t.minChoices=0;t.maxChoices=1;t._handleDisabledChange=function(e,n){t._choiceElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){t._choiceElements.forEach(function(t){return t.readonly=n})};t._value="";return t}c(n,[{key:"_handleMaxChoicesChange",value:function t(t,e){this._determineInputType()}},{key:"value",get:function t(){return Array.isArray(this._value)?this._value.join(","):this._value},set:function t(t){var e=this;if(this.maxChoices>1&&typeof t=="string"?this._value=t.split(","):this._value=t,Array.isArray(this._value)){var n=new FormData;this._value.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(this._value);this._updateChoiceSelection()}},{key:"correctResponse",get:function t(){return this._correctResponse},set:function t(t){this._correctResponse=t;var e=Array.isArray(t)?t:[t];this._choiceElements.forEach(function(t){t.internals.states.delete("correct-response"),t.internals.states.delete("incorrect-response"),e.length>0&&(e.includes(t.identifier)?t.internals.states.add("correct-response"):t.internals.states.add("incorrect-response"))})}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("register-".concat(e),this._registerChoiceElement),this.addEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.addEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"disconnectedCallback",value:function t(){d(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-".concat(e),this._registerChoiceElement),this.removeEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.removeEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"validate",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}),n=e.length,r=!0,i="";return this.maxChoices!==0&&n>this.maxChoices?(r=!1,i=this.dataset.maxSelectionsMessage||"You can select at most ".concat(this.maxChoices," choices.")):n<this.minChoices&&(r=!1,i=this.dataset.minSelectionsMessage||"You must select at least ".concat(this.minChoices," choices.")),e.length>0&&this._internals.setValidity(r?{}:{customError:!0},i,e[n-1]||this._choiceElements[0]||this),this.reportValidity(),r}},{key:"reportValidity",value:function t(){return this._validationMessageElement&&(this._internals.validity.valid?(this._validationMessageElement.textContent="",this._validationMessageElement.style.display="none"):(this._validationMessageElement.textContent=this._internals.validationMessage,this._validationMessageElement.style.display="block")),this._internals.validity.valid}},{key:"_registerChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;e.disabled=this.disabled,this._choiceElements.push(e),this._setInputType(e)}},{key:"_unregisterChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;this._choiceElements=this._choiceElements.filter(function(t){return t!==e})}},{key:"_determineInputType",value:function t(){var t=this;this._choiceElements.forEach(function(e){t._setInputType(e)})}},{key:"_setInputType",value:function t(t){t.internals.role=this.maxChoices===1?"radio":"checkbox",t.internals.states.add(t.internals.role)}},{key:"_choiceElementSelectedHandler",value:function t(t){var e=this;this._toggleChoiceChecked(t.target),this.maxChoices===1&&this._choiceElements.forEach(function(n){n.identifier!==t.detail.identifier&&e._setChoiceChecked(n,!1)}),this._handleChoiceSelection()}},{key:"_setChoiceChecked",value:function t(t,e){var n;((n=t.internals)===null||n===void 0?void 0:n.states)&&(e?(t.internals.states.add("--checked"),t.internals.ariaChecked="true"):(t.internals.states.delete("--checked"),t.internals.ariaChecked="false"))}},{key:"_getChoiceChecked",value:function t(t){return t.internals.states.has("--checked")}},{key:"_toggleChoiceChecked",value:function t(t){var e=this._getChoiceChecked(t);this._setChoiceChecked(t,!e)}},{key:"_handleChoiceSelection",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).map(function(t){return t.identifier});this.value=this.maxChoices===1?e[0]||"":e,this.validate(),this.saveResponse(this._value)}},{key:"_updateChoiceSelection",value:function t(){var t=this;var e=Array.isArray(this._value)?this._value:[this._value];this._choiceElements.forEach(function(n){var r=e.includes(n.identifier);t._setChoiceChecked(n,r)})}}]);return n}(t);return eq([n7("#validationMessage")],n.prototype,"_validationMessageElement",2),eq([n5({type:Number,attribute:"min-choices"})],n.prototype,"minChoices",2),eq([n5({type:Number,attribute:"max-choices"})],n.prototype,"maxChoices",2),eq([rt("maxChoices",{waitUntilFirstUpdate:!0})],n.prototype,"_handleMaxChoicesChange",1),eq([rt("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"_handleDisabledChange",2),eq([rt("readonly",{waitUntilFirstUpdate:!0})],n.prototype,"_handleReadonlyChange",2),n};var is=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nT(tu())};return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("qti-hottext-interaction","")}}]);return e}(ia(rj,"qti-hottext"));is=eq([n2("qti-hottext-interaction")],is);var iu=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),n.it=nM,t.type!==rJ.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}c(e,[{key:"render",value:function t(t){if(t===nM||t==null)return this._t=void 0,this.it=t;if(t===nU)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;var e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}]);return e}(r1);iu.directiveName="unsafeHTML",iu.resultType=1;var il=r0(iu);var ic=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.options=[];t.correctOption="";t.dataPrompt="select";return t}c(e,[{key:"render",value:function t(){return nT(th(),this.choiceSelected,this.disabled,this.readonly,this.options.map(function(t){return nT(tc(),t.value,t.selected,il(t.textContent))}),il(this.correctOption))}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("on-dropdown-selected",this.choiceSelected);var t=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1}].concat($(t.map(function(t){return{textContent:t.innerHTML,value:t.getAttribute("identifier"),selected:!1}})))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}},{key:"validate",value:function t(){var t=this.options.find(function(t){return t.selected});return t?t.value!=="":!1}},{key:"reset",value:function t(){this.options=this.options.map(function(t,e){return w(k({},t),{selected:e===0})})}},{key:"value",get:function t(){return this.options.find(function(t){return t.selected}).value},set:function t(t){this.options=this.options.map(function(e){return t===e.value&&(e.selected=!0),e})}},{key:"correctResponse",set:function t(t){if(t===""){this.correctOption="";return}this.correctOption='<span part="correct-option">'.concat(this.options.find(function(e){return t===e.value}).textContent,"</span>")}},{key:"choiceSelected",value:function t(t){var e=t.target.value;this.options=this.options.map(function(t){return w(k({},t),{selected:t.value===e})}),this.saveResponse(e)}}],[{key:"styles",get:function t(){return[eG(tl())]}}]);return e}(rj);ic.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],eq([n6()],ic.prototype,"options",2),eq([n6()],ic.prototype,"correctOption",2),eq([n5({attribute:"data-prompt",type:String})],ic.prototype,"dataPrompt",2),ic=eq([n2("qti-inline-choice-interaction")],ic);var ih=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t._shuffle=!1;return t}c(n,[{key:"shuffle",get:function t(){return this._shuffle},set:function t(t){var e=this._shuffle;this._shuffle=t,t?this._shuffleChoices():this._resetShuffleChoices(),this.requestUpdate("shuffle",e)}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.shuffle?this._shuffleChoices():this._resetShuffleChoices()}},{key:"_shuffleChoices",value:function t(){var t=Array.from(this.querySelectorAll(e)),n=[],r=[];if(t.forEach(function(t,e){t.hasAttribute("fixed")?n.push({element:t,index:e}):r.push(t)}),r.length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return}var i=!1,o=10,a=0,s=$(r);for(;!i&&a<o;){a++;for(var u=r.length-1;u>0;u--){var l=Math.floor(Math.random()*(u+1));var c;c=[r[l],r[u]],r[u]=c[0],r[l]=c[1],c}if(i=!r.every(function(t,e){return t===s[e]}),i)break}i||console.warn("Failed to shuffle the choices after multiple attempts.");var h=1;t.forEach(function(t,e){t.hasAttribute("fixed")?t.style.setProperty("order",String(h++)):r.shift().style.setProperty("order",String(h++))})}},{key:"_resetShuffleChoices",value:function t(){Array.from(this.querySelectorAll("qti-simple-choice")).forEach(function(t,e){t.style.setProperty("order","initial")})}}]);return n}(t);return eq([n5({type:String,reflect:!0,converter:id})],n.prototype,"shuffle",1),n},id={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}};var ip=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._classes=[];t._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];t._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"];return t}c(e,[{key:"class",get:function t(){var t;return((t=this._classes)===null||t===void 0?void 0:t.join(" "))||""},set:function t(t){t&&(this._classes=t.split(" "),this._addLabels())}},{key:"updated",value:function t(t){d(f(e.prototype),"updated",this).call(this,t),t.has("shuffle")&&this._addLabels()}},{key:"_addLabels",value:function t(){var t=this;var e=this._classes.some(function(e){return t._allLabels.includes(e)||t._allLabelSuffixes.includes(e)}),n=function(t){return!isNaN(+t)};if(e){var r=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(t){return t}).map(function(t,e){return{el:t,order:n(t.style.order)?+t.style.order:e+1}}).sort(function(t,e){return t.order-e.order}).map(function(t){return t.el});for(var i=0;i<r.length;i++)r[i].marker=this._getLabel(i+1)}}},{key:"_getLabel",value:function t(t){var e=this;var n=this._classes.filter(function(t){return e._allLabels.includes(t)}).pop(),r=this._classes.filter(function(t){return e._allLabelSuffixes.includes(t)}).pop();!n&&r&&(n="qti-labels-upper-alpha");var i="";switch(n){case"qti-labels-decimal":i="".concat(t);break;case"qti-labels-lower-alpha":i="".concat(String.fromCharCode(97+t-1));break;case"qti-labels-upper-alpha":i="".concat(String.fromCharCode(65+t-1));break}return r==="qti-labels-suffix-period"?i+=".":r==="qti-labels-suffix-parenthesis"&&(i+=")"),i}}]);return e}(t);return eq([n5({type:String,reflect:!0})],n.prototype,"class",1),n};var iv=eG(td());var iy=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tf())}}]);return e}(ip(ih(ia(rj,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"));iy.styles=iv,eq([n5({type:String})],iy.prototype,"orientation",2),iy=eq([n2("qti-choice-interaction")],iy);var im=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tp())}},{key:"process",value:function t(){var t=new ig,e=$(this.children);t.process(e)}}]);return e}(nJ);im.styles=[eG(tv())],im=eq([n2("qti-outcome-processing")],im);var ig=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,[{key:"process",value:function t(t){var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}}]);return t}();var ib='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier="RESPONSE"></qti-variable>\n <qti-correct identifier="RESPONSE"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',i_='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response identifier="RESPONSE"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',ik='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>';var iE=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(ty())}},{key:"process",value:function t(){var t=$(this.children);var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}},{key:"firstUpdated",value:function t(t){if(this.getAttribute("template")){var e=this.getAttribute("template").split("/"),n=e[e.length-1].replace(".xml","");switch(this.innerHTML="",n){case"map_response":{this.appendChild(this.fragmentFromString(i_).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(ik).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(ib).firstElementChild.firstElementChild);break}}}},{key:"fragmentFromString",value:function t(t){return document.createRange().createContextualFragment(t)}}]);return e}(nJ);iE.styles=[eG(tm())],iE=eq([n2("qti-response-processing")],iE);var iw=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tg())}},{key:"process",value:function t(){throw new Error("Not implemented")}}]);return e}(nJ);iw=eq([n2("qti-rule")],iw);var ix=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"childExpression",get:function t(){return this.firstElementChild}},{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),n;return e.interpolationTable&&(n=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),n==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:rU(n)}})),n)}}]);return e}(iw);eq([n5({type:String})],ix.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",ix);var iC=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tb())}},{key:"process",value:function t(){var t=$(this.children);for(var e=0;e<t.length;e++){var n=t[e];if(n.calculate()){n.process();return}}}}]);return e}(iw);customElements.define("qti-response-condition",iC);var iA=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.firstElementChild,n=new iS(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(n)?n.map(function(t){return rU(t)}):rU(n)}}))}}]);return e}(iw),iS=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expression=e}c(t,[{key:"process",value:function t(){var t=this.expression?this.expression.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}return t}}]);return t}();customElements.define("qti-set-outcome-value",iA);var iq=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(t_())}},{key:"calculate",value:function t(){return!0}},{key:"getSubRules",value:function t(){return $(this.children)}},{key:"process",value:function t(){var t=this.getSubRules();for(var e=0;e<t.length;e++)t[e].process()}}]);return e}(nJ);customElements.define("qti-response-else",iq);var iR=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.firstElementChild.calculate()}},{key:"getSubRules",value:function t(){var t=[];for(var e=1;e<this.children.length;e++)t.push(this.children[e]);return t}}]);return e}(iq);customElements.define("qti-response-if",iR);var iP=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tk(),d(f(e.prototype),"render",this).call(this))}}]);return e}(iR);customElements.define("qti-response-else-if",iP);var iT=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n=e.getAttribute("identifier")||"";return t.assessmentItem.getVariable(n)}case"qti-multiple":{var r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-correct":{var i=e.getAttribute("identifier")||"",o=t.assessmentItem.getResponse(i);return{baseType:o.baseType,value:o.correctResponse,cardinality:o.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}c(e,[{key:"render",value:function t(){return nT(tE(),JSON.stringify(this.result,null,2))}},{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}},{key:"assessmentItem",get:function t(){return this.closest("qti-assessment-item")}}]);return e}(nJ);iT.styles=eG(tw()),eq([n6()],iT.prototype,"result",2);var i$=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(iT);var iD=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(iU(i$));function iU(t){return /*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculateChildren",value:function t(t){return t.map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).every(function(t){return typeof t=="boolean"&&t})}}]);return e}(t)}customElements.define("qti-and",iD);var iM=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.baseType="string";return t}c(e,[{key:"getResult",value:function t(){return this.textContent.trim()}}]);return e}(iT);eq([n5({type:String,attribute:"base-type"})],iM.prototype,"baseType",2);customElements.define("qti-base-value",iM);var iI=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(this.children.length===2){var e=t[0],n=t[1];if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="multiple"){var r=e.value,i=n.value;return r.filter(function(t){return i.includes(t)}).length>0}else if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="single"){var o=e.value;return n.value.includes(o)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}}]);return e}(i$);customElements.define("qti-contains",iI);var iO=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"interpretation",get:function t(){return this.getAttribute("interpretation")||""}},{key:"getResult",value:function t(){var t=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(t);return e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}}]);return e}(iT);customElements.define("qti-correct",iO);var iL=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.roundingMode="significantFigures";return t}c(e,[{key:"figures",get:function t(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;var t=parseInt(this.getAttribute("figures")||"0");return isNaN(t)?(console.error("figures attribute is not a number"),null):t<0?(console.error("figures attribute is negative"),null):t<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):t}},{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(this.roundingMode===null)return null;if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti equal"),!1;switch(t[0].baseType){case"integer":case"float":{var r=parseFloat(e.value),i=parseFloat(n.value);if(!isNaN(r)&&!isNaN(i))return this.roundingMode==="significantFigures"?r.toPrecision(this.figures)===i.toPrecision(this.figures):Math.round(r*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(r,", ").concat(i));break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}}]);return e}(iT);eq([n5({type:String})],iL.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",iL);var iN=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,null,[{key:"compareSingleValues",value:function t(t,e,n){switch(n){case"identifier":case"string":return t===e;case"integer":{var r=parseInt(t,10),i=parseInt(e,10);if(!isNaN(r)&&!isNaN(i))return r===i;console.error("Cannot convert ".concat(t," and/or ").concat(e," to int."));break}case"float":{var o=parseFloat(t),a=parseFloat(e);if(!isNaN(o)&&!isNaN(a))return o===a;console.error("couldn't convert ".concat(t," and/or ").concat(e," to float."));break}case"pair":case"directedPair":{var s=t.split(" ").sort(),u=e.split(" ").sort();if(s.length===2&&u.length===2)return n==="pair"&&(s.sort(),u.sort()),s.join(" ")===u.join(" ");console.error("compared two pair but one of the values does not have 2 values: 1: ".concat(t," 2: ").concat(e));break}}return!1}}]);return t}();var iV=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.toleranceMode="exact";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),!1):iN.compareSingleValues(e.value,n.value,e.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return e}(iT);eq([n5({type:String})],iV.prototype,"toleranceMode",2);customElements.define("qti-equal",iV);var iH=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+n.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}}]);return e}(iT);customElements.define("qti-gt",iH);var ij=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+n.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}}]);return e}(i$);customElements.define("qti-gte",ij);var iQ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===1){var t=this.getVariables();if(!t)return!0;var e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}}]);return e}(iT);customElements.define("qti-is-null",iQ);var iB=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+n.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}}]);return e}(iT);customElements.define("qti-lt",iB);var iF=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+n.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}}]);return e}(i$);customElements.define("qti-lte",iF);var iz=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.assessmentItem.getResponse(this.identifier);if(!t)return console.warn("Response ".concat(this.identifier," can not be found")),null;var e=t.mapping,n=Array.isArray(t.value)?t.value:[t.value],r=0;var i=true,o=false,a=undefined;try{var s=function(){var n=l.value;var i=e.mapEntries.find(function(e){return iN.compareSingleValues(e.mapKey,n,t.baseType)});i==null||i.mappedValue==null?r+=e.defaultValue:r+=i.mappedValue};for(var u=n[Symbol.iterator](),l;!(i=(l=u.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&u.return!=null){u.return()}}finally{if(o){throw a}}}return e.lowerBound!=null&&(r=Math.max(e.lowerBound,r)),e.upperBound!=null&&(r=Math.min(e.upperBound,r)),r}}]);return e}(iT);eq([n5({type:String})],iz.prototype,"identifier",2);customElements.define("qti-map-response",iz);var iW=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.defaultValue=0;return t}c(e,[{key:"mapEntries",get:function t(){return Array.from(this.querySelectorAll("qti-map-entry")).map(function(t){return{mapKey:t.getAttribute("map-key"),mappedValue:+t.getAttribute("mapped-value")}})}}]);return e}(nJ);eq([n5({attribute:"default-value",type:Number})],iW.prototype,"defaultValue",2),eq([n5({attribute:"lower-bound",type:Number})],iW.prototype,"lowerBound",2),eq([n5({attribute:"upper-bound",type:Number})],iW.prototype,"upperBound",2);customElements.define("qti-mapping",iW);var iY=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),n=t[0],r=t[1];return e.match(n,r)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function t(t,e){switch(e.cardinality){case"single":var n;return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):iN.compareSingleValues((n=t.value)===null||n===void 0?void 0:n.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;for(var r=0;r<t.value.length;r++)if(!iN.compareSingleValues(e.value[r],t.value[r],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;var i=0;var o=true,a=false,s=undefined;try{for(var u=e.value[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;var h=null,d=$(t.value);var f=true,p=false,v=undefined;try{for(var y=d[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;if(iN.compareSingleValues(c,g,e.baseType)){h=g;break}}}catch(t){p=true;v=t}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(p){throw v}}}if(h!==null)d.splice(d.indexOf(h),1);else return!1;i++}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return e}(iT);customElements.define("qti-match",iY);var iX=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");var e=q(t,2),n=e[0],r=e[1];if(n.baseType!==r.baseType&&console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(n.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(n.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),n.value===null||r.value===null)return null;var i=n.value;return r.value.includes(i)}}]);return e}(iT);customElements.define("qti-member",iX);var iZ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="multiple"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(iT);customElements.define("qti-multiple",iZ);var iG=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tx(),d(f(e.prototype),"render",this).call(this))}},{key:"getResult",value:function t(){return!this.firstElementChild.calculate()}}]);return e}(iT);customElements.define("qti-not",iG);var iK=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return Array.from(this.children).map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).some(function(t){return typeof t=="boolean"&&t})}}]);return e}(i$);customElements.define("qti-or",iK);var iJ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="ordered"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(iT);customElements.define("qti-ordered",iJ);var i0=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nT(tC(),JSON.stringify(r,null,2))}},{key:"calculate",value:function t(){var t=this.closest("qti-assessment-item"),e=this.identifier;return t.getVariable(e).value}}]);return e}(nJ);eq([n5({type:String})],i0.prototype,"identifier",2),eq([eM({context:rn,subscribe:!0}),n6()],i0.prototype,"itemContext",2);customElements.define("qti-printed-variable",i0);var i1=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return this.getVariables().reduce(function(t,e){if(e.baseType=="float"||e.baseType=="integer")try{return t*parseInt(e.value.toString())}catch(t){console.warn("can not convert to number")}else console.warn("has another baseType ".concat(e.baseType));return t},1)}}]);return e}(iT);customElements.define("qti-product",i1);var i2=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.caseSensitive="true";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti string-match"),!1;var r=this.caseSensitive==="true"?e.value:e.value.toLowerCase(),i=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return iN.compareSingleValues(r,i,e.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return e}(iT);eq([n5({type:String,attribute:"case-sensitive"})],i2.prototype,"caseSensitive",2);customElements.define("qti-string-match",i2);var i3=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t._expression=new i4(Array.from(t.children));return t}c(e,[{key:"getResult",value:function t(){return this._expression.calculate()}}]);return e}(iT),i4=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expressions=e}c(t,[{key:"calculate",value:function t(){return this.expressions.map(function(t){if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var e=t.calculate();return Number.isNaN(e)?(console.error("unexpected value in qti-sum, expected number"),null):Number(e)}).reduce(function(t,e){return t+e},0)}}]);return t}();customElements.define("qti-sum",i3);var i5=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}}]);return e}(iT);customElements.define("qti-variable",i5);var i6=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;var n;t=a(this,e,arguments),n=t;t._errorMessage=null;t.loadConfig=/*#__PURE__*/function(){var t=o(function(t,e){var r,i,o,a;return O(this,function(o){switch(o.label){case 0:t=n.removeDoubleSlashes(t);o.label=1;case 1:o.trys.push([1,5,,6]);return[4,fetch(t)];case 2:r=o.sent();if(!r.ok)return[3,4];return[4,r.json()];case 3:i=o.sent();for(var s in i.paths)e&&(i.paths[s]=n.getResolvablePath(i.paths[s],e));return[2,i];case 4:return[3,6];case 5:a=o.sent();return[3,6];case 6:return[2,null]}})});return function(e,n){return t.apply(this,arguments)}}();t.getResolvablePathString=function(e,n){return e=e.replace(/\.js$/,""),(e===null||e===void 0?void 0:e.toLocaleLowerCase().startsWith("http"))||!n?e:t.removeDoubleSlashes("".concat(n,"/").concat(e))};t.getResolvablePath=function(e,n){return Array.isArray(e)?e.map(function(e){return t.getResolvablePathString(e,n)}):t.getResolvablePathString(e,n)};return t}c(e,[{key:"convertQtiVariableJSON",value:function t(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n){for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];if(Array.isArray(i))return i.map(String);if(i!=null)return String(i)}}}return null}},{key:"startChecking",value:function t(){var t=this;this.intervalId=setInterval(function(){var e=t.pci.getResponse(),n=t.pci.getResponse(),r=JSON.stringify(e);if(r!==t.rawResponse){t.rawResponse=r;var i=t.convertQtiVariableJSON(n);t.value=i,t.saveResponse(i)}},200)}},{key:"stopChecking",value:function t(){this.intervalId!==void 0&&clearInterval(this.intervalId)}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this.rawResponse},set:function t(t){}},{key:"getTAOConfig",value:function t(t){var e=t.querySelectorAll("properties"),n={},r=function(t){var e={},n=t.getAttribute("key");if(n){var r=Array.from(t.children),o=r.map(function(t){return t.getAttribute("key")});o.length>0&&!o.find(function(t){return!Number.isInteger(+t)})?e[n]=r.map(function(t){return i(t)}):e[n]=t.textContent}return e},i=function(t){if(t){var e={};var n=true,i=false,o=undefined;try{for(var a=t.children[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var u=s.value;e=k({},e,r(u))}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e}};var o=true,a=false,s=undefined;try{for(var u=e[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;return c.getAttribute("key")||(n=k({},n,i(c))),n}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return console.log("Can not find qti-custom-interaction config"),null}},{key:"register",value:function t(t){this.pci=t;var e=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",n=e=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");n.classList.add("qti-customInteraction"),e=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");var r=e=="IMS"?{properties:this.dataset,onready:function(){console.log("onready")}}:this.getTAOConfig(this);e=="IMS"?t.getInstance(n,r,void 0):t.initialize(this.customInteractionTypeIdentifier,n.firstElementChild,r),e=="TAO"&&Array.from(this.querySelectorAll("link")).map(function(t){return t.getAttribute("href")}).forEach(function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.media="screen",e.href=t,n.appendChild(e)}),this.startChecking()}},{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this),define("qtiCustomInteractionContext",function(){return{register:function(e){t.register(e)},notifyReady:function(){}}});var n=this.buildRequireConfig();requirejs.config(n)(["require"],function(e){e([t.module])})}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),requirejs.undef(this.customInteractionTypeIdentifier);var t=requirejs.s.contexts;delete t[this.customInteractionTypeIdentifier],this.stopChecking()}},{key:"buildRequireConfig",value:function t(){var t={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;var e=this.getAttribute("data-base-url"),n=this.querySelector("qti-interaction-modules");if(n){var r=n.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true){var l=u.value;var c=l.getAttribute("id"),h=l.getAttribute("primary-path"),d=l.getAttribute("fallback-path");if(c&&h){var f=d?this.combineRequireResolvePaths(this.getResolvablePath(h,e),this.getResolvablePath(d,e)):this.getResolvablePath(h,e),p=t.paths[c]||[];t.paths[c]=this.combineRequireResolvePaths(p,f)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return t}},{key:"combineRequireResolvePaths",value:function t(t,e){var n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e];return n.concat(r)}},{key:"removeDoubleSlashes",value:function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}},{key:"render",value:function t(){return nT(tS(),this._errorMessage&&nT(tA(),this._errorMessage))}}]);return e}(rj);eq([n5({type:String,attribute:"response-identifier"})],i6.prototype,"responseIdentifier",2),eq([n5({type:String,attribute:"module"})],i6.prototype,"module",2),eq([n5({type:String,attribute:"custom-interaction-type-identifier"})],i6.prototype,"customInteractionTypeIdentifier",2),eq([n6()],i6.prototype,"_errorMessage",2),i6=eq([n2("qti-portable-custom-interaction")],i6);var i9=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.touchStartTime=0;this.touchStartPoint=null;this.lastClickTime=0;this.isDraggable=!1;this.dragSource=null;this.dragClone=null;this.touchEndTriggered=!1;this.isDragging=!1;this.initialTransform="";this.hasDispatchedDragStart=!1;this.rootNode=null;this.focusedElement=null;this.focusableDropZones=[];this.currentDropZoneIndex=-1;this.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"};this.cloneOffset={x:0,y:0};this.lastTarget=null;this.currentDropTarget=null;this.allowClick=!0;this.copyStylesForDragClone=!0;this.dragOnClickEnabled=!1;this.useDragClone=!1;this.MIN_DRAG_DISTANCE=5;this.DRAG_CLONE_OPACITY=1;if(t.instance)return t.instance;t.instance=this,document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("keyup",this.handleKeyUp.bind(this))}c(t,[{key:"addDraggableElements",value:function t(t){var e=this;t.forEach(function(t){t.setAttribute("tabindex","0"),t.addEventListener("focus",function(){return e.focusedElement=t}),t.addEventListener("blur",function(){return e.focusedElement=null}),t.addEventListener("touchstart",e.handleTouchStart.bind(e),{passive:!1}),t.addEventListener("mousedown",e.handleTouchStart.bind(e),{passive:!1})})}},{key:"handleTouchStart",value:function t(t){this.touchStartTime=Date.now();var e=this.getEventCoordinates(t),n=e.x,r=e.y;if(this.touchStartPoint={x:n,y:r},this.dragSource=t.currentTarget,this.isDraggable=!0,this.rootNode=this.dragSource.getRootNode(),this.dragOnClickEnabled&&(this.isDragging=!0,this.createDragClone(t,{clientX:n,clientY:r})),!this.useDragClone){var i=window.getComputedStyle(this.dragSource);this.initialTransform=i.transform==="none"?"":i.transform,this.initialTransition=i.transition||"",this.dragSource.style.transition="none";var o=this.dragSource.getBoundingClientRect();this.cloneOffset.x=n-o.left,this.cloneOffset.y=r-o.top,this.dragSource.style.zIndex="9999",this.dragSource.focus()}t.preventDefault()}},{key:"handleTouchMove",value:function t(t){if(this.isDraggable&&this.dragSource){var e=this.getEventCoordinates(t),n=e.x,r=e.y,i={clientX:n,clientY:r};this.calculateDragDistance(i)>=this.MIN_DRAG_DISTANCE&&(this.dragSource.style.pointerEvents="none",this.isDragging=!0),this.createDragClone(t,i),t.preventDefault()}}},{key:"createDragClone",value:function t(t,e){if(!this.isDragging)return;if(this.useDragClone){if(!this.dragClone){if(this.dragSource.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone=this.dragSource.cloneNode(!0),this.copyStylesForDragClone){var n=window.getComputedStyle(this.dragSource);var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;this.dragClone.style[u]=n.getPropertyValue(u)}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}v(this.rootNode,ShadowRoot)?this.rootNode.host.appendChild(this.dragClone):v(this.rootNode,Document)&&document.body.appendChild(this.dragClone),this.calculateClonePosition(e),this.setDragCloneStyles(e),this.dispatchCustomEvent(this.dragSource,"dragstart")}this.updateDragClonePosition(e)}else if(this.touchStartPoint){var l=e.clientX-this.touchStartPoint.x,c=e.clientY-this.touchStartPoint.y;this.dragSource.style.transform="".concat(this.initialTransform," translate(").concat(l,"px, ").concat(c,"px)"),this.hasDispatchedDragStart||(this.dispatchCustomEvent(this.dragSource,"dragstart"),this.hasDispatchedDragStart=!0)}var h=this.findDropTarget(t);h!==this.lastTarget&&(this.dispatchCustomEvent(h,"dragenter"),this.dispatchCustomEvent(this.lastTarget,"dragleave"),this.lastTarget=h),this.currentDropTarget=h,this.currentDropTarget&&this.dispatchCustomEvent(h,"dragover")}},{key:"handleTouchEnd",value:function t(t){this.touchEndTriggered=!0,this.isDraggable=!1;var e=!1;if(this.currentDropTarget)this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),e=!0;else if(this.isDragging){var n;var r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(n=this.dragSource)===null||n===void 0?void 0:n.dispatchEvent(r)}this.resetDragState(e)}},{key:"handleTouchCancel",value:function t(t){this.resetDragState()}},{key:"findDropTarget",value:function t(t){var e=this.getEventCoordinates(t),n=e.x,r=e.y;return this.getDropTargetAtPoint(document,n,r)}},{key:"getDropTargetAtPoint",value:function t(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r>2)return null;var i=t.elementFromPoint(e,n);if(!i)return null;if(i.hasAttribute("dropzone"))return i;var o=i.parentElement;for(;o;){if(o.hasAttribute("dropzone"))return o;o=o.parentElement}if(i.shadowRoot&&r<2){var a=this.getDropTargetAtPoint(i.shadowRoot,e,n,r+1);if(a)return a}return null}},{key:"handleKeyDown",value:function t(t){this.focusedElement&&(t.key===" "&&!this.isDragging?(t.preventDefault(),this.isDraggable=!0,this.dragSource=this.focusedElement,this.isDragging=!0,this.collectDropZones(),this.dispatchCustomEvent(this.dragSource,"dragstart")):t.key==="Tab"&&this.isDragging&&(t.preventDefault(),this.moveToNextDropZone()))}},{key:"handleKeyUp",value:function t(t){t.key===" "&&this.isDragging&&this.currentDropTarget&&(t.preventDefault(),this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),this.resetDragState(!0))}},{key:"collectDropZones",value:function t(){this.focusableDropZones=Array.from(document.querySelectorAll("[dropzone]")),this.currentDropZoneIndex=-1}},{key:"moveToNextDropZone",value:function t(){if(this.focusableDropZones.length===0)return;this.currentDropZoneIndex=(this.currentDropZoneIndex+1)%this.focusableDropZones.length;var t=this.focusableDropZones[this.currentDropZoneIndex];t.focus(),this.currentDropTarget=t,this.dispatchCustomEvent(t,"dragenter")}},{key:"getEventCoordinates",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=t.touches?t.touches[0]:t;return{x:e?n.pageX:n.clientX,y:e?n.pageY:n.clientY}}},{key:"calculateClonePosition",value:function t(t){var e=this.dragSource.getBoundingClientRect();this.cloneOffset.x=t.clientX-e.left,this.cloneOffset.y=t.clientY-e.top}},{key:"setDragCloneStyles",value:function t(t){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(t.clientY-this.cloneOffset.y,"px"),this.dragClone.style.left="".concat(t.clientX-this.cloneOffset.x,"px"),this.dragClone.style.pointerEvents="none",this.dragClone.style.zIndex="999999"}},{key:"updateDragClonePosition",value:function t(t){var e=this;requestAnimationFrame(function(){if(e.touchEndTriggered||!e.dragClone)return;var n=t.clientX-e.cloneOffset.x,r=t.clientY-e.cloneOffset.y,i=e.applyBoundaries(n,r,e.dragClone),o=i.newLeft,a=i.newTop;e.dragClone.style.left="".concat(o,"px"),e.dragClone.style.top="".concat(a,"px")})}},{key:"applyTransformBoundaries",value:function t(t,e){var n;v(this.rootNode,ShadowRoot)?n=this.rootNode.host.getBoundingClientRect():v(this.rootNode,Document)?n=document.documentElement.getBoundingClientRect():n=new DOMRect(0,0,window.innerWidth,window.innerHeight);var r=this.dragSource.getBoundingClientRect(),i=r.width,o=r.height,a=r.left+t,s=r.top+e,u=Math.max(n.left,Math.min(a,n.right-i)),l=Math.max(n.top,Math.min(s,n.bottom-o)),c=u-r.left,h=l-r.top;return{boundedDeltaX:c,boundedDeltaY:h}}},{key:"applyBoundaries",value:function t(t,e,n){var r;v(this.rootNode,ShadowRoot)?r=this.rootNode.host.getBoundingClientRect():v(this.rootNode,Document)?r=document.documentElement.getBoundingClientRect():r=new DOMRect(0,0,window.innerWidth,window.innerHeight);var i=n.getBoundingClientRect(),o=i.width,a=i.height,s=Math.max(r.left,Math.min(t,r.right-o)),u=Math.max(r.top,Math.min(e,r.bottom-a));return{newLeft:s,newTop:u}}},{key:"calculateDragDistance",value:function t(t){var e=Math.abs(t.clientX-this.touchStartPoint.x),n=Math.abs(t.clientY-this.touchStartPoint.y);return e+n}},{key:"dispatchCustomEvent",value:function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t)return;var r=new CustomEvent(e,{bubbles:n,cancelable:!0});r.dataTransfer=this.dataTransfer,t.dispatchEvent(r)}},{key:"resetDragState",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var e;this.isDragging&&(this.useDragClone?(this.dragSource.style.opacity="1.0",(e=this.dragClone)===null||e===void 0?void 0:e.parentElement.removeChild(this.dragClone)):(t||(this.dragSource.style.transform="translate(0, 0)"),this.dragSource.style.zIndex="",this.dragSource.style.pointerEvents="",this.dragSource.style.transition=this.initialTransition,this.initialTransition="")),this.isDragging=!1,this.dragSource=null,this.dragClone=null,this.isDraggable=!1,this.touchStartTime=0,this.touchStartPoint=null,this.touchEndTriggered=!1,this.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"},this.cloneOffset={x:0,y:0},this.lastTarget=null,this.currentDropTarget=null,this.allowClick=!0,this.initialTransform="",this.hasDispatchedDragStart=!1,this.rootNode=null}}]);return t}();var i7=function(t,e,n){var r=/*#__PURE__*/function(t){"use strict";p(r,t);function r(){s(this,r);var t;t=a(this,r,arguments);t.disabled=!1;return t}c(r,[{key:"firstUpdated",value:function t(t){var e=this;if(this.isMatchTabular())return;d(f(r.prototype),"firstUpdated",this).call(this,t);var n=this.getDroppableElements();this.initializeEventHandlers(),n.forEach(function(t){e.prepareDroppable(t),e.observeDroppableAttributes(t)})}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"getDroppableElements",value:function t(){return Array.from(e?this.shadowRoot.querySelectorAll(n):this.querySelectorAll(n))}},{key:"initializeEventHandlers",value:function t(){this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this)}},{key:"prepareDroppable",value:function t(t){t.setAttribute("dropzone","move"),t.addEventListener("dragleave",this.dragleaveHandler),this.attachEventListeners(t)}},{key:"observeDroppableAttributes",value:function t(t){var e=this;this.observer=new MutationObserver(function(n){n.forEach(function(n){var r=n.attributeName;r==="disabled"&&e.toggleDroppableHandlers(t)})}),this.observer.observe(t,{attributes:!0})}},{key:"toggleDroppableHandlers",value:function t(t){t.hasAttribute("disabled")?this.removeEventListeners(t):this.attachEventListeners(t)}},{key:"attachEventListeners",value:function t(t){t.addEventListener("dragover",this.dragoverHandler),t.addEventListener("dragenter",this.dragenterHandler),t.addEventListener("drop",this.dropHandler)}},{key:"removeEventListeners",value:function t(t){t.removeEventListener("dragover",this.dragoverHandler),t.removeEventListener("dragenter",this.dragenterHandler),t.removeEventListener("drop",this.dropHandler)}},{key:"disconnectedCallback",value:function t(){var t;this.isMatchTabular()||(d(f(r.prototype),"disconnectedCallback",this).call(this),(t=this.observer)===null||t===void 0?void 0:t.disconnect())}},{key:"dragenterHandler",value:function t(t){t.preventDefault()}},{key:"dragoverHandler",value:function t(t){return t.preventDefault(),this.activateDroppable(t.currentTarget),t.dataTransfer.dropEffect="move",!1}},{key:"activateDroppable",value:function t(t){t.setAttribute("active","")}},{key:"dropHandler",value:function t(t){var e=this;return o(function(){var n,r,i,o,a;return O(this,function(s){switch(s.label){case 0:t.preventDefault();n=t.currentTarget,r=t.dataTransfer.getData("text"),i=e.findDraggable(r);if(!i)return[3,4];if(!(i&&!e.isValidDrop(n,i)))return[3,1];a=(i.style.transform="translate(0, 0)",!1);return[3,3];case 1:return[4,e.moveDraggableToDroppable(i,n)];case 2:a=(s.sent(),e.deactivateDroppable(n),!1);s.label=3;case 3:o=a;return[3,5];case 4:o=!1;s.label=5;case 5:return[2,o]}})})()}},{key:"findDraggable",value:function t(t){return t?this.querySelector("[identifier=".concat(t,"]"))||this.shadowRoot.querySelector("[identifier=".concat(t,"]")):null}},{key:"isValidDrop",value:function t(t,e){return e.parentElement.getAttribute("identifier")!==t.getAttribute("identifier")}},{key:"moveDraggableToDroppable",value:function t(t,e){var n=this;return o(function(){var r;return O(this,function(i){switch(i.label){case 0:r=function(){t.style.transform="translate(0, 0)",e.appendChild(t),n.checkMaxAssociations(),n.saveResponse(null)};if(!document.startViewTransition){r();return[2]}return[4,document.startViewTransition(r).finished];case 1:i.sent();return[2]}})})()}},{key:"deactivateDroppable",value:function t(t){t.removeAttribute("active")}},{key:"dragleaveHandler",value:function t(t){return t.preventDefault(),this.deactivateDroppable(t.currentTarget),t.dataTransfer.dropEffect="none",!1}}]);return r}(t);return eq([n5({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var i8=function(t,e,n){var r=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(t);return r};function ot(t,e){var n,r=k({},e);return function(e,r){var i=e.connectedCallback,o=e.disconnectedCallback;e.connectedCallback=function(){var e=this;i.call(this);var o=function(n){var i=Array.from(e.querySelectorAll(t));var o=true,a=false,s=undefined;try{for(var u=n[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;var h=Array.from(c.addedNodes).map(function(t){return t}),d=Array.from(c.addedNodes).map(function(t){return t});c.type==="childList"&&h.find(function(t){return i.includes(t)})&&e[r](h,d)}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}};n=new MutationObserver(o),n.observe(this,{childList:!0,subtree:!0});var a;var s=(a=this.querySelectorAll(t))!==null&&a!==void 0?a:[];this[r](Array.from(s),[])},e.disconnectedCallback=function(){o.call(this),n.disconnect()}}}var oe=function(t,e,n,r){var i=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;var n;t=a(this,e,arguments),n=t;t.draggables=new Map;t.droppables=[];t.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};t.minAssociations=1;t.maxAssociations=1;t.handleDragStart=function(e){var n=e.currentTarget;e.dataTransfer.setData("text",n.getAttribute("identifier")),n.setAttribute("dragging",""),t.activateDroppables()};t.handleDragEnd=/*#__PURE__*/function(){var t=o(function(t){var e;return O(this,function(r){switch(r.label){case 0:t.preventDefault(),n.deactivateDroppables();e=t.currentTarget;e.removeAttribute("dragging");return[4,n.wasDropped(t)];case 1:r.sent()||n.configuration.dragCanBePlacedBack&&n.restoreInitialDraggablePosition(e);return[2]}})});return function(e){return t.apply(this,arguments)}}();t.checkForMoveTestItem=function(t){return t.dataTransfer.items?new Promise(function(e){var n=!1,r=Array.from(t.dataTransfer.items),i=r.length;if(i===0){e(!1);return}r.forEach(function(t){t.kind==="string"&&t.type==="text"?t.getAsString(function(t){t==="move-test"&&(n=!0),i===0&&e(n)}):i===0&&e(n)})}):Promise.resolve(!1)};return t}c(e,[{key:"handleDraggablesChange",value:function t(t,e){if(this.isMatchTabular())return;var n=this.filterExistingDraggables(t);n.length>0&&this.addNewDraggables(n)}},{key:"firstUpdated",value:function t(t){d(f(e.prototype),"firstUpdated",this).call(this,t),this.initializeDroppables()}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.initializeDragDropApi()}},{key:"initializeDragDropApi",value:function t(){this.dragDropApi=new i9,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"filterExistingDraggables",value:function t(t){var e=this;return t.filter(function(t){return!e.draggables.has(t)})}},{key:"addNewDraggables",value:function t(t){var e=this;this.dragDropApi.addDraggableElements(t),t.forEach(function(t){return e.storeDraggable(t)})}},{key:"storeDraggable",value:function t(t){var e=Array.from(t.parentNode.children).indexOf(t);this.draggables.set(t,{parent:t.parentElement,index:e}),t.style.viewTransitionName="drag-".concat(e,"-").concat(this.getAttribute("identifier")||crypto.randomUUID()),t.setAttribute("qti-draggable","true"),t.addEventListener("dragstart",this.handleDragStart),t.addEventListener("dragend",this.handleDragEnd)}},{key:"initializeDroppables",value:function t(){this.droppables=Array.from(n?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r))}},{key:"activateDroppables",value:function t(){this.droppables.forEach(function(t){return t.setAttribute("enabled","")})}},{key:"deactivateDroppables",value:function t(){this.droppables.forEach(function(t){return t.removeAttribute("enabled")})}},{key:"wasDropped",value:function t(t){var e=this;return o(function(){var n;return O(this,function(r){switch(r.label){case 0:return[4,e.checkForMoveTestItem(t)];case 1:n=r.sent();return[2,t.dataTransfer.dropEffect!=="none"||n]}})})()}},{key:"wasMoved",value:function t(t){return t.dataTransfer.dropEffect==="move"}},{key:"restoreInitialDraggablePosition",value:function t(t){var e=this;return o(function(){var n,r,i,o,a,s;return O(this,function(u){n=e.draggables.get(t),r=n.parent,i=n.index,o=Math.min(i,r.children.length),a=function(t,n,r){var i=Math.min(r,n.children.length);n.insertBefore(t,n.children[i]),t.style.transform="translate(0, 0)",e.checkMaxAssociations()};if(!document.startViewTransition){a(t,r,i);return[2]}s=document.startViewTransition(function(){t.style.transform="",a(t,r,i)});return[2]})})()}},{key:"checkMaxAssociations",value:function t(){var t=this;this.droppables.forEach(function(e,n){var r=+(e.getAttribute("match-max")||1);e.querySelectorAll('[qti-draggable="true"]').length>=r?t.disableDroppable(e):t.enableDroppable(e)})}},{key:"disableDroppable",value:function t(t){t.setAttribute("disabled",""),t.removeAttribute("dropzone")}},{key:"enableDroppable",value:function t(t){t.removeAttribute("disabled"),t.setAttribute("dropzone","move")}},{key:"value",get:function t(){return this.collectResponseData()},set:function t(t){var e=this;this.isMatchTabular()||(this.resetDroppables(),t===null||t===void 0?void 0:t.forEach(function(t){return e.placeResponse(t)}))}},{key:"placeResponse",value:function t(t){var e=this;var n=T(t.split(" ").reverse()),r=n[0],i=n.slice(1),o=this.findDroppableById(r);i.forEach(function(t){return e.placeDraggableInDroppable(t,o)})}},{key:"findDroppableById",value:function t(t){return this.droppables.find(function(e){return e.getAttribute("identifier")===t})}},{key:"placeDraggableInDroppable",value:function t(t,e){var n=this;return o(function(){var r,i,o;return O(this,function(a){switch(a.label){case 0:r=n.querySelector("[identifier=".concat(t,"]"));if(!e||!r){console.error("Cannot find draggable or droppable with the given identifier: ".concat(t));return[2]}i=function(){r.style.transform="translate(0, 0)",e.appendChild(r),n.checkMaxAssociations()};if(!document.startViewTransition)return[3,2];return[4,document.startViewTransition(i).finished];case 1:o=a.sent();return[3,3];case 2:o=i();a.label=3;case 3:o;return[2]}})})()}},{key:"validate",value:function t(){var t=this.getValidAssociations();return this.minAssociations<=0||this.minAssociations<=t}},{key:"getValidAssociations",value:function t(){return this.droppables.filter(function(t){return t.childElementCount>0}).length}},{key:"saveResponse",value:function t(){var t=this.collectResponseData();this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:t}}))}},{key:"collectResponseData",value:function t(){return this.droppables.map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]'),n=Array.from(e).map(function(t){return t.getAttribute("identifier")}),r=t.getAttribute("identifier");return n.map(function(t){return"".concat(t," ").concat(r)})}).flat()}},{key:"reset",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.resetDroppables(),t&&this.saveResponse()}},{key:"resetDroppables",value:function t(){var t=this;return o(function(){var e;return O(this,function(n){switch(n.label){case 0:e=function(t,e,n){t.style.transform="translate(0, 0)";var r=Math.min(n,e.children.length);e.insertBefore(t,e.children[r])};if(!document.startViewTransition){t.draggables.forEach(function(t,n){var r=t.parent,i=t.index;e(n,r,i)});return[2]}return[4,document.startViewTransition(function(){t.draggables.forEach(function(t,n){var r=t.parent,i=t.index;e(n,r,i)})}).finished];case 1:n.sent();return[2]}})})()}}]);return e}(i8(i7(t,n,r),r,e));return eq([n5({attribute:!1,type:Object})],i.prototype,"configuration",2),eq([n5({type:Number,reflect:!0,attribute:"min-associations"})],i.prototype,"minAssociations",2),eq([n5({type:Number,reflect:!0,attribute:"max-associations"})],i.prototype,"maxAssociations",2),eq([ot(e)],i.prototype,"handleDraggablesChange",1),i};var on=eG(tq());var or=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._childrenMap=[];t._registerChoiceHandler=t._registerChoice.bind(t),t.addEventListener("register-qti-simple-associable-choice",t._registerChoiceHandler);return t}c(e,[{key:"_registerChoice",value:function t(t){var e=t.target;this._childrenMap.push(e)}},{key:"render",value:function t(){return nT(tP(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(t,e){return nT(tR(),e,e,e,e)}))}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return e}(oe(rj,"qti-simple-associable-choice",!0,".dl"));or.styles=on,eq([n6()],or.prototype,"_childrenMap",2),or=eq([n2("qti-associate-interaction")],or);var oi=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._errorMessage=null;t.handlePostMessage=t.handlePostMessage.bind(t);return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this);var n=this.data.startsWith("http")?this.data:rI(this.baseItemUrl+"/"+this.data);fetch(n).then(function(t){return t.json()}).then(function(e){t.manifest=e,t.setupCES()}).catch(function(e){t._errorMessage=e})}},{key:"setupCES",value:function t(){var t=this.shadowRoot.querySelector("#pciContainer"),e=t.contentWindow||t,n=t.contentDocument;window.addEventListener("message",this.handlePostMessage),n.open(),n.write("\n <html>\n <head>\n <link href='".concat(rI("".concat(this.baseRefUrl,"/").concat(this.manifest.style[0])),"' rel=\"stylesheet\" />\n <script src='").concat(rI("".concat(this.baseRefUrl,"/").concat(this.manifest.script[0])),"'></script>\n </head>\n <body></body>\n </html>\n ")),n.close()}},{key:"getIFrames",value:function t(){var t=this.shadowRoot.querySelectorAll("iframe"),e=this.querySelectorAll("iframe"),n=$(t).concat($(e));var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;var l=u.src;if(new URL(l,window.location.href).origin===window.location.origin)try{var c=u.contentDocument||u.contentWindow.document;c&&this.getInnerIFrames(c,n)}catch(t){console.error("Error accessing nested iframe:",t)}}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}return n.forEach(function(t,e){n.indexOf(t)!==e&&n.splice(e,1)}),n}},{key:"getInnerIFrames",value:function t(t){var e=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.querySelectorAll("iframe").forEach(function(t){n.push(t);var r=t.src;if(new URL(r,window.location.href).origin===window.location.origin)try{var i=t.contentDocument||t.contentWindow.document;e.getInnerIFrames(i,n)}catch(t){console.error("Error accessing nested iframe:",t)}else console.warn("Skipped cross-origin iframe:",r)}),n}},{key:"postToWindowAndIframes",value:function t(t,e){window.postMessage({type:t,data:e},"*");var n=this.getIFrames();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;u.contentWindow&&u.contentWindow.postMessage({type:t,data:e},"*")}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"handlePostMessage",value:function t(t){var e=this;var n=t.data,r=n.type,i=n.data;switch(r){case"setResponse":this.rawResponse=i,this.saveResponse(i);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{var o=this.manifest.media.map(function(t){return t.startsWith("http")?t:rI(e.baseRefUrl+"/"+t)});this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function t(){return this.rawResponse!==""}},{key:"value",get:function t(){return this.rawResponse},set:function t(t){if(typeof t=="string")this.rawResponse=t,this.saveResponse(t);else throw new Error("Value must be a string")}},{key:"disconnectedCallback",value:function t(){window.removeEventListener("message",this.handlePostMessage),d(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function t(){return nT(t$(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&nT(tT(),this._errorMessage))}}]);return e}(rj);eq([n5({type:String,attribute:"response-identifier"})],oi.prototype,"responseIdentifier",2),eq([n5({type:String,attribute:"data"})],oi.prototype,"data",2),eq([n5({type:String,attribute:"data-base-item"})],oi.prototype,"baseItemUrl",2),eq([n5({type:String,attribute:"data-base-ref"})],oi.prototype,"baseRefUrl",2),eq([n5({type:String,attribute:"id"})],oi.prototype,"id",2),eq([n6()],oi.prototype,"_errorMessage",2),oi=eq([n2("qti-custom-interaction")],oi);var oo=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.countAttempt="true";return t}c(e,[{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return""},set:function t(t){}},{key:"render",value:function t(){return nT(tD(),this.disabled,this.endAttempt,this.title)}},{key:"endAttempt",value:function t(t){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}}]);return e}(rj);eq([n5({type:String,attribute:"count-attempt"})],oo.prototype,"countAttempt",2),eq([n5({type:String})],oo.prototype,"title",2),oo=eq([n2("qti-end-attempt-interaction")],oo);var oa=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tU())}},{key:"correctResponse",set:function t(t){var e=this;var n=[],r=Array.isArray(t)?t:[t];r&&(n=r.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-gap").forEach(function(t,r){var i,o,a;var s=t.getAttribute("identifier"),u=(i=n.find(function(t){return t.gap===s}))===null||i===void 0?void 0:i.text,l=(o=e.querySelector('qti-gap-text[identifier="'.concat(u,'"]')))===null||o===void 0?void 0:o.textContent.trim();if(u&&l){var c;if(!((c=t.nextElementSibling)===null||c===void 0?void 0:c.classList.contains("correct-option"))){var h=document.createElement("span");h.classList.add("correct-option"),h.textContent=l,t.insertAdjacentElement("afterend",h)}}else((a=t.nextElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}}]);return e}(oe(rj,"qti-gap-text",!1,"qti-gap"));oa.styles=[eG(tM())],oa=eq([n2("qti-gap-match-interaction")],oa);var os=function(t,e,n){var r=new Map;for(var i=e;i<=n;i++)r.set(t[i],i);return r},ou=r0(/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),t.type!==rJ.CHILD)throw Error("repeat() can only be used in text expressions");return n}c(e,[{key:"dt",value:function t(t,e,n){var r;n===void 0?n=e:e!==void 0&&(r=e);var i=[],o=[],a=0;var s=true,u=false,l=undefined;try{for(var c=t[Symbol.iterator](),h;!(s=(h=c.next()).done);s=true){var d=h.value;i[a]=r?r(d,a):a,o[a]=n(d,a),a++}}catch(t){u=true;l=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(u){throw l}}}return{values:o,keys:i}}},{key:"render",value:function t(t,e,n){return this.dt(t,e,n).values}},{key:"update",value:function t(t,e){var n=q(e,3),r=n[0],i=n[1],o=n[2];var a=rG(t),s=this.dt(r,i,o),u=s.values,l=s.keys;if(!Array.isArray(a))return this.ut=l,u;var c;var h=(c=this.ut)!==null&&c!==void 0?c:this.ut=[],d=[],f,p,v=0,y=a.length-1,m=0,g=u.length-1;for(;v<=y&&m<=g;)if(a[v]===null)v++;else if(a[y]===null)y--;else if(h[v]===l[m])d[m]=rY(a[v],u[m]),v++,m++;else if(h[y]===l[g])d[g]=rY(a[y],u[g]),y--,g--;else if(h[v]===l[g])d[g]=rY(a[v],u[g]),rW(t,d[g+1],a[v]),v++,g--;else if(h[y]===l[m])d[m]=rY(a[y],u[m]),rW(t,a[v],a[y]),y--,m++;else if(f===void 0&&(f=os(l,m,g),p=os(h,v,y)),f.has(h[v]))if(f.has(h[y])){var b=p.get(l[m]),_=b!==void 0?a[b]:null;if(_===null){var k=rW(t,a[v]);rY(k,u[m]),d[m]=k}else d[m]=rY(_,u[m]),rW(t,a[v],_),a[b]=null;m++}else rK(a[y]),y--;else rK(a[v]),v++;for(;m<=g;){var E=rW(t,d[g+1]);rY(E,u[m]),d[m++]=E}for(;v<=y;){var w=a[v++];w!==null&&rK(w)}return this.ut=l,rZ(t,d),nU}}]);return e}(r1));function ol(t,e,n,r){switch(t){case"circle":{var i=q(e,3),o=i[0],a=i[1],s=i[2],u=o/n.width*100,l=a/n.height*100,c=s/n.width*100;r.style.left=u-c+"%",r.style.top=l-c+"%",r.style.width=r.style.height=4*c+"px",r.style.borderRadius="9999px"}break;case"rect":{var h=q(e,4),d=h[0],f=h[1],p=h[2],v=h[3],y=d/n.width*100,m=f/n.height*100,g=p/n.width*100,b=v/n.height*100;r.style.left=y+"%",r.style.top=m+"%",r.style.width=g-y+"%",r.style.height=b-m+"%"}break;case"poly":{var _,k,E,w;var x=e.reduce(function(t,e,n,r){if(n%2===1){var i=t.pop();t[t.length]={x:i,y:r[n]}}else t.push(e);return t},[]),C=(_=Math).min.apply(_,$(x.map(function(t){return t.x}))),A=(k=Math).max.apply(k,$(x.map(function(t){return t.x}))),S=(E=Math).min.apply(E,$(x.map(function(t){return t.y}))),R=(w=Math).max.apply(w,$(x.map(function(t){return t.y}))),P=C/n.width*100,T=S/n.height*100,D=A/n.width*100,U=R/n.height*100;r.style.left=C/n.width*100+"%",r.style.top=S/n.height*100+"%",r.style.width=D-P+"%",r.style.height=U-T+"%";var M=x.map(function(t){return{x:(t.x-C)/(A-C)*100,y:(t.y-S)/(R-S)*100}}).map(function(t){return Math.round(t.x)+"% "+Math.round(t.y)+"%"}).join(",");r.style.clipPath="polygon(".concat(M,")")}break;default:break}}var oc=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.startPoint=null;t.endPoint=null;t._lines=[];t.addEventListener("qti-register-hotspot",t.positionHotspotOnRegister);return t}c(e,[{key:"reset",value:function t(){this._lines=[]}},{key:"validate",value:function t(){return this._lines.length>0}},{key:"value",get:function t(){return this._lines},set:function t(t){Array.isArray(t)&&(this._lines=t)}},{key:"render",value:function t(){var t=this;var e,n,r,i;return nT(tL(),rH((e=this.grImage[0])===null||e===void 0?void 0:e.width),rH((n=this.grImage[0])===null||n===void 0?void 0:n.height),(r=this.grImage[0])===null||r===void 0?void 0:r.width,(i=this.grImage[0])===null||i===void 0?void 0:i.height,ou(this._lines,function(t){return t},function(e,n){return n$(tI(),parseInt(t.querySelector("[identifier="+e.split(" ")[0]+"]").style.left),parseInt(t.querySelector("[identifier="+e.split(" ")[0]+"]").style.top),parseInt(t.querySelector("[identifier="+e.split(" ")[1]+"]").style.left),parseInt(t.querySelector("[identifier="+e.split(" ")[1]+"]").style.top),function(e){e.stopPropagation(),t._lines=t._lines.filter(function(t,e){return e!==n}),t.saveResponse(t._lines)})}),this.startPoint&&n$(tO(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});ol(i,o,e,n)}},{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",function(t){n.mouseCoord={x:t.clientX-n.grImage[0].getBoundingClientRect().left,y:t.clientY-n.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(function(t){t.style.left=t.getAttribute("coords").split(",")[0]+"px",t.style.top=t.getAttribute("coords").split(",")[1]+"px",t.addEventListener("click",function(t){n.startPoint?n.endPoint||(n.endPoint=t.target,n._lines=$(n._lines).concat([n.startPoint.getAttribute("identifier")+" "+n.endPoint.getAttribute("identifier")]),n.saveResponse(n._lines),n.startPoint=null,n.endPoint=null):(n.startPoint=t.target,n.startCoord={x:n.startPoint.getAttribute("coords").split(",")[0],y:n.startPoint.getAttribute("coords").split(",")[1]})})})}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(rj);oc.styles=[eG(tN())],eq([n6()],oc.prototype,"_lines",2),eq([n6()],oc.prototype,"startCoord",2),eq([n6()],oc.prototype,"mouseCoord",2),eq([n7("svg")],oc.prototype,"svgContainer",2),eq([n8({selector:"img"})],oc.prototype,"grImage",2),oc=eq([n2("qti-graphic-associate-interaction")],oc);var oh=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tV())}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});switch(i){case"circle":{var a=q(o,3),s=a[0],u=a[1],l=a[2];n.style.left=s-l+"px",n.style.top=u-l+"px",n.style.width=n.style.height=2*l+"px"}break;case"rect":{var c=q(o,4),h=c[0],d=c[1],f=c[2],p=c[3];n.style.left=h+"px",n.style.top=d+"px",n.style.width=f-h+"px",n.style.height=p-d+"px"}break;default:break}}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(oe(rj,"qti-gap-img",!1,"qti-associable-hotspot"));oh.styles=eG(tH()),oh=eq([n2("qti-graphic-gap-match-interaction")],oh);var od=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tj())}},{key:"setHotspotOrder",value:function t(t){var e=t.detail,n=e.identifier,r=this._choiceElements.find(function(t){return t.getAttribute("identifier")===n}),i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(function(t){return t.order>0}).length>=i){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(function(t){return!!t.order}).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(function(t){return t.order>t.order&&t.order--,t}),r.order=null;this.choiceOrdering=!1}}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});ol(i,o,e,n)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return e}(ia(rj,"qti-hotspot-choice"));od.styles=[eG(tQ())],od=eq([n2("qti-graphic-order-interaction")],od);var of=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(tB())}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});ol(i,o,e,n)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}}]);return e}(ia(rj,"qti-hotspot-choice"));of.styles=[eG(tF())],of=eq([n2("qti-hotspot-interaction")],of);var op=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.matchMin=0;t.matchMax=1;t.fixed=!1;return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}},{key:"render",value:function t(){return nT(tz())}}]);return e}(rE(nJ,"qti-simple-associable-choice"));op.styles=eG(tW()),eq([n5({type:Number,attribute:"match-min"})],op.prototype,"matchMin",2),eq([n5({type:Number,attribute:"match-max"})],op.prototype,"matchMax",2),eq([n5({type:Boolean,attribute:"fixed"})],op.prototype,"fixed",2),op=eq([n2("qti-simple-associable-choice")],op);var ov=eG(tY());var oy=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.lastCheckedRadio=null;t._response=[];t.correctOptions=[];t.responseIdentifier="";t.handleRadioClick=function(e){var n=e.target;t.lastCheckedRadio===n?(n.checked=!1,t.lastCheckedRadio=null,t.handleRadioChange(e)):t.lastCheckedRadio=n};t.handleRadioChange=function(e){var n=e.target,r=n.value,i=n.name,o=n.type;n.checked?(t.value?t.value.indexOf(r)===-1&&(o==="radio"&&(t.value=t.value.filter(function(t){return t.indexOf(i)===-1})),t.value=$(t.value).concat([r])):t.value=[r],t.lastCheckedRadio=n):(t.value=t.value.filter(function(t){return t!==r}),t.lastCheckedRadio=null),t.requestUpdate(),t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t.responseIdentifier,response:Array.isArray(t.value)?$(t.value):t.value}}))};return t}c(e,[{key:"value",get:function t(){return this.classList.contains("qti-match-tabular")?this._response:d(f(e.prototype),"value",this)},set:function t(t){this.classList.contains("qti-match-tabular")?this._response=t:A(f(e.prototype),"value",t,this,true)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){r().call(n),n.rows=Array.from(n.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),n.cols=Array.from(n.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),n.value=[];return[2]})})()}},{key:"correctResponse",set:function t(t){if(t===""){this.correctOptions=[];return}else Array.isArray(t)&&(this.correctOptions=t)}},{key:"render",value:function t(){var t=this;return this.classList.contains("qti-match-tabular")?nT(tK(),this.cols.map(function(t,e){return nT(tX(),il(t.innerHTML))}),this.rows.map(function(e,n){return nT(tG(),il(e.innerHTML),t.cols.map(function(n,r){var i=e.getAttribute("identifier"),o=n.getAttribute("identifier"),a="".concat(i," ").concat(o),s=t.value.filter(function(t){return t.split(" ")[0]===i}).length||0,u=t.value.includes(a),l="rb ".concat(u?"rb-checked":""," ").concat(t.correctOptions.includes(a)?"rb-correct":""),c=t.correctOptions.length>0?!0:e.matchMax===1?!1:s>=e.matchMax&&!u;return nT(tZ(),e.matchMax===1?"radio":"checkbox",l,i,a,c,function(e){return t.handleRadioChange(e)},function(n){return e.matchMax===1?t.handleRadioClick(n):null})}))})):nT(tJ())}}]);return e}(oe(rj,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"));oy.styles=ov,eq([n6()],oy.prototype,"_response",2),eq([n6()],oy.prototype,"correctOptions",2),eq([n5({type:String,attribute:"response-identifier"})],oy.prototype,"responseIdentifier",2),oy=eq([n2("qti-match-interaction")],oy);var om=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._value=0;return t}c(e,[{key:"reset",value:function t(){}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){if(!isNaN(parseInt(t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}},{key:"render",value:function t(){return nT(t0())}},{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){t._value++,t.saveResponse(t.value)})}}],[{key:"properties",get:function t(){return w(k({},rj.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return e}(rj);om.styles=[eG(t1())],om=eq([n2("qti-media-interaction")],om);var og=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.nrChoices=0;t.correctResponses=[];t.showCorrectResponses=!1;return t}c(e,[{key:"render",value:function t(){var t=this;var e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),nT(t3(),Array.from(Array(this.nrChoices)).map(function(e,n){return nT(t2(),n,t.showCorrectResponses&&t.correctResponses.length>n?il("<span part='correct-response'>".concat(t.correctResponses[n],"</span>")):"")}))}},{key:"correctResponse",set:function t(t){var e=this;if(t===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(t)?t:[t]).forEach(function(t,n){var r=e.querySelector('qti-simple-choice[identifier="'.concat(t,'"]'));r||(r=e.shadowRoot.querySelector('qti-simple-choice[identifier="'.concat(t,'"]')));var i=r===null||r===void 0?void 0:r.textContent.trim();e.correctResponses=$(e.correctResponses).concat([i])}),this.showCorrectResponses=!0}},{key:"getResponse",value:function t(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]');return $(Array.from(e).map(function(t){return t.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function t(t){var n=this;var r=this,i=function(){return d(f(e.prototype),"firstUpdated",n)};return o(function(){return O(this,function(e){i().call(r,t),r.childrenMap=Array.from(r.querySelectorAll("qti-simple-choice")),r.childrenMap.forEach(function(t){return t.setAttribute("part","qti-simple-choice")});return[2]})})()}}]);return e}(ih(oe(rj,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"));og.styles=[eG(t4())],eq([n6()],og.prototype,"nrChoices",2),eq([n6()],og.prototype,"correctResponses",2),eq([n6()],og.prototype,"showCorrectResponses",2),eq([n5({type:String})],og.prototype,"orientation",2),og=eq([n2("qti-order-interaction")],og);var ob=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(t5())}}]);return e}(nJ);ob.styles=[eG(t6())];customElements.define("qti-position-object-interaction",ob);var o_=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t.removeMoveListener=t.removeMoveListener.bind(t),t.dragElementHandler=t.dragElementHandler.bind(t);return t}c(e,[{key:"render",value:function t(){return nT(t9())}},{key:"dragElementHandler",value:function t(t){t.preventDefault();var e=t.clientX-this.startX,n=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+n+"px",this.startX=t.clientX,this.startY=t.clientY}},{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",function(t){n.startX=t.clientX,n.startY=t.clientY,document.addEventListener("mousemove",n.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}},{key:"removeMoveListener",value:function t(t){document.removeEventListener("mousemove",this.dragElementHandler,!0)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return e}(nJ);o_.styles=[eG(t7())],o_=eq([n2("qti-position-object-stage")],o_);var ok="important",oE=" !"+ok,ow=r0(/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;var r;if(n=a(this,e,[t]),t.type!==rJ.ATTRIBUTE||t.name!=="style"||((r=t.strings)===null||r===void 0?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");return n}c(e,[{key:"render",value:function t(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return r==null?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(r,";")},"")}},{key:"update",value:function t(t,e){var n=q(e,1),r=n[0];var i=t.element,o=i.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);var a=true,s=false,u=undefined;try{for(var l=this.ft[Symbol.iterator](),c;!(a=(c=l.next()).done);a=true){var h=c.value;r[h]==null&&(this.ft.delete(h),h.includes("-")?o.removeProperty(h):o[h]=null)}}catch(t){s=true;u=t}finally{try{if(!a&&l.return!=null){l.return()}}finally{if(s){throw u}}}for(var d in r){var f=r[d];if(f!=null){this.ft.add(d);var p=typeof f=="string"&&f.endsWith(oE);d.includes("-")||p?o.setProperty(d,p?f.slice(0,-11):f,p?ok:""):o[d]=f}}return nU}}]);return e}(r1));var ox=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.maxChoices=1/0;t.minChoices=0;t._points=[];t._imgElement=null;t._onImageClick=function(e){if(t._points.length<t.maxChoices){var n=e.offsetX,r=e.offsetY;t._points=$(t._points).concat(["".concat(n," ").concat(r)]),t.saveResponse(t._points)}};return t}c(e,[{key:"render",value:function t(){var t=this;return nT(et(),ou(this._points,function(t){return t},function(e,n){return nT(t8(),ow({position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(e.split(" ")[0],"px"),top:"".concat(e.split(" ")[1],"px")}),e,function(e){e.stopPropagation(),t._points=t._points.filter(function(t,e){return e!==n}),t.saveResponse(t._points)})}))}},{key:"reset",value:function t(){this._points=[]}},{key:"validate",value:function t(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}},{key:"value",get:function t(){return this._points},set:function t(t){this._points=Array.isArray(t)?t:[t]}},{key:"firstUpdated",value:function t(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}}]);return e}(rj);ox.styles=[eG(ee())],eq([n5({type:Number,attribute:"max-choices"})],ox.prototype,"maxChoices",2),eq([n5({type:Number,attribute:"min-choices"})],ox.prototype,"minChoices",2),eq([n6()],ox.prototype,"_points",2),ox=eq([n2("qti-select-point-interaction")],ox);var oC=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._value=0;t.stepLabel=!1;t.reverse=!1;t._handleDisabledChange=function(t,e){};t._handleReadonlyChange=function(t,e){};t.csLive=getComputedStyle(t);return t}c(e,[{key:"min",get:function t(){return this._min},set:function t(t){this._min=t,this._value=t,this.style.setProperty("--min","".concat(this._min))}},{key:"max",get:function t(){return this._max},set:function t(t){this._max=t,this.style.setProperty("--max","".concat(this._max))}},{key:"step",get:function t(){return this._step},set:function t(t){this._step=t,this.style.setProperty("--step","".concat(this._step))}},{key:"reset",value:function t(){}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){if(!isNaN(parseInt(t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}},{key:"response",set:function t(t){if(Array.isArray(t)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}var e=parseInt(t);if(Number.isNaN(e)){console.error("QtiSliderInteraction: response is not a number");return}this._value=e}},{key:"render",value:function t(){this._value<this.min&&(this._value=this.min),this._value>this.max&&(this._value=this.max);var t=(this._value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage","".concat(t,"%")),this.setAttribute("aria-valuenow",this.value.toString()),nT(eo(),this.csLive.getPropertyValue("--show-bounds")=="true"?nT(en(),this._min,this._max):nM,this.csLive.getPropertyValue("--show-ticks")=="true"?nT(er()):nM,this._onMouseDown,this._onTouchMove,this.csLive.getPropertyValue("--show-value")=="true"?nT(ei(),this.value):nM)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"_onTouchMove",value:function t(t){var e=this;var n=function(t){var n=e.getPositionFromEvent(t),r=n.x,i=r-e._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;e.calculateValue(i),t.stopPropagation()},r=function(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),e.saveResponse(e.value.toString())};document.addEventListener("touchmove",n),document.addEventListener("touchend",r);var i=this.getPositionFromEvent(t),o=i.x,a=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),t.stopPropagation()}},{key:"_onMouseDown",value:function t(t){var e=this;var n=function(t){var n=t.pageX-e._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;e.calculateValue(n),t.preventDefault(),t.stopPropagation()},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),e.saveResponse(e.value.toString())};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r);var i=t.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(i),t.preventDefault(),t.stopPropagation()}},{key:"calculateValue",value:function t(t){var e=this.min+(this.max-this.min)*t/this._rail.getBoundingClientRect().width,n=this.min+Math.round((e-this.min)/this._step)*this._step;this._value=n}},{key:"getPositionFromEvent",value:function t(t){var e;if(t.type=="touchstart"||t.type=="touchmove"||t.type=="touchend"||t.type=="touchcancel"){var n=D(t.originalEvent)>"u"?t:t.originalEvent,r=n.touches[0]||n.changedTouches[0];e={x:r.pageX,y:r.pageY}}else(t.type=="mousedown"||t.type=="mouseup"||t.type=="mousemove"||t.type=="mouseover"||t.type=="mouseout"||t.type=="mouseenter"||t.type=="mouseleave")&&(e={x:t.clientX,y:t.clientY});return e}}]);return e}(rj);oC.styles=[eG(ea())],eq([n7("#knob")],oC.prototype,"_knob",2),eq([n7("#rail")],oC.prototype,"_rail",2),eq([n5({type:Boolean,attribute:"step-label"})],oC.prototype,"stepLabel",2),eq([n5({type:Boolean})],oC.prototype,"reverse",2),eq([n5({type:Number,attribute:"lower-bound"})],oC.prototype,"min",1),eq([n5({type:Number,attribute:"upper-bound"})],oC.prototype,"max",1),eq([n5({type:Number,attribute:"step"})],oC.prototype,"step",1),eq([rt("disabled",{waitUntilFirstUpdate:!0})],oC.prototype,"_handleDisabledChange",2),eq([rt("readonly",{waitUntilFirstUpdate:!0})],oC.prototype,"_handleReadonlyChange",2),oC=eq([n2("qti-slider-interaction")],oC);var oA=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(es(),this.handleSlotChange)}},{key:"handleSlotChange",value:function t(t){var e;var n;var r=Array.from((n=(e=this.firstElementChild)===null||e===void 0?void 0:e.childNodes)!==null&&n!==void 0?n:[]).find(function(t){return t.nodeType===Node.COMMENT_NODE});try{var i;this.operatorFunction=new Function("context","fn","item",(i=r.textContent)!==null&&i!==void 0?i:"")}catch(t){console.error("custom-operator contains invalid javascript code",t)}}},{key:"calculate",value:function t(){var t=this;var e={variable:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:""},correct:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.correctResponse)!==null&&i!==void 0?i:""}},n={getVariable:function(e){var n;return(n=t._context)===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier===e})},updateOutcomeVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:n}}))},updateResponseVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,response:n}}))}};return this.operatorFunction(this._context,e,n)}}]);return e}(nJ);eq([eM({context:rn,subscribe:!0}),n6()],oA.prototype,"_context",2),oA=eq([n2("qti-custom-operator")],oA);var oS=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,cancelable:!1,composed:!0}))}},{key:"render",value:function t(){return nT(eu())}}]);return e}(nJ);oS.styles=eG(el()),oS=eq([n2("qti-associable-hotspot")],oS);var oq=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"render",value:function t(){return nT(ec())}}]);return e}(nJ);oq.styles=eG(eh()),eq([n5({type:Number,reflect:!0})],oq.prototype,"tabindex",2),oq=eq([n2("qti-gap")],oq);var oR=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){this.setAttribute("slot","qti-gap-img")}}]);return e}(nJ);oR.styles=eG(ed()),eq([n5({type:Number,reflect:!0})],oR.prototype,"tabindex",2),oR=eq([n2("qti-gap-img")],oR);var oP=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-gap-text")}},{key:"render",value:function t(){return nT(ef())}}]);return e}(rE(nJ,"qti-gap-text"));oP.styles=eG(ep()),eq([n5({type:Number,reflect:!0})],oP.prototype,"tabindex",2),oP=eq([n2("qti-gap-text")],oP);var oT=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(rE(nJ,"qti-hotspot-choice"));oT.styles=eG(ev()),eq([n5({attribute:"aria-ordervalue",type:Number,reflect:!0})],oT.prototype,"order",2),oT=eq([n2("qti-hotspot-choice")],oT);var o$=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nT(ey())}}]);return e}(rE(nJ,"qti-hottext"));o$.styles=eG(em()),o$=eq([n2("qti-hottext")],o$);var oD=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,cancelable:!1,composed:!0}))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("click",this._onSelectInlineChoice)}},{key:"render",value:function t(){return nT(eb())}},{key:"_onSelectInlineChoice",value:function t(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}}],[{key:"styles",get:function t(){return[eG(eg())]}}]);return e}(nJ);eq([n5({type:String})],oD.prototype,"identifier",2),oD=eq([n2("qti-inline-choice")],oD);var oU=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"checked",get:function t(){return this.internals.states.has("--checked")}},{key:"render",value:function t(){return nT(ek(),this.marker?nT(e_(),this.marker):nM)}}]);return e}(rE(nJ,"qti-simple-choice"));oU.styles=eG(eE()),eq([n5({type:String,attribute:!1})],oU.prototype,"marker",2),oU=eq([n2("qti-simple-choice")],oU);console.log("%cC\xbfTO%cLab%c: qti-components loaded","font-weight:bold; color:green",'font-family: "PT Sans", font-weight:bold; color:green; font-size: smaller;vertical-align: sub',"font-weight:unset");function oM(t){var e=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"assessmentItem",get:function t(){var t;return(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector("qti-assessment-item")}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){switch(t.label){case 0:r().call(n);return[4,n.updateComplete];case 1:t.sent(),n.dispatchEvent(new CustomEvent("qti-item-connected",{bubbles:!0,composed:!0,detail:{identifier:n.identifier,href:n.href}}));return[2]}})})()}},{key:"render",value:function t(){return nT(ew(),this.xmlDoc)}}]);return e}(t);return eq([n5({type:String,reflect:!0})],e.prototype,"identifier",2),eq([n5({type:String})],e.prototype,"href",2),eq([n5({type:Object,attribute:!1})],e.prototype,"xmlDoc",2),e}var oI=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(oM(nJ));oI=eq([n2("qti-item")],oI);var oO=/*#__PURE__*/function(){var t=o(function(t){var e,n,r,i,o,a;return O(this,function(s){switch(s.label){case 0:e=t.substring(0,t.lastIndexOf("/"));return[4,rg().load("".concat(t)).then(function(t){return t.assessmentTest()})];case 1:n=s.sent();return[4,rb().load("".concat(e,"/").concat(n.href)).then(function(t){return t.htmlDoc()})];case 2:r=s.sent();return[4,rb().load("".concat(e,"/").concat(n.href)).then(function(t){return t.items()})];case 3:i=s.sent(),o="".concat(e,"/").concat(n.href),a="".concat(e,"/").concat(n.href.substring(0,n.href.lastIndexOf("/")));return[2,{testHTMLDoc:r,testURI:a,testURL:o,items:i,testIdentifier:n.identifier}]}})});return function e(e){return t.apply(this,arguments)}}(),oL=/*#__PURE__*/function(){var t=o(function(t){return O(this,function(e){return[2,rm().load(t).then(function(t){return t.htmlDoc().firstElementChild})]})});return function e(e){return t.apply(this,arguments)}}();export{rE as ActiveElementMixin,rj as Interaction,iD as QtiAnd,rr as QtiAssessmentItem,r_ as QtiAssessmentStimulusRef,oS as QtiAssociableHotspot,or as QtiAssociateInteraction,iM as QtiBaseValue,iy as QtiChoiceInteraction,rP as QtiCompanionMaterialsInfo,i$ as QtiConditionExpression,iI as QtiContains,rT as QtiContentBody,iO as QtiCorrect,oi as QtiCustomInteraction,oA as QtiCustomOperator,oo as QtiEndAttemptInteraction,iV as QtiEqual,iL as QtiEqualRounded,iT as QtiExpression,rQ as QtiExtendedTextInteraction,rL as QtiFeedbackBlock,rN as QtiFeedbackInline,oq as QtiGap,oR as QtiGapImg,oa as QtiGapMatchInteraction,oP as QtiGapText,oc as QtiGraphicAssociateInteraction,oh as QtiGraphicGapMatchInteraction,od as QtiGraphicOrderInteraction,iH as QtiGt,ij as QtiGte,oT as QtiHotspotChoice,of as QtiHotspotInteraction,o$ as QtiHottext,is as QtiHottextInteraction,oD as QtiInlineChoice,ic as QtiInlineChoiceInteraction,iQ as QtiIsNull,oI as QtiItem,rx as QtiItemBody,oM as QtiItemMixin,ix as QtiLookupOutcomeValue,iB as QtiLt,iF as QtiLte,iz as QtiMapResponse,iW as QtiMapping,iY as QtiMatch,oy as QtiMatchInteraction,om as QtiMediaInteraction,iX as QtiMember,rV as QtiModalFeedback,iZ as QtiMultiple,iG as QtiNot,iK as QtiOr,og as QtiOrderInteraction,iJ as QtiOrdered,rq as QtiOutcomeDeclaration,im as QtiOutcomeProcessing,ig as QtiOutcomeProcessingProcessor,i6 as QtiPortableCustomInteraction,o_ as QtiPositionObjectStage,i0 as QtiPrintedVariable,i1 as QtiProduct,rC as QtiPrompt,iC as QtiResponseCondition,rR as QtiResponseDeclaration,iq as QtiResponseElse,iP as QtiResponseElseIf,iR as QtiResponseIf,iE as QtiResponseProcessing,r$ as QtiRubricBlock,iw as QtiRule,ob as QtiSPositionObjectInteraction,ox as QtiSelectPointInteraction,iA as QtiSetOutcomeValue,iS as QtiSetOutcomeValueRule,op as QtiSimpleAssociableChoice,oU as QtiSimpleChoice,oC as QtiSliderInteraction,i2 as QtiStringMatch,rA as QtiStylesheet,i3 as QtiSum,i4 as QtiSumExpression,io as QtiTextEntryInteraction,i5 as QtiVariable,oL as getItemByUri,oO as getManifestInfo,rn as itemContext,re as itemContextVariables,iU as qtiAndMixin,rm as qtiTransformItem,rg as qtiTransformManifest,rb as qtiTransformTest};/*! Bundled license information:
591
2
 
592
3
  @lit/context/lib/context-request-event.js:
593
4
  (**
@@ -812,4 +223,4 @@ lit-html/node/directives/style-map.js:
812
223
  * Copyright 2018 Google LLC
813
224
  * SPDX-License-Identifier: BSD-3-Clause
814
225
  *)
815
- */
226
+ */