@citolab/qti-components 7.22.0 → 7.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function i(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function o(t,e,n,i,o,a,s){try{var l=t[a](s);var u=l.value}catch(t){n(t);return}if(l.done){e(u)}else{Promise.resolve(u).then(i,o)}}function a(t){return function(){var e=this,n=arguments;return new Promise(function(i,a){var s=t.apply(e,n);function l(t){o(s,i,a,l,u,"next",t)}function u(t){o(s,i,a,l,u,"throw",t)}l(undefined)})}}function s(t,e,n){e=f(e);return S(t,V()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function l(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function u(t,e,n){if(V()){u=Reflect.construct}else{u=function t(t,e,n){var i=[null];i.push.apply(i,e);var o=Function.bind.apply(t,i);var a=new o;if(n)I(a,n.prototype);return a}}return u.apply(null,arguments)}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(t,i.key,i)}}function d(t,e,n){if(e)c(t.prototype,e);if(n)c(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 p(t,e,n){if(typeof Reflect!=="undefined"&&Reflect.get){p=Reflect.get}else{p=function t(t,e,n){var i=T(t,e);if(!i)return;var o=Object.getOwnPropertyDescriptor(i,e);if(o.get){return o.get.call(n||t)}return o.value}}return p(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 v(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)I(t,e)}function m(t,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](t)}else{return t instanceof e}}function g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function b(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function y(t,e){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var i=[];var o=true;var a=false;var s,l;try{for(n=n.call(t);!(o=(s=n.next()).done);o=true){i.push(s.value);if(e&&i.length===e)break}}catch(t){a=true;l=t}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return i}function w(){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 q(){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 i=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}i.forEach(function(e){h(t,e,n[e])})}return t}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);if(e){i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})}n.push.apply(n,i)}return n}function _(t,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}else{x(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function C(t,e){if(t==null)return{};var n={},i,o,a;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){i=Reflect.ownKeys(t);for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}return n}n=E(t,e);if(Object.getOwnPropertySymbols){i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}}return n}function E(t,e){if(t==null)return{};var n={},i=Object.getOwnPropertyNames(t),o,a;for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}return n}function S(t,e){if(e&&(U(e)==="object"||typeof e==="function")){return e}return i(t)}function A(t,e,n,i){if(typeof Reflect!=="undefined"&&Reflect.set){A=Reflect.set}else{A=function t(t,e,n,i){var o=T(t,e);var a;if(o){a=Object.getOwnPropertyDescriptor(o,e);if(a.set){a.set.call(i,n);return true}else if(!a.writable){return false}}a=Object.getOwnPropertyDescriptor(i,e);if(a){if(!a.writable){return false}a.value=n;Object.defineProperty(i,e,a)}else{h(i,e,n)}return true}}return A(t,e,n,i)}function R(t,e,n,i,o){var a=A(t,e,n,i||t);if(!a&&o){throw new Error("failed to set property")}return n}function I(t,e){I=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return I(t,e)}function M(t,n){return e(t)||y(t,n)||N(t,n)||w()}function T(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 O(t){return e(t)||b(t)||N(t)||w()}function L(t){return n(t)||b(t)||N(t)||q()}function U(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function N(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor)i=e.constructor.name;if(i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return t(e,n)}function D(t){var e=typeof Map==="function"?new Map:undefined;D=function t(t){if(t===null||!g(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 I(n,t)};return D(t)}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(V=function(){return!!t})()}function z(t,e){var n,i,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),typeof Symbol==="function"&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(t){return function(e){return c([t,e])}}function c(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(a=0)),a)try{if(n=1,i&&(o=l[0]&2?i["return"]:l[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;if(i=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;i=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=e.call(t,a)}catch(t){l=[6,t];i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}function $(){var t=P(["<slot></slot>"]);$=function e(){return t};return t}function W(){var t=P(["<slot></slot>"]);W=function e(){return t};return t}function B(){var t=P(["<pre>","</pre>\n <slot></slot>"]);B=function e(){return t};return t}function j(){var t=P(["\n slot {\n display: none;\n }\n "]);j=function e(){return t};return t}function F(){var t=P(["<slot></slot>"]);F=function e(){return t};return t}function Q(){var t=P(['<slot name="qti-rubric-block"></slot><slot></slot>']);Q=function e(){return t};return t}function H(){var t=P([" <slot></slot>"]);H=function e(){return t};return t}function G(){var t=P([" <slot></slot>"]);G=function e(){return t};return t}function X(){var t=P(["<slot></slot>"]);X=function e(){return t};return t}function J(){var t=P(["<slot @slotchange=","></slot>"]);J=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 Y(){var t=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);Y=function e(){return t};return t}function Z(){var t=P([' <slot part="feedback" class="','"></slot> ']);Z=function e(){return t};return t}function tt(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);tt=function e(){return t};return t}function te(){var t=P(['\n <dialog class="qti-dialog" part="feedback" ?open="','">\n <slot></slot>\n <div style="margin-top: var(--qti-gap-size); text-align: center;">\n <button class="button close-button" @click="','">Close</button>\n </div>\n </dialog>\n ']);te=function e(){return t};return t}function tn(){var t=P(["\n .qti-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n .button:hover {\n background-color: var(--qti-hover-bg);\n }\n\n .button:disabled {\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n "]);tn=function e(){return t};return t}function tr(){var t=P(["\n :host {\n display: block;\n }\n"]);tr=function e(){return t};return t}function ti(){var t=P(['<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>']);ti=function e(){return t};return t}function to(){var t=P(["<slot></slot>"]);to=function e(){return t};return t}function ta(){var t=P(["<slot></slot>"]);ta=function e(){return t};return t}function ts(){var t=P(["\n :host {\n display: block;\n }\n "]);ts=function e(){return t};return t}function tl(){var t=P(["",""]);tl=function e(){return t};return t}function tu(){var t=P(["\n :host {\n display: none;\n }\n "]);tu=function e(){return t};return t}function tc(){var t=P(["",""]);tc=function e(){return t};return t}function td(){var t=P(["\n :host {\n display: none;\n }\n "]);td=function e(){return t};return t}function th(){var t=P(["<slot></slot>"]);th=function e(){return t};return t}function tp(){var t=P(["\n :host {\n display: none;\n }\n "]);tp=function e(){return t};return t}function tf(){var t=P(["<slot></slot>"]);tf=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 tm(){var t=P(["<slot></slot>"]);tm=function e(){return t};return t}function tg(){var t=P(["\n :host {\n display: none;\n }\n "]);tg=function e(){return t};return t}function tb(){var t=P([""]);tb=function e(){return t};return t}function ty(){var t=P(["\n :host {\n color: gray;\n }\n "]);ty=function e(){return t};return t}function tw(){var t=P(["<slot></slot>"]);tw=function e(){return t};return t}function tq(){var t=P(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n"]);tq=function e(){return t};return t}function tk(){var t=P(["\n background-color: lightgray;\n ",";\n"]);tk=function e(){return t};return t}function tx(){var t=P(["\n cursor: not-allowed;\n opacity: 0.8;\n"]);tx=function e(){return t};return t}function t_(){var t=P(["\n ",";\n border: 1px solid gray;\n"]);t_=function e(){return t};return t}function tC(){var t=P(["<slot></slot>"]);tC=function e(){return t};return t}function tE(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tE=function e(){return t};return t}function tS(){var t=P(["<slot></slot>"]);tS=function e(){return t};return t}function tA(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tA=function e(){return t};return t}function tR(){var t=P(['<option value="','" ?selected=',">","</option>"]);tR=function e(){return t};return t}function tI(){var t=P(['\n <label part="label" for="viewSelect">','</label>\n <select\n part="select"\n id="viewSelect"\n @change=',"\n >\n ","\n </select>\n "]);tI=function e(){return t};return t}function tM(){var t=P([" <slot></slot> "]);tM=function e(){return t};return t}function tT(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tT=function e(){return t};return t}function tP(){var t=P([" <slot></slot> "]);tP=function e(){return t};return t}function tO(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tO=function e(){return t};return t}function tL(){var t=P([' <div @click="','">',"</div> "]);tL=function e(){return t};return t}function tU(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tU=function e(){return t};return t}function tN(){var t=P([""]);tN=function e(){return t};return t}function tD(){var t=P([" "," "]);tD=function e(){return t};return t}function tV(){var t=P(["<span>Loading...</span>"]);tV=function e(){return t};return t}function tz(){var t=P(["\n ","\n <slot></slot>\n ","\n "]);tz=function e(){return t};return t}function t$(){var t=P([""]);t$=function e(){return t};return t}function tW(){var t=P([""]);tW=function e(){return t};return t}function tB(){var t=P(["\n <tr>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n </tr>\n "]);tB=function e(){return t};return t}function tj(){var t=P(["\n <h3>","</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ","\n </tbody>\n </table>\n "]);tj=function e(){return t};return t}function tF(){var t=P(["\n "," ","\n "]);tF=function e(){return t};return t}function tQ(){var t=P(["\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n "]);tQ=function e(){return t};return t}function tH(){var t=P([""]);tH=function e(){return t};return t}function tG(){var t=P([" "," "]);tG=function e(){return t};return t}function tX(){var t=P([" <slot></slot> "]);tX=function e(){return t};return t}function tJ(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tJ=function e(){return t};return t}function tK(){var t=P([" <small><pre>","</pre></small> "]);tK=function e(){return t};return t}function tY(){var t=P(["<small><pre>","</pre></small>"]);tY=function e(){return t};return t}function tZ(){var t=P([" ","\n ",""]);tZ=function e(){return t};return t}function t0(){var t=P([""]);t0=function e(){return t};return t}function t1(){var t=P(["",""]);t1=function e(){return t};return t}function t2(){var t=P(["",""]);t2=function e(){return t};return t}function t3(){var t=P([""]);t3=function e(){return t};return t}function t5(){var t=P(["<div>","</div>"]);t5=function e(){return t};return t}function t4(){var t=P(["<div>","</div>"]);t4=function e(){return t};return t}function t6(){var t=P([" <slot></slot> "]);t6=function e(){return t};return t}function t8(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);t8=function e(){return t};return t}function t7(){var t=P(["<span>Loading...</span>"]);t7=function e(){return t};return t}function t9(){var t=P(["\n ","\n <slot></slot>\n ","\n "]);t9=function e(){return t};return t}function et(){var t=P([""]);et=function e(){return t};return t}function ee(){var t=P(['<option value="','" ?selected=',">\n ","\n </option>"]);ee=function e(){return t};return t}function en(){var t=P(['\n <label part="label" for="modeSelect">','</label>\n <select\n part="select"\n id="modeSelect"\n @change=',"\n >\n ","\n </select>\n "]);en=function e(){return t};return t}function er(){var t=P(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n"]);er=function e(){return t};return t}function ei(){var t=P(["\n background-color: lightgray;\n ",";\n"]);ei=function e(){return t};return t}function eo(){var t=P(["\n cursor: not-allowed;\n opacity: 0.8;\n"]);eo=function e(){return t};return t}function ea(){var t=P(["\n ",";\n border: 1px solid gray;\n"]);ea=function e(){return t};return t}function es(){var t=P([' <div @click="','">',"</div> "]);es=function e(){return t};return t}function el(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);el=function e(){return t};return t}function eu(){var t=P([' <div @click="','">',"</div> "]);eu=function e(){return t};return t}function ec(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);ec=function e(){return t};return t}function ed(){var t=P([""]);ed=function e(){return t};return t}function eh(){var t=P(["\n <tr>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n </tr>\n "]);eh=function e(){return t};return t}function ep(){var t=P(["\n <h3>","</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ","\n </tbody>\n </table>\n "]);ep=function e(){return t};return t}function ef(){var t=P(["\n "," ","\n "]);ef=function e(){return t};return t}function ev(){var t=P(["\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n "]);ev=function e(){return t};return t}function em(){var t=P(["<slot></slot>"]);em=function e(){return t};return t}function eg(){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 align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n\n [part='drop-list'][active] {\n border-color: var(--qti-border-active) !important;\n background-color: var(--qti-bg-active) !important;\n }\n\n [part='drop-list'][enabled] {\n background-color: var(--qti-bg-active) !important;\n }\n\n :host::part(associables-container) {\n display: flex;\n padding: 0.5rem;\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"]);eg=function e(){return t};return t}function eb(){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>']);eb=function e(){return t};return t}function ey(){var t=P([' <slot name="prompt"></slot>\n <slot name="qti-simple-associable-choice"></slot>\n <div part="drop-container">\n ','\n\n <div role="alert" part="message" id="validation-message"></div>\n </div>']);ey=function e(){return t};return t}function ew(){var t=P(["\n :host {\n display: block;\n }\n\n [part='slot'] {\n display: grid;\n gap: 10px;\n }\n\n /* Define the number of columns dynamically */\n :host([class*='qti-choices-stacking-']) [part='slot'] {\n grid-template-columns: repeat(var(--stacking-count, 1), 1fr);\n }\n\n /* Apply dynamic stacking count based on class */\n :host(.qti-choices-stacking-1) {\n --stacking-count: 1;\n }\n :host(.qti-choices-stacking-2) {\n --stacking-count: 2;\n }\n :host(.qti-choices-stacking-3) {\n --stacking-count: 3;\n }\n :host(.qti-choices-stacking-4) {\n --stacking-count: 4;\n }\n :host(.qti-choices-stacking-5) {\n --stacking-count: 5;\n }\n :host(.qti-choices-stacking-6) {\n --stacking-count: 6;\n }\n\n /* Default slot item layout */\n ::slotted(qti-simple-choice) {\n display: flex;\n align-items: center;\n white-space: normal;\n }\n\n /* Orientation styles */\n :host(.qti-orientation-horizontal) [part='slot'] {\n grid-auto-flow: dense column;\n grid-auto-columns: 1fr;\n }\n\n :host(.qti-orientation-vertical) [part='slot'] {\n grid-auto-flow: row;\n }\n\n /* Vertical and horizontal stacking logic */\n :host(.qti-orientation-vertical[class*='qti-choices-stacking-']) [part='slot'] {\n grid-auto-flow: dense column;\n grid-auto-columns: 1fr;\n grid-template-columns: repeat(var(--stacking-count), 1fr);\n grid-template-rows: repeat(calc(var(--item-count) / var(--stacking-count)), 1fr);\n }\n\n :host(.qti-orientation-horizontal[class*='qti-choices-stacking-']) [part='slot'] {\n grid-auto-flow: row;\n grid-template-columns: repeat(var(--stacking-count), 1fr);\n grid-template-rows: unset;\n }\n\n /* Ensure even distribution in vertical mode */\n :host(.qti-orientation-vertical) ::slotted(qti-simple-choice:nth-child(even)) {\n grid-row: auto;\n }\n"]);ew=function e(){return t};return t}function eq(){var t=P(['\n <slot part="prompt" name="prompt"></slot>\n <slot part="slot" @slotchange=','></slot>\n <div part="message" role="alert" id="validation-message"></div>\n ']);eq=function e(){return t};return t}function ek(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);ek=function e(){return t};return t}function ex(){var t=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);ex=function e(){return t};return t}function e_(){var t=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);e_=function e(){return t};return t}function eC(){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"]);eC=function e(){return t};return t}function eE(){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>"]);eE=function e(){return t};return t}function eS(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\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 [name='prompt'] {\n width: 100%;\n }\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n"]);eS=function e(){return t};return t}function eA(){var t=P(['<slot name="prompt"> </slot>\n <slot part="drags" name="drags"></slot>\n <slot part="drops"></slot>\n <div role="alert" part="message" id="validation-message"></div>']);eA=function e(){return t};return t}function eR(){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 width: fit-content;\n }\n svg {\n position: absolute;\n top: 0px;\n left: 0px;\n }\n"]);eR=function e(){return t};return t}function eI(){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 "]);eI=function e(){return t};return t}function eM(){var t=P(['\n <line\n part="correct-line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-correct)"\n stroke-width="3"\n stroke-dasharray="5,5"\n />\n ']);eM=function e(){return t};return t}function eT(){var t=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-border-active)"\n stroke-width="3"\n />']);eT=function e(){return t};return t}function eP(){var t=P(['<slot name="prompt"></slot>\n <line-container>\n <svg\n width=',"\n height=",'\n viewbox="0 0 '," ",'"\n >\n ',"\n ","\n ",'\n </svg>\n <slot></slot>\n </line-container>\n <div role="alert" part="message" id="validation-message"></div>']);eP=function e(){return t};return t}function eO(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column;\n }\n :host(.qti-choices-left) {\n flex-direction: row-reverse;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n :host(.qti-choices-right) {\n flex-direction: row;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n [part='image'] {\n display: block;\n position: relative;\n }\n /* [part='drops'] , */\n\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n ::slotted(img) {\n display: inline-block;\n user-select: none;\n pointer-events: none;\n }\n"]);eO=function e(){return t};return t}function eL(){var t=P([' <slot name="prompt"></slot>\n <slot part="image"></slot>\n <slot part="drags" name="drags" class="hover-border"></slot>\n <div role="alert" part="message" id="validation-message"></div>']);eL=function e(){return t};return t}function eU(){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"]);eU=function e(){return t};return t}function eN(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div role="alert" part="message" id="validation-message"></div>\n ']);eN=function e(){return t};return t}function eD(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: inline-block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n line-height: 0; /* remove gaps below image */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n display: block;\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n"]);eD=function e(){return t};return t}function eV(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n ']);eV=function e(){return t};return t}function ez(){var t=P(['<slot></slot>\n <div part="message" role="alert" id="validation-message"></div>']);ez=function e(){return t};return t}function e$(){var t=P(["\n :host {\n display: inline-block;\n vertical-align: baseline;\n position: relative;\n }\n\n /* --- Progressive enhancement: Customizable select (MDN / WHATWG) --- */\n select[part='select'] {\n font: inherit;\n color: inherit;\n background-color: var(--qti-bg, white);\n border: var(--qti-border-thickness, 2px) var(--qti-border-style, solid) var(--qti-border-color, #c6cad0);\n border-radius: var(--qti-border-radius, 0.3rem);\n padding: 0.25rem 0.75rem;\n min-width: var(--qti-calculated-min-width, auto);\n /* Enables full styling when supported (Chromium behind a flag / rolling out). */\n appearance: base-select;\n }\n\n select[part='select']:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n select[part='select']::picker(select) {\n border: var(--qti-border-thickness, 2px) var(--qti-border-style, solid) var(--qti-border-color, #c6cad0);\n border-radius: var(--qti-border-radius, 0.3rem);\n background: var(--qti-bg, white);\n box-shadow:\n 0 10px 15px -3px rgb(0 0 0 / 10%),\n 0 4px 6px -4px rgb(0 0 0 / 10%);\n padding: 4px;\n width: max-content;\n min-width: 100%;\n max-width: min(90vw, 36rem);\n }\n\n select[part='select']::picker-icon {\n color: var(--qti-border-color, #c6cad0);\n transition: 0.4s rotate;\n font-size: 1.75em;\n }\n\n select[part='select']:open::picker-icon {\n color: var(--qti-border-active, #f86d70);\n rotate: 180deg;\n }\n\n select[part='select'] > button {\n font: inherit;\n color: inherit;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n padding: 0;\n background: transparent;\n border: 0;\n cursor: pointer;\n }\n\n select[part='select'] selectedcontent {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n white-space: nowrap;\n }\n\n option {\n font: inherit;\n color: inherit;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem 0.5rem;\n white-space: nowrap;\n line-height: 1.25;\n min-height: 2.25rem;\n }\n\n option:hover {\n background-color: var(--qti-hover-bg, #f9fafb);\n }\n\n option:checked {\n background-color: var(--qti-bg-active, #ffecec);\n }\n\n option::checkmark {\n color: var(--qti-border-active, #f86d70);\n }\n\n /* --- Fallback custom listbox (for browsers without customizable select) --- */\n button[part='trigger'] {\n font: inherit;\n color: inherit;\n background-color: var(--qti-bg, white);\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n justify-content: space-between;\n border: var(--qti-border-thickness, 2px) var(--qti-border-style, solid) var(--qti-border-color, #c6cad0);\n border-radius: var(--qti-border-radius, 0.3rem);\n padding: 0.25rem 0.75rem;\n min-width: var(--qti-calculated-min-width, auto);\n }\n\n [part='value'] {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n min-width: 0;\n }\n\n [part='dropdown-icon'] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n transition: transform 150ms ease;\n transform-origin: 50% 50%;\n color: var(--qti-border-color, #c6cad0);\n font-size: 1.75em;\n line-height: 1;\n }\n\n button[part='trigger'][aria-expanded='true'] [part='dropdown-icon'] {\n transform: rotate(180deg);\n color: var(--qti-border-active, #f86d70);\n }\n\n button[part='trigger'][disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n [part='menu'] {\n position: absolute;\n z-index: 1000;\n top: calc(100% + 4px);\n left: 0;\n min-width: 100%;\n max-width: min(90vw, 36rem);\n max-height: min(40vh, 20rem);\n overflow: auto;\n background-color: var(--qti-bg, white);\n border: var(--qti-border-thickness, 2px) var(--qti-border-style, solid) var(--qti-border-color, #c6cad0);\n border-radius: var(--qti-border-radius, 0.3rem);\n box-shadow:\n 0 10px 15px -3px rgb(0 0 0 / 10%),\n 0 4px 6px -4px rgb(0 0 0 / 10%);\n padding: 4px;\n box-sizing: border-box;\n transform: translate(var(--qti-menu-shift-x, 0px), var(--qti-menu-shift-y, 0px));\n }\n\n [part='menu'][data-placement='top'] {\n top: auto;\n bottom: calc(100% + 4px);\n }\n\n button[part='option'] {\n font: inherit;\n color: inherit;\n background-color: transparent;\n border: 0;\n padding: 0.5rem 0.5rem;\n width: 100%;\n text-align: left;\n border-radius: calc(var(--qti-border-radius, 0.3rem) - 2px);\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.25;\n min-height: 2.25rem;\n }\n\n button[part='option'][aria-selected='true'] {\n background-color: var(--qti-bg-active, #ffecec);\n }\n\n button[part='option']:hover {\n background-color: var(--qti-hover-bg, #f9fafb);\n }\n\n button[part='option']:focus-visible {\n outline: 2px solid var(--qti-border-active, #f86d70);\n outline-offset: 2px;\n }\n\n [part='option-content'] {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: nowrap;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n select[part='select'] img,\n button[part='option'] img,\n button[part='trigger'] img,\n [part='menu'] img {\n display: inline-block;\n max-height: 1em;\n max-width: 1.5em;\n vertical-align: middle;\n }\n "]);e$=function e(){return t};return t}function eW(){var t=P(['<option value="','">',"</option>"]);eW=function e(){return t};return t}function eB(){var t=P(['\n <select\n part="select"\n @change=','\n ?disabled="','"\n .value="','"\n >\n <button type="button">\n <selectedcontent></selectedcontent>\n </button>\n ',"\n </select>\n "]);eB=function e(){return t};return t}function ej(){var t=P(['\n <button\n part="option"\n type="button"\n role="option"\n aria-selected="','"\n @click="','"\n >\n <span part="option-content">',"</span>\n </button>\n "]);ej=function e(){return t};return t}function eF(){var t=P(['\n <div part="menu" role="listbox" @keydown=',">\n ","\n </div>\n "]);eF=function e(){return t};return t}function eQ(){var t=P(['\n <button\n part="trigger"\n type="button"\n @click=',"\n @keydown=",'\n aria-haspopup="listbox"\n aria-expanded="','"\n ?disabled="','"\n data-readonly="','"\n >\n <span part="value">','</span>\n <span part="dropdown-icon" aria-hidden="true">▾</span>\n </button>\n ',"\n "]);eQ=function e(){return t};return t}function eH(){var t=P(["\n ","\n ","\n "]);eH=function e(){return t};return t}function eG(){var t=P(["\n slot:not([hidden]) {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\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"]);eG=function e(){return t};return t}function eX(){var t=P(['<th part="r-header">',"</th>"]);eX=function e(){return t};return t}function eJ(){var t=P(['\n <svg\n part="checkmark"\n viewBox="0 0 24 24"\n style="position: absolute; width: 20px; height: 20px; top: 2px; left: 2px; pointer-events: none;"\n >\n <path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" fill="white" />\n </svg>\n ']);eJ=function e(){return t};return t}function eK(){var t=P(['<td part="input-cell">\n <div\n class="input-container"\n style="position: relative; width: 24px; height: 24px; margin: 0 auto;"\n >\n <input\n type=',"\n part=","\n name=","\n value=","\n .disabled=","\n @change=","\n @click=","\n />\n ","\n </div>\n </td>"]);eK=function e(){return t};return t}function eY(){var t=P(['<tr part="row">\n <td part="c-header">',"</td>\n ","\n </tr>"]);eY=function e(){return t};return t}function eZ(){var t=P(['\n <table part="table">\n <tr part="r-header">\n <td></td>\n ',"\n </tr>\n\n ","\n </table>\n "]);eZ=function e(){return t};return t}function e0(){var t=P(['\n <slot name="prompt"></slot>\n <slot ?hidden=',"></slot>\n\n ",'\n\n <div role="alert" part="message" id="validation-message"></div>\n ']);e0=function e(){return t};return t}function e1(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>']);e1=function e(){return t};return t}function e2(){var t=P([""]);e2=function e(){return t};return t}function e3(){var t=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n flex-wrap: wrap;\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='drop-list'][active] {\n border-color: var(--qti-border-active) !important;\n background-color: var(--qti-bg-active) !important;\n }\n\n [part='drop-list'][enabled] {\n background-color: var(--qti-bg-active) !important;\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"]);e3=function e(){return t};return t}function e5(){var t=P(['<drop-list role="region" part="drop-list" identifier="droplist','"></drop-list>']);e5=function e(){return t};return t}function e4(){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>"]);e4=function e(){return t};return t}function e6(){var t=P(["\n ::slotted(qti-interaction-markup) {\n display: none;\n }\n"]);e6=function e(){return t};return t}function e8(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);e8=function e(){return t};return t}function e7(){var t=P(["\n <slot></slot>\n ","\n "]);e7=function e(){return t};return t}function e9(){var t=P(["\n :host {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n "]);e9=function e(){return t};return t}function nt(){var t=P(["<slot></slot>"]);nt=function e(){return t};return t}function ne(){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 "]);ne=function e(){return t};return t}function nn(){var t=P(["<slot></slot>"]);nn=function e(){return t};return t}function nr(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);nr=function e(){return t};return t}function ni(){var t=P(['\n <button\n part="point','"\n style=','\n aria-label="Remove point at ','"\n ?disabled=',"\n @click=","\n ></button>\n "]);ni=function e(){return t};return t}function no(){var t=P(["<div\n style=",'\n data-coord="','"\n alt=','\n data-shape="','"\n ></div>']);no=function e(){return t};return t}function na(){var t=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n ","\n <slot></slot>\n </point-container>"]);na=function e(){return t};return t}function ns(){var t=P(["\n :host {\n display: block;\n }\n point-container {\n display: block;\n position: relative;\n width: fit-content;\n }\n\n ::slotted(img) {\n max-width: 100%;\n height: auto;\n display: block;\n }\n "]);ns=function e(){return t};return t}function nl(){var t=P(["\n :host {\n display: block;\n --show-bounds: true;\n --show-ticks: true;\n --show-value: true;\n }\n\n [part='slider'] {\n margin-left: 2rem; /* mx-8 */\n margin-right: 2rem;\n padding-bottom: 1rem; /* pb-4 */\n padding-top: 1.25rem; /* pt-5 */\n }\n\n [part='bounds'] {\n display: flex;\n width: 100%;\n justify-content: space-between;\n margin-bottom: 0.5rem; /* mb-2 */\n }\n\n [part='ticks'] {\n margin-left: 0.125rem; /* mx-0.5 */\n margin-right: 0.125rem;\n margin-bottom: 0.25rem; /* mb-1 */\n height: 0.5rem; /* h-2 */\n background: linear-gradient(to right, var(--qti-border-color) var(--qti-border-thickness), transparent 1px) repeat-x\n 0 center / calc(calc(100% - var(--qti-border-thickness)) / ((var(--max) - var(--min)) / var(--step))) 100%;\n }\n\n [part='rail'] {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 0.375rem; /* h-1.5 */\n width: 100%;\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n border: 1px solid #d1d5db; /* border-gray-300 */\n background-color: #e5e7eb; /* bg-gray-200 */\n }\n\n [part='knob'] {\n background-color: var(--qti-bg-active);\n border: 2px solid var(--qti-border-active);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage);\n }\n [part='knob-correct'] {\n background-color: var(--qti-correct-light);\n border: 2px solid var(--qti-correct);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage-correct);\n }\n\n [part='value'] {\n position: absolute;\n bottom: 2rem; /* bottom-8 */\n left: 0.5rem; /* left-2 */\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 0.25rem; /* rounded */\n background-color: #f3f4f6; /* bg-gray-100 */\n padding: 0.25rem 0.5rem; /* px-2 py-1 */\n text-align: center;\n color: #6b7280; /* text-gray-500 */\n }\n"]);nl=function e(){return t};return t}function nu(){var t=P(['\n <div id="knob-correct" part="knob-correct">\n <div id="value" part="value">',"</div>\n </div>\n "]);nu=function e(){return t};return t}function nc(){var t=P(['\n <slot name="prompt"></slot>\n <div id="slider" part="slider">\n <div id="bounds" part="bounds">\n <div>',"</div>\n <div>",'</div>\n </div>\n\n <div id="ticks" part="ticks"></div>\n\n <div id="rail" part="rail" @mousedown='," @touchstart=",'>\n <div id="knob" part="knob">\n <div id="value" part="value">',"</div>\n </div>\n\n ","\n </div>\n </div>\n "]);nc=function e(){return t};return t}function nd(){var t=P(["\n :host {\n display: inline-block;\n }\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\n :host {\n position: relative;\n }\n input {\n anchor-name: --text-entry-input;\n z-index: 100;\n position: relative;\n }\n\n [part='correct'] {\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg);\n z-index: 0;\n position: absolute;\n left: 0;\n right: 0;\n position-anchor: --text-entry-input;\n bottom: anchor(top);\n left: anchor(left);\n /* opacity: 1; */\n transition: all 1s;\n\n @starting-style {\n display: grid;\n /* opacity: 0; */\n bottom: 0;\n }\n }\n"]);nd=function e(){return t};return t}function nh(){var t=P(['<div part="correct">',"</div>"]);nh=function e(){return t};return t}function np(){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 ',"\n "]);np=function e(){return t};return t}function nf(){var t=P(['\n <div>\n <slot name="prompt"></slot>\n <input type="file" @change="','" ?disabled="','" ?readonly="','" />\n </div>\n ']);nf=function e(){return t};return t}function nv(){var t=P(["\n :host {\n display: block;\n margin: 1em 0;\n }\n input[type='file'] {\n display: block;\n margin-top: 0.5em;\n }\n "]);nv=function e(){return t};return t}function nm(){var t=P([' <slot name="drags"></slot> ']);nm=function e(){return t};return t}function ng(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);ng=function e(){return t};return t}function nb(){var t=P([' <slot name="drags"></slot>']);nb=function e(){return t};return t}function ny(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ny=function e(){return t};return t}function nw(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);nw=function e(){return t};return t}function nq(){var t=P(["<slot></slot>"]);nq=function e(){return t};return t}function nk(){var t=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);nk=function e(){return t};return t}function nx(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);nx=function e(){return t};return t}function n_(){var t=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);n_=function e(){return t};return t}function nC(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);nC=function e(){return t};return t}function nE(){var t=P(["\n :host {\n display: block;\n cursor: pointer;\n }\n "]);nE=function e(){return t};return t}function nS(){var t=P([" <slot></slot> "]);nS=function e(){return t};return t}function nA(){var t=P(["<slot></slot>"]);nA=function e(){return t};return t}function nR(){var t=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);nR=function e(){return t};return t}function nI(){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: auto;\n }\n "]);nI=function e(){return t};return t}function nM(){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"]);nM=function e(){return t};return t}function nT(){var t=P(['<div id="label">',"</div>"]);nT=function e(){return t};return t}function nP(){var t=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot>']);nP=function e(){return t};return t}function nO(){var t=P(["<slot></slot>"]);nO=function e(){return t};return t}function nL(){var t=P(["<slot></slot>"]);nL=function e(){return t};return t}function nU(){var t=P(["<slot></slot>"]);nU=function e(){return t};return t}function nN(){var t=P(["",""]);nN=function e(){return t};return t}function nD(){var t=P(["",""]);nD=function e(){return t};return t}function nV(){var t=P(["",""]);nV=function e(){return t};return t}var QtiComponents=function(){var t=function t(){var t,e;return{promise:new Promise(function(n,i){t=n,e=i}),resolve:t,reject:e}};var e=function t(t,e){if(!ip(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return io!==void 0?io.createHTML(e):e};var n=function t(t){return function(e,n){return(typeof n==="undefined"?"undefined":U(n))=="object"?iJ(t,e,n):function(t,e,n){var i=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),i?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}};var i=function t(t){return n(_(k({},t),{state:!0,attribute:!1}))};var o=function t(t,e){return function(n,i,o){var a=function e(e){var n;var i;return(n=(i=e.renderRoot)===null||i===void 0?void 0:i.querySelector(t))!==null&&n!==void 0?n:null};if(e){var s=(typeof i==="undefined"?"undefined":U(i))=="object"?n:o!==null&&o!==void 0?o:function(){var t=Symbol();return{get:function e(){return this[t]},set:function e(e){this[t]=e}}}(),l=s.get,u=s.set;return iK(n,i,{get:function t(){var t=l.call(this);return t===void 0&&(t=a(this),(t!==null||this.hasUpdated)&&u.call(this,t)),t}})}return iK(n,i,{get:function t(){return a(this)}})}};var u=function t(t){return function(e,n){var i=t!==null&&t!==void 0?t:{},o=i.slot,a=i.selector,s="slot"+(o?"[name=".concat(o,"]"):":not([name])");return iK(e,n,{get:function e(){var e;var n;var i=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(s),o=(e=i===null||i===void 0?void 0:i.assignedElements(t))!==null&&e!==void 0?e:[];return a===void 0?o:o.filter(function(t){return t.matches(a)})}})}};var c=function t(t,e,n){Array.from(t.getElementsByTagName("*")).filter(function(t){var n;return t.localName===e||((n=t.localName)===null||n===void 0?void 0:n.toLowerCase())===e.toLowerCase()}).forEach(function(t){var i="".concat(e,"-").concat(n),o=b(t,i);t.replaceWith(o)})};var g=function t(t,e){t.querySelectorAll("*").forEach(function(t){var n=t.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(e,":"))){var i=n.slice("".concat(e,":").length),o="".concat(t.nodeName,"-").concat(i),a=b(t,o);t.replaceWith(a)}})})};var b=function t(t,e){var n=t.ownerDocument.createElement(e);var i=true,o=false,a=undefined;try{for(var s=t.attributes[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;n.setAttribute(u.name,u.value)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}for(;t.firstChild;)n.appendChild(t.firstChild);return n};var y=function t(t){var e=[];return t.querySelectorAll("qti-assessment-item-ref").forEach(function(t){var n=t.getAttribute("identifier"),i=t.getAttribute("href"),o=t.getAttribute("category");e.push({identifier:n,href:i,category:o})}),e};var w=function t(t,e){return fetch(t,{signal:e}).then(function(t){if(!t.ok)throw new Error("HTTP error! status: ".concat(t.status));return t.text()}).then(function(t){return new DOMParser().parseFromString(t,"text/xml")}).catch(function(t){throw t.name==="AbortError"?t:new Error("Failed to load XML: ".concat(t.message))})};var q=function t(t){return new DOMParser().parseFromString(t,"text/xml")};var x=function t(t){var e=document.createDocumentFragment();for(var n=0;n<t.childNodes.length;n++)e.appendChild(iY(t.childNodes[n],document));return e};var E=function t(t,e){e.endsWith("/")||(e+="/"),t.querySelectorAll("*").forEach(function(t){for(var n=0,i=["src","href"];n<i.length;n++){var o=i[n];var a;var s=(a=t.getAttribute(o))===null||a===void 0?void 0:a.trim();if(s&&!/^(data:|https?:|blob:)/.test(s)){var l=e+encodeURI(s);t.setAttribute(o,l)}}})};var S=function t(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)})};var A=function t(t){t.querySelectorAll("qti-stylesheet").forEach(function(t){return t.remove()})};var I=function t(t){switch(t){case"qti-choice-interaction":case"qti-order-interaction":return"qti-simple-choice";case"qti-inline-choice-interaction":return"qti-inline-choice";case"qti-match-interaction":return["qti-simple-match-set:first-of-type qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice"];case"qti-gap-match-interaction":return"qti-gap-text";case"qti-associate-interaction":return"qti-simple-associable-choice";default:return null}};var T=function t(t){var e=t.context;return function(t,n){var i=new WeakMap;if((typeof n==="undefined"?"undefined":U(n))=="object")return{get:function e(){return t.get.call(this)},set:function e(e){return i.get(this).setValue(e),t.set.call(this,e)},init:function t(t){return i.set(this,new i7(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer(function(t){i.set(t,new i7(t,{context:e}))});var o=Object.getOwnPropertyDescriptor(t,n),a;if(o===void 0){var s=new WeakMap;a={get:function t(){return s.get(this)},set:function t(t){i.get(this).setValue(t),s.set(this,t)},configurable:!0,enumerable:!0}}else{var l=o.set;a=_(k({},o),{set:function t(t){i.get(this).setValue(t),l===null||l===void 0?void 0:l.call(this,t)}})}return void Object.defineProperty(t,n,a)}}};var P=function t(t){var e=t.context,n=t.subscribe;return function(t,i){(typeof i==="undefined"?"undefined":U(i))=="object"?i.addInitializer(function(){var i=this;new i4(this,{context:e,callback:function e(e){t.set.call(i,e)},subscribe:n})}):t.constructor.addInitializer(function(t){new i4(t,{context:e,callback:function e(e){t[i]=e},subscribe:n})})}};var N=function t(t,e){return function(n,i){var o=n.connectedCallback,s=n.disconnectedCallback;n.connectedCallback=function(){var n=this;o.call(this);var s=this[i],l=function e(e){var i=[],o=[];var a=true,l=false,u=undefined;try{for(var c=e[Symbol.iterator](),d;!(a=(d=c.next()).done);a=true){var h=d.value;h.type==="childList"&&(h.addedNodes.forEach(function(e){var n;var o;var a,s;if(e.nodeType!==1)return;var l=e;((a=l.matches)===null||a===void 0?void 0:a.call(l,t))&&i.push(l),(n=i).push.apply(n,L((o=(s=l.querySelectorAll)===null||s===void 0?void 0:s.call(l,t))!==null&&o!==void 0?o:[]))}),h.removedNodes.forEach(function(e){var n;var i;var a,s;if(e.nodeType!==1)return;var l=e;((a=l.matches)===null||a===void 0?void 0:a.call(l,t))&&o.push(l),(n=o).push.apply(n,L((i=(s=l.querySelectorAll)===null||s===void 0?void 0:s.call(l,t))!==null&&i!==void 0?i:[]))}))}}catch(t){l=true;u=t}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(l){throw u}}}var p=function t(t){return Array.from(new Set(t))},f=p(i),v=p(o);(f.length||v.length)&&s.call(n,f,v)},u=new MutationObserver(l);u.observe(this,{childList:!0,subtree:!0});var c=this.shadowRoot?new MutationObserver(l):null;c===null||c===void 0?void 0:c.observe(this.shadowRoot,{childList:!0,subtree:!0}),this.__lqObservers=[u,c].filter(function(t){return!!t}),function(){return a(function(){var n,i,o,a;return z(this,function(l){switch(l.label){case 0:o=(e===null||e===void 0?void 0:e.waitUntilFirstUpdate)&&"updateComplete"in this;if(!o)return[3,2];return[4,this.updateComplete];case 1:o=l.sent();l.label=2;case 2:o;a=L(this.querySelectorAll(t)).concat(L((n=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll(t))!==null&&n!==void 0?n:[]));a.length&&s.call(this,a,[]);return[2]}})}).call(n)}()},n.disconnectedCallback=function(){var t;s.call(this),(t=this.__lqObservers)===null||t===void 0?void 0:t.forEach(function(t){return t.disconnect()}),this.__lqObservers=void 0}}};var V=function t(t,e){var n=k({waitUntilFirstUpdate:!1},e);return function(e,i){var o=e.update,a=Array.isArray(t)?t:[t];e.update=function(t){var e=this;a.forEach(function(o){var a=o;if(t.has(a)){var s=t.get(a),l=e[a];s!==l&&(!n.waitUntilFirstUpdate||e.hasUpdated)&&e[i](s,l)}}),o.call(this,t)}}};var nz=function t(t){this._$AN!==void 0?(ox(this),this._$AM=t,o_(this)):this._$AM=t};var n$=function t(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 i=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(i))for(var a=n;a<i.length;a++)ok(i[a],!1),ox(i[a]);else i!=null&&(ok(i,!1),ox(i));else ok(this,t)};var nW=function t(t){return t==null};var nB=function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var nj=function t(t,e,n,i){var o=n.getAttribute("width")?parseFloat(n.getAttribute("width")):n.naturalWidth,a=n.getAttribute("height")?parseFloat(n.getAttribute("height")):n.naturalHeight;switch(t){case"circle":{if(e.length!==3){console.error("Invalid circle coordinates:",e);return}var s=M(e,3),l=s[0],u=s[1],c=s[2],d=l/o*100,h=u/a*100,p=c/o*100,f=c/a*100;i.style.left=d-p+"%",i.style.top=h-f+"%",i.style.width=2*p+"%",i.style.height=2*f+"%",i.style.borderRadius="50%"}break;case"rect":{if(e.length!==4){console.error("Invalid rectangle coordinates:",e);return}var v=M(e,4),m=v[0],g=v[1],b=v[2],y=v[3],w=m/o*100,q=g/a*100,k=b/o*100,x=y/a*100;i.style.left=w+"%",i.style.top=q+"%",i.style.width=k-w+"%",i.style.height=x-q+"%"}break;case"ellipse":{if(e.length!==4){console.error("Invalid ellipse coordinates:",e);return}var _=M(e,4),C=_[0],E=_[1],S=_[2],A=_[3],R=C/o*100,I=E/a*100,T=S/o*100,P=A/a*100;i.style.left=R-T+"%",i.style.top=I-P+"%",i.style.width=2*T+"%",i.style.height=2*P+"%",i.style.borderRadius="50%"}break;case"poly":{var O,U,N,D;if(e.length<6||e.length%2!==0){console.error("Invalid polygon coordinates:",e);return}var V=[];for(var z=0;z<e.length;z+=2)V.push({x:e[z],y:e[z+1]});var $=(O=Math).min.apply(O,L(V.map(function(t){return t.x}))),W=(U=Math).max.apply(U,L(V.map(function(t){return t.x}))),B=(N=Math).min.apply(N,L(V.map(function(t){return t.y}))),j=(D=Math).max.apply(D,L(V.map(function(t){return t.y}))),F=$/o*100,Q=B/a*100,H=W/o*100,G=j/a*100;i.style.left=F+"%",i.style.top=Q+"%",i.style.width=H-F+"%",i.style.height=G-Q+"%";var X=V.map(function(t){return{x:(t.x-$)/(W-$)*100,y:(t.y-B)/(j-B)*100}}).map(function(t){return"".concat(t.x,"% ").concat(t.y,"%")}).join(",");i.style.clipPath="polygon(".concat(X,")")}break;default:console.error("Unsupported shape: ".concat(t));break}};var nF=function t(t,e){var i=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++){e[i]=arguments[i]}l(this,n);var o;o=s(this,n,L(e));o.identifier="";o.tabIndex=0;o.disabled=!1;o.readonly=!1;o.internals=o.attachInternals();return o}d(n,[{key:"handleDisabledChange",value:function t(t,e){this.tabIndex=e?-1:0,e&&this.blur()}},{key:"connectedCallback",value:function t(){p(f(n.prototype),"connectedCallback",this).call(this),this.internals.ariaChecked="false",this.disabled&&(this.tabIndex=-1),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(){p(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.code==="Enter")&&(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 iC($())}}]);return n}(t);return rr([n({type:String})],i.prototype,"identifier",2),rr([n({type:Number,reflect:!0,attribute:"tabindex"})],i.prototype,"tabIndex",2),rr([n({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:hr})],i.prototype,"disabled",2),rr([n({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:hr})],i.prototype,"readonly",2),rr([V("disabled",{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),i};var nQ=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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(),i=!1;if(typeof n=="string")if(n==="true")i=!0;else if(n==="false")i=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(i=n);return i}).every(function(t){return typeof t=="boolean"&&t})}}]);return e}(t)};var nH=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"calculateChildren",value:function t(t){var e=t.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-subtract, expected number"),null):Number(e)});return e.some(function(t){return t===null})?(console.error("One or more child expressions returned invalid values"),0):e[0]-e[1]}}]);return e}(t)};var nG,nX,nJ,nK,nY,nZ,n0,n1,n2,n3;var n5;var n4=Object.defineProperty;var n6=Object.getOwnPropertyDescriptor;var n8=Object.getOwnPropertyNames;var n7=Object.prototype.hasOwnProperty;var n9=function t(t){throw TypeError(t)};var rt=function t(t,e){for(var n in e)n4(t,n,{get:e[n],enumerable:!0})},re=function t(t,e,n,i){var o=true,a=false,s=undefined;if(e&&(typeof e==="undefined"?"undefined":U(e))=="object"||typeof e=="function")try{var l=function(){var o=c.value;!n7.call(t,o)&&o!==n&&n4(t,o,{get:function t(){return e[o]},enumerable:!(i=n6(e,o))||i.enumerable})};for(var u=n8(e)[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return t};var rn=function t(t){return re(n4({},"__esModule",{value:!0}),t)},rr=function t(t,e,n,i){for(var o=i>1?void 0:i?n6(e,n):e,a=t.length-1,s;a>=0;a--)(s=t[a])&&(o=(i?s(e,n,o):s(o))||o);return i&&o&&n4(e,n,o),o};var ri=function t(t,e,n){return e.has(t)||n9("Cannot "+n)};var ro=function t(t,e,n){return ri(t,e,"read from private field"),n?n.call(t):e.get(t)},ra=function t(t,e,n){return e.has(t)?n9("Cannot add the same private member more than once"):m(e,WeakSet)?e.add(t):e.set(t,n)},rs=function t(t,e,n,i){return ri(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n},rl=function t(t,e,n){return ri(t,e,"access private method"),n};var ru=function t(t,e,n,i){return{set _(r){rs(t,e,r,n)},get _(){return ro(t,e,i)}}};var rc={};rt(rc,{Correctness:function t(){return oM},INITIAL_SESSION_CONTEXT:function t(){return oo},INITIAL_TEST_CONTEXT:function t(){return os},Interaction:function t(){return oT},IsNullOrUndefined:function t(){return nW},ItemContainer:function t(){return ur},ItemCorrectResponseMode:function t(){return ua},ItemPrintVariables:function t(){return ux},ItemShowCandidateCorrection:function t(){return um},ItemShowCorrectResponse:function t(){return uk},QtiAnd:function t(){return hE},QtiAssessmentItem:function t(){return al},QtiAssessmentItemRef:function t(){return oG},QtiAssessmentSection:function t(){return oK},QtiAssessmentStimulusRef:function t(){return ad},QtiAssessmentStimulusRefConnectedEvent:function t(){return ac},QtiAssessmentTest:function t(){return oZ},QtiAssociableHotspot:function t(){return ht},QtiAssociateInteraction:function t(){return u$},QtiBaseValue:function t(){return hS},QtiChoiceInteraction:function t(){return uH},QtiCompanionMaterialsInfo:function t(){return ah},QtiConditionExpression:function t(){return oL},QtiContainerSize:function t(){return hA},QtiContains:function t(){return hR},QtiContentBody:function t(){return aq},QtiContextDeclaration:function t(){return aF},QtiCorrect:function t(){return hI},QtiCustomInteraction:function t(){return u7},QtiCustomOperator:function t(){return af},QtiDefault:function t(){return hM},QtiDelete:function t(){return pl},QtiEndAttemptInteraction:function t(){return u9},QtiEqual:function t(){return hD},QtiEqualRounded:function t(){return hT},QtiExpression:function t(){return oO},QtiExtendedTextInteraction:function t(){return ce},QtiFeedback:function t(){return oz},QtiFeedbackBlock:function t(){return av},QtiFeedbackInline:function t(){return ag},QtiFieldValue:function t(){return hH},QtiGap:function t(){return he},QtiGapImg:function t(){return hn},QtiGapMatchInteraction:function t(){return co},QtiGapText:function t(){return hi},QtiGcd:function t(){return hW},QtiGraphicAssociateInteraction:function t(){return cm},QtiGraphicGapMatchInteraction:function t(){return cw},QtiGraphicOrderInteraction:function t(){return cC},QtiGt:function t(){return hB},QtiGte:function t(){return hj},QtiHotspotChoice:function t(){return ho},QtiHotspotInteraction:function t(){return cM},QtiHottext:function t(){return ha},QtiHottextInteraction:function t(){return cL},QtiIndex:function t(){return pd},QtiInlineChoice:function t(){return hu},QtiInlineChoiceInteraction:function t(){return cZ},QtiIsNull:function t(){return hQ},QtiItem:function t(){return uN},QtiItemBody:function t(){return aw},QtiLookupOutcomeValue:function t(){return hg},QtiLt:function t(){return hG},QtiLte:function t(){return hX},QtiMapResponse:function t(){return hJ},QtiMapResponsePoint:function t(){return hK},QtiMatch:function t(){return h1},QtiMatchInteraction:function t(){return c3},QtiMathOperator:function t(){return h0},QtiMediaInteraction:function t(){return c4},QtiMember:function t(){return h2},QtiModalFeedback:function t(){return ab},QtiMultiple:function t(){return h3},QtiNot:function t(){return h5},QtiNull:function t(){return hF},QtiOr:function t(){return h4},QtiOrderInteraction:function t(){return c8},QtiOrdered:function t(){return h6},QtiOutcomeDeclaration:function t(){return aT},QtiPortableCustomInteraction:function t(){return dq},QtiPositionObjectInteraction:function t(){return d_},QtiPositionObjectStage:function t(){return dC},QtiPower:function t(){return h8},QtiPrintedVariable:function t(){return h7},QtiProduct:function t(){return h9},QtiPrompt:function t(){return hc},QtiRandom:function t(){return ps},QtiRandomInteger:function t(){return pa},QtiResponseCondition:function t(){return hb},QtiResponseDeclaration:function t(){return aM},QtiResponseElse:function t(){return hx},QtiResponseElseIf:function t(){return hC},QtiResponseIf:function t(){return h_},QtiResponseProcessing:function t(){return aD},QtiRound:function t(){return hP},QtiRoundTo:function t(){return hN},QtiRubricBlock:function t(){return ak},QtiRuleElement:function t(){return o$},QtiSelectPointInteraction:function t(){return dD},QtiSetOutcomeValue:function t(){return hq},QtiSetOutcomeValueRule:function t(){return hk},QtiSimpleAssociableChoice:function t(){return hd},QtiSimpleChoice:function t(){return hp},QtiSliderInteraction:function t(){return dX},QtiStringMatch:function t(){return pe},QtiStylesheet:function t(){return aE},QtiSubtract:function t(){return pt},QtiSum:function t(){return pr},QtiSumExpression:function t(){return pi},QtiTemplateDeclaration:function t(){return aj},QtiTest:function t(){return oQ},QtiTestFeedback:function t(){return aQ},QtiTestPart:function t(){return o1},QtiTextEntryInteraction:function t(){return d3},QtiUploadInteraction:function t(){return d9},QtiVariable:function t(){return po},QtiVariableDeclaration:function t(){return oP},ScoringHelper:function t(){return oW},TestCheckItem:function t(){return l7},TestContainer:function t(){return lG},TestEndAttempt:function t(){return so},TestItemLink:function t(){return si},TestNavigation:function t(){return a3},TestNext:function t(){return a9},TestPagingButtonsStamp:function t(){return lU},TestPrev:function t(){return st},TestPrintContext:function t(){return l1},TestPrintVariables:function t(){return lX},TestScoringButtons:function t(){return l4},TestScoringFeedback:function t(){return l8},TestSectionButtonsStamp:function t(){return lK},TestSectionLink:function t(){return l0},TestShowCorrectResponse:function t(){return sc},TestStamp:function t(){return l2},TestView:function t(){return sr},TestViewToggle:function t(){return l6},computedContext:function t(){return ot},computedItemContext:function t(){return i9},configContext:function t(){return oe},convertNumberToUniversalFormat:function t(){return oN},decimalSeparator:function t(){return oU},getItemByUri:function t(){return hv},getManifestInfo:function t(){return hf},itemContext:function t(){return or},itemContextVariables:function t(){return on},qtiAndMixin:function t(){return nQ},qtiContext:function t(){return oi},qtiSubtractMixin:function t(){return nH},qtiTransformItem:function t(){return iZ},qtiTransformManifest:function t(){return i0},qtiTransformTest:function t(){return i1},removeDoubleSlashes:function t(){return nB},sessionContext:function t(){return oa},testContext:function t(){return ol}});var rd=/*#__PURE__*/function(){"use strict";function t(e){l(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}d(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 rh=function t(t,e,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(t,n):o?o.value=n:e.set(t,n),n},rp=function t(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},rf,rv,rm,rg,rb,ry,rw,rq,rk,rx,r_,rC,rE=function t(t){var e;return typeof t=="boolean"?t:(e=t===null||t===void 0?void 0:t.capture)!==null&&e!==void 0?e:!1};var rS=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.__eventListeners=new Map,this.__captureEventListeners=new Map}d(t,[{key:"addEventListener",value:function t(t,e,n){var i=this;var o;if(e==null)return;var a=rE(n)?this.__captureEventListeners:this.__eventListeners,s=a.get(t);if(s===void 0)s=new Map,a.set(t,s);else if(s.has(e))return;var l=(typeof n==="undefined"?"undefined":U(n))=="object"&&n?n:{};(o=l.signal)===null||o===void 0?void 0:o.addEventListener("abort",function(){return i.removeEventListener(t,e,n)}),s.set(e,l!==null&&l!==void 0?l:{})}},{key:"removeEventListener",value:function t(t,e,n){if(e==null)return;var i=rE(n)?this.__captureEventListeners:this.__eventListeners,o=i.get(t);o!==void 0&&(o.delete(e),o.size||i.delete(t))}},{key:"dispatchEvent",value:function t(t){var e=this;var n=[this],i=this.__eventTargetParent;if(t.composed)for(;i;)n.push(i),i=i.__eventTargetParent;else for(;i&&i!==this.__host;)n.push(i),i=i.__eventTargetParent;var o=!1,a=!1,s=0,l=null,u=null,c=null,d=t.stopPropagation,h=t.stopImmediatePropagation;Object.defineProperties(t,{target:k({get:function t(){return l!==null&&l!==void 0?l:u}},rR),srcElement:k({get:function e(){return t.target}},rR),currentTarget:k({get:function t(){return c}},rR),eventPhase:k({get:function t(){return s}},rR),composedPath:k({value:function t(){return n}},rR),stopPropagation:k({value:function e(){o=!0,d.call(t)}},rR),stopImmediatePropagation:k({value:function e(){a=!0,h.call(t)}},rR)});var p=function e(e,n,i){typeof e=="function"?e(t):typeof(e===null||e===void 0?void 0:e.handleEvent)=="function"&&e.handleEvent(t),n.once&&i.delete(e)},f=function e(){return c=null,s=0,!t.defaultPrevented},v=n.slice().reverse();l=!this.__host||!t.composed?this:null;var m=function t(t){for(u=e;u.__host&&t.includes(u.__host);)u=u.__host};var g=true,b=false,y=undefined;try{for(var w=v[Symbol.iterator](),q;!(g=(q=w.next()).done);g=true){var x=q.value;!l&&(!u||u===x.__host)&&m(v.slice(v.indexOf(x))),c=x,s=x===t.target?2:1;var _=x.__captureEventListeners.get(t.type);if(_){var C=true,E=false,S=undefined;try{for(var A=_[Symbol.iterator](),R;!(C=(R=A.next()).done);C=true){var I=M(R.value,2),T=I[0],P=I[1];if(p(T,P,_),a)return f()}}catch(t){E=true;S=t}finally{try{if(!C&&A.return!=null){A.return()}}finally{if(E){throw S}}}}if(o)return f()}}catch(t){b=true;y=t}finally{try{if(!g&&w.return!=null){w.return()}}finally{if(b){throw y}}}var O=t.bubbles?n:[this];u=null;var L=true,U=false,N=undefined;try{for(var D=O[Symbol.iterator](),V;!(L=(V=D.next()).done);L=true){var z=V.value;!l&&(!u||z===u.__host)&&m(O.slice(0,O.indexOf(z)+1)),c=z,s=z===t.target?2:3;var $=z.__eventListeners.get(t.type);if($){var W=true,B=false,j=undefined;try{for(var F=$[Symbol.iterator](),Q;!(W=(Q=F.next()).done);W=true){var H=M(Q.value,2),G=H[0],X=H[1];if(p(G,X,$),a)return f()}}catch(t){B=true;j=t}finally{try{if(!W&&F.return!=null){F.return()}}finally{if(B){throw j}}}}if(o)return f()}}catch(t){U=true;N=t}finally{try{if(!L&&D.return!=null){D.return()}}finally{if(U){throw N}}}return f()}}]);return t}(),rA=rS;var rR={__proto__:null};rR.enumerable=!0;Object.freeze(rR);var rI=(rx=/*#__PURE__*/function(){"use strict";function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,t);if(rf.set(this,!1),rv.set(this,!1),rm.set(this,!1),rg.set(this,!1),rb.set(this,Date.now()),ry.set(this,!1),rw.set(this,void 0),rq.set(this,void 0),rk.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if((typeof n==="undefined"?"undefined":U(n))!="object"||!n)throw new Error('The "options" argument must be an object');var i=n.bubbles,o=n.cancelable,a=n.composed;rh(this,rf,!!o,"f"),rh(this,rv,!!i,"f"),rh(this,rm,!!a,"f"),rh(this,rw,"".concat(e),"f"),rh(this,rq,null,"f"),rh(this,rk,!1,"f")}d(t,[{key:"initEvent",value:function t(t,e,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function t(){this.stopPropagation()}},{key:"preventDefault",value:function t(){rh(this,rg,!0,"f")}},{key:"target",get:function t(){return rp(this,rq,"f")}},{key:"currentTarget",get:function t(){return rp(this,rq,"f")}},{key:"srcElement",get:function t(){return rp(this,rq,"f")}},{key:"type",get:function t(){return rp(this,rw,"f")}},{key:"cancelable",get:function t(){return rp(this,rf,"f")}},{key:"defaultPrevented",get:function t(){return rp(this,rf,"f")&&rp(this,rg,"f")}},{key:"timeStamp",get:function t(){return rp(this,rb,"f")}},{key:"composedPath",value:function t(){return rp(this,rk,"f")?[rp(this,rq,"f")]:[]}},{key:"returnValue",get:function t(){return!rp(this,rf,"f")||!rp(this,rg,"f")}},{key:"bubbles",get:function t(){return rp(this,rv,"f")}},{key:"composed",get:function t(){return rp(this,rm,"f")}},{key:"eventPhase",get:function t(){return rp(this,rk,"f")?rx.AT_TARGET:rx.NONE}},{key:"cancelBubble",get:function t(){return rp(this,ry,"f")},set:function t(t){t&&rh(this,ry,!0,"f")}},{key:"stopPropagation",value:function t(){rh(this,ry,!0,"f")}},{key:"isTrusted",get:function t(){return!1}}]);return t}(),rf=new WeakMap,rv=new WeakMap,rm=new WeakMap,rg=new WeakMap,rb=new WeakMap,ry=new WeakMap,rw=new WeakMap,rq=new WeakMap,rk=new WeakMap,rx.NONE=0,rx.CAPTURING_PHASE=1,rx.AT_TARGET=2,rx.BUBBLING_PHASE=3,rx);Object.defineProperties(rI.prototype,{initEvent:rR,stopImmediatePropagation:rR,preventDefault:rR,target:rR,currentTarget:rR,srcElement:rR,type:rR,cancelable:rR,defaultPrevented:rR,timeStamp:rR,composedPath:rR,returnValue:rR,bubbles:rR,composed:rR,eventPhase:rR,cancelBubble:rR,stopPropagation:rR,isTrusted:rR});var rM=(rC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,e);var i;var o;i=s(this,e,[t,n]),r_.set(i,void 0),rh(i,r_,(o=n===null||n===void 0?void 0:n.detail)!==null&&o!==void 0?o:null,"f");return i}d(e,[{key:"initCustomEvent",value:function t(t,e,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function t(){return rp(this,r_,"f")}}]);return e}(rI),r_=new WeakMap,rC);Object.defineProperties(rM.prototype,{detail:rR});var rT=rI,rP=rM;(nG=globalThis.Event)!==null&&nG!==void 0?nG:globalThis.Event=rT;(nX=globalThis.CustomEvent)!==null&&nX!==void 0?nX:globalThis.CustomEvent=rP;var rO=new WeakMap,rL=function t(t){var e=rO.get(t);return e===void 0&&rO.set(t,e=new Map),e},rU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.__shadowRootMode=null,t.__shadowRoot=null,t.__internals=null;return t}d(e,[{key:"attributes",get:function t(){return Array.from(rL(this)).map(function(t){var e=M(t,2),n=e[0],i=e[1];return{name:n,value:i}})}},{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){rL(this).set(t,String(e))}},{key:"removeAttribute",value:function t(t){rL(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 rL(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 rd(this);return this.__internals=t,t}},{key:"getAttribute",value:function t(t){var e;return(e=rL(this).get(t))!==null&&e!==void 0?e:null}}]);return e}(rA);var rN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(rU),rD=rN;(nJ=globalThis.litServerRoot)!==null&&nJ!==void 0?nJ:globalThis.litServerRoot=Object.defineProperty(new rD,"localName",{get:function t(){return"lit-server-root"}});var rV=/*#__PURE__*/function(){"use strict";function e(){l(this,e);this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}d(e,[{key:"define",value:function t(t,e){var n;var i;if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn("'CustomElementRegistry' already has \"".concat(t,'" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.'));else throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the name \"".concat(t,'" has already been used with this registry'));if(this.__reverseDefinitions.has(e))throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ".concat(this.__reverseDefinitions.get(e)));e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:(n=e.observedAttributes)!==null&&n!==void 0?n:[]}),this.__reverseDefinitions.set(e,t),(i=this.__pendingWhenDefineds.get(t))===null||i===void 0?void 0:i.resolve(e),this.__pendingWhenDefineds.delete(t)}},{key:"get",value:function t(t){var e;return(e=this.__definitions.get(t))===null||e===void 0?void 0:e.ctor}},{key:"getName",value:function t(t){var e;return(e=this.__reverseDefinitions.get(t))!==null&&e!==void 0?e:null}},{key:"upgrade",value:function t(t){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function e(e){return a(function(){var n,i;return z(this,function(o){n=this.__definitions.get(e);if(n)return[2,n.ctor];i=this.__pendingWhenDefineds.get(e);return[2,(i||(i=t(),this.__pendingWhenDefineds.set(e,i)),i.promise)]})}).call(this)}}]);return e}(),rz=rV;var r$=new rz;var rW=globalThis,rB=rW.ShadowRoot&&(rW.ShadyCSS===void 0||rW.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rj=Symbol(),rF=new WeakMap,rQ=/*#__PURE__*/function(){"use strict";function t(e,n,i){l(this,t);if(this._$cssResult$=!0,i!==rj)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}d(t,[{key:"styleSheet",get:function t(){var t=this.o,e=this.t;if(rB&&t===void 0){var n=e!==void 0&&e.length===1;n&&(t=rF.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&rF.set(e,t))}return t}},{key:"toString",value:function t(){return this.cssText}}]);return t}(),rH=function t(t){return new rQ(typeof t=="string"?t:t+"",void 0,rj)},rG=function t(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++){n[i-1]=arguments[i]}var o=t.length===1?t[0]:n.reduce(function(e,n,i){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[i+1]},t[0]);return new rQ(o,t,rj)},rX=function t(t,e){var n=true,i=false,o=undefined;if(rB)t.adoptedStyleSheets=e.map(function(t){return m(t,CSSStyleSheet)?t:t.styleSheet});else try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;var u=document.createElement("style"),c=rW.litNonce;c!==void 0&&u.setAttribute("nonce",c),u.textContent=l.cssText,t.appendChild(u)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}},rJ=rB||rW.CSSStyleSheet===void 0?function(t){return t}:function(t){return m(t,CSSStyleSheet)?function(t){var e="";var n=true,i=false,o=undefined;try{for(var a=t.cssRules[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;e+=l.cssText}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return rH(e)}(t):t};var rK=Object.is,rY=Object.defineProperty,rZ=Object.getOwnPropertyDescriptor,r0=Object.getOwnPropertyNames,r1=Object.getOwnPropertySymbols,r2=Object.getPrototypeOf,r3=globalThis;(nK=r3.customElements)!==null&&nK!==void 0?nK:r3.customElements=r$;var r5=r3.trustedTypes,r4=r5?r5.emptyScript:"",r6=r3.reactiveElementPolyfillSupport,r8=function t(t,e){return t},r7={toAttribute:function t(t,e){switch(e){case Boolean:t=t?r4: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}},r9=function t(t,e){return!rK(t,e)},it={attribute:!0,type:String,converter:r7,reflect:!1,useDefault:!1,hasChanged:r9};(nY=Symbol.metadata)!==null&&nY!==void 0?nY:Symbol.metadata=Symbol("metadata"),(nZ=r3.litPropertyMetadata)!==null&&nZ!==void 0?nZ:r3.litPropertyMetadata=new WeakMap;var ie=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev();return t}d(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;((e=this._$EO)!==null&&e!==void 0?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)===null||n===void 0?void 0:n.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,i=false,o=undefined;try{for(var a=e.keys()[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;this.hasOwnProperty(l)&&(t.set(l,this[l]),delete this[l])}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}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 rX(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function t(){var t;var e;(t=this.renderRoot)!==null&&t!==void 0?t:this.renderRoot=this.createRenderRoot(),this.enableUpdating(!0),(e=this._$EO)===null||e===void 0?void 0:e.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:"_$ET",value:function t(t,e){var n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(i!==void 0&&n.reflect===!0){var o;var a=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:r7).toAttribute(e,n.type);this._$Em=t,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}},{key:"_$AK",value:function t(t,e){var n=this.constructor,i=n._$Eh.get(t);if(i!==void 0&&this._$Em!==i){var o;var a,s;var l=n.getPropertyOptions(i),u=typeof l.converter=="function"?{fromAttribute:l.converter}:((a=l.converter)===null||a===void 0?void 0:a.fromAttribute)!==void 0?l.converter:r7;this._$Em=i;var c=u.fromAttribute(e,l.type);this[i]=(o=c!==null&&c!==void 0?c:(s=this._$Ej)===null||s===void 0?void 0:s.get(i))!==null&&o!==void 0?o:c,this._$Em=null}}},{key:"requestUpdate",value:function t(t,e,n){if(t!==void 0){var i;var o;var a=this.constructor,s=this[t];if(n!==null&&n!==void 0?n:n=a.getPropertyOptions(t),!(((i=n.hasChanged)!==null&&i!==void 0?i:r9)(s,e)||n.useDefault&&n.reflect&&s===((o=this._$Ej)===null||o===void 0?void 0:o.get(t))&&!this.hasAttribute(a._$Eu(t,n))))return;this.C(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}},{key:"C",value:function t(t,e,n,i){var o=n.useDefault,a=n.reflect,s=n.wrapped;var l,u,c;o&&!((l=this._$Ej)!==null&&l!==void 0?l:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,(u=i!==null&&i!==void 0?i:e)!==null&&u!==void 0?u:this[t]),s!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),a===!0&&this._$Em!==t&&((c=this._$Eq)!==null&&c!==void 0?c:this._$Eq=new Set).add(t))}},{key:"_$EP",value:function t(){return a(function(){var t,e,n;return z(this,function(i){switch(i.label){case 0:this.isUpdatePending=!0;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this._$ES];case 2:i.sent();return[3,4];case 3:t=i.sent();Promise.reject(t);return[3,4];case 4:e=this.scheduleUpdate();n=e!=null;if(!n)return[3,6];return[4,e];case 5:n=i.sent();i.label=6;case 6:return[2,(n,!this.isUpdatePending)]}})}).call(this)}},{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,i=undefined;try{for(var o=this._$Ep[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=M(a.value,2),l=s[0],u=s[1];this[l]=u}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}this._$Ep=void 0}var c=this.constructor.elementProperties;var d=true,h=false,p=undefined;if(c.size>0)try{for(var f=c[Symbol.iterator](),v;!(d=(v=f.next()).done);d=true){var m=M(v.value,2),g=m[0],b=m[1];var y=b.wrapped,w=this[g];y!==!0||this._$AL.has(g)||w===void 0||this.C(g,void 0,b,w)}}catch(t){h=true;p=t}finally{try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}}}var q=!1,k=this._$AL;try{var x;q=this.shouldUpdate(k),q?(this.willUpdate(k),(x=this._$EO)===null||x===void 0?void 0:x.forEach(function(t){var e;return(e=t.hostUpdate)===null||e===void 0?void 0:e.call(t)}),this.update(k)):this._$EM()}catch(t){throw q=!1,this._$EM(),t}q&&this._$AE(k)}},{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:"_$EM",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._$Eq&&(this._$Eq=this._$Eq.forEach(function(t){return e._$ET(t,e[t])})),this._$EM()}},{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&&L(this._$Eh.keys())}},{key:"createProperty",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:it;if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(t,n,e);i!==void 0&&rY(this.prototype,t,i)}}},{key:"getPropertyDescriptor",value:function t(t,e,n){var i;var o=(i=rZ(this.prototype,t))!==null&&i!==void 0?i:{get:function t(){return this[e]},set:function t(t){this[e]=t}},a=o.get,s=o.set;return{get:a,set:function e(e){var i=a===null||a===void 0?void 0:a.call(this);s===null||s===void 0?void 0:s.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function t(t){var e;return(e=this.elementProperties.get(t))!==null&&e!==void 0?e:it}},{key:"_$Ei",value:function t(){if(this.hasOwnProperty(r8("elementProperties")))return;var t=r2(this);t.finalize(),t.l!==void 0&&(this.l=L(t.l)),this.elementProperties=new Map(t.elementProperties)}},{key:"finalize",value:function t(){if(this.hasOwnProperty(r8("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(r8("properties"))){var t=this.properties,e=L(r0(t)).concat(L(r1(t)));var n=true,i=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;this.createProperty(l,t[l])}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}var u=this[Symbol.metadata];if(u!==null){var c=litPropertyMetadata.get(u);var d=true,h=false,p=undefined;if(c!==void 0)try{for(var f=c[Symbol.iterator](),v;!(d=(v=f.next()).done);d=true){var m=M(v.value,2),g=m[0],b=m[1];this.elementProperties.set(g,b)}}catch(t){h=true;p=t}finally{try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}}}this._$Eh=new Map;var y=true,w=false,q=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),x;!(y=(x=k.next()).done);y=true){var _=M(x.value,2),C=_[0],E=_[1];var S=this._$Eu(C,E);S!==void 0&&this._$Eh.set(S,C)}}catch(t){w=true;q=t}finally{try{if(!y&&k.return!=null){k.return()}}finally{if(w){throw q}}}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 i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;e.unshift(rJ(u))}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}else t!==void 0&&e.push(rJ(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}((n0=globalThis.HTMLElement)!==null&&n0!==void 0?n0:rD);ie.elementStyles=[],ie.shadowRootOptions={mode:"open"},ie[r8("elementProperties")]=new Map,ie[r8("finalized")]=new Map,r6===null||r6===void 0?void 0:r6({ReactiveElement:ie}),((n1=r3.reactiveElementVersions)!==null&&n1!==void 0?n1:r3.reactiveElementVersions=[]).push("2.1.1");var ir=globalThis,ii=ir.trustedTypes,io=ii?ii.createPolicy("lit-html",{createHTML:function t(t){return t}}):void 0,ia="$lit$",is="lit$".concat(Math.random().toFixed(9).slice(2),"$"),il="?"+is,iu="<".concat(il,">"),ic=ir.document===void 0?{createTreeWalker:function t(){return{}}}:document,id=function t(){return ic.createComment("")},ih=function t(t){return t===null||(typeof t==="undefined"?"undefined":U(t))!="object"&&typeof t!="function"},ip=Array.isArray,iv=function t(t){return ip(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},im="[ \n\f\r]",ig=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ib=/-->/g,iy=/>/g,iw=RegExp(">|".concat(im,"(?:([^\\s\"'>=/]+)(").concat(im,"*=").concat(im,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),iq=/'/g,ik=/"/g,ix=/^(?:script|style|textarea|title)$/i,i_=function t(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++){i[o-1]=arguments[o]}return{_$litType$:t,strings:e,values:i}}},iC=i_(1),iE=i_(2),iS=i_(3),iA=Symbol.for("lit-noChange"),iR=Symbol.for("lit-nothing"),iI=new WeakMap,iM=ic.createTreeWalker(ic,129);var iT=function t(t,n){var i=t.length-1,o=[],a,s=n===2?"<svg>":n===3?"<math>":"",l=ig;for(var u=0;u<i;u++){var c=t[u],d=void 0,h=void 0,p=-1,f=0;for(;f<c.length&&(l.lastIndex=f,h=l.exec(c),h!==null);)f=l.lastIndex,l===ig?h[1]==="!--"?l=ib:h[1]!==void 0?l=iy:h[2]!==void 0?(ix.test(h[2])&&(a=RegExp("</"+h[2],"g")),l=iw):h[3]!==void 0&&(l=iw):l===iw?h[0]===">"?(l=a!==null&&a!==void 0?a:ig,p=-1):h[1]===void 0?p=-2:(p=l.lastIndex-h[2].length,d=h[1],l=h[3]===void 0?iw:h[3]==='"'?ik:iq):l===ik||l===iq?l=iw:l===ib||l===iy?l=ig:(l=iw,a=void 0);var v=l===iw&&t[u+1].startsWith("/>")?" ":"";s+=l===ig?c+iu:p>=0?(o.push(d),c.slice(0,p)+ia+c.slice(p)+is+v):c+is+(p===-2?u:v)}return[e(t,s+(t[i]||"<?>")+(n===2?"</svg>":n===3?"</math>":"")),o]},iP=/*#__PURE__*/function(){"use strict";function t(e,n){var i=e.strings,o=e._$litType$;l(this,t);var a;this.parts=[];var s=0,u=0,c=i.length-1,d=this.parts,h=M(iT(i,o),2),p=h[0],f=h[1];if(this.el=t.createElement(p,n),iM.currentNode=this.el.content,o===2||o===3){var v;var m=this.el.content.firstChild;(v=m).replaceWith.apply(v,L(m.childNodes))}for(;(a=iM.nextNode())!==null&&d.length<c;){if(a.nodeType===1){var g=true,b=false,y=undefined;if(a.hasAttributes())try{for(var w=a.getAttributeNames()[Symbol.iterator](),q;!(g=(q=w.next()).done);g=true){var k=q.value;if(k.endsWith(ia)){var x=f[u++],_=a.getAttribute(k).split(is),C=/([.?@])?(.*)/.exec(x);d.push({type:1,index:s,name:C[2],strings:_,ctor:C[1]==="."?iD:C[1]==="?"?iV:C[1]==="@"?iz:iN}),a.removeAttribute(k)}else k.startsWith(is)&&(d.push({type:6,index:s}),a.removeAttribute(k))}}catch(t){b=true;y=t}finally{try{if(!g&&w.return!=null){w.return()}}finally{if(b){throw y}}}if(ix.test(a.tagName)){var E=a.textContent.split(is),S=E.length-1;if(S>0){a.textContent=ii?ii.emptyScript:"";for(var A=0;A<S;A++)a.append(E[A],id()),iM.nextNode(),d.push({type:2,index:++s});a.append(E[S],id())}}}else if(a.nodeType===8)if(a.data===il)d.push({type:2,index:s});else{var R=-1;for(;(R=a.data.indexOf(is,R+1))!==-1;)d.push({type:7,index:s}),R+=is.length-1}s++}}d(t,null,[{key:"createElement",value:function t(t,e){var n=ic.createElement("template");return n.innerHTML=t,n}}]);return t}();function iO(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0;var o;var a,s;if(e===iA)return e;var l=i!==void 0?(a=n._$Co)===null||a===void 0?void 0:a[i]:n._$Cl,u=ih(e)?void 0:e._$litDirective$;return(l===null||l===void 0?void 0:l.constructor)!==u&&(l===null||l===void 0?void 0:(s=l._$AO)===null||s===void 0?void 0:s.call(l,!1),u===void 0?l=void 0:(l=new u(t),l._$AT(t,n,i)),i!==void 0?((o=n._$Co)!==null&&o!==void 0?o:n._$Co=[])[i]=l:n._$Cl=l),l!==void 0&&(e=iO(t,l._$AS(t,e.values),l,i)),e}var iL=/*#__PURE__*/function(){"use strict";function t(e,n){l(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}d(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,i=n.el,o=i.content,a=n.parts,s=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:ic).importNode(o,!0);iM.currentNode=s;var l=iM.nextNode(),u=0,c=0,d=a[0];for(;d!==void 0;){if(u===d.index){var h=void 0;d.type===2?h=new iU(l,l.nextSibling,this,t):d.type===1?h=new d.ctor(l,d.name,d.strings,this,t):d.type===6&&(h=new i$(l,this,t)),this._$AV.push(h),d=a[++c]}u!==(d===null||d===void 0?void 0:d.index)&&(l=iM.nextNode(),u++)}return iM.currentNode=ic,s}},{key:"p",value:function t(t){var e=0;var n=true,i=false,o=undefined;try{for(var a=this._$AV[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;l!==void 0&&(l.strings!==void 0?(l._$AI(t,l,e),e+=l.strings.length-2):l._$AI(t[e])),e++}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}}]);return t}(),iU=/*#__PURE__*/function(){"use strict";function t(e,n,i,o){l(this,t);var a;this.type=2,this._$AH=iR,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=o,this._$Cv=(a=o===null||o===void 0?void 0:o.isConnected)!==null&&a!==void 0?a:!0}d(t,[{key:"_$AU",get:function t(){var t;var e;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t: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=iO(this,t,e),ih(t)?t===iR||t==null||t===""?(this._$AH!==iR&&this._$AR(),this._$AH=iR):t!==this._$AH&&t!==iA&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):iv(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!==iR&&ih(this._$AH)?this._$AA.nextSibling.data=t:this.T(ic.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var n;var i=t.values,o=t._$litType$,a=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=iP.createElement(e(o.h,o.h[0]),this.options)),o);if(((n=this._$AH)===null||n===void 0?void 0:n._$AD)===a)this._$AH.p(i);else{var s=new iL(a,this),l=s.u(this.options);s.p(i),this.T(l),this._$AH=s}}},{key:"_$AC",value:function t(t){var e=iI.get(t.strings);return e===void 0&&iI.set(t.strings,e=new iP(t)),e}},{key:"k",value:function e(e){ip(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,i,o=0;var a=true,s=false,l=undefined;try{for(var u=e[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;o===n.length?n.push(i=new t(this.O(id()),this.O(id()),this,this.options)):i=n[o],i._$AI(d),o++}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}o<n.length&&(this._$AR(i&&i._$AB.nextSibling,o),n.length=o)}},{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,i;for((n=(i=this)._$AP)===null||n===void 0?void 0:n.call(i,!1,!0,e);t!==this._$AB;){var o=t.nextSibling;t.remove(),t=o}}},{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}(),iN=/*#__PURE__*/function(){"use strict";function t(e,n,i,o,a){l(this,t);this.type=1,this._$AH=iR,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=iR}d(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,i=arguments.length>3?arguments[3]:void 0;var o=this.strings,a=!1;if(o===void 0)t=iO(this,t,e,0),a=!ih(t)||t!==this._$AH&&t!==iA,a&&(this._$AH=t);else{var s=t,l,u;for(t=o[0],l=0;l<o.length-1;l++)u=iO(this,s[n+l],e,l),u===iA&&(u=this._$AH[l]),a||(a=!ih(u)||u!==this._$AH[l]),u===iR?t=iR:t!==iR&&(t+=(u!==null&&u!==void 0?u:"")+o[l+1]),this._$AH[l]=u}a&&!i&&this.j(t)}},{key:"j",value:function t(t){t===iR?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),iD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.type=3;return t}d(e,[{key:"j",value:function t(t){this.element[this.name]=t===iR?void 0:t}}]);return e}(iN),iV=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.type=4;return t}d(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==iR)}}]);return e}(iN),iz=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i,o,a){l(this,e);var u;u=s(this,e,[t,n,i,o,a]),u.type=5;return u}d(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=iO(this,t,e,0))!==null&&n!==void 0?n:iR)===iA)return;var i=this._$AH,o=t===iR&&i!==iR||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==iR&&(i===iR||o);o&&this.element.removeEventListener(this.name,this,i),a&&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((e=(n=this.options)===null||n===void 0?void 0:n.host)!==null&&e!==void 0?e:this.element,t):this._$AH.handleEvent(t)}}]);return e}(iN),i$=/*#__PURE__*/function(){"use strict";function t(e,n,i){l(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}d(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){iO(this,t)}}]);return t}(),iW={M:ia,P:is,A:il,C:1,L:iT,R:iL,D:iv,V:iO,I:iU,H:iN,N:iV,U:iz,B:iD,F:i$},iB=ir.litHtmlPolyfillSupport;iB===null||iB===void 0?void 0:iB(iP,iU),((n2=ir.litHtmlVersions)!==null&&n2!==void 0?n2:ir.litHtmlVersions=[]).push("3.3.1");var ij=function t(t,e,n){var i;var o=(i=n===null||n===void 0?void 0:n.renderBefore)!==null&&i!==void 0?i:e,a=o._$litPart$;if(a===void 0){var s;var l=(s=n===null||n===void 0?void 0:n.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=a=new iU(e.insertBefore(id(),l),l,void 0,n!==null&&n!==void 0?n:{})}return a._$AI(t),a};var iF=globalThis,iQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.renderOptions={host:t},t._$Do=void 0;return t}d(e,[{key:"createRenderRoot",value:function t(){var t;var n;var i=p(f(e.prototype),"createRenderRoot",this).call(this);return(t=(n=this.renderOptions).renderBefore)!==null&&t!==void 0?t:n.renderBefore=i.firstChild,i}},{key:"update",value:function t(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),p(f(e.prototype),"update",this).call(this,t),this._$Do=ij(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function t(){var t;p(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;p(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 iA}}]);return e}(ie);iQ._$litElement$=!0,iQ.finalized=!0,(n5=iF.litElementHydrateSupport)===null||n5===void 0?void 0:n5.call(iF,{LitElement:iQ});var iH=iF.litElementPolyfillSupport;iH===null||iH===void 0?void 0:iH({LitElement:iQ});((n3=iF.litElementVersions)!==null&&n3!==void 0?n3:iF.litElementVersions=[]).push("4.2.1");var iG=function t(t){return function(e,n){n!==void 0?n.addInitializer(function(){customElements.define(t,e)}):customElements.define(t,e)}};var iX={attribute:!0,type:String,converter:r7,reflect:!1,hasChanged:r9},iJ=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iX,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var i=n.kind,o=n.metadata,a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),i==="setter"&&((t=Object.create(t)).wrapped=!0),a.set(n.name,t),i==="accessor"){var s=n.name;return{set:function n(n){var i=e.get.call(this);e.set.call(this,n),this.requestUpdate(s,i,t)},init:function e(e){return e!==void 0&&this.C(s,void 0,t,e),e}}}if(i==="setter"){var l=n.name;return function(n){var i=this[l];e.call(this,n),this.requestUpdate(l,i,t)}}throw Error("Unsupported decorator location: "+i)};var iK=function t(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof e==="undefined"?"undefined":U(e))!="object"&&Object.defineProperty(t,e,n),n};function iY(t,e){if(t.nodeType===Node.ELEMENT_NODE){var n=t,i=e.createElement(n.localName);for(var o=0;o<n.attributes.length;o++){var a=n.attributes[o];i.setAttribute(a.localName,a.value)}for(var s=0;s<n.childNodes.length;s++)i.appendChild(iY(n.childNodes[s],e));return i}return t.cloneNode(!1)}var iZ=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var e,n="",i={load:function o(o,a){n=o;var s=encodeURI(o);return t&&sessionStorage.getItem(s)?Promise.resolve(i.parse(sessionStorage.getItem(s))):w(o,a).then(function(n){return e=n,i.shuffleInteractions(),t&&sessionStorage.setItem(s,new XMLSerializer().serializeToString(e)),i})},parse:function t(t){return e=q(t),i},path:function t(t){return E(e,t),n=null,i},fn:function t(t){return t(e),i},pciHooks:function t(t){var n=["hook","module"],o=t.substring(0,t.lastIndexOf("/"));var a=true,s=false,l=undefined;try{var u=function(){var n=d.value;e.querySelectorAll("["+n+"]").forEach(function(e){var i=e.getAttribute(n);!i.startsWith("data:")&&!i.startsWith("http")&&(e.setAttribute("base-url",t),e.setAttribute("module",o+"/"+encodeURI(i+(i.endsWith(".js")?"":".js"))))})};for(var c=n[Symbol.iterator](),d;!(a=(d=c.next()).done);a=true)u()}catch(t){s=true;l=t}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw l}}}return i},configurePci:function t(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"qti-portable-custom-interaction";return a(function(){var s,l,u,c,d,h,p,f,v,m,g,b,y,w,q,k,x,_,C,E,S,A,R,I,M,T,P,O,L,U,N,D,V,$;return z(this,function(P){switch(P.label){case 0:s=[],l=e.querySelectorAll(o);if(l.length===0)return[2,i];u=null,c=null,d=function e(){return a(function(){var e,i;return z(this,function(o){switch(o.label){case 0:if(!(u===null))return[3,4];o.label=1;case 1:o.trys.push([1,3,,4]);return[4,n(t,"/modules/module_resolution.js")];case 2:u=o.sent();return[3,4];case 3:e=o.sent();u=null;return[3,4];case 4:if(!(c===null))return[3,8];o.label=5;case 5:o.trys.push([5,7,,8]);return[4,n(t,"/modules/fallback_module_resolution.js")];case 6:c=o.sent();return[3,8];case 7:i=o.sent();c=null;return[3,8];case 8:return[2]}})})()};h=true,p=false,f=undefined;P.label=1;case 1:P.trys.push([1,12,13,14]);v=Array.from(l)[Symbol.iterator]();P.label=2;case 2:if(!!(h=(m=v.next()).done))return[3,11];g=m.value;g.setAttribute("data-base-url",t);b=g.getAttribute("custom-interaction-type-identifier");b&&s.includes(b)&&(b=b+s.length,g.setAttribute("custom-interaction-type-identifier",b),s.push(b)),b&&s.push(b);y=g.querySelector("qti-interaction-modules");if(!(y&&y.getAttribute("primary-configuration")))return[3,8];return[4,d()];case 3:P.sent();w=y.getAttribute("primary-configuration");if(!w)return[3,7];P.label=4;case 4:P.trys.push([4,6,,7]);return[4,n(t,"/".concat(w))];case 5:q=P.sent(),k=Array.from(y.querySelectorAll("qti-interaction-module"));x=true,_=false,C=undefined;try{for(E=k[Symbol.iterator]();!(x=(S=E.next()).done);x=true){A=S.value;R=A.getAttribute("id");if(R&&q.paths&&q.paths[R]){I=q.paths[R],M=Array.isArray(I)?I[0]:I;if(A.setAttribute("primary-path",M),c&&c.paths&&c.paths[R]){T=c.paths[R];Array.isArray(T)?A.setAttribute("fallback-path",T[0]):A.setAttribute("fallback-path",T)}}}}catch(t){_=true;C=t}finally{try{if(!x&&E.return!=null){E.return()}}finally{if(_){throw C}}}if(q.paths){for(var V in q.paths)if(!y.querySelector('qti-interaction-module[id="'.concat(V,'"]'))){O=e.createElement("qti-interaction-module");O.setAttribute("id",V);L=Array.isArray(q.paths[V])?q.paths[V][0]:q.paths[V];if(O.setAttribute("primary-path",L),c&&c.paths&&c.paths[V]){U=c.paths[V];Array.isArray(U)?O.setAttribute("fallback-path",U[0]):O.setAttribute("fallback-path",U)}y.appendChild(O)}}q.urlArgs&&y.setAttribute("url-args",q.urlArgs);return[3,7];case 6:N=P.sent();console.warn("Failed to load primary configuration: ".concat(w),N);return[3,7];case 7:return[3,10];case 8:return[4,d()];case 9:if(P.sent(),u){D=function(t){var n=u.paths[t],i="";c&&c.paths&&c.paths[t]&&(i=c.paths[t]);var o=Array.isArray(n)?n:[n],a=Array.isArray(i)?i:[i],s=o.map(function(t,e){var n=a.length>e?a[e]:"";return{primaryPath:t,fallbackPath:n}});var l=true,d=false,h=undefined;try{var p=function(){var t=v.value;s.some(function(e){return e.fallbackPath===t})||s.push({primaryPath:o.length>0?o[0]:t,fallbackPath:t})};for(var f=a[Symbol.iterator](),v;!(l=(v=f.next()).done);l=true)p()}catch(t){d=true;h=t}finally{try{if(!l&&f.return!=null){f.return()}}finally{if(d){throw h}}}var m=true,g=false,b=undefined;try{for(var w=s[Symbol.iterator](),q;!(m=(q=w.next()).done);m=true){var k=q.value;var x=e.createElement("qti-interaction-module");k.fallbackPath&&x.setAttribute("fallback-path",k.fallbackPath),x.setAttribute("id",t),x.setAttribute("primary-path",k.primaryPath),y&&y.appendChild(x)}}catch(t){g=true;b=t}finally{try{if(!m&&w.return!=null){w.return()}}finally{if(g){throw b}}}};g.querySelector("qti-interaction-modules")===null?(y=e.createElement("qti-interaction-modules"),g.appendChild(y)):y=g.querySelector("qti-interaction-modules");for(var W in u.paths)D(W)}P.label=10;case 10:h=true;return[3,2];case 11:return[3,14];case 12:$=P.sent();p=true;f=$;return[3,14];case 13:try{if(!h&&v.return!=null){v.return()}}finally{if(p){throw f}}return[7];case 14:return[2,i]}})})()},shuffleInteractions:function t(){var t=e.querySelectorAll('[shuffle="true"]'),n=Array.from(t).filter(function(t){var e;return(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase().endsWith("-interaction")});var o=true,a=false,s=undefined;try{for(var l=n[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;var d=I(c.tagName.toLowerCase()),h=Array.isArray(d)?d:[d];var p=true,f=false,v=undefined;try{var m=function(){var t=b.value;var e;var n=Array.from(c.querySelectorAll(t)),o=n.map(function(t,e){return{element:t,fixed:t.hasAttribute("fixed")&&t.getAttribute("fixed")==="true",originalOrder:e}}).filter(function(t){return t.fixed}),a=n.filter(function(t){return!t.hasAttribute("fixed")||t.getAttribute("fixed")!=="true"});if(a.length<=1)return{v:(console.warn("Shuffling is not possible with fewer than 2 non-fixed elements."),i)};var s=L(a),l=!1,u=0;for(;!l&&u<20;){u++;for(var d=a.length-1;d>0;d--){var h=Math.floor(Math.random()*(d+1));var p;p=[a[h],a[d]],a[d]=p[0],a[h]=p[1],p}l=!a.every(function(t,e){return t===s[e]})}if(!l)return{v:(console.warn("Failed to shuffle the choices after multiple attempts."),null)};c.removeAttribute("shuffle");var f=0;var v=true,m=false,g=undefined;try{for(var y=a[Symbol.iterator](),w;!(v=(w=y.next()).done);v=true){var q=w.value;q.parentElement.insertBefore(q,(e=o[f])===null||e===void 0?void 0:e.element),f++}}catch(t){m=true;g=t}finally{try{if(!v&&y.return!=null){y.return()}}finally{if(m){throw g}}}var k=true,x=false,_=undefined;try{for(var C=o[Symbol.iterator](),E;!(k=(E=C.next()).done);k=true){var S=E.value;S.element.parentElement.insertBefore(S.element,a[S.originalOrder])}}catch(t){x=true;_=t}finally{try{if(!k&&C.return!=null){C.return()}}finally{if(x){throw _}}}};for(var g=h[Symbol.iterator](),b;!(p=(b=g.next()).done);p=true){var y=m();if(U(y)==="object")return y.v}}catch(t){f=true;v=t}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(f){throw v}}}}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return i},extendElementName:function t(t,n){return c(e,t,n),i},extendElementsWithClass:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return g(e,t),i},customInteraction:function t(t,n){var o=e.querySelector("qti-custom-interaction"),a=o.querySelector("object");return o.setAttribute("data-base-ref",t),o.setAttribute("data-base-item",t+n),o.setAttribute("data",a.getAttribute("data")),o.setAttribute("width",a.getAttribute("width")),o.setAttribute("height",a.getAttribute("height")),o.removeChild(a),i},convertCDATAtoComment:function t(){return S(e),i},stripStyleSheets:function t(){return A(e),i},html:function t(){return n!==null&&E(e,n.substring(0,n.lastIndexOf("/"))),new XMLSerializer().serializeToString(x(e))},xml:function t(){return new XMLSerializer().serializeToString(e)},htmlDoc:function t(){return n!==null&&E(e,n.substring(0,n.lastIndexOf("/"))),x(e)},xmlDoc:function t(){return e}};return i};var i0=function t(){var t,e={load:function n(n,i){return a(function(){return z(this,function(o){return[2,new Promise(function(o){w(n,i).then(function(n){return t=n,o(e)})})]})})()},parse:function e(e){t=q(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 i1=function t(){var t,e={load:function n(n,i){return a(function(){return z(this,function(o){return[2,new Promise(function(o,a){w(n,i).then(function(i){return t=i,e.path(n.substring(0,n.lastIndexOf("/"))),o(e)})})]})})()},parse:function n(n){return t=q(n),e},path:function n(n){return E(t,n),e},fn:function n(n){return n(t),e},items:function e(){return y(t)},html:function e(){return new XMLSerializer().serializeToString(x(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return x(t)},xmlDoc:function e(){return t}};return e};var i2=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,L(n));o.navigate=null;o.cacheTransform=!1;o.requestTimeout=3e4;o.postLoadTransformCallback=null;o.postLoadTestTransformCallback=null;o._activeController=null;o._loadResults=[];o._navigationId=0;o._loadingState={expectedItems:0,connectedItems:0,expectedStimulus:0,loadedStimulus:0,isComplete:!1};o._loadedStimulusHrefs=new Set;o._loadingStimulusHrefs=new Set;o._bindEventHandlers();return o}d(e,[{key:"navigateTo",value:function t(t,e){var n=e||this._getDefaultNavigationId(t);n&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:n},bubbles:!0,composed:!0}))}},{key:"_bindEventHandlers",value:function t(){this.addEventListener("qti-request-navigation",this._handleNavigationRequest.bind(this)),this.addEventListener("qti-assessment-test-connected",this._handleTestConnected.bind(this)),this.addEventListener("qti-assessment-item-connected",this._handleItemConnected.bind(this)),this.addEventListener("qti-assessment-stimulus-ref-connected",this._handleStimulusRefConnected.bind(this))}},{key:"_handleTestConnected",value:function t(t){this._testElement=t.detail,this._initializeNavigation()}},{key:"_handleItemConnected",value:function t(t){var e=t.detail;this._loadingState.connectedItems++;var n=e.querySelectorAll("qti-assessment-stimulus-ref");this._loadingState.expectedStimulus+=n.length,this._checkLoadingComplete()}},{key:"_handleStimulusRefConnected",value:function t(t){return a(function(){var e,n,i;return z(this,function(o){switch(o.label){case 0:t.preventDefault();e=t.element,n=t.item;if(console.info("Stimulus ref connected:",{identifier:e.identifier,href:e.href,item:n.identifier}),this._loadedStimulusHrefs.has(e.href)){console.info("Stimulus already loaded, skipping:",e.href),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[2]}if(this._loadingStimulusHrefs.has(e.href)){console.info("Stimulus already loading, skipping duplicate:",e.href),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[2]}this._loadingStimulusHrefs.add(e.href),console.info("Starting stimulus load:",e.href);o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this._loadStimulusRef(e,n)];case 2:o.sent(),this._loadedStimulusHrefs.add(e.href),this._loadingState.loadedStimulus++,console.info("Stimulus loaded successfully:",e.href),this._checkLoadingComplete();return[3,5];case 3:i=o.sent();i.name!=="AbortError"&&console.warn("Failed to load stimulus ".concat(e.identifier,":"),i),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[3,5];case 4:this._loadingStimulusHrefs.delete(e.href);return[7];case 5:return[2]}})}).call(this)}},{key:"_getDefaultNavigationId",value:function t(t){var e;var n,i,o,a,s;return t==="section"?(i=this._testElement)===null||i===void 0?void 0:(n=i.querySelector("qti-assessment-section"))===null||n===void 0?void 0:n.identifier:(e=(o=this.sessionContext)===null||o===void 0?void 0:o.navItemRefId)!==null&&e!==void 0?e:(s=this._testElement)===null||s===void 0?void 0:(a=s.querySelector("qti-assessment-item-ref"))===null||a===void 0?void 0:a.identifier}},{key:"_initializeNavigation",value:function t(){if(!this.navigate)return;var t=this._getDefaultNavigationId(this.navigate);t&&this.navigateTo(this.navigate,t)}},{key:"_handleNavigationRequest",value:function t(t){return a(function(t){var e,n,i,o;return z(this,function(a){switch(a.label){case 0:e=t.detail;if(!(e===null||e===void 0?void 0:e.id))return[2];this._cancelPreviousNavigation();n=++this._navigationId,i=new AbortController;a.label=1;case 1:a.trys.push([1,3,4,5]);this._dispatchLoadingStarted(e.type,e.id),this._activeController=i;return[4,this._executeNavigation(e.type,e.id,n,i)];case 2:a.sent();return[3,5];case 3:o=a.sent();this._handleNavigationError(o,e.type,e.id);return[3,5];case 4:this._activeController===i&&(this._activeController=null),this._dispatchLoadingEnded(e.type,e.id);return[7];case 5:return[2]}})}).apply(this,arguments)}},{key:"_handleNavigationError",value:function t(t,e,n){t.name!=="AbortError"&&this._dispatchError(this._createNavigationError(t,e,n))}},{key:"_executeNavigation",value:function t(t,e,n,i){return a(function(){var o;return z(this,function(a){switch(a.label){case 0:if(!(t==="item"))return[3,2];return[4,this._navigateToItem(e,n,i)];case 1:o=a.sent();return[3,4];case 2:return[4,this._navigateToSection(e,n,i)];case 3:o=a.sent();a.label=4;case 4:o;return[2]}})}).call(this)}},{key:"_navigateToItem",value:function t(t,e,n){return a(function(){var i;return z(this,function(o){switch(o.label){case 0:i=this._findItemRef(t);this._updateSessionContext(i,t),this._resetLoadingState(),this._loadingState.expectedItems=1;return[4,this._loadItems([t],e,n)];case 1:o.sent();return[4,this._waitForLoadingComplete(e,n)];case 2:o.sent(),!this._isStaleNavigation(e,n)&&this._dispatchTestLoaded(this._loadResults);return[2]}})}).call(this)}},{key:"_navigateToSection",value:function t(t,e,n){return a(function(){var i,o,a,s;return z(this,function(l){switch(l.label){case 0:a=(o=this._findSection(t))===null||o===void 0?void 0:(i=o.closest("qti-test-part"))===null||i===void 0?void 0:i.identifier;this.sessionContext=_(k({},this.sessionContext),{navPartId:a,navSectionId:t,navItemRefId:null});s=this._getSectionItemIds(t);this._resetLoadingState(),this._loadingState.expectedItems=s.length;return[4,this._loadItems(s,e,n)];case 1:l.sent();return[4,this._waitForLoadingComplete(e,n)];case 2:l.sent(),!this._isStaleNavigation(e,n)&&this._dispatchTestLoaded(this._loadResults);return[2]}})}).call(this)}},{key:"_resetLoadingState",value:function t(){this._loadingState={expectedItems:0,connectedItems:0,expectedStimulus:0,loadedStimulus:0,isComplete:!1},this._loadedStimulusHrefs.clear(),this._loadingStimulusHrefs.clear()}},{key:"_checkLoadingComplete",value:function t(){var t=this._loadingState.connectedItems>=this._loadingState.expectedItems,e=this._loadingState.loadedStimulus>=this._loadingState.expectedStimulus;t&&e&&!this._loadingState.isComplete&&(this._loadingState.isComplete=!0)}},{key:"_waitForLoadingComplete",value:function t(t,e){return a(function(){return z(this,function(n){switch(n.label){case 0:if(!!this._loadingState.isComplete)return[3,3];if(this._isStaleNavigation(t,e))return[2];return[4,new Promise(function(t){return setTimeout(t,10)})];case 1:n.sent();n.label=2;case 2:return[3,0];case 3:return[2]}})}).call(this)}},{key:"getLoadingProgress",value:function t(){return k({},this._loadingState)}},{key:"_loadStimulusRef",value:function t(t,e){return a(function(){var n;return z(this,function(i){switch(i.label){case 0:console.info("Loading stimulus:",t.href);return[4,this._loadStimulus(t.href)];case 1:n=i.sent();console.info("Stimulus loaded, applying content:",n?"has content":"no content"),this._applyStimulusContent(n,t,e);return[2]}})}).call(this)}},{key:"_applyStimulusContent",value:function t(t,e,n){if(!t){console.warn("No stimulus content to apply");return}var i=t.querySelectorAll("qti-stimulus-body, qti-stylesheet");if(console.info("Found ".concat(i.length," stimulus elements to apply for ").concat(e.identifier)),i.length===0){console.warn("No qti-stimulus-body or qti-stylesheet elements found in stimulus");return}var o=[],a=document.querySelector('qti-assessment-item[identifier="'.concat(n.identifier,'"] [data-stimulus-idref="').concat(e.identifier,'"]'));if(a)o.push(a),console.info("Found specific target:",a);else{var s=Array.from(this.querySelectorAll('[data-stimulus-idref="'.concat(e.identifier,'"]')));if(s.length>0)o=s,console.info("Found targets by identifier:",s.length);else{var l=Array.from(this.querySelectorAll("[data-stimulus-idref]"));o=l,console.info("Using fallback targets:",l.length)}}if(o.length===0){console.warn("No targets found for stimulus content");return}o.forEach(function(t,e){var n;t.innerHTML="";var a=Array.from(i).map(function(t){return t.cloneNode(!0)});(n=t).append.apply(n,L(a)),console.info("Applied stimulus content to target ".concat(e+1,"/").concat(o.length))})}},{key:"_cancelPreviousNavigation",value:function t(){this._activeController&&(this._activeController.abort(),console.info("Previous navigation request cancelled")),this._clearNavigationState()}},{key:"_clearNavigationState",value:function t(){this._clearLoadedItems(),this._resetLoadingState(),this._loadResults=[]}},{key:"_loadItems",value:function t(t,e,n){return a(function(){var i,o,a;return z(this,function(s){switch(s.label){case 0:i=this;if(!this._testElement||t.length===0)return[2];o=t.map(function(t){return i._findItemRef(t)});this._clearLoadedItems(),this._clearStimulusRef();return[4,Promise.all(o.map(function(t){return i._loadSingleItem(t,e,n)}))];case 1:a=s.sent().filter(Boolean);this._isStaleNavigation(e,n)||(a.forEach(function(t){var e=t.itemRef,n=t.doc;e&&n&&(e.xmlDoc=n)}),a.forEach(function(t){var e=t.itemRef;var n;var o=e===null||e===void 0?void 0:e.identifier;if(!e||!o)return;var a=(n=i.testContext.items.find(function(t){return t.identifier===o}))===null||n===void 0?void 0:n.state;a!==void 0&&e.updateComplete.then(function(){var t=e.assessmentItem;t&&(t.state=a)})}),this._loadResults=a);return[2]}})}).call(this)}},{key:"_loadSingleItem",value:function t(t,e,n){return a(function(){var i,o,a;return z(this,function(s){switch(s.label){case 0:s.trys.push([0,4,,5]);return[4,iZ(this.cacheTransform).load(t.href,n.signal)];case 1:i=s.sent();o=this.postLoadTransformCallback;if(!o)return[3,3];return[4,this.postLoadTransformCallback(i,t)];case 2:o=i=s.sent();s.label=3;case 3:return[2,(o,this._isStaleNavigation(e,n)?null:{itemRef:t,doc:i.htmlDoc()})];case 4:a=s.sent();if(a.name==="AbortError")throw console.info("Item load for ".concat(t.identifier," was aborted")),a;return[2,(console.warn("Failed to load item ".concat(t.identifier,":"),a),null)];case 5:return[2]}})}).call(this)}},{key:"_loadStimulus",value:function t(t){return a(function(){var e;return z(this,function(n){switch(n.label){case 0:return[4,iZ().load(t,(e=this._activeController)===null||e===void 0?void 0:e.signal)];case 1:return[2,n.sent().htmlDoc()]}})}).call(this)}},{key:"_findItemRef",value:function t(t){var e;var n=(e=this._testElement)===null||e===void 0?void 0:e.querySelector('qti-assessment-item-ref[identifier="'.concat(t,'"]'));if(!n)throw new Error('Item with identifier "'.concat(t,'" not found'));return n}},{key:"_findSection",value:function t(t){var e;return((e=this._testElement)===null||e===void 0?void 0:e.querySelector('qti-assessment-section[identifier="'.concat(t,'"]')))||null}},{key:"_updateSessionContext",value:function t(t,e){var n,i;var o=(n=t.closest("qti-test-part"))===null||n===void 0?void 0:n.identifier,a=(i=t.closest("qti-assessment-section"))===null||i===void 0?void 0:i.identifier;this.sessionContext=_(k({},this.sessionContext),{navPartId:o,navSectionId:a,navItemRefId:e})}},{key:"_getSectionItemIds",value:function t(t){return Array.from(this._testElement.querySelectorAll('qti-assessment-section[identifier="'.concat(t,'"] > qti-assessment-item-ref'))).map(function(t){return t.identifier}).filter(Boolean)}},{key:"_clearLoadedItems",value:function t(){var t;var e=(t=this._testElement)===null||t===void 0?void 0:t.querySelectorAll("qti-assessment-item-ref");Array.from(e||[]).forEach(function(t){t.xmlDoc=null})}},{key:"_clearStimulusRef",value:function t(){this.querySelectorAll("[data-stimulus-idref]").forEach(function(t){return t.innerHTML=""})}},{key:"_isStaleNavigation",value:function t(t,e){return e.signal.aborted||t!==this._navigationId}},{key:"_createNavigationError",value:function t(t,e,n){return{message:t.message||"Failed to load ".concat(e,": ").concat(n),details:t,itemId:e==="item"?n:void 0,sectionId:e==="section"?n:void 0}}},{key:"_dispatchLoadingStarted",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-navigation-loading-started",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}},{key:"_dispatchLoadingEnded",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-navigation-loading-ended",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}},{key:"_dispatchError",value:function t(t){this.dispatchEvent(new CustomEvent("qti-navigation-error",{detail:t,bubbles:!0,composed:!0}))}},{key:"_dispatchTestLoaded",value:function t(t){var e=this;requestAnimationFrame(function(){e.dispatchEvent(new CustomEvent("qti-test-loaded",{detail:t.map(function(t){var e=t.itemRef;return{identifier:e===null||e===void 0?void 0:e.identifier,element:e}}),bubbles:!0,composed:!0}))})}}]);return e}(t);return rr([n({type:String})],e.prototype,"navigate",2),rr([n({type:Boolean,attribute:"cache-transform"})],e.prototype,"cacheTransform",2),rr([n({type:Number})],e.prototype,"requestTimeout",2),rr([n({attribute:!1})],e.prototype,"postLoadTransformCallback",2),rr([n({attribute:!1})],e.prototype,"postLoadTestTransformCallback",2),e};var i3=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,L(n)),o.sessionContext=_(k({},o.sessionContext),{view:"candidate"}),o.addEventListener("on-test-switch-view",function(t){o.sessionContext=_(k({},o.sessionContext),{view:t.detail}),o._updateElementView()}),o.addEventListener("qti-assessment-test-connected",function(){o._updateElementView()}),o.addEventListener("qti-assessment-item-connected",function(t){o._updateElementView(),o._setCorrectResponseVisibility(t.detail)});return o}d(e,[{key:"willUpdate",value:function t(t){p(f(e.prototype),"willUpdate",this).call(this,t),t.has("sessionContext")&&this._updateElementView()}},{key:"_updateElementView",value:function t(){var t=this;if(this._testElement){var e;Array.from(this._testElement.querySelectorAll("[view]")).forEach(function(e){e.classList.toggle("show",e.getAttribute("view")===t.sessionContext.view)});var n=(e=this._testElement.querySelector('qti-assessment-item-ref[identifier="'.concat(this.sessionContext.navItemRefId,'"]')))===null||e===void 0?void 0:e.assessmentItem;n&&n.showCorrectResponse(this.sessionContext.view==="scorer")}}},{key:"_setCorrectResponseVisibility",value:function t(t){t.showCorrectResponse(this.sessionContext.view==="scorer")}}]);return e}(t);return e};var i5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i,o){l(this,e);var a;a=s(this,e,["context-request",{bubbles:!0,composed:!0}]),a.context=t,a.contextTarget=n,a.callback=i,a.subscribe=o!==null&&o!==void 0?o:!1;return a}return e}(D(Event));var i4=/*#__PURE__*/function(){"use strict";function t(e,n,i,o){var a=this;l(this,t);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(t,e){a.unsubscribe&&(a.unsubscribe!==e&&(a.provided=!1,a.unsubscribe()),a.subscribe||a.unsubscribe()),a.value=t,a.host.requestUpdate(),a.provided&&!a.subscribe||(a.provided=!0,a.callback&&a.callback(t,e)),a.unsubscribe=e},this.host=e,n.context!==void 0){var s;var u=n;this.context=u.context,this.callback=u.callback,this.subscribe=(s=u.subscribe)!==null&&s!==void 0?s:!1}else this.context=n,this.callback=i,this.subscribe=o!==null&&o!==void 0?o:!1;this.host.addController(this)}d(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 i5(this.context,this.host,this.t,this.subscribe))}}]);return t}();var i6=/*#__PURE__*/function(){"use strict";function t(e){var n=this;l(this,t);this.subscriptions=new Map,this.updateObservers=function(){var t=true,e=false,i=undefined;try{for(var o=n.subscriptions[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=M(a.value,2),l=s[0],u=s[1],c=u.disposer;l(n.o,c)}}catch(t){e=true;i=t}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(e){throw i}}}},e!==void 0&&(this.value=e)}d(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 i=this;if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:function e(){i.subscriptions.delete(t)},consumerHost:e});var o=this.subscriptions.get(t),a=o.disposer;t(this.value,a)}},{key:"clearCallbacks",value:function t(){this.subscriptions.clear()}}]);return t}();var i8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n){l(this,e);var i;i=s(this,e,["context-provider",{bubbles:!0,composed:!0}]),i.context=t,i.contextTarget=n;return i}return e}(D(Event)),i7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i){l(this,e);var o;var a,u;o=s(this,e,[n.context!==void 0?n.initialValue:i]),o.onContextRequest=function(t){var e;if(t.context!==o.context)return;var n=(e=t.contextTarget)!==null&&e!==void 0?e:t.composedPath()[0];n!==o.host&&(t.stopPropagation(),o.addCallback(t.callback,n,t.subscribe))},o.onProviderRequest=function(t){var e;if(t.context!==o.context||((e=t.contextTarget)!==null&&e!==void 0?e:t.composedPath()[0])===o.host)return;var n=new Set;var i=true,a=false,s=undefined;try{for(var l=o.subscriptions[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true){var c=M(u.value,2),d=c[0],h=c[1],p=h.consumerHost;n.has(d)||(n.add(d),p.dispatchEvent(new i5(o.context,p,d,!0)))}}catch(t){a=true;s=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(a){throw s}}}t.stopPropagation()},o.host=t,n.context!==void 0?o.context=n.context:o.context=n,o.attachListeners(),(a=(u=o.host).addController)===null||a===void 0?void 0:a.call(u,o);return o}d(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 i8(this.context,this.host))}}]);return e}(i6);var i9=Symbol("computedItemContext");var ot=Symbol("computedContext");var oe=Symbol("configContext");var on=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}];var or=Symbol("item");var oi=Symbol("qtiContext");var oo={view:"candidate"},oa=Symbol("testContext");var os={items:[],testOutcomeVariables:[]},ol=Symbol("testContext");var ou={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},oc=function t(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++){n[i]=arguments[i]}return{_$litDirective$:t,values:n}}},od=/*#__PURE__*/function(){"use strict";function t(e){l(this,t)}d(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,L(e))}}]);return t}();var oh=iW.I,op=function t(t){return t===null||(typeof t==="undefined"?"undefined":U(t))!="object"&&typeof t!="function"};var of=function t(t){return t.strings===void 0},ov=function t(){return document.createComment("")},om=function t(t,e,n){var i=t._$AA.parentNode,o=e===void 0?t._$AB:e._$AA;if(n===void 0){var a=i.insertBefore(ov(),o),s=i.insertBefore(ov(),o);n=new oh(a,s,t,t.options)}else{var l=n._$AB.nextSibling,u=n._$AM,c=u!==t;if(c){var d;var h;(d=n._$AQ)===null||d===void 0?void 0:d.call(n,t),n._$AM=t,n._$AP!==void 0&&(h=t._$AU)!==u._$AU&&n._$AP(h)}if(l!==o||c){var p=n._$AA;for(;p!==l;){var f=p.nextSibling;i.insertBefore(p,o),p=f}}}return n},og=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;return t._$AI(e,n),t},ob={},oy=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ob;return t._$AH=e},ow=function t(t){return t._$AH},oq=function t(t){t._$AR(),t._$AA.remove()};var ok=function t(t,e){var n;var i=t._$AN;if(i===void 0)return!1;var o=true,a=false,s=undefined;try{for(var l=i[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;(n=c._$AO)===null||n===void 0?void 0:n.call(c,e,!1),ok(c,e)}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return!0},ox=function t(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)},o_=function t(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),oC(e)}};var oC=function t(t){var e,n;t.type==ou.CHILD&&((e=t._$AP)!==null&&e!==void 0?e:t._$AP=n$,(n=t._$AQ)!==null&&n!==void 0?n:t._$AQ=nz)},oE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t._$AN=void 0;return t}d(e,[{key:"_$AT",value:function t(t,n,i){p(f(e.prototype),"_$AT",this).call(this,t,n,i),o_(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,i,o,a;t!==this.isConnected&&(this.isConnected=t,t?(n=(i=this).reconnected)===null||n===void 0?void 0:n.call(i):(o=(a=this).disconnected)===null||o===void 0?void 0:o.call(a)),e&&(ok(this,t),ox(this))}},{key:"setValue",value:function t(t){if(of(this._$Ct))this._$Ct._$AI(t,this);else{var e=L(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}(od);var oS,oA,oR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,oS);t.prevData={};return t}d(e,[{key:"render",value:function t(t){return iR}},{key:"update",value:function t(t,e){var n=M(e,1),i=n[0];var o;return this.element!==t.element&&(this.element=t.element),this.host=((o=t.options)===null||o===void 0?void 0:o.host)||this.element,this.apply(i),this.groom(i),this.prevData=k({},i),iR}},{key:"apply",value:function t(t){var e=rl(this,oS,oA).call(this,t),n=this,i=n.prevData,o=n.element;for(var a in e){var s=e[a];s!==i[a]&&(s===!0?o.setAttribute(a,""):s===!1?o.removeAttribute(a):s!=null?o.setAttribute(a,String(s)):o.removeAttribute(a))}}},{key:"groom",value:function t(t){var e=this,n=e.prevData,i=e.element;if(!n)return;var o=t?rl(this,oS,oA).call(this,t):{};for(var a in n)(!o||!(a in o))&&i.removeAttribute(a)}}]);return e}(oE);oS=new WeakSet,oA=function t(t){return Object.fromEntries(Object.entries(t).filter(function(t){var e=M(t,2),n=e[0],i=e[1];return typeof i=="function"?!1:n==="max-choices"&&i===0?!0:!(i===""||i===null||i===void 0)}))};var oI=oc(oR);var oM=function(t){return t.Correct="correct",t.PartiallyCorrect="partially-correct",t.Incorrect="incorrect",t}(oM||{}),oT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t.disabled=!1;t.readonly=!1;t.showCorrectResponse=!1;t._handleShowCorrectResponseChange=function(e,n){t.toggleInternalCorrectResponse(n)};t.showFullCorrectResponse=!1;t._handleShowFullCorrectResponseChange=function(e,n){t.toggleFullCorrectResponse(n)};t.showCandidateCorrection=!1;t._handleShowCandidateCorrectionChange=function(e,n){t.toggleCandidateCorrection(n)};t._correctResponse=null;t._internals=t.attachInternals();return t}d(e,[{key:"internals",get:function t(){return this._internals}},{key:"correctResponseAttr",get:function t(){return this._correctResponse===null||this._correctResponse===void 0?null:Array.isArray(this._correctResponse)?this._correctResponse.join(","):this._correctResponse},set:function t(t){t===null?this._correctResponse=null:t.includes(",")?this._correctResponse=t.split(",").map(function(t){return t.trim()}):this._correctResponse=t}},{key:"isFullCorrectResponse",get:function t(){return this._isFullCorrectResponse},set:function t(t){this._isFullCorrectResponse=t,t&&(this.disabled=!0,this.setAttribute("inert",""),this.setAttribute("response-identifier",this.responseIdentifier+"_cr"))}},{key:"correctResponse",get:function t(){var t=this.responseVariable;return(t===null||t===void 0?void 0:t.correctResponse)?t.correctResponse:this._correctResponse},set:function t(t){var e=this._correctResponse;this._correctResponse=t,t==null?this.removeAttribute("correct-response"):this.setAttribute("correct-response",Array.isArray(t)?t.join(","):t),this.requestUpdate("_correctResponse",e)}},{key:"correctness",get:function t(){var t=this.correctResponse;if(!t)return null;var e=this.response;if(e==null||e===""||Array.isArray(e)&&e.length===0)return null;var n=Array.isArray(t)?t:[t],i=(Array.isArray(e)?e:[e]).filter(function(t){return t!==""});if(i.length===0)return null;var o=i.filter(function(t){return n.includes(t)}).length,a=i.filter(function(t){return!n.includes(t)}).length;return o===n.length&&a===0&&i.length===n.length?"correct":o>0&&(o<n.length||a>0)?"partially-correct":"incorrect"}},{key:"isInline",get:function t(){return!1}},{key:"responseVariable",get:function t(){var t;if(!((t=this._context)===null||t===void 0?void 0:t.variables))return;var e=this._context.variables.filter(function(t){return t.type==="response"}),n=this.getAttribute("response-identifier");return e.find(function(t){return t.identifier===n})}},{key:"toggleCorrectResponse",value:function t(t){var e,n;(((n=this)===null||n===void 0?void 0:(e=n.configContext)===null||e===void 0?void 0:e.correctResponseMode)||"internal")==="full"?this.toggleFullCorrectResponse(t):this.toggleInternalCorrectResponse(t)}},{key:"toggleFullCorrectResponse",value:function t(t){return a(function(){var e,n,i,o,a,s,l,u,c;return z(this,function(d){switch(d.label){case 0:o=this.nextSibling,a=m(o,HTMLDivElement)&&(o===null||o===void 0?void 0:o.classList.contains("full-correct-response")),s=this.correctResponse;if(!s)return[2];if(!(t&&(((n=this)===null||n===void 0?void 0:(e=n.configContext)===null||e===void 0?void 0:e.fullCorrectResponseOnlyWhenIncorrect)===!1||this.correctness!=="correct"))){;if(!a)return[2];(l=this.parentElement)===null||l===void 0?void 0:l.removeChild(o);return[2]}if(a)return[2];u=this.cloneNode(!0);u.removeAttribute("show-full-correct-response"),u.removeAttribute("show-correct-response"),u.removeAttribute("show-candidate-correction");c=document.createElement("div");c.classList.add("full-correct-response"),this.isInline?c.classList.add("full-correct-response-inline"):c.classList.add("full-correct-response-block"),c.role="full-correct-response",c.appendChild(u),u.isFullCorrectResponse=!0,(i=this.parentElement)===null||i===void 0?void 0:i.insertBefore(c,this.nextSibling);return[4,u.updateComplete];case 1:d.sent(),u.response=Array.isArray(s)?L(s):s;return[2]}})}).call(this)}},{key:"toggleInternalCorrectResponse",value:function t(t){this._internals.states.delete("show-correct-response"),t&&this.correctResponse&&this._internals.states.add("show-correct-response")}},{key:"toggleCandidateCorrection",value:function t(t){this._internals.states.delete("candidate-correct"),this._internals.states.delete("candidate-partially-correct"),this._internals.states.delete("candidate-incorrect"),t&&(this.correctness==="correct"&&this._internals.states.add("candidate-correct"),this.correctness==="partially-correct"&&this._internals.states.add("candidate-partially-correct"),this.correctness==="incorrect"&&this._internals.states.add("candidate-incorrect"))}},{key:"value",get:function t(){return JSON.stringify(this.response)},set:function t(t){this.response=t?JSON.parse(t):null}},{key:"reportValidity",value:function t(){return this._internals.reportValidity()}},{key:"reset",value:function t(){this.response=null}},{key:"formResetCallback",value:function t(){this.reset()}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),!this.isFullCorrectResponse&&this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1,detail:{interactionElement:this,responseIdentifier:this.responseIdentifier}}))}},{key:"firstUpdated",value:function t(){this.isFullCorrectResponse||(this.showCorrectResponse&&this.toggleInternalCorrectResponse(!0),this.showFullCorrectResponse&&this.toggleFullCorrectResponse(!0),this.showCandidateCorrection&&this.toggleCandidateCorrection(!0))}},{key:"saveResponse",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:k({responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?L(t):t},e!==void 0?{state:e}:{})}))}}]);return e}(iQ);oT.formAssociated=!0,rr([P({context:or,subscribe:!0})],oT.prototype,"_context",2),rr([P({context:oe,subscribe:!0})],oT.prototype,"configContext",2),rr([n({type:String,attribute:"response-identifier"})],oT.prototype,"responseIdentifier",2),rr([n({reflect:!0,type:Boolean})],oT.prototype,"disabled",2),rr([n({reflect:!0,type:Boolean})],oT.prototype,"readonly",2),rr([n({type:String})],oT.prototype,"name",2),rr([n({type:String,attribute:"correct-response",reflect:!0})],oT.prototype,"correctResponseAttr",1),rr([n({type:Boolean,attribute:"show-correct-response",reflect:!0})],oT.prototype,"showCorrectResponse",2),rr([V("showCorrectResponse",{waitUntilFirstUpdate:!0})],oT.prototype,"_handleShowCorrectResponseChange",2),rr([n({type:Boolean,attribute:"show-full-correct-response",reflect:!0})],oT.prototype,"showFullCorrectResponse",2),rr([V("showFullCorrectResponse",{waitUntilFirstUpdate:!0})],oT.prototype,"_handleShowFullCorrectResponseChange",2),rr([n({type:Boolean,attribute:"show-candidate-correction",reflect:!0})],oT.prototype,"showCandidateCorrection",2),rr([V("showCandidateCorrection",{waitUntilFirstUpdate:!0})],oT.prototype,"_handleShowCandidateCorrectionChange",2),rr([i()],oT.prototype,"_isFullCorrectResponse",2),rr([i()],oT.prototype,"_correctResponse",2);var oP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(W())}},{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==="multiple"||t==="ordered"?n:n[0]}}]);return e}(iQ);var oO=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(console.debug("getVariables",e.tagName.toLowerCase()),e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n;var i=e.getAttribute("identifier")||"";return i==="QTI_CONTEXT"?((n=t.qtiContext)===null||n===void 0?void 0:n.QTI_CONTEXT)?{identifier:"QTI_CONTEXT",baseType:"record",value:t.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}:(console.warn("QTI_CONTEXT not available"),{identifier:"QTI_CONTEXT",baseType:"record",value:t.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}):t.context.variables.find(function(t){return t.identifier===i})||null}case"qti-multiple":{var o=e.getResult();return console.debug("values",o),(o===null||o===void 0?void 0:o.length)>0?{identifier:"",baseType:o[0].baseType,value:o.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-ordered":{var a=e.getResult();return(a===null||a===void 0?void 0:a.length)>0?{identifier:"",baseType:a[0].baseType,value:a.map(function(t){return t.value}),cardinality:"ordered",type:"response"}:null}case"qti-correct":{var s,l;var u=e.getAttribute("identifier")||"",c=((l=t.context)===null||l===void 0?void 0:(s=l.variables)===null||s===void 0?void 0:s.find(function(t){return t.identifier===u}))||null;return{baseType:c.baseType,value:c.correctResponse,cardinality:c.cardinality}}default:{try{var d;return{baseType:"integer",value:((d=e.getResult())===null||d===void 0?void 0:d.toString())||null,cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}d(e,[{key:"render",value:function t(){return iC(B(),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")}}]);return e}(iQ);oO.styles=rG(j()),rr([i()],oO.prototype,"result",2),rr([P({context:or,subscribe:!0}),i()],oO.prototype,"context",2),rr([P({context:oi,subscribe:!0}),i()],oO.prototype,"qtiContext",2);var oL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(oO);var oU=function t(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},oN=function t(t){if(typeof t=="string")return t;var e=oU();return e==="."?t.toLocaleString():t.toString().replace(".","").replace(e,".")};var oD,oV,oz=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,oD);return t}d(e,[{key:"connectedCallback",value:function t(){p(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._context.variables.find(function(e){return e.identifier===t})||null;if(this.outcomeIdentifier!==t||!e)return;var n=!1;Array.isArray(e.value)?n=e.value.includes(this.identifier):n=!nW(this.identifier)&&!nW(e===null||e===void 0?void 0:e.value)&&this.identifier===e.value||!1,rl(this,oD,oV).call(this,n)}}]);return e}(iQ);oD=new WeakSet,oV=function t(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"},rr([n({type:String,attribute:"show-hide"})],oz.prototype,"showHide",2),rr([n({type:String,attribute:"outcome-identifier"})],oz.prototype,"outcomeIdentifier",2),rr([n({type:String})],oz.prototype,"identifier",2),rr([n({type:String,attribute:!1})],oz.prototype,"showStatus",2),rr([P({context:or,subscribe:!0}),i()],oz.prototype,"_context",2);var o$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(iQ);var oW=/*#__PURE__*/function(){"use strict";function t(){l(this,t)}d(t,null,[{key:"isPointInArea",value:function t(t,e,n){if(n!=="point")return console.warn("Base type ".concat(n," is not supported for point area mapping.")),!1;var i=M(t.split(" ").map(Number),2),o=i[0],a=i[1],s=O(e.split(",")),l=s[0],u=s.slice(1),c=u.map(Number);switch(l.toLowerCase()){case"circle":case"default":{var d=M(c,3),h=d[0],p=d[1],f=d[2];return c.length!==3?(console.warn("Invalid circle definition: ".concat(e)),!1):Math.sqrt(Math.pow(o-h,2)+Math.pow(a-p,2))<=f}case"rect":{var v=M(c,4),m=v[0],g=v[1],b=v[2],y=v[3];return c.length!==4?(console.warn("Invalid rectangle definition: ".concat(e)),!1):o>=m&&o<=b&&a>=g&&a<=y}case"ellipse":{var w=M(c,4),q=w[0],k=w[1],x=w[2],_=w[3];if(c.length!==4)return console.warn("Invalid ellipse definition: ".concat(e)),!1;var C=Math.pow(o-q,2)/Math.pow(x,2),E=Math.pow(a-k,2)/Math.pow(_,2);return C+E<=1}case"poly":{if(c.length<6||c.length%2!==0)return console.warn("Invalid polygon definition: ".concat(e)),!1;var S=[];for(var A=0;A<c.length;A+=2)S.push({x:c[A],y:c[A+1]});return this.isPointInPolygon({x:o,y:a},S)}default:return console.warn("Unsupported shape type: ".concat(l)),!1}}},{key:"isPointInPolygon",value:function t(t,e){var n=!1;for(var i=0,o=e.length-1;i<e.length;o=i++){var a=e[i].x,s=e[i].y,l=e[o].x,u=e[o].y;s>t.y!=u>t.y&&t.x<(l-a)*(t.y-s)/(u-s)+a&&(n=!n)}return n}},{key:"compareSingleValues",value:function t(t,e,n){switch(n){case"identifier":case"string":return t===e;case"integer":{var i=parseInt(t,10),o=parseInt(e,10);if(!isNaN(i)&&!isNaN(o))return i===o;console.error("Cannot convert ".concat(t," and/or ").concat(e," to int."));break}case"float":{var a=parseFloat(t),s=parseFloat(e);if(!isNaN(a)&&!isNaN(s))return a===s;console.error("couldn't convert ".concat(t," and/or ").concat(e," to float."));break}case"pair":case"directedPair":{var l=t.split(" ").sort(),u=e.split(" ").sort();if(l.length===2&&u.length===2)return n==="pair"&&(l.sort(),u.sort()),l.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 oB=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,L(n));o.testContext=os;o.sessionContext=oo;o._updateItemInTestContext=function(t){var e;var n=t._context,i=n.identifier,a=n.variables,s=o.testContext.items.find(function(t){return(t===null||t===void 0?void 0:t.identifier)===i});if(!s){console.warn("Item IDs between assessment.xml and item.xml should match: ".concat(i," is not found!"));return}if(((e=s.variables)===null||e===void 0?void 0:e.length)===1)o._updateItemVariablesInTestContext(i,a);else{var l=L(t.variables);var u=true,c=false,d=undefined;try{var h=function(){var t=f.value;var e=l.find(function(e){return e.identifier===t.identifier});e?e.value=t.value:l.push(t)};for(var p=s.variables[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true)h()}catch(t){c=true;d=t}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(c){throw d}}}t.variables=l}};o._initializeEventListeners();return o}d(e,[{key:"updateItemVariables",value:function t(t,e){var n=this.testContext.items.find(function(e){return e.identifier===t});n&&(n.variables=n.variables.map(function(t){var n=e.find(function(e){return e.identifier===t.identifier});return n?k({},t,n):t}));var i=this._testElement.querySelector('qti-assessment-item-ref[identifier="'.concat(t,'"]'));i&&i.assessmentItem&&(i.assessmentItem.variables=e)}},{key:"_initializeEventListeners",value:function t(){var t=this;this.addEventListener("qti-assessment-test-connected",function(e){if(t.testContext=os,t.sessionContext=oo,t.testContext&&t.testContext.items.length>0)return;t._testElement=e.detail;var n=Array.from(t._testElement.querySelectorAll("qti-assessment-item-ref")).map(function(t){return{href:t.href,identifier:t.identifier,category:t.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}});t.testContext=_(k({},t.testContext),{items:n})}),this.addEventListener("qti-assessment-item-connected",function(e){var n;var i=e.detail,o=(n=i.closest("qti-assessment-item-ref"))===null||n===void 0?void 0:n.identifier;o&&(i.assessmentItemRefId=o),t._updateItemInTestContext(e.detail)}),this.addEventListener("qti-item-context-updated",function(e){t._updateItemVariablesInTestContext(e.detail.itemContext.identifier,e.detail.itemContext.variables,e.detail.itemContext.state)})}},{key:"_updateItemVariablesInTestContext",value:function t(t,e,n){this.testContext=_(k({},this.testContext),{items:this.testContext.items.map(function(i){return i.identifier!==t?i:k(_(k({},i),{variables:e.map(function(t){var e=i.variables.find(function(e){return e.identifier===t.identifier});return e?k({},e,t):t})}),n!==void 0?{state:n?k({},n):void 0}:{})})}),this.dispatchEvent(new CustomEvent("qti-test-context-updated",{detail:this.testContext,bubbles:!1,composed:!1}))}}]);return e}(t);return rr([n({attribute:!1,type:Object}),T({context:ol})],e.prototype,"testContext",2),rr([n({attribute:!1,type:Object}),T({context:oa})],e.prototype,"sessionContext",2),e},oj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(oB(iQ));var oF=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,L(n)),o.addEventListener("qti-register-variable",function(t){o.testContext=_(k({},o.testContext),{testOutcomeVariables:L(o.testContext.testOutcomeVariables||[]).concat([t.detail.variable])}),t.stopPropagation()}),o.addEventListener("qti-set-outcome-value",function(t){var e=t.detail,n=e.outcomeIdentifier,i=e.value;o.updateOutcomeVariable(n,i),t.stopPropagation()});return o}d(e,[{key:"outcomeProcessing",value:function t(){var t=this.querySelector("qti-outcome-processing");return t?(t===null||t===void 0?void 0:t.process(),!0):!1}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var i=this.getOutcome(t);if(!i){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this.testContext=_(k({},this.testContext),{testOutcomeVariables:(n=this.testContext.testOutcomeVariables)===null||n===void 0?void 0:n.map(function(n){return n.identifier!==t?n:_(k({},n),{value:i.cardinality==="single"?e:L(n.value).concat([e])})})})}},{key:"getOutcome",value:function t(t){return this.getVariable(t)}},{key:"getVariable",value:function t(t){var e;return((e=this.testContext.testOutcomeVariables)===null||e===void 0?void 0:e.find(function(e){return e.identifier===t}))||null}}]);return e}(t);return e};var oQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-test-connected",{detail:this}));return[2]}})}).call(this)}},{key:"render",value:function t(){return iC(F())}}]);return e}(i2(i3(oF(oB(iQ)))));oQ=rr([iG("qti-test")],oQ);var oH={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}},oG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.weigths=new Map;return t}d(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,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-assessment-item-ref-connected",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href,category:this.category}}));return[2]}})}).call(this)}},{key:"render",value:function t(){return this.myTemplate?this.myTemplate({xmlDoc:this.xmlDoc}):this.xmlDoc}}]);return e}(iQ);rr([n({type:String})],oG.prototype,"category",2),rr([n({type:String})],oG.prototype,"identifier",2),rr([n({type:Boolean,converter:oH})],oG.prototype,"required",2),rr([n({type:Boolean,converter:oH})],oG.prototype,"fixed",2),rr([n({type:String})],oG.prototype,"href",2),rr([n({type:Object,attribute:!1})],oG.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",oG);var oX={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}},oJ,oK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,oJ,"");return t}d(e,[{key:"title",get:function t(){return ro(this,oJ)},set:function t(t){rs(this,oJ,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:rs(this,oJ,this.getAttribute("title")||""),i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return iC(Q())}}]);return e}(iQ);oJ=new WeakMap,rr([n({type:String})],oK.prototype,"identifier",2),rr([n({type:String})],oK.prototype,"required",2),rr([n({type:Boolean,converter:oX})],oK.prototype,"fixed",2),rr([n({type:Boolean,converter:oX})],oK.prototype,"visible",2),rr([n({type:Boolean,converter:oX,attribute:"keep-together"})],oK.prototype,"keepTogether",2),rr([P({context:ol,subscribe:!0})],oK.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",oK);var oY,oZ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,oY,"");return t}d(e,[{key:"title",get:function t(){return ro(this,oY)},set:function t(t){rs(this,oY,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return iC(H())}}]);return e}(iQ);oY=new WeakMap,rr([n({type:String})],oZ.prototype,"identifier",2),rr([n({type:String})],oZ.prototype,"title",1),rr([P({context:ol,subscribe:!0})],oZ.prototype,"_testContext",2),oZ=rr([iG("qti-assessment-test")],oZ);var o0,o1=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.class="";t.navigationMode="nonlinear";t.submissionMode="individual";ra(t,o0,"");return t}d(e,[{key:"title",get:function t(){return ro(this,o0)},set:function t(t){rs(this,o0,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return iC(G())}}]);return e}(iQ);o0=new WeakMap,rr([n({type:String})],o1.prototype,"identifier",2),rr([n({type:String})],o1.prototype,"class",2),rr([n({type:String,attribute:"navigation-mode"})],o1.prototype,"navigationMode",2),rr([n({type:String,attribute:"submission-mode"})],o1.prototype,"submissionMode",2),o1=rr([iG("qti-test-part")],o1);customElements.get("qti-test-part")||customElements.define("qti-test-part",o1);var o2,o3,o5,o4,o6,o8,o7,o9,at,ae,an,ar,ai,ao,aa,as,al=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,o8);ra(t,o2);ra(t,o3,null);t.identifier="";t.adaptive="false";t.timeDependent=null;t._handleDisabledChange=function(e,n){ro(t,o6).forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){return ro(t,o6).forEach(function(t){return t.readonly=n})};t._context={variables:on};ra(t,o5,_(k({},t._context),{variables:t._context.variables}));ra(t,o4,[]);ra(t,o6,[]);ra(t,at,function(e){e.stopImmediatePropagation(),t._context=_(k({},t._context),{variables:L(t._context.variables).concat([e.detail.variable])}),rs(t,o5,t._context),e.stopPropagation()});ra(t,ae,function(e){var n;e.stopImmediatePropagation();var i=e.detail;ro(t,o4).push(i),(Number((n=t._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)||0)>0&&i.checkShowFeedback(i.outcomeIdentifier)});ra(t,an,function(e){e.stopImmediatePropagation(),ro(t,o6).push(e.detail.interactionElement)});ra(t,ar,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.responseIdentifier,o=n.countAttempt;t.validate(),t.updateResponseVariable(i,"true"),t.processResponse(o)});ra(t,ai,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.outcomeIdentifier,o=n.value;t.updateOutcomeVariable(i,o),e.stopPropagation()});ra(t,ao,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.responseIdentifier,o=n.response,a=n.state;t.updateResponseVariable(i,o),a!==void 0&&(t._context=_(k({},t._context),{state:_(k({},t._context.state||{}),h({},i,a))})),t.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:t._context}}))});return t}d(e,[{key:"title",get:function t(){return ro(this,o2)},set:function t(t){rs(this,o2,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"assessmentItemRefId",get:function t(){return this._context.identifier},set:function t(t){this._context=_(k({},this._context),{identifier:t})}},{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=_(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),{interpolationTable:e.interpolationTable}):e})}),this._context.variables.forEach(function(t){if(t.type==="response"){var n=ro(e,o6).find(function(e){return e.responseIdentifier===t.identifier});n&&(n.response=t.value)}}),this.variables.forEach(function(t){t.type==="outcome"&&ro(e,o4).forEach(function(e){return e.checkShowFeedback(t.identifier)})})}},{key:"state",get:function t(){return this._context.state},set:function t(t){this._context=_(k({},this._context),{state:t?k({},t):void 0})}},{key:"responses",set:function t(t){var e=true,n=false,i=undefined;if(t)try{var o,a=function(){var t=l.value;o.getResponse(t.responseIdentifier)&&o.updateResponseVariable(t.responseIdentifier,t.response);var e=ro(o,o6).find(function(e){return e.getAttribute("response-identifier")===t.responseIdentifier});e&&(e.response=t.response)};for(var s=t[Symbol.iterator](),l;!(e=(l=s.next()).done);e=true)o=this,a()}catch(t){n=true;i=t}finally{try{if(!e&&s.return!=null){s.return()}}finally{if(n){throw i}}}}},{key:"render",value:function t(){return iC(X())}},{key:"connectedCallback",value:function t(){var t=this;rl(this,o8,o7).call(this),p(f(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){t.dispatchEvent(new CustomEvent("qti-assessment-item-connected",{bubbles:!0,composed:!0,detail:t})),rl(t,o8,aa).call(t)})}},{key:"disconnectedCallback",value:function t(){rl(this,o8,o9).call(this),p(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"showCorrectResponse",value:function t(t){var e=true,n=false,i=undefined;try{for(var o=ro(this,o6)[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.toggleCorrectResponse(t)}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}document.querySelectorAll("item-show-correct-response").forEach(function(e){e.shown=t})}},{key:"showCandidateCorrection",value:function t(t){var e=true,n=false,i=undefined;try{for(var o=ro(this,o6)[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.toggleCandidateCorrection(t)}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}document.querySelectorAll("item-show-candidate-correction").forEach(function(e){e.shown=t})}},{key:"processResponse",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n;this.validate(e),t&&this.updateOutcomeVariable("numAttempts",(+((n=this._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)+1).toString());var i=this.querySelector("qti-response-processing"),o=!!(i&&typeof i.process=="function");return o&&i.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",rl(this,o8,as).call(this)),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}})),o}},{key:"resetResponses",value:function t(){this._context=ro(this,o5)}},{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:"updateResponseVariable",value:function t(t,e){this._context=_(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:_(k({},n),{value:e})})}),this.showCandidateCorrection(!1),this.dispatchEvent(new CustomEvent("qti-interaction-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,responseIdentifier:t,response:Array.isArray(e)?L(e):e}})),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",rl(this,o8,as).call(this))}},{key:"setOutcomeVariable",value:function t(t,e){this.updateOutcomeVariable(t,e),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}}))}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var i=this.getOutcome(t);if(!i){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this._context=_(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:_(k({},n),{value:i.cardinality==="single"||Array.isArray(e)?e:[e]})})}),ro(this,o4).forEach(function(e){return e.checkShowFeedback(t)}),this.dispatchEvent(new CustomEvent("qti-outcome-changed",{bubbles:!0,composed:!0,detail:{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:"validate",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var e=ro(this,o6).every(function(t){return t.validate()});return t&&this.reportValidity(),e}},{key:"reportValidity",value:function t(){var t=true,e=false,n=undefined;try{for(var i=ro(this,o6)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.reportValidity()}}catch(t){e=true;n=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw n}}}}}]);return e}(iQ);o2=new WeakMap,o3=new WeakMap,o5=new WeakMap,o4=new WeakMap,o6=new WeakMap,o8=new WeakSet,o7=function t(){this.addEventListener("qti-register-variable",ro(this,at)),this.addEventListener("qti-register-feedback",ro(this,ae)),this.addEventListener("qti-register-interaction",ro(this,an)),this.addEventListener("end-attempt",ro(this,ar)),this.addEventListener("qti-set-outcome-value",ro(this,ai)),this.addEventListener("qti-interaction-response",ro(this,ao))},o9=function t(){this.removeEventListener("qti-register-variable",ro(this,at)),this.removeEventListener("qti-register-feedback",ro(this,ae)),this.removeEventListener("qti-register-interaction",ro(this,an)),this.removeEventListener("end-attempt",ro(this,ar)),this.removeEventListener("qti-set-outcome-value",ro(this,ai)),this.removeEventListener("qti-interaction-response",ro(this,ao))},at=new WeakMap,ae=new WeakMap,an=new WeakMap,ar=new WeakMap,ai=new WeakMap,ao=new WeakMap,aa=function t(){rs(this,o3,this.querySelector("qti-template-processing")),ro(this,o3)&&ro(this,o3).process()},as=function t(){var t=this.validate(!1);return t===!0?"completed":t===!1?"incomplete":"not_attempted"},rr([n({type:String})],al.prototype,"identifier",2),rr([n({type:String})],al.prototype,"adaptive",2),rr([n({type:String})],al.prototype,"timeDependent",2),rr([n({type:String})],al.prototype,"title",1),rr([n({type:Boolean})],al.prototype,"disabled",2),rr([V("disabled",{waitUntilFirstUpdate:!0})],al.prototype,"_handleDisabledChange",2),rr([n({type:Boolean})],al.prototype,"readonly",2),rr([V("readonly",{waitUntilFirstUpdate:!0})],al.prototype,"_handleReadonlyChange",2),rr([T({context:or})],al.prototype,"_context",2),al=rr([iG("qti-assessment-item")],al);var au=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n){l(this,e);var i;i=s(this,e,[e.eventName,{bubbles:!0,composed:!0,cancelable:!0}]);i.element=t;i.item=n;return i}return e}(D(Event));au.eventName="qti-assessment-stimulus-ref-connected";var ac=au,ad=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.href="";return t}d(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){var t,e,o,a;return z(this,function(s){switch(s.label){case 0:i().call(n);return[4,this.updateComplete];case 1:s.sent();t=this.closest("qti-assessment-item"),e=new ac(this,t);this.dispatchEvent(e);o=t===null||t===void 0?void 0:t.querySelector('[data-stimulus-idref="'.concat(this.identifier,'"]'));a=!e.defaultPrevented&&o;if(!a)return[3,3];return[4,this.updateStimulusRef(o)];case 2:a=s.sent();s.label=3;case 3:a;return[2]}})}).call(this)}},{key:"updateStimulusRef",value:function t(t){return a(function(){var e,n,i;return z(this,function(o){switch(o.label){case 0:return[4,iZ().load(this.href).then(function(t){return t.htmlDoc()})];case 1:e=o.sent();if(e){;i=e.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",(n=t).append.apply(n,L(i))}return[2]}})}).call(this)}}]);return e}(iQ);rr([n({type:String})],ad.prototype,"identifier",2),rr([n({type:String})],ad.prototype,"href",2),ad=rr([iG("qti-assessment-stimulus-ref")],ad);var ah=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(iQ);ah=rr([iG("qti-companion-materials-info")],ah);var ap,af=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,ap);return t}d(e,[{key:"render",value:function t(){return iC(J(),this.handleSlotChange)}},{key:"handleSlotChange",value:function t(){var t;var e;var n=Array.from((t=(e=this.firstElementChild)===null||e===void 0?void 0:e.childNodes)!==null&&t!==void 0?t:[]).find(function(t){return t.nodeType===Node.COMMENT_NODE});try{var i;rs(this,ap,new Function("context","fn","item",(i=n===null||n===void 0?void 0:n.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(e){var n;var i,o;return(n=(o=t._context)===null||o===void 0?void 0:(i=o.variables.find(function(t){return t.identifier===e}))===null||i===void 0?void 0:i.value)!==null&&n!==void 0?n:""},correct:function e(e){var n;var i,o;return(n=(o=t._context)===null||o===void 0?void 0:(i=o.variables.find(function(t){return t.identifier===e}))===null||i===void 0?void 0:i.correctResponse)!==null&&n!==void 0?n:""}},n={getVariable:function e(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(e,n){t.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:n}}))},updateResponseVariable:function e(e,n){t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,response:n}}))}};return ro(this,ap).call(this,this._context,e,n)}}]);return e}(iQ);ap=new WeakMap,rr([P({context:or,subscribe:!0}),i()],af.prototype,"_context",2),af=rr([iG("qti-custom-operator")],af);var av=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(K(),this.showStatus)}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(oz);av.styles=rG(Y()),av=rr([iG("qti-feedback-block")],av);var am=function t(t){return t!==null&&t!==void 0?t:iR};var ag=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.render=function(){return iC(Z(),am(t.showStatus))};return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(oz);ag.styles=rG(tt()),ag=rr([iG("qti-feedback-inline")],ag);var ab=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(te(),this.showStatus==="on",this.closeFeedback)}},{key:"openFeedback",value:function t(){var t;var e=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("dialog");e&&!e.open&&e.showModal()}},{key:"closeFeedback",value:function t(){var t;var e=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("dialog");e&&e.open&&(e.close(),this.showStatus="off")}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.showStatus==="on"&&this.openFeedback()}},{key:"updated",value:function t(t){t.has("showStatus")&&(this.showStatus==="on"?this.openFeedback():this.closeFeedback())}}]);return e}(oz);ab.styles=rG(tn()),ab=rr([iG("qti-modal-feedback")],ab);var ay=rG(tr());var aw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(ti())}}]);return e}(iQ);aw.styles=ay,aw=rr([iG("qti-item-body")],aw);var aq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(to())}}]);return e}(iQ);aq=rr([iG("qti-content-body")],aq);var ak=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"handleclassNamesChange",value:function t(){var t=this;this.classNames.split(" ").forEach(function(e){switch(e){case"qti-rubric-discretionary-placement":{var n=new CustomEvent("qti-rubric:discretionary-placement",{detail:{className:e,element:t},bubbles:!0,composed:!0,cancelable:!0});if(!t.dispatchEvent(n))return;t.setAttribute("slot","qti-rubric-block")}break;case"qti-rubric-inline":t.setAttribute("slot","");break;default:break}})}},{key:"render",value:function t(){return iC(ta())}}]);return e}(iQ);ak.styles=rG(ts()),rr([n({type:String})],ak.prototype,"id",2),rr([n({type:String})],ak.prototype,"use",2),rr([n({type:String})],ak.prototype,"view",2),rr([n({type:String,attribute:"class"})],ak.prototype,"classNames",2),rr([V("classNames",{waitUntilFirstUpdate:!0})],ak.prototype,"handleclassNamesChange",1),ak=rr([iG("qti-rubric-block")],ak);var ax,a_,aC,aE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,a_);ra(t,ax,null);return t}d(e,[{key:"firstUpdated",value:function t(t){var n=this;p(f(e.prototype),"firstUpdated",this).call(this,t);var i=this.getAttribute("href");if(i!==null&&fetch(i).then(function(t){return t.text()}).then(function(t){var e=rl(n,a_,aC).call(n,t);rs(n,ax,document.createElement("style")),ro(n,ax).media="screen",ro(n,ax).textContent="@scope {".concat(e,"}"),n.parentElement?n.parentElement.appendChild(ro(n,ax)):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 o=rl(this,a_,aC).call(this,this.textContent);rs(this,ax,document.createElement("style")),ro(this,ax).media="screen",ro(this,ax).textContent="@scope {".concat(o,"}"),this.parentElement?this.parentElement.appendChild(ro(this,ax)):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"disconnectedCallback",value:function t(){if(ro(this,ax))try{ro(this,ax).remove()}catch(t){console.error("Could not remove stylesheet:",t)}p(f(e.prototype),"disconnectedCallback",this).call(this)}}]);return e}(iQ);ax=new WeakMap,a_=new WeakSet,aC=function t(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()},aE=rr([iG("qti-stylesheet")],aE);var aS,aA,aR,aI,aM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,aS);return t}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(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 iC(tl(),JSON.stringify(i,null,2))}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.defaultValues(this.cardinality),n={baseType:this.baseType,identifier:this.identifier,correctResponse:ro(this,aS,aA),cardinality:this.cardinality||"single",mapping:ro(this,aS,aR),defaultValue:t,areaMapping:ro(this,aS,aI),value:null,type:"response",candidateResponse:null};n.value=t,this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}}]);return e}(oP);aS=new WeakSet,aA=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.trim(),n[0].remove();else if(this.cardinality!=="single"){t=[];for(var i=0;i<n.length;i++)t.push(n[i].textContent.trim()),n[i].remove()}}return t},aR=function t(){var t=this.querySelector("qti-mapping"),e=parseFloat(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),n=parseFloat(t===null||t===void 0?void 0:t.getAttribute("upper-bound"));return{defaultValue:Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,lowerBound:isNaN(e)?null:e,upperBound:isNaN(n)?null:n,mapEntries:Array.from((t===null||t===void 0?void 0:t.querySelectorAll("qti-map-entry"))||[]).map(function(t){return{mapKey:t.getAttribute("map-key")||"",mappedValue:Number(t.getAttribute("mapped-value"))||0,caseSensitive:t.hasAttribute("case-sensitive")?t.getAttribute("case-sensitive")!=="false":!1}})}},aI=function t(){var t=this.querySelector("qti-area-mapping"),e=Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,n=parseFloat(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),i=parseFloat(t===null||t===void 0?void 0:t.getAttribute("upper-bound")),o=Array.from((t===null||t===void 0?void 0:t.querySelectorAll("qti-area-map-entry"))||[]).map(function(t){return{shape:t.getAttribute("shape")||"default",coords:t.getAttribute("coords")||"",mappedValue:Number(t.getAttribute("mapped-value"))||0,defaultValue:Number(t.getAttribute("default-value"))||0}});return{defaultValue:e,lowerBound:isNaN(n)?null:n,upperBound:isNaN(i)?null:i,areaMapEntries:o}},aM.styles=[rG(tu())],rr([n({type:String,attribute:"base-type"})],aM.prototype,"baseType",2),rr([n({type:String})],aM.prototype,"identifier",2),rr([n({type:String})],aM.prototype,"cardinality",2),rr([P({context:or,subscribe:!0}),i()],aM.prototype,"itemContext",2),aM=rr([iG("qti-response-declaration")],aM);var aT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.externalScored=null;return t}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(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 iC(tc(),JSON.stringify(i,null,2))}},{key:"interpolationTable",get:function t(){var t=this.querySelector("qti-interpolation-table");if(t){var e=new Map;var n=true,i=false,o=undefined;try{for(var a=t.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;!l.getAttribute("source-value")&&l.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var u=parseFloat(l.getAttribute("source-value")),c=parseFloat(l.getAttribute("target-value"));(isNaN(u)||isNaN(c))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),e.set(u,c)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e}return null}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.defaultValues(this.cardinality),n={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,defaultValue:t,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};n.value=t,(n.value===null||n.value==null)&&(n.baseType==="integer"||n.baseType==="float")&&(n.value="0"),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}}]);return e}(oP);aT.styles=[rG(td())],rr([n({type:String,attribute:"base-type"})],aT.prototype,"baseType",2),rr([n({type:String,attribute:"external-scored"})],aT.prototype,"externalScored",2),rr([n({type:String})],aT.prototype,"identifier",2),rr([n({type:String})],aT.prototype,"cardinality",2),rr([P({context:or,subscribe:!0}),i()],aT.prototype,"itemContext",2),aT=rr([iG("qti-outcome-declaration")],aT);var aP='<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>',aO='<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>',aL='<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 aU,aN,aD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,aU);return t}d(e,[{key:"render",value:function t(){return iC(th())}},{key:"process",value:function t(){if(!this.closest("qti-assessment-item"))return;var t=L(this.children);var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.process()}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}}},{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(rl(this,aU,aN).call(this,aO).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(rl(this,aU,aN).call(this,aL).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(rl(this,aU,aN).call(this,aP).firstElementChild.firstElementChild);break}}}}]);return e}(iQ);aU=new WeakSet,aN=function t(t){return document.createRange().createContextualFragment(t)},aD.styles=[rG(tp())],aD=rr([iG("qti-response-processing")],aD);var aV,az,a$,aW,aB,aj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,az);t.identifier="";t.cardinality="single";t.baseType="string";t.mathVariable=!1;t.paramVariable=!1;ra(t,aV,null);return t}d(e,[{key:"render",value:function t(){return iC(tf())}},{key:"connectedCallback",value:function t(){var t=this;p(f(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){rl(t,az,a$).call(t),rl(t,az,aB).call(t)})}},{key:"getTemplateVariable",value:function t(){return{identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,value:ro(this,aV),type:"template",mathVariable:this.mathVariable,paramVariable:this.paramVariable}}}]);return e}(iQ);aV=new WeakMap,az=new WeakSet,a$=function t(){var t;var e=this.querySelector("qti-default-value");if(!e)return;var n=((t=e.textContent)===null||t===void 0?void 0:t.trim())||"";rs(this,aV,rl(this,az,aW).call(this,n))},aW=function t(t){if(!t)return null;switch(this.baseType){case"integer":return parseInt(t,10);case"float":case"duration":return parseFloat(t);case"boolean":return t.toLowerCase()==="true";default:return t}},aB=function t(){var t;var e=_(k({},{identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,defaultValue:ro(this,aV),value:ro(this,aV),type:"template",mathVariable:this.mathVariable,paramVariable:this.paramVariable}),{value:((t=ro(this,aV))===null||t===void 0?void 0:t.toString())||""});this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))},aj.styles=[rG(tv())],rr([n({type:String})],aj.prototype,"identifier",2),rr([n({type:String})],aj.prototype,"cardinality",2),rr([n({type:String,attribute:"base-type"})],aj.prototype,"baseType",2),rr([n({type:Boolean,attribute:"math-variable"})],aj.prototype,"mathVariable",2),rr([n({type:Boolean,attribute:"param-variable"})],aj.prototype,"paramVariable",2),aj=rr([iG("qti-template-declaration")],aj);var aF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.cardinality="record";return t}d(e,[{key:"render",value:function t(){return iC(tm())}}]);return e}(iQ);aF.styles=[rG(tg())],rr([n({type:String})],aF.prototype,"identifier",2),rr([n({type:String})],aF.prototype,"cardinality",2),aF=rr([iG("qti-context-declaration")],aF);var aQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(tb())}}]);return e}(ab);aQ.styles=rG(ty()),aQ=rr([iG("qti-test-feedback")],aQ);var aH,aG,aX,aJ,aK,aY,aZ,a0,a1,a2,a3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,aG);t.identifier=void 0;t.initContext=[];t.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}};t.configContext={};t.autoScoreItems=!1;ra(t,aH);t.addEventListener("qti-assessment-test-connected",rl(t,aG,a0).bind(t)),t.addEventListener("qti-assessment-item-connected",rl(t,aG,a2).bind(t)),t.addEventListener("qti-interaction-changed",rl(t,aG,aZ).bind(t)),t.addEventListener("test-end-attempt",rl(t,aG,aX).bind(t)),t.addEventListener("test-show-correct-response",rl(t,aG,aJ).bind(t)),t.addEventListener("test-show-candidate-correction",rl(t,aG,aK).bind(t)),t.addEventListener("test-update-outcome-variable",rl(t,aG,aY).bind(t));return t}d(e,[{key:"render",value:function t(){return iC(tw())}},{key:"willUpdate",value:function t(t){var e=this;var n;if(!this.computedContext)return;var i=1;this.computedContext=_(k({},this.computedContext),{view:(n=this._sessionContext)===null||n===void 0?void 0:n.view,testParts:this.computedContext.testParts.map(function(t){var n;return _(k({},t),{active:((n=e._sessionContext)===null||n===void 0?void 0:n.navPartId)===t.identifier||!1,sections:t.sections.map(function(t){var n;return _(k({},t),{active:((n=e._sessionContext)===null||n===void 0?void 0:n.navSectionId)===t.identifier||!1,completed:t.items.every(function(t){var n;return((n=e._testContext.items.find(function(e){return e.identifier===t.identifier}))===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier==="completionStatus"}).value)==="completed"}),items:t.items.map(function(t){var n,o,a,s,l,u,c,d,h,p,f,v,m,g;var b=(n=e._testContext)===null||n===void 0?void 0:n.items.find(function(e){return e.identifier===t.identifier}),y=k({},t,b,(o=e.initContext)===null||o===void 0?void 0:o.find(function(e){return e.identifier===t.identifier})),w=(s=y.variables)===null||s===void 0?void 0:(a=s.find(function(t){return t.identifier=="SCORE"}))===null||a===void 0?void 0:a.value,q=w==null?null:parseFloat(w===null||w===void 0?void 0:w.toString()),x=(u=y.variables)===null||u===void 0?void 0:(l=u.find(function(t){return t.identifier==="completionStatus"}))===null||l===void 0?void 0:l.value,C=((d=y.variables)===null||d===void 0?void 0:(c=d.find(function(t){return t.identifier==="RESPONSE"}))===null||c===void 0?void 0:c.value)||"",E=((p=y.variables)===null||p===void 0?void 0:(h=p.find(function(t){return t.identifier==="numAttempts"}))===null||h===void 0?void 0:h.value)||0,S=((f=e._sessionContext)===null||f===void 0?void 0:f.navItemRefId)===y.identifier||!1,A=t.categories.includes((v=e.configContext)===null||v===void 0?void 0:v.infoItemCategory)?null:i++,R=(g=t.variables)===null||g===void 0?void 0:(m=g.find(function(t){return t.identifier=="MAXSCORE"}))===null||m===void 0?void 0:m.value,I=R==null?null:parseFloat(R===null||R===void 0?void 0:R.toString());return _(k({},y),{completionStatus:x,numAttempts:E,score:q,response:C,index:A,active:S,maxScore:I})})})})})})}),this.dispatchEvent(new CustomEvent("qti-computed-context-updated",{detail:this.computedContext,bubbles:!0}))}}]);return e}(iQ);aH=new WeakMap,aG=new WeakSet,aX=function t(t){var e;var n=ro(this,aH).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem,i=((e=this.configContext)===null||e===void 0?void 0:e.reportValidityAfterScoring)===!0;n.processResponse(!0,i)},aJ=function t(t){var e=ro(this,aH).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem;e&&e.showCorrectResponse(t.detail)},aK=function t(t){ro(this,aH).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem.showCandidateCorrection(t.detail)},aY=function t(t){ro(this,aH).querySelector('qti-assessment-item-ref[identifier="'.concat(t.detail.assessmentItemRefId,'"]')).assessmentItem.setOutcomeVariable(t.detail.outcomeVariableId,t.detail.value)},aZ=function t(t){if(this.autoScoreItems){var e=t.composedPath()[0].closest("qti-assessment-item"),n=e.variables.find(function(t){return t.identifier==="SCORE"});if(n&&n.externalScored===null&&e.adaptive==="false"){var i;var o=((i=this.configContext)===null||i===void 0?void 0:i.reportValidityAfterScoring)===!0;e.processResponse(!0,o)}}},a0=function t(t){var e=this;var n,i,o;if(rs(this,aH,t.detail),!((n=this.qtiContext.QTI_CONTEXT)===null||n===void 0?void 0:n.testIdentifier)){var a=this.qtiContext.QTI_CONTEXT||{testIdentifier:"",candidateIdentifier:"not set",environmentIdentifier:"default"};this.qtiContext={QTI_CONTEXT:_(k({},a),{testIdentifier:ro(this,aH).identifier,environmentIdentifier:a.environmentIdentifier||"default"})}}ro(this,aH).querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(function(t){var n=rl(e,aG,a1).call(e,t);Object.keys(n).length>0&&(e.qtiContext={QTI_CONTEXT:k({},n,e.qtiContext.QTI_CONTEXT)})});var s=Array.from(((i=ro(this,aH))===null||i===void 0?void 0:i.querySelectorAll("qti-test-part"))||[]);this.computedContext={identifier:ro(this,aH).identifier,title:ro(this,aH).title,view:(o=this._sessionContext)===null||o===void 0?void 0:o.view,testParts:s.map(function(t){var n=L(t.querySelectorAll("qti-assessment-section"));return{active:!1,identifier:t.identifier,navigationMode:t.navigationMode,submissionMode:t.submissionMode,sections:n.map(function(t){var n=L(t.querySelectorAll("qti-assessment-item-ref"));return{active:!1,identifier:t.identifier,title:t.title,items:n.map(function(t){var n,i;return _(k({},(n=e.initContext)===null||n===void 0?void 0:n.find(function(e){return e.identifier===t.identifier})),{active:!1,identifier:t.identifier,categories:t.category?(i=t.category)===null||i===void 0?void 0:i.split(" "):[],href:t.href,variables:[]})})}})}})}},a1=function t(t){var e={},n=t.querySelector("qti-default-value");return n&&n.querySelectorAll("qti-value[field-identifier]").forEach(function(t){var n;var i=t.getAttribute("field-identifier"),o=t.getAttribute("base-type")||"string",a=((n=t.textContent)===null||n===void 0?void 0:n.trim())||"";if(i){var s=a;switch(o){case"integer":s=parseInt(a,10);break;case"float":case"duration":s=parseFloat(a);break;case"boolean":s=a.toLowerCase()==="true";break;default:s=a;break}e[i]=s}}),e},a2=function t(t){var e=t.detail;this.computedContext=_(k({},this.computedContext),{testParts:this.computedContext.testParts.map(function(t){return _(k({},t),{sections:t.sections.map(function(t){return _(k({},t),{items:t.items.map(function(t){var n;if(t.identifier!==e.parentElement.getAttribute("identifier"))return t;var i=(n=e.querySelector("qti-outcome-declaration[identifier='SCORE']"))===null||n===void 0?void 0:n.getAttribute("externalScored"),o=e.querySelectorAll("qti-response-declaration"),a=Array.from(o).some(function(t){return t.querySelector("qti-correct-response")}),s=Array.from(o).some(function(t){var e=t.querySelector("qti-mapping"),n=t.querySelector("qti-area-mapping");return(e===null||e===void 0?void 0:e.querySelector("qti-map-entry"))||(n===null||n===void 0?void 0:n.querySelector("qti-area-map-entry"))}),l=a||s,u=!!e.querySelector("qti-response-processing");return _(k({},t),{assessmentItemIdentifier:e.getAttribute("identifier"),label:e.getAttribute("label"),title:e.title,externalScored:i,adaptive:e.adaptive=="true"||!1,timeDependent:e.timeDependent=="true"||!1,variables:e.variables,hasCorrectResponse:l,hasResponseProcessing:u})})})})})})})},rr([n({type:String})],a3.prototype,"identifier",2),rr([i()],a3.prototype,"initContext",2),rr([i(),T({context:oi})],a3.prototype,"qtiContext",2),rr([i(),T({context:oe})],a3.prototype,"configContext",2),rr([i(),P({context:ol,subscribe:!0})],a3.prototype,"_testContext",2),rr([i(),P({context:oa,subscribe:!0})],a3.prototype,"_sessionContext",2),rr([i(),T({context:ot})],a3.prototype,"computedContext",2),rr([n({type:Boolean,attribute:"auto-score-items"})],a3.prototype,"autoScoreItems",2),a3=rr([iG("test-navigation")],a3);var a5=rG(tq()),a4=rG(tk(),a5),a6=rG(tx()),a8=rG(t_(),a5);var a7,a9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._internalDisabled=!0;ra(t,a7);rs(t,a7,t.attachInternals()),ro(t,a7).role="button",ro(t,a7).ariaLabel="Next item",t.addEventListener("click",function(e){e.preventDefault(),t._internalDisabled||t._requestItem(t.sectionItems[t.itemIndex+1].identifier)});return t}d(e,[{key:"_handleTestElementChange",value:function t(t,e){e&&(this._internalDisabled=!1)}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.checkDisabled()}},{key:"willUpdate",value:function t(t){var e;if(!this.computedContext)return;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.find(function(t){return t.active});n&&(this.sectionItems=n.sections.flatMap(function(t){return t.items}),this.itemIndex=this.sectionItems.findIndex(function(t){return t.active}),this.checkDisabled())}},{key:"checkDisabled",value:function t(){var t;this._internalDisabled=!this.computedContext||this.itemIndex<0||this.itemIndex>=((t=this.sectionItems)===null||t===void 0?void 0:t.length)-1}},{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return iC(tC())}}]);return e}(iQ);a7=new WeakMap,a9.styles=rG(tE(),a4,a6),rr([n({type:Boolean,reflect:!0,attribute:"disabled"})],a9.prototype,"_internalDisabled",2),rr([P({context:ot,subscribe:!0})],a9.prototype,"computedContext",2),rr([V("computedContext")],a9.prototype,"_handleTestElementChange",1),a9=rr([iG("test-next")],a9);var st=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._internalDisabled=!0;t.addEventListener("click",function(e){e.preventDefault(),t._internalDisabled||t._requestItem(t.sectionItems[t.itemIndex-1].identifier)});return t}d(e,[{key:"_handleTestElementChange",value:function t(t,e){e&&(this._internalDisabled=!1)}},{key:"willUpdate",value:function t(t){var e;if(!this.computedContext)return;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.find(function(t){return t.active});n&&(this.sectionItems=n.sections.flatMap(function(t){return t.items}),this.itemIndex=this.sectionItems.findIndex(function(t){return t.active}),this.checkDisabled())}},{key:"checkDisabled",value:function t(){this._internalDisabled=!this.computedContext||this.itemIndex===0||this.itemIndex===-1}},{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return iC(tS())}}]);return e}(iQ);st.styles=rG(tA(),a4,a6),rr([n({type:Boolean,reflect:!0,attribute:"disabled"})],st.prototype,"_internalDisabled",2),rr([P({context:ot,subscribe:!0})],st.prototype,"computedContext",2),rr([V("computedContext")],st.prototype,"_handleTestElementChange",1),st=rr([iG("test-prev")],st);var se,sn,sr=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,se);t.label="view";t._handleViewOptionsChange=function(){rl(t,se,sn).call(t)};t._viewOptions=sr.DEFAULT_VIEW_OPTIONS;return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),rl(this,se,sn).call(this)}},{key:"_switchView",value:function t(t){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:t}))}},{key:"render",value:function t(){var t=this;return iC(tI(),this.label,function(e){var n=e.target;t._switchView(n.value)},this._viewOptions.map(function(e){return iC(tR(),e,e===t.sessionContext.view,e)}))}}]);return e}(iQ);se=new WeakSet,sn=function t(){if(this.viewOptions){var t=this.viewOptions.split(",").map(function(t){return t.trim()});this._viewOptions=t.filter(function(t){return sr.DEFAULT_VIEW_OPTIONS.includes(t)})}else this._viewOptions=sr.DEFAULT_VIEW_OPTIONS},sr.DEFAULT_VIEW_OPTIONS=["author","candidate","proctor","scorer","testConstructor","tutor"],rr([P({context:oa,subscribe:!0})],sr.prototype,"sessionContext",2),rr([n({type:String})],sr.prototype,"label",2),rr([n({type:String,attribute:"view-options"})],sr.prototype,"viewOptions",2),rr([V("viewOptions",{waitUntilFirstUpdate:!0})],sr.prototype,"_handleViewOptionsChange",2),rr([i()],sr.prototype,"_viewOptions",2),sr=rr([iG("test-view")],sr);var si=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t.itemId=null;t.addEventListener("click",function(){return t._requestItem(t.itemId)});return t}d(e,[{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return iC(tM())}}]);return e}(iQ);si.styles=rG(tT(),a4,a6),rr([n({type:String,attribute:"item-id"})],si.prototype,"itemId",2),si=rr([iG("test-item-link")],si);var so=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.addEventListener("click",function(){return t.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0}))});return t}d(e,[{key:"render",value:function t(){return iC(tP())}}]);return e}(iQ);so.styles=rG(tO(),a4,a6),so=rr([iG("test-end-attempt")],so);var sa,ss,sl,su,sc=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,ss);t.shown=!1;t.disabled=!1;t.showCorrectText="Show correct response";t.hideCorrectText="Hide correct response";t.noCorrectResponseText="No correct response specified";ra(t,sa);return t}d(e,[{key:"willUpdate",value:function t(t){var e;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(ro(this,sa)!==n&&(this.shown=!1,rs(this,sa,n)),n){var i,o;var a=!!(n===null||n===void 0?void 0:(i=n.variables)===null||i===void 0?void 0:i.some(function(t){return t.correctResponse})),s=!!(n===null||n===void 0?void 0:(o=n.variables)===null||o===void 0?void 0:o.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));this.disabled=!a&&!s}else this.disabled=!0}},{key:"render",value:function t(){return iC(tL(),rl(this,ss,sl),rl(this,ss,su).call(this))}}]);return e}(iQ);sa=new WeakMap,ss=new WeakSet,sl=function t(){this.disabled||(this.shown=!this.shown,this.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:this.shown,bubbles:!0})))},su=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText},sc.styles=rG(tU(),a4,a6),rr([P({context:ot,subscribe:!0})],sc.prototype,"computedContext",2),rr([n({type:Boolean,reflect:!0})],sc.prototype,"shown",2),rr([n({type:Boolean,reflect:!0})],sc.prototype,"disabled",2),rr([n({type:String})],sc.prototype,"showCorrectText",2),rr([n({type:String})],sc.prototype,"hideCorrectText",2),rr([n({type:String})],sc.prototype,"noCorrectResponseText",2),sc=rr([iG("test-show-correct-response")],sc);var sd=["this"],sh=["+","-","!"],sp=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],sf={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},sv=13;var sm=["==","!=","<=",">=","||","&&","??","|>"],sg=["===","!=="],sb;(function(t){t[t.STRING=1]="STRING",t[t.IDENTIFIER=2]="IDENTIFIER",t[t.DOT=3]="DOT",t[t.COMMA=4]="COMMA",t[t.COLON=5]="COLON",t[t.INTEGER=6]="INTEGER",t[t.DECIMAL=7]="DECIMAL",t[t.OPERATOR=8]="OPERATOR",t[t.GROUPER=9]="GROUPER",t[t.KEYWORD=10]="KEYWORD",t[t.ARROW=11]="ARROW"})(sb||(sb={}));var sy=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return{kind:t,value:e,precedence:n}},sw=function t(t){return t===9||t===10||t===13||t===32},sq=function t(t){return t===95||t===36||(t&=-33,65<=t&&t<=90)},sk=function t(t){return sq(t)||sC(t)},sx=function t(t){return sd.indexOf(t)!==-1},s_=function t(t){return t===34||t===39},sC=function t(t){return 48<=t&&t<=57},sE=function t(t){return t===43||t===45||t===42||t===47||t===33||t===38||t===37||t===60||t===61||t===62||t===63||t===94||t===124},sS=function t(t){return t===40||t===41||t===91||t===93||t===123||t===125},sA=function t(t){return t.replace(/\\(.)/g,function(t,e){switch(e){case"n":return"\n";case"r":return"\r";case"t":return" ";case"b":return"\b";case"f":return"\f";default:return e}})},sR,sI,sM,sT,sP,sO,sL,sU,sN,sD,sV,sz,s$,sW,sB,sj,sF,sQ=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);ra(this,sP);ra(this,sR);ra(this,sI,-1);ra(this,sM,0);ra(this,sT);rs(this,sR,e),rl(this,sP,sO).call(this)}d(t,[{key:"nextToken",value:function t(){for(;sw(ro(this,sT));)rl(this,sP,sO).call(this,!0);if(s_(ro(this,sT)))return rl(this,sP,sN).call(this);if(sq(ro(this,sT)))return rl(this,sP,sD).call(this);if(sC(ro(this,sT)))return rl(this,sP,sV).call(this);if(ro(this,sT)===46)return rl(this,sP,sz).call(this);if(ro(this,sT)===44)return rl(this,sP,s$).call(this);if(ro(this,sT)===58)return rl(this,sP,sW).call(this);if(sE(ro(this,sT)))return rl(this,sP,sj).call(this);if(sS(ro(this,sT)))return rl(this,sP,sF).call(this);if(rl(this,sP,sO).call(this),ro(this,sT)!==void 0)throw new Error("Expected end of input, got ".concat(ro(this,sT)))}}]);return t}();sR=new WeakMap,sI=new WeakMap,sM=new WeakMap,sT=new WeakMap,sP=new WeakSet,sO=function t(t){ru(this,sI)._++,ro(this,sI)<ro(this,sR).length?(rs(this,sT,ro(this,sR).charCodeAt(ro(this,sI))),t===!0&&rs(this,sM,ro(this,sI))):rs(this,sT,void 0)},sL=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;var e=ro(this,sR).substring(ro(this,sM),ro(this,sI)+t);return t===0&&rl(this,sP,sU).call(this),e},sU=function t(){rs(this,sM,ro(this,sI))},sN=function t(){var t="unterminated string",e=ro(this,sT);for(rl(this,sP,sO).call(this,!0);ro(this,sT)!==e;){if(ro(this,sT)===void 0)throw new Error(t);if(ro(this,sT)===92&&(rl(this,sP,sO).call(this),ro(this,sT)===void 0))throw new Error(t);rl(this,sP,sO).call(this)}var n=sy(sb.STRING,sA(rl(this,sP,sL).call(this)));return rl(this,sP,sO).call(this),n},sD=function t(){do rl(this,sP,sO).call(this);while(sk(ro(this,sT)));var t=rl(this,sP,sL).call(this),e=sx(t)?sb.KEYWORD:sb.IDENTIFIER;return sy(e,t)},sV=function t(){do rl(this,sP,sO).call(this);while(sC(ro(this,sT)));return ro(this,sT)===46?rl(this,sP,sz).call(this):sy(sb.INTEGER,rl(this,sP,sL).call(this))},sz=function t(){return rl(this,sP,sO).call(this),sC(ro(this,sT))?rl(this,sP,sB).call(this):(rl(this,sP,sU).call(this),sy(sb.DOT,".",sv))},s$=function t(){return rl(this,sP,sO).call(this,!0),sy(sb.COMMA,",")},sW=function t(){return rl(this,sP,sO).call(this,!0),sy(sb.COLON,":")},sB=function t(){do rl(this,sP,sO).call(this);while(sC(ro(this,sT)));return sy(sb.DECIMAL,rl(this,sP,sL).call(this))},sj=function t(){rl(this,sP,sO).call(this);var t=rl(this,sP,sL).call(this,2);if(sg.indexOf(t)!==-1)rl(this,sP,sO).call(this),rl(this,sP,sO).call(this);else{if(t=rl(this,sP,sL).call(this,1),t==="=>")return rl(this,sP,sO).call(this),sy(sb.ARROW,t);sm.indexOf(t)!==-1&&rl(this,sP,sO).call(this)}return t=rl(this,sP,sL).call(this),sy(sb.OPERATOR,t,sf[t])},sF=function t(){var t=String.fromCharCode(ro(this,sT)),e=sy(sb.GROUPER,t,sf[t]);return rl(this,sP,sO).call(this,!0),e};var sH=function t(t,e){return new ll(t,e).parse()},sG,sX,sJ,sK,sY,sZ,s0,s1,s2,s3,s5,s4,s6,s8,s7,s9,lt,le,ln,lr,li,lo,la,ls,ll=/*#__PURE__*/function(){"use strict";function t(e,n){l(this,t);ra(this,sZ);ra(this,sG);ra(this,sX);ra(this,sJ);ra(this,sK);ra(this,sY);rs(this,sX,new sQ(e)),rs(this,sJ,n)}d(t,[{key:"parse",value:function t(){return rl(this,sZ,s0).call(this),rl(this,sZ,s1).call(this)}},{key:"_matches",value:function t(t,e){return!(t&&ro(this,sG)!==t||e&&ro(this,sY)!==e)}}]);return t}();sG=new WeakMap,sX=new WeakMap,sJ=new WeakMap,sK=new WeakMap,sY=new WeakMap,sZ=new WeakSet,s0=function t(t,e){var n,i;if(!this._matches(t,e))throw new Error("Expected kind ".concat(t," (").concat(e,"), was ").concat((n=ro(this,sK))===null||n===void 0?void 0:n.kind," (").concat((i=ro(this,sK))===null||i===void 0?void 0:i.value,")"));var o=ro(this,sX).nextToken();rs(this,sK,o),rs(this,sG,o===null||o===void 0?void 0:o.kind),rs(this,sY,o===null||o===void 0?void 0:o.value)},s1=function t(){if(!ro(this,sK))return ro(this,sJ).empty();var t=rl(this,sZ,s4).call(this);return t===void 0?void 0:rl(this,sZ,s2).call(this,t,0)},s2=function t(t,e){if(t===void 0)throw new Error("Expected left to be defined.");for(;ro(this,sK);)if(this._matches(sb.GROUPER,"(")){var n=rl(this,sZ,ln).call(this);t=ro(this,sJ).invoke(t,void 0,n)}else if(this._matches(sb.GROUPER,"[")){var i=rl(this,sZ,lr).call(this);t=ro(this,sJ).index(t,i)}else if(this._matches(sb.DOT)){rl(this,sZ,s0).call(this);var o=rl(this,sZ,s4).call(this);t=rl(this,sZ,s3).call(this,t,o)}else{if(this._matches(sb.KEYWORD))break;if(this._matches(sb.OPERATOR)&&ro(this,sK).precedence>=e)t=ro(this,sY)==="?"?rl(this,sZ,s6).call(this,t):rl(this,sZ,s5).call(this,t,ro(this,sK));else break}return t},s3=function t(t,e){if(e===void 0)throw new Error("expected identifier");if(e.type==="ID")return ro(this,sJ).getter(t,e.value);if(e.type==="Invoke"&&e.receiver.type==="ID"){var n=e.receiver;return ro(this,sJ).invoke(t,n.value,e.arguments)}else throw new Error("expected identifier: ".concat(e))},s5=function t(t,e){if(sp.indexOf(e.value)===-1)throw new Error("unknown operator: ".concat(e.value));rl(this,sZ,s0).call(this);var n=rl(this,sZ,s4).call(this);for(;(ro(this,sG)===sb.OPERATOR||ro(this,sG)===sb.DOT||ro(this,sG)===sb.GROUPER)&&ro(this,sK).precedence>e.precedence;)n=rl(this,sZ,s2).call(this,n,ro(this,sK).precedence);return ro(this,sJ).binary(t,e.value,n)},s4=function t(){if(this._matches(sb.OPERATOR)){var t=ro(this,sY);if(rl(this,sZ,s0).call(this),t==="+"||t==="-"){if(this._matches(sb.INTEGER))return rl(this,sZ,la).call(this,t);if(this._matches(sb.DECIMAL))return rl(this,sZ,ls).call(this,t)}if(sh.indexOf(t)===-1)throw new Error("unexpected token: ".concat(t));var e=rl(this,sZ,s2).call(this,rl(this,sZ,s8).call(this),sv);return ro(this,sJ).unary(t,e)}return rl(this,sZ,s8).call(this)},s6=function t(t){rl(this,sZ,s0).call(this,sb.OPERATOR,"?");var e=rl(this,sZ,s1).call(this);rl(this,sZ,s0).call(this,sb.COLON);var n=rl(this,sZ,s1).call(this);return ro(this,sJ).ternary(t,e,n)},s8=function t(){switch(ro(this,sG)){case sb.KEYWORD:var t=ro(this,sY);if(t==="this")return rl(this,sZ,s0).call(this),ro(this,sJ).id(t);throw sd.indexOf(t)!==-1?new Error("unexpected keyword: ".concat(t)):new Error("unrecognized keyword: ".concat(t));case sb.IDENTIFIER:return rl(this,sZ,lt).call(this);case sb.STRING:return rl(this,sZ,lo).call(this);case sb.INTEGER:return rl(this,sZ,la).call(this);case sb.DECIMAL:return rl(this,sZ,ls).call(this);case sb.GROUPER:return ro(this,sY)==="("?rl(this,sZ,li).call(this):ro(this,sY)==="{"?rl(this,sZ,s9).call(this):ro(this,sY)==="["?rl(this,sZ,s7).call(this):void 0;case sb.COLON:throw new Error('unexpected token ":"');default:return}},s7=function t(){var t=[];do{if(rl(this,sZ,s0).call(this),this._matches(sb.GROUPER,"]"))break;t.push(rl(this,sZ,s1).call(this))}while(this._matches(sb.COMMA));return rl(this,sZ,s0).call(this,sb.GROUPER,"]"),ro(this,sJ).list(t)},s9=function t(){var t={};do{if(rl(this,sZ,s0).call(this),this._matches(sb.GROUPER,"}"))break;var e=ro(this,sY);(this._matches(sb.STRING)||this._matches(sb.IDENTIFIER))&&rl(this,sZ,s0).call(this),rl(this,sZ,s0).call(this,sb.COLON),t[e]=rl(this,sZ,s1).call(this)}while(this._matches(sb.COMMA));return rl(this,sZ,s0).call(this,sb.GROUPER,"}"),ro(this,sJ).map(t)},lt=function t(){var t=ro(this,sY);if(t==="true")return rl(this,sZ,s0).call(this),ro(this,sJ).literal(!0);if(t==="false")return rl(this,sZ,s0).call(this),ro(this,sJ).literal(!1);if(t==="null")return rl(this,sZ,s0).call(this),ro(this,sJ).literal(null);if(t==="undefined")return rl(this,sZ,s0).call(this),ro(this,sJ).literal(void 0);var e=rl(this,sZ,le).call(this),n=rl(this,sZ,ln).call(this);return n?ro(this,sJ).invoke(e,void 0,n):e},le=function t(){if(!this._matches(sb.IDENTIFIER))throw new Error("expected identifier: ".concat(ro(this,sY)));var t=ro(this,sY);return rl(this,sZ,s0).call(this),ro(this,sJ).id(t)},ln=function t(){if(!this._matches(sb.GROUPER,"("))return;var t=[];do{if(rl(this,sZ,s0).call(this),this._matches(sb.GROUPER,")"))break;var e=rl(this,sZ,s1).call(this);t.push(e)}while(this._matches(sb.COMMA));return rl(this,sZ,s0).call(this,sb.GROUPER,")"),t},lr=function t(){rl(this,sZ,s0).call(this);var t=rl(this,sZ,s1).call(this);return rl(this,sZ,s0).call(this,sb.GROUPER,"]"),t},li=function t(){var t=rl(this,sZ,ln).call(this);if(this._matches(sb.ARROW)){var e;rl(this,sZ,s0).call(this);var n=rl(this,sZ,s1).call(this),i=(e=t===null||t===void 0?void 0:t.map(function(t){return t.value}))!==null&&e!==void 0?e:[];return ro(this,sJ).arrowFunction(i,n)}else return ro(this,sJ).paren(t[0])},lo=function t(){var t=ro(this,sJ).literal(ro(this,sY));return rl(this,sZ,s0).call(this),t},la=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var e=ro(this,sJ).literal(parseInt("".concat(t).concat(ro(this,sY)),10));return rl(this,sZ,s0).call(this),e},ls=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var e=ro(this,sJ).literal(parseFloat("".concat(t).concat(ro(this,sY))));return rl(this,sZ,s0).call(this),e};var lu=Object.hasOwn,lc=Object.fromEntries,ld={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"??":function(t,e){return t!==null&&t!==void 0?t:e},"|":function(t,e){return e(t)},"|>":function(t,e){return e(t)}},lh={"+":function(t){return t},"-":function(t){return-t},"!":function(t){return!t}},lp=/*#__PURE__*/function(){"use strict";function t(){l(this,t)}d(t,[{key:"empty",value:function t(){return{type:"Empty",evaluate:function t(t){return t},getIds:function t(t){return t}}}},{key:"literal",value:function t(t){return{type:"Literal",value:t,evaluate:function t(t){return this.value},getIds:function t(t){return t}}}},{key:"id",value:function t(t){return{type:"ID",value:t,evaluate:function t(t){return this.value==="this"?t:t===null||t===void 0?void 0:t[this.value]},getIds:function t(t){return t.push(this.value),t}}}},{key:"unary",value:function t(t,e){var n=lh[t];return{type:"Unary",operator:t,child:e,evaluate:function t(t){return n(this.child.evaluate(t))},getIds:function t(t){return this.child.getIds(t)}}}},{key:"binary",value:function t(t,e,n){var i=ld[e];return{type:"Binary",operator:e,left:t,right:n,evaluate:function t(t){if(this.operator==="="){if(this.left.type!=="ID"&&this.left.type!=="Getter"&&this.left.type!=="Index")throw new Error("Invalid assignment target: ".concat(this.left));var e=this.right.evaluate(t),n,o;return this.left.type==="Getter"?(n=this.left.receiver.evaluate(t),o=this.left.name):this.left.type==="Index"?(n=this.left.receiver.evaluate(t),o=this.left.argument.evaluate(t)):this.left.type==="ID"&&(n=t,o=this.left.value),n===void 0?void 0:n[o]=e}return i(this.left.evaluate(t),this.right.evaluate(t))},getIds:function t(t){return this.left.getIds(t),this.right.getIds(t),t}}}},{key:"getter",value:function t(t,e){return{type:"Getter",receiver:t,name:e,evaluate:function t(t){var e;return(e=this.receiver.evaluate(t))===null||e===void 0?void 0:e[this.name]},getIds:function t(t){return this.receiver.getIds(t),t}}}},{key:"invoke",value:function t(t,e,n){if(e!=null&&typeof e!="string")throw new Error("method not a string");return{type:"Invoke",receiver:t,method:e,arguments:n,evaluate:function t(t){var n,i;var o;var a=this.receiver.evaluate(t),s=this.method?a:(n=t===null||t===void 0?void 0:t.this)!==null&&n!==void 0?n:t,l=this.method?a===null||a===void 0?void 0:a[e]:a,u=((i=this.arguments)!==null&&i!==void 0?i:[]).map(function(e){return e===null||e===void 0?void 0:e.evaluate(t)});return l===null||l===void 0?void 0:(o=l.apply)===null||o===void 0?void 0:o.call(l,s,u)},getIds:function t(t){var e;return this.receiver.getIds(t),(e=this.arguments)===null||e===void 0?void 0:e.forEach(function(e){return e===null||e===void 0?void 0:e.getIds(t)}),t}}}},{key:"paren",value:function t(t){return t}},{key:"index",value:function t(t,e){return{type:"Index",receiver:t,argument:e,evaluate:function t(t){var e;return(e=this.receiver.evaluate(t))===null||e===void 0?void 0:e[this.argument.evaluate(t)]},getIds:function t(t){return this.receiver.getIds(t),t}}}},{key:"ternary",value:function t(t,e,n){return{type:"Ternary",condition:t,trueExpr:e,falseExpr:n,evaluate:function t(t){return this.condition.evaluate(t)?this.trueExpr.evaluate(t):this.falseExpr.evaluate(t)},getIds:function t(t){return this.condition.getIds(t),this.trueExpr.getIds(t),this.falseExpr.getIds(t),t}}}},{key:"map",value:function t(t){return{type:"Map",entries:t,evaluate:function e(e){var n={};if(t&&this.entries)for(var i in t){var o=this.entries[i];o&&(n[i]=o.evaluate(e))}return n},getIds:function e(e){if(t&&this.entries)for(var n in t){var i=this.entries[n];i&&i.getIds(e)}return e}}}},{key:"list",value:function t(t){return{type:"List",items:t,evaluate:function t(t){var e;return(e=this.items)===null||e===void 0?void 0:e.map(function(e){return e===null||e===void 0?void 0:e.evaluate(t)})},getIds:function t(t){var e;return(e=this.items)===null||e===void 0?void 0:e.forEach(function(e){return e===null||e===void 0?void 0:e.getIds(t)}),t}}}},{key:"arrowFunction",value:function t(t,e){return{type:"ArrowFunction",params:t,body:e,evaluate:function t(t){var e=this.params,n=this.body;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}var s=lc(e.map(function(t,e){return[t,o[e]]})),l=new Proxy(t!==null&&t!==void 0?t:{},{set:function t(t,e,n){return lu(s,e)&&(s[e]=n),t[e]=n},get:function t(t,e){return lu(s,e)?s[e]:t[e]}});return n.evaluate(l)}},getIds:function t(t){var e=this;return this.body.getIds(t).filter(function(t){return!e.params.includes(t)})}}}}]);return t}();var lf=null,lv={boundAttributeSuffix:iW.M,marker:iW.P,markerMatch:iW.A,HTML_RESULT:iW.C,getTemplateHtml:iW.L,overrideDirectiveResolve:function t(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){l(this,n);return s(this,n,arguments)}d(n,[{key:"_$AS",value:function t(t,n){return e(this,n)}}]);return n}(t);return n},patchDirectiveResolve:function t(t,e){if(t.prototype._$AS.name!==e.name){lf!==null&&lf!==void 0?lf:lf=t.prototype._$AS.name;for(var n=t.prototype;n!==Object.prototype;n=Object.getPrototypeOf(n))if(n.hasOwnProperty(lf))return void(n[lf]=e);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass:function t(t,e){t._$litDirective$=e},getAttributePartCommittedValue:function t(t,e,n){var i=iA;return t.j=function(t){return i=t},t._$AI(e,t,n),i},connectedDisconnectable:function t(t){return _(k({},t),{_$AU:!0})},resolveDirective:iW.V,AttributePart:iW.H,PropertyPart:iW.B,BooleanAttributePart:iW.N,EventPart:iW.U,ElementPart:iW.F,TemplateInstance:iW.R,isIterable:iW.D,ChildPart:iW.I};var lm=lv.AttributePart,lg=lv.PropertyPart,lb=lv.BooleanAttributePart,ly=lv.EventPart,lw=new lp,lq=new Map,lk=function t(t){return t.replace(/-(-|\w)/g,function(t,e){return e.toUpperCase()})},lx=function t(t,e){var n=lq.get(t);if(n===void 0){if(lq.has(t))return;if(t=t.trim(),t.startsWith("{{")&&t.endsWith("}}")){var i=t.substring(2,t.length-2).trim();n=new ll(i,lw).parse(),lq.set(t,n)}}return n===null||n===void 0?void 0:n.evaluate(e)},l_=function t(t,e,n,i){var o=t.getAttribute("if");if(o!==null&&lx(o,e))return lM(t,e,n,i)},lC=RegExp("(?<!\\\\){{(.*?)(?:(?<!\\\\)}})","g"),lE=function t(t){return/(?:\\{{)|(?:\\}})/g.test(t)},lS=function t(t){return t.replaceAll(/\\{{/g,"{{").replace(/\\}}/g,"}}")},lA=function t(t,e,n,i){var o=t.getAttribute("repeat");if(o!==null){var a=lx(o,e);if(!a[Symbol.iterator])return iR;var s=lP(t),l=-1,u=[];var c=true,d=false,h=undefined;try{for(var p=a[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;var m;l++;var g=Object.create(e);g.item=v,g.index=l,g.this=(m=e.this)!==null&&m!==void 0?m:e;var b=[];var y=true,w=false,q=undefined;try{for(var k=s.parts[Symbol.iterator](),x;!(y=(x=k.next()).done);y=true){var _=x.value;var C;var E=_.update(g,n,i);_.type===1?(C=b).push.apply(C,L(E)):b.push(E)}}catch(t){w=true;q=t}finally{try{if(!y&&k.return!=null){k.return()}}finally{if(w){throw q}}}var S={_$litType$:s,values:b};u.push(S)}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}return u}},lR={if:l_,repeat:lA},lI=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lR,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;var o=lP(t).renderers;if(i){var a=lP(i).renderers,s=o.super;s!==void 0?n=_(k({},o,n),{super:function t(t,e,n){return n=_(k({},a,n),{super:function t(t,e,n){return lM(i,t,e,n)}}),s(t,e,n)}}):(n=k({},a,o,n),t=i)}else n=k({},o,n);return function(i){return lM(t,i,e,n)}};var lM=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lR,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};var o=lP(t),a=[];var s=true,l=false,u=undefined;try{for(var c=o.parts[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;var p;var f=h.update(e,n,i);h.type===1?(p=a).push.apply(p,L(f)):a.push(f)}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}return{_$litType$:o,values:a}},lT=new Map,lP=function t(t){var e=lT.get(t);return e===void 0&&lT.set(t,e=lO(t)),e},lO=function t(t){var e=function(){if(o.nodeType===Node.COMMENT_NODE)a++;else if(o.nodeType===Node.ELEMENT_NODE){a++;var t=o;if(t.tagName==="TEMPLATE"){var e=t.getAttribute("type"),l=t.getAttribute("name"),u=t.getAttribute("call");if(u!==null||e!==null||l!==null){t.parentNode.insertBefore(document.createComment(""),t),s.push(t);var c=void 0;if(u!==null){var d=u.trim(),h=d.startsWith("{{")&&d.endsWith("}}");c=function e(e,n,i){var o;var a=t.getAttribute("data"),s=a===null?void 0:lx(a,e);return(o=h?lx(d,e):i[u])===null||o===void 0?void 0:o(s,n,i)}}else e!==null?c=function n(n,i,o){var a=i[e];return a===null||a===void 0?void 0:a(t,n,i,o)}:(l==="super"?n.renderers.super=function(e,n,i){var o=i.super,a=lP(t);return i=k({},i,a.renderers),o(e,n,i)}:n.renderers[l]=function(e,n,i){return lM(t,e,n,i)},c=function t(t,e,n){var i=n[l];return i===null||i===void 0?void 0:i(t,e,n)});n.parts.push({type:2,index:a,update:c});return"continue"}}var p=t.getAttributeNames();var f=true,v=false,m=undefined;try{var g=function(){var e=y.value;var i=t.getAttribute(e),o=i.split(lC);if(o.length===1){lE(i)&&t.setAttribute(e,lS(i));return"continue"}t.removeAttribute(e);var s=e,l=lm,u=e[0];u==="."?(s=lk(e.substring(1)),l=lg):u==="?"?(s=e.substring(1),l=lb):u==="@"&&(s=lk(e.substring(1)),l=ly);var c=[lS(o[0])],d=[];for(var h=1;h<o.length;h+=2){var p=o[h];d.push(sH(p,lw)),c.push(lS(o[h+1]))}n.parts.push({type:1,index:a,name:s,strings:c,ctor:l,update:function t(t,e,n){return d.map(function(e){return e.evaluate(t)})}})};for(var b=p[Symbol.iterator](),y;!(f=(y=b.next()).done);f=true)g()}catch(t){v=true;m=t}finally{try{if(!f&&b.return!=null){b.return()}}finally{if(v){throw m}}}}else if(o.nodeType===Node.TEXT_NODE){var w=function(t){var e=_[t],o=sH(e,lw);n.parts.push({type:2,index:++a,update:function t(t,e){return o.evaluate(t)}});var s=new Text(_[t+1].replace("\\{{","{{"));q.parentNode.insertBefore(s,q.nextSibling),q.parentNode.insertBefore(document.createComment(""),q.nextSibling),q=s,i.currentNode=s};var q=o,x=q.textContent,_=x.split(lC);_.length>1?q.textContent=lS(_[0]):lE(x)&&(q.textContent=lS(x));for(var C=1;C<_.length;C+=2)w(C)}};var n={h:void 0,el:t.cloneNode(!0),parts:[],renderers:{}},i=document.createTreeWalker(n.el.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),o=i.currentNode,a=-1,s=[];for(;(o=i.nextNode())!==null;)e();var l=true,u=false,c=undefined;try{for(var d=s[Symbol.iterator](),h;!(l=(h=d.next()).done);l=true){var p=h.value;p.remove()}}catch(t){u=true;c=t}finally{try{if(!l&&d.return!=null){d.return()}}finally{if(u){throw c}}}return n};var lL,lU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,lL);rs(t,lL,t.attachInternals()),ro(t,lL).ariaLabel="pagination";return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");this.myTemplate=lI(t)}},{key:"render",value:function t(){var t=this;if(!this.computedContext)return iC(tN());var e=this.computedContext.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})});return iC(tD(),e.map(function(e){return t.myTemplate({item:e,view:t.computedContext.view})}))}}]);return e}(iQ);lL=new WeakMap,rr([P({context:ot,subscribe:!0})],lU.prototype,"computedContext",2),lU=rr([iG("test-paging-buttons-stamp")],lU);var lN=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.G=e}d(t,[{key:"disconnect",value:function t(){this.G=void 0}},{key:"reconnect",value:function t(t){this.G=t}},{key:"deref",value:function t(){return this.G}}]);return t}(),lD=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.Y=void 0,this.Z=void 0}d(t,[{key:"get",value:function t(){return this.Y}},{key:"pause",value:function t(){var t=this;var e;(e=this.Y)!==null&&e!==void 0?e:this.Y=new Promise(function(e){return t.Z=e})}},{key:"resume",value:function t(){var t,e;(t=(e=this).Z)===null||t===void 0?void 0:t.call(e),this.Y=this.Z=void 0}}]);return t}();var lV=function t(t){return!op(t)&&typeof t.then=="function"},lz=0x3fffffff,l$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t._$Cwt=lz,t._$Cbt=[],t._$CK=new lN(t),t._$CX=new lD;return t}d(e,[{key:"render",value:function t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var i;return(i=e.find(function(t){return!lV(t)}))!==null&&i!==void 0?i:iA}},{key:"update",value:function t(t,e){var n,i=function(t){var i=e[t];if(!lV(i))return{v:(n._$Cwt=t,i)};t<s&&i===o[t]||(n._$Cwt=lz,s=0,Promise.resolve(i).then(function(t){return a(function(){var e,n;return z(this,function(o){switch(o.label){case 0:if(!u.get())return[3,3];return[4,u.get()];case 1:o.sent();o.label=2;case 2:return[3,0];case 3:e=l.deref();if(e!==void 0){n=e._$Cbt.indexOf(i);n>-1&&n<e._$Cwt&&(e._$Cwt=n,e.setValue(t))}return[2]}})})()}))};var o=this._$Cbt,s=o.length;this._$Cbt=e;var l=this._$CK,u=this._$CX;this.isConnected||this.disconnected();for(var c=0;c<e.length&&!(c>this._$Cwt);c++){var d=(n=this,i(c));if(U(d)==="object")return d.v}return iA}},{key:"disconnected",value:function t(){this._$CK.disconnect(),this._$CX.pause()}},{key:"reconnected",value:function t(){this._$CK.reconnect(this),this._$CX.resume()}}]);return e}(oE),lW=oc(l$);var lB="@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;\n\n:root,\n:host {\n /* Active colors */\n --qti-bg-active: #ffecec;\n --qti-border-active: #f86d70;\n\n /* Correct colors */\n --qti-correct-light: #c8e6c9;\n --qti-correct: #66bb6a;\n\n /** Partially correct colors */\n --qti-partially-correct-light: #fff3e0;\n --qti-partially-correct: #ffeb3b;\n\n /* Incorrect colors */\n --qti-incorrect-light: #ef9a9a;\n --qti-incorrect: #ef5350;\n\n /* Validation colors */\n --qti-validation-error-bg: #fffbeb;\n --qti-validation-text: #92400e;\n\n /* Gap size */\n --qti-gap-size: 1rem;\n\n /* Background colors */\n --qti-bg: white;\n --qti-hover-bg: #f9fafb;\n\n /* Light theme colors */\n --qti-light-bg-active: #f0f0f0; /* Light gray */\n --qti-light-border-active: #d0d0d0; /* Medium gray */\n\n /* Dark theme colors */\n --qti-dark-bg-active: #1f2937; /* Dark gray */\n --qti-dark-border-active: #64748b; /* Medium gray */\n\n /* Disabled colors */\n --qti-disabled-bg: #f3f4f6;\n --qti-disabled-color: #45484f;\n\n /* Border properties */\n --qti-border-thickness: 2px;\n --qti-border-style: solid;\n --qti-border-color: #c6cad0;\n --qti-border-radius: 0.3rem;\n --qti-drop-border-radius: calc(var(--qti-border-radius) + var(--qti-border-thickness));\n\n /* Focus & active states */\n --qti-focus-border-width: 5px;\n --qti-focus-color: #bddcff7e;\n\n /* Class-specific variables */\n\n /* Form elements */\n --qti-form-size: 1rem;\n\n /* Order buttons */\n --qti-order-size: 2rem;\n\n /* Generic padding for all elements */\n --qti-padding-vertical: 0.5rem; /* py-2 */\n --qti-padding-horizontal: 0.5rem; /* px-2 */\n\n /* Dropzones */\n --qti-dropzone-padding: 0rem;\n}\n\n/* SVG masks and backgrounds */\n\n.chevron {\n background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n.handle {\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n background-repeat: repeat-y;\n background-position: left center;\n background-size: 14px 8px;\n}\n\n.check-mask {\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/*\n Following are classes that can be applied to elements and element states, so they are not used directly\n The @apply directive is used to apply these classes to elements\n*/\n\n/* Apply .bordered to an element */\n\n.bordered {\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .form rules for checkbox and radiobutton */\n\n.form {\n\n /* background-color: var(--qti-bg); */\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .button rules for button-like elements, such as drags and buttons */\n\n.button {\n\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .select for the select dropdown element */\n\n.select {\n\n border-radius: var(--qti-border-radius);\n position: relative;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n padding-right: calc(var(--qti-padding-horizontal) + 1.5rem); /* 1.5rem for the chevron */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n/* Apply .text for the input text and textarea */\n\n.text {\n\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .spot for hotspot shapes */\n\n.spot {\n\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n box-sizing: border-box !important;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .point for circular small hotspots */\n\n.point {\n\n box-sizing: border-box;\n border-radius: 100%;\n border: 1px solid white;\n background-color: black;\n opacity: 0.5;\n padding: 0;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .drag for draggable elements */\n\n.drag {\n\n box-sizing: border-box;\n transition:\n transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n\n /* padding-left: calc(var(--qti-padding-horizontal) + 0.5rem) !important; */\n\n /* 1.5rem for the drag */\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n}\n\n/* Apply .dragging for the dragging state of a draggable element */\n\n.dragging {\n pointer-events: none;\n rotate: -2deg;\n box-shadow:\n 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n}\n\n/* Apply .drop for an element where you can drop the draggable */\n\n.drop {\n /* @apply bordered; */\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n}\n\n/* Apply .dropping for an indicator where you can drop the draggable */\n\n.dropping {\n background-color: var(--qti-bg-active);\n}\n\n/* Apply .order for a small circular button */\n\n.order {\n\n display: grid;\n place-content: center;\n\n /* background-color: var(--qti-bg-active); */\n box-sizing: border-box;\n border-radius: 100%;\n width: var(--qti-order-size);\n height: var(--qti-order-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-size for radio and checkbox size */\n\n.check-size {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n}\n\n/* Apply .check for checkbox */\n\n.check {\n gap: 0.5rem;\n background-color: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n outline: none;\n cursor: pointer;\n}\n\n/* Apply .check-radio for outer circle of the radio buttons */\n\n.check-radio {\n\n border-radius: 100%;\n\n display: grid;\n\n place-content: center;\n\n width: var(--qti-form-size);\n\n height: var(--qti-form-size);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n}\n\n/* Apply .check-radio-checked for the inner checked radio */\n\n.check-radio-checked {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n}\n\n/* Apply .check-checkbox for outer square of the checkbox */\n\n.check-checkbox {\n\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-checkbox-checked for the inner checkmark */\n\n.check-checkbox-checked {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/* Apply .hov for hover state */\n\n.hov {\n /* background-color: var(--qti-hover-bg); */\n}\n\n/* Apply .foc for focus state */\n\n.foc {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n}\n\n/* Apply .act for active state */\n\n.act {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n}\n\n.act-bg {\n background-color: var(--qti-bg-active);\n}\n\n.act-bor {\n border-color: var(--qti-border-active);\n}\n\n/* Apply .rdo for readonly state */\n\n.rdo {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n}\n\n/* Apply .dis for disabled state */\n\n.dis {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n}\n\n/* base */\n\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n\n@layer qti-base {\n .qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n }\n\n .qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n }\n\n .qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there’s padding or borders */\n }\n\n .qti-layout-col1 {\n width: 6.3829787234%;\n }\n\n .qti-layout-col2 {\n width: 14.8936170213%;\n }\n\n .qti-layout-col3 {\n width: 23.4042553191%;\n }\n\n .qti-layout-col4 {\n width: 31.914893617%;\n }\n\n .qti-layout-col5 {\n width: 40.4255319149%;\n }\n\n .qti-layout-col6 {\n width: 48.9361702128%;\n }\n\n .qti-layout-col7 {\n width: 57.4468085106%;\n }\n\n .qti-layout-col8 {\n width: 65.9574468085%;\n }\n\n .qti-layout-col9 {\n width: 74.4680851064%;\n }\n\n .qti-layout-col10 {\n width: 82.9787234043%;\n }\n\n .qti-layout-col11 {\n width: 91.4893617021%;\n }\n\n .qti-layout-col12 {\n width: 100%;\n }\n\n .qti-layout-offset1 {\n margin-left: 8.5106382979%;\n }\n\n .qti-layout-offset2 {\n margin-left: 17.0212765957%;\n }\n\n .qti-layout-offset3 {\n margin-left: 25.5319148936%;\n }\n\n .qti-layout-offset4 {\n margin-left: 34.0425531915%;\n }\n\n .qti-layout-offset5 {\n margin-left: 42.5531914894%;\n }\n\n .qti-layout-offset6 {\n margin-left: 51.0638297872%;\n }\n\n .qti-layout-offset7 {\n margin-left: 59.5744680851%;\n }\n\n .qti-layout-offset8 {\n margin-left: 68.085106383%;\n }\n\n .qti-layout-offset9 {\n margin-left: 76.5957446809%;\n }\n\n .qti-layout-offset10 {\n margin-left: 85.1063829787%;\n }\n\n .qti-layout-offset11 {\n margin-left: 93.6170212766%;\n }\n\n .qti-layout-offset12 {\n margin-left: 102.1276595745%;\n }\n\n @media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n }\n}\n\n[view],\nqti-outcome-declaration,\nqti-response-declaration {\n display: none;\n}\n\n[view].show {\n display: block;\n}\n\n:host {\n box-sizing: border-box;\n}\n\n/* components */\n\n@layer qti-components {\n qti-choice-interaction {\n &.qti-input-control-hidden {\n & qti-simple-choice {\n position: relative; /* Add position relative here instead of a separate rule */\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n /* Add styling for correct responses with border instead of checkmark */\n &:state(correct-response),\n &[data-correct-response='true'] {\n border: 3px solid var(--qti-correct) !important;\n padding-right: 30px;\n\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n position: absolute;\n top: 5px;\n right: 5px;\n font-size: 1.2em;\n font-weight: bold;\n }\n }\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n }\n\n &:not(.qti-input-control-hidden) {\n & qti-simple-choice {\n\n &:not([aria-disabled='true'], [aria-readonly='true'], :state(--checked)):hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n\n gap: 0.5rem;\n\n background-color: var(--qti-bg);\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n outline: none;\n\n cursor: pointer\n }\n }\n\n & qti-simple-choice {\n width: -moz-fit-content;\n width: fit-content;\n cursor: pointer;\n\n /* Keep the checkmark for non-hidden input controls */\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n }\n }\n }\n\n & qti-simple-choice > p {\n margin: 0 !important;\n padding: 0 !important;\n }\n }\n\n .hover-border {\n border: 2px solid #000; /* Adjust the border style and color as needed */\n }\n\n qti-graphic-gap-match-interaction {\n position: relative;\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-gap-img,\n qti-gap-text {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: grab;\n }\n\n & qti-associable-hotspot {\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid transparent;\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &[active] {\n\n /* Light theme override */\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n\n &[disabled] {\n\n &:not(:empty) {\n cursor: default !important;\n }\n\n cursor: not-allowed;\n\n background-color: var(--qti-disabled-bg);\n\n color: var(--qti-disabled-color);\n\n border-color: var(--qti-border-color);\n\n outline: 4px solid var(--qti-disabled-bg)\n }\n\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */\n content: '\\0000a0'; /* when empty, put a space in it */\n }\n\n &:not(:empty) {\n padding: 0;\n width: auto;\n }\n\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0); /* rotate-0 */\n box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */\n }\n }\n\n & img {\n margin: 0;\n padding: 0;\n }\n }\n\n qti-text-entry-interaction {\n &:state(candidate-correct) {\n &::part(input) {\n background-color: var(--qti-correct);\n }\n }\n\n &:state(candidate-partially-correct) {\n &::part(input) {\n background-color: var(--qti-partially-correct);\n }\n }\n\n &:state(candidate-incorrect) {\n &::part(input) {\n background-color: var(--qti-incorrect);\n }\n }\n\n &::part(input) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:hover {\n }\n\n &:focus-within {\n &::part(input) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n\n qti-extended-text-interaction {\n &::part(textarea) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:hover {\n }\n\n &:focus-within {\n &::part(textarea) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n\n qti-gap-match-interaction {\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-gap-text {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n & qti-gap {\n\n &[disabled] {\n\n &:not(:empty) {\n cursor: default !important;\n }\n\n cursor: not-allowed;\n\n background-color: var(--qti-disabled-bg);\n\n color: var(--qti-disabled-color);\n\n border-color: var(--qti-border-color);\n\n outline: 4px solid var(--qti-disabled-bg)\n }\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light {\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &[active] {\n\n /* Light theme override */\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n\n display: inline-flex;\n align-items: center;\n\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */\n content: '\\0000a0'; /* when empty, put a space in it */\n }\n\n &:not(:empty) {\n display: inline-flex;\n padding: 0;\n width: auto;\n }\n\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0); /* rotate-0 */\n box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */\n }\n\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n\n border-radius: var(--qti-border-radius);\n\n position: relative;\n\n background-color: var(--qti-bg)\n }\n }\n\n qti-hotspot-interaction {\n & qti-hotspot-choice {\n &[shape='circle'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n\n &:state(--readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(--disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='rect'] {\n\n /* &:hover {\n @apply hov;\n } */\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='poly'] {\n &:hover::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n var(--qti-border-active),\n var(--qti-border-active) 5px,\n transparent 5px,\n transparent 10px\n );\n display: block;\n }\n\n &:state(--checked)::after,\n &[aria-checked='true']::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 5px,\n var(--qti-border-active) 5px,\n var(--qti-border-active) 10px\n );\n display: block;\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n\n qti-hottext-interaction {\n /* &:not(.qti-input-control-hidden),\n &:not(.qti-unselected-hidden) { */\n qti-hottext {\n display: inline-flex;\n align-items: center;\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: #16a34a; /* text-green-600 */\n }\n }\n\n gap: 0.5rem;\n\n background-color: var(--qti-bg);\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n outline: none;\n\n cursor: pointer\n }\n\n &.qti-input-control-hidden {\n qti-hottext {\n /* --qti-padding-md: 0.1rem;\n --qti-padding-lg: 0.2rem;\n --qti-border-radius-md: 0.3rem;\n --qti-border-thickness: 1px;\n --qti-font-weight-semibold: 400; */\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n /* @layer qti-variants { */\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n /* } */\n }\n\n &.qti-unselected-hidden {\n qti-hottext {\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n cursor: pointer;\n\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked) {\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n\n qti-inline-choice-interaction {\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n\n &::part(select) {\n\n font-size: inherit;\n vertical-align: baseline;\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n border-radius: var(--qti-border-radius);\n\n position: relative;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n padding-right: calc(var(--qti-padding-horizontal) + 1.5rem);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n\n background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px\n }\n }\n\n qti-match-interaction.qti-match-tabular {\n /* Table element */\n &::part(table) {\n border-collapse: collapse;\n width: 100%;\n }\n\n /* Row headers - take up remaining space */\n &::part(r-header) {\n background-color: var(--qti-bg-active, #f8f8f8);\n font-weight: 500;\n text-align: center;\n padding: 8px 15px;\n border: 1px solid #ddd;\n width: auto; /* Let it expand naturally */\n word-wrap: break-word; /* Allow long words to break */\n white-space: wrap; /* Allow text to wrap to multiple lines */\n min-width: 4rem; /* Allow column to shrink below content width */\n }\n\n /* Column headers - minimal width */\n &::part(c-header) {\n background-color: var(--qti-bg-active, #f8f8f8);\n font-weight: 500;\n text-align: left;\n padding: 8px;\n border: 1px solid #ddd;\n width: 8rem; /* Force minimal width */\n white-space: normal; /* Prevent wrapping */\n }\n\n /* Table rows */\n &::part(row) {\n border-bottom: 1px solid #ddd;\n }\n\n /* Input cells - minimal width */\n &::part(input-cell) {\n text-align: center;\n vertical-align: middle;\n height: 48px;\n border: 1px solid #ddd;\n padding: 8px;\n width: 1%; /* Force minimal width */\n }\n\n /* Radio button styling */\n &::part(rb) {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n border: 2px solid var(--qti-border-active, #2196f3);\n background-color: transparent !important;\n margin: 0 auto;\n cursor: pointer;\n display: block;\n }\n\n /* Radio button checked state */\n &::part(rb-checked) {\n box-shadow: inset 0 0 0 6px var(--qti-border-active, #2196f3);\n }\n\n /* Checkbox styling */\n &::part(cb) {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n width: 24px;\n height: 24px;\n border-radius: 3px;\n border: 2px solid var(--qti-border-active, #2196f3);\n background-color: transparent !important;\n margin: 0 auto;\n cursor: pointer;\n display: block;\n }\n\n /* Checkbox checked state - only change border if we're adding an SVG checkmark */\n &::part(cb-checked) {\n background-color: var(--qti-border-active, #2196f3) !important;\n }\n\n &::part(checkmark) {\n position: absolute;\n width: 18px;\n height: 18px;\n top: 3px;\n left: 3px;\n pointer-events: none;\n }\n\n /* Correct answers for both types */\n &::part(rb-correct) {\n border-color: var(--qti-correct, #4caf50);\n }\n\n &::part(rb-checked rb-correct) {\n box-shadow: inset 0 0 0 6px var(--qti-correct, #4caf50);\n }\n\n &::part(cb-correct) {\n border-color: var(--qti-correct, #4caf50);\n }\n\n &::part(cb-checked cb-correct) {\n background-color: var(--qti-correct, #4caf50) !important;\n }\n\n /* Incorrect answers for both types */\n &::part(rb-incorrect) {\n border-color: var(--qti-incorrect, #f44336);\n }\n\n &::part(rb-checked rb-incorrect) {\n box-shadow: inset 0 0 0 6px var(--qti-incorrect, #f44336);\n }\n\n &::part(cb-incorrect) {\n border-color: var(--qti-incorrect, #f44336);\n }\n\n &::part(cb-checked cb-incorrect) {\n background-color: var(--qti-incorrect, #f44336) !important;\n }\n }\n\n qti-match-interaction:not(.qti-match-tabular) {\n &:state(--dragzone-enabled) qti-simple-match-set:first-of-type {\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-active) qti-simple-match-set:first-of-type {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n /* The draggables */\n & qti-simple-match-set:first-of-type {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start; /* Prevents children from stretching */\n gap: var(--qti-gap-size);\n border: 2px solid transparent;\n\n & qti-simple-associable-choice {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n /* The droppables */\n & qti-simple-match-set:last-of-type {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n grid-auto-flow: unset;\n grid-auto-columns: unset;\n gap: var(--qti-gap-size);\n\n & > qti-simple-associable-choice {\n /* a droppable qti-simple-associable-choice */\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n grid-row: unset;\n box-sizing: border-box;\n\n & img {\n max-width: 100%;\n height: auto;\n }\n\n &[enabled] {\n &::part(dropslot) {\n background-color: var(--qti-bg-active);\n }\n }\n\n &[disabled] {\n &::part(dropslot) {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n\n &[active] {\n &::part(dropslot) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n }\n\n &::part(dropslot) {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n padding: var(--qti-dropzone-padding);\n margin-top: 0.5rem;\n gap: 0.5rem;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n\n & > *:not(qti-simple-associable-choice) {\n pointer-events: none;\n }\n\n & > qti-simple-associable-choice {\n\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n\n &::part(dropslot) {\n display: none;\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n flex-basis: fit-content;\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n }\n }\n }\n }\n\n qti-order-interaction {\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n &::part(qti-simple-choice),\n & qti-simple-choice {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &::part(qti-simple-choice) {\n display: flex;\n overflow: hidden;\n align-items: center;\n width: 100%;\n text-overflow: ellipsis;\n }\n\n &::part(drops) {\n gap: 0.5rem; /* gap-2 */\n }\n\n &::part(drags) {\n gap: 0.5rem; /* gap-2 */\n }\n\n &::part(drop-list) {\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light {\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n display: flex;\n min-height: 4rem;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n\n &::part(active) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n & drop-list {\n &[shape='circle'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='square'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n }\n\n qti-associate-interaction {\n /* General styles for active and enabled states */\n &:state(--dragzone-active) slot[name='qti-simple-associable-choice'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled) slot[name='qti-simple-associable-choice'] {\n background-color: var(--qti-bg-active);\n }\n\n & qti-simple-associable-choice, /* drags when in lightdom */\n &::part(qti-simple-associable-choice) /* drags when in shadowdom */ {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n /* display: flex;\n overflow: hidden;\n align-items: center; */\n\n /* &::part(drop-container) {\n display: flex;\n flex-direction: column;\n gap: var(--qti-gap-size);\n } */\n\n &::part(drop-list) {\n\n display: grid;\n height: 3rem;\n min-width: 10rem;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n\n &::part(drop-list):focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(drop-list)[dragging] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n /* &::part(drop-list) {\n @apply act;\n } */\n }\n\n qti-graphic-order-interaction {\n & qti-hotspot-choice {\n width: 100%;\n height: 100%;\n background-color: rgb(128 128 128 / 30%);\n padding: 0;\n\n &:hover {\n background-color: rgb(128 128 128 / 70%);\n }\n\n &:focus {\n background-color: rgb(128 128 128 / 70%);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n background-color: rgb(128 128 128 / 70%);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &[aria-ordervalue] {\n display: grid;\n place-content: center;\n }\n\n &[aria-ordervalue]::after {\n content: attr(aria-ordervalue) !important;\n }\n\n &[aria-ordercorrectvalue] {\n display: grid;\n place-content: center;\n }\n\n /* When both attributes are present */\n &[aria-ordercorrectvalue][aria-ordervalue]::after {\n content: 'C=' attr(aria-ordercorrectvalue) ' R=' attr(aria-ordervalue) !important;\n color: var(--qti-correct);\n }\n\n /* When only aria-ordercorrectvalue is present */\n &[aria-ordercorrectvalue]:not([aria-ordervalue])::after {\n content: 'C=' attr(aria-ordercorrectvalue) !important;\n color: var(--qti-correct);\n }\n }\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-graphic-associate-interaction {\n position: relative;\n display: block;\n\n & qti-associable-hotspot {\n &[shape='circle'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='square'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-slider-interaction {\n --qti-tick-color: rgb(229 231 235 / 100%);\n --qti-tick-width: 1px;\n }\n\n qti-select-point-interaction {\n &::part(point) {\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n box-sizing: border-box;\n\n border-radius: 100%;\n\n border: 1px solid white;\n\n background-color: black;\n\n opacity: 0.5;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n }\n\n &::part(correct) {\n background-color: var(--qti-correct);\n }\n\n &::part(incorrect) {\n background-color: var(--qti-incorrect);\n }\n }\n\n qti-position-object-stage {\n & qti-position-object-interaction {\n /* no styles necessary, only layout styles, defined in the component */\n }\n }\n\n qti-prompt {\n margin: 0.5rem 0; /* my-2 */\n display: block;\n width: 100%;\n }\n}\n\nqti-test-part:not(:has(qti-assessment-item)),\nqti-assessment-section:not(:has(qti-assessment-item)),\nqti-assessment-item-ref:not(:has(qti-assessment-item)) {\n display: none;\n}\n\nqti-hottext-interaction::part(message),\nqti-choice-interaction::part(message),\nqti-association-interaction::part(message),\nqti-graphic-association-interaction::part(message),\nqti-graphic-gap-match-interaction::part(message),\nqti-graphic-order-interaction::part(message),\nqti-math-interaction::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n}\n\ndiv.full-correct-response {\n border: 1px solid #39a7c0;\n background-color: #d9e8ee;\n}\n\ndiv.full-correct-response-block {\n display: block;\n margin-top: var(--qti-padding-vertical);\n padding: 0.5rem;\n}\n\ndiv.full-correct-response-inline {\n display: inline-block;\n margin-left: var(--qti-padding-horizontal);\n margin-right: var(--qti-padding-horizontal);\n padding: 0.2rem;\n}\n";var lj,lF,lQ,lH,lG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,lF);t.testURL=null;t.testDoc=null;t.testXML=null;ra(t,lj,null);return t}d(e,[{key:"handleTestURLChange",value:function t(){return a(function(){var t,e,n,i,o;return z(this,function(a){switch(a.label){case 0:if(!this.testURL)return[3,7];a.label=1;case 1:a.trys.push([1,6,,7]);return[4,i1().load(this.testURL)];case 2:t=a.sent(),e=this.closest("qti-test");if(!(e===null||e===void 0?void 0:e.postLoadTestTransformCallback))return[3,5];n=t.htmlDoc().querySelector("qti-assessment-test");i=n;if(!i)return[3,4];return[4,e.postLoadTestTransformCallback(t,n)];case 3:i=t=a.sent();a.label=4;case 4:i;a.label=5;case 5:this.testDoc=t.htmlDoc();return[3,7];case 6:o=a.sent();console.error("Error loading or parsing XML:",o);return[3,7];case 7:return[2]}})}).call(this)}},{key:"handleTestXMLChange",value:function t(){if(this.testXML)try{this.testDoc=i1().parse(this.testXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){i().call(n),rl(this,lF,lQ).call(this),rl(this,lF,lH).call(this),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange();return[2]})}).call(this)}},{key:"render",value:function t(){return iC(tz(),ro(this,lj),lW(this.testDoc,iC(tV())))}}]);return e}(iQ);lj=new WeakMap,lF=new WeakSet,lQ=function t(){var t=this.querySelector("template");rs(this,lj,t?t.content:iC(t$()))},lH=function t(){var t=new CSSStyleSheet;t.replaceSync(lB),this.shadowRoot.adoptedStyleSheets=[t]},rr([n({type:String,attribute:"test-url"})],lG.prototype,"testURL",2),rr([i()],lG.prototype,"testDoc",2),rr([i()],lG.prototype,"testXML",2),rr([V("testURL",{waitUntilFirstUpdate:!0})],lG.prototype,"handleTestURLChange",1),rr([V("testXML",{waitUntilFirstUpdate:!0})],lG.prototype,"handleTestXMLChange",1),lG=rr([iG("test-container")],lG);var lX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t;var e=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!e||!e.variables)return iC(tW());var n=e.variables.filter(function(t){return t.type==="response"}),i=e.variables.filter(function(t){return t.type==="outcome"}),o=function t(t,e){return iC(tj(),e,t.map(function(t){var e,n,i,o;var a=t.correctResponse?Array.isArray(t.correctResponse)?t.correctResponse.join(", "):t.correctResponse:"",s=((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.map(function(t){return"".concat(t.mapKey,"=").concat(t.mappedValue,"pt")}).join(", "))||"",l=((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.map(function(t){return"".concat(t.shape,"(").concat(t.coords,")=").concat(t.mappedValue,"pt")}).join(", "))||"";return iC(tB(),t.identifier,Array.isArray(t.value)?t.value.join(", "):t.value,t.cardinality,t.baseType,a||s||l)}))};return iC(tF(),o(n,"Response Variables"),o(i,"Outcome Variables"))}}]);return e}(iQ);lX.styles=rG(tQ()),rr([P({context:ot,subscribe:!0})],lX.prototype,"computedContext",2),lX=rr([iG("test-print-item-variables")],lX);var lJ,lK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,lJ);rs(t,lJ,t.attachInternals()),ro(t,lJ).ariaLabel="pagination";return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");this.myTemplate=lI(t)}},{key:"render",value:function t(){var t=this;if(!this.computedContext)return iC(tH());var e=this.computedContext.testParts.flatMap(function(t){return t.sections});return iC(tG(),e.map(function(e){return t.myTemplate({item:e})}))}}]);return e}(iQ);lJ=new WeakMap,rr([P({context:ot,subscribe:!0})],lK.prototype,"computedContext",2),lK=rr([iG("test-section-buttons-stamp")],lK);var lY,lZ,l0=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,lY);t.sectionId=null;t.addEventListener("click",function(){return rl(t,lY,lZ).call(t,t.sectionId)});return t}d(e,[{key:"render",value:function t(){return iC(tX())}}]);return e}(iQ);lY=new WeakSet,lZ=function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"section",id:t}}))},l0.styles=rG(tJ(),a4,a6),rr([n({type:String,attribute:"section-id"})],l0.prototype,"sectionId",2),l0=rr([iG("test-section-link")],l0);var l1=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(tK(),JSON.stringify(this.computedContext,null,2))}}]);return e}(iQ);rr([i(),P({context:ot,subscribe:!0})],l1.prototype,"computedContext",2),l1=rr([iG("test-print-context")],l1);var l2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.debug=!1;t.stampContext={view:"candidate",activeItem:{},activeSection:{items:[]},activeTestpart:{items:[],sections:[]},test:{}};return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=lI(t)}},{key:"willUpdate",value:function t(t){if(!this.computedContext)return;var e=this.computedContext.testParts.find(function(t){return t.active}),n=e===null||e===void 0?void 0:e.sections.find(function(t){return t.active}),i=n===null||n===void 0?void 0:n.items.find(function(t){return t.active}),o=i||{},a=o.variables,s=C(o,["variables"]);if(!e||!n||!i)return;var l=_(k({},e),{items:e.sections.flatMap(function(t){return t.items.map(function(t){var e=t.variables,n=C(t,["variables"]);return n})}),sections:e.sections.map(function(t){return _(k({},t),{items:t.items.map(function(t){var e=t.variables,n=C(t,["variables"]);return n})})})}),u=_(k({},n),{items:n.items.map(function(t){var e=t.variables,n=C(t,["variables"]);return n})}),c=this.computedContext,d=c.testParts,h=C(c,["testParts"]);this.stampContext={view:this.computedContext.view,activeItem:s,activeSection:u,activeTestpart:l,test:h},this.dispatchEvent(new CustomEvent("qti-stamp-context-updated",{detail:this.stampContext,bubbles:!0}))}},{key:"render",value:function t(){return iC(tZ(),this.debug?iC(tY(),JSON.stringify(this.stampContext,null,2)):iR,this.myTemplate?this.myTemplate(this.stampContext):iR)}}]);return e}(iQ);rr([n({type:Boolean,reflect:!0})],l2.prototype,"debug",2),rr([i(),P({context:ot,subscribe:!0})],l2.prototype,"computedContext",2),rr([i()],l2.prototype,"stampContext",2),l2=rr([iG("test-stamp")],l2);var l3,l5,l4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,l3);t.view="";t.disabled=!1;t.myTemplate=null;t.addEventListener("click",function(e){var n=e.target,i=parseFloat(n.value);n.tagName==="INPUT"&&rl(t,l3,l5).call(t,i)});return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=lI(t)}},{key:"render",value:function t(){var t,e;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!n||!n.variables)return iC(t0());var i=(e=n.variables.find(function(t){return t.identifier=="MAXSCORE"}))===null||e===void 0?void 0:e.value,o=n.variables.find(function(t){return t.identifier=="SCORE"}),a=o===null||o===void 0?void 0:o.value,s=(o===null||o===void 0?void 0:o.externalScored)!=="human";if(!i||!o)return iR;var l=L(Array(Number(i)+1).keys());return iC(t1(),this.myTemplate?this.myTemplate({scores:l,score:a,disabled:s}):iR)}}]);return e}(iQ);l3=new WeakSet,l5=function t(t){var e,n;var i=(e=((n=this.computedContext)===null||n===void 0?void 0:n.testParts.find(function(t){return t.active})).sections.flatMap(function(t){return t.items}).find(function(t){return t.active}))===null||e===void 0?void 0:e.identifier;this.dispatchEvent(new CustomEvent("test-update-outcome-variable",{detail:{assessmentItemRefId:i,outcomeVariableId:"SCORE",value:t},bubbles:!0}))},rr([n({type:String,attribute:"view"})],l4.prototype,"view",2),rr([n({type:Boolean})],l4.prototype,"disabled",2),rr([P({context:ot,subscribe:!0})],l4.prototype,"computedContext",2),l4=rr([iG("test-scoring-buttons")],l4);var l6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=lI(t)}},{key:"_switchView",value:function t(t){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:t}))}},{key:"firstUpdated",value:function t(t){var e=this;this.addEventListener("click",function(){var t;((t=e.sessionContext)===null||t===void 0?void 0:t.view)==="scorer"?e._switchView("candidate"):e._switchView("scorer")})}},{key:"render",value:function t(){var t;return iC(t2(),this.myTemplate?this.myTemplate({view:(t=this.sessionContext)===null||t===void 0?void 0:t.view}):iR)}}]);return e}(iQ);rr([P({context:oa,subscribe:!0})],l6.prototype,"sessionContext",2),l6=rr([iG("test-view-toggle")],l6);var l8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.view=null;return t}d(e,[{key:"render",value:function t(){var t,e;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!n||!n.variables)return iC(t3());if(n.category==="dep-informational")return iC(t5(),this.dataset.informational);var i=n===null||n===void 0?void 0:(e=n.variables.find(function(t){return t.identifier==="completionStatus"}))===null||e===void 0?void 0:e.value,o=n===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier=="SCORE"}),a=parseFloat(o===null||o===void 0?void 0:o.value),s=n.externalScored;return iC(t4(),i!=="completed"?this.dataset.textNoResponse:!s&&a!==void 0&&!Number.isNaN(a)?a>0?this.dataset.textCorrect:this.dataset.textIncorrect:s==="externalMachine"?Number.isNaN(a)||a===void 0?this.dataset.scoreUnknown:"We hebben je antwoord ".concat(a===0?"geen punten":a==1?"\xe9\xe9n punt":"".concat(a," punten")," gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt."):s==="human"?Number.isNaN(a)?"":"Deze score heb je zelf toegekend.":this.dataset.inProgress)}}]);return e}(iQ);rr([P({context:ot,subscribe:!0})],l8.prototype,"computedContext",2),rr([n({type:String,attribute:"view"})],l8.prototype,"view",2),l8=rr([iG("test-scoring-feedback")],l8);var l7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.addEventListener("click",function(){t.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0})),t.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:!0,bubbles:!0}));var e=t.closest("qti-test").querySelector("test-container");Array.from(e.shadowRoot.querySelectorAll("[view]")).forEach(function(t){t.classList.toggle("show",!0)})});return t}d(e,[{key:"render",value:function t(){return iC(t6())}}]);return e}(iQ);l7.styles=rG(t8(),a4,a6),l7=rr([iG("test-check-item")],l7);var l9,ut,ue,un,ur=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,ut);t.itemURL=null;t.itemDoc=null;t.itemXML=null;ra(t,l9,null);return t}d(e,[{key:"handleItemURLChange",value:function t(){return a(function(){var t,e;return z(this,function(n){switch(n.label){case 0:if(!this.itemURL)return[3,4];n.label=1;case 1:n.trys.push([1,3,,4]);return[4,iZ().load(this.itemURL)];case 2:t=n.sent();this.itemDoc=t.htmlDoc();return[3,4];case 3:e=n.sent();console.error("Error loading or parsing XML:",e);return[3,4];case 4:return[2]}})}).call(this)}},{key:"handleItemXMLChange",value:function t(){if(this.itemXML)try{this.itemDoc=iZ().parse(this.itemXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){i().call(n),rl(this,ut,ue).call(this),rl(this,ut,un).call(this),this.itemURL&&this.handleItemURLChange(),this.itemXML&&this.handleItemXMLChange();return[2]})}).call(this)}},{key:"render",value:function t(){return iC(t9(),ro(this,l9),lW(this.itemDoc,iC(t7())))}}]);return e}(iQ);l9=new WeakMap,ut=new WeakSet,ue=function t(){var t=this.querySelector("template");rs(this,l9,t?t.content:iC(et()))},un=function t(){var t=new CSSStyleSheet;t.replaceSync(lB),this.shadowRoot.adoptedStyleSheets=[t]},rr([n({type:String,attribute:"item-url"})],ur.prototype,"itemURL",2),rr([i()],ur.prototype,"itemDoc",2),rr([i()],ur.prototype,"itemXML",2),rr([V("itemURL",{waitUntilFirstUpdate:!0})],ur.prototype,"handleItemURLChange",1),rr([V("itemXML",{waitUntilFirstUpdate:!0})],ur.prototype,"handleItemXMLChange",1),ur=rr([iG("item-container")],ur);var ui,uo,ua=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,ui);t.label="Correct response mode";t._options={internal:"Internal",full:"Full (copy)"};return t}d(e,[{key:"render",value:function t(){var t=this;return iC(en(),this.label,function(e){var n=e.target;rl(t,ui,uo).call(t,n.value)},Object.keys(this._options).map(function(e){var n;return iC(ee(),e,e===((n=t.itemContext)===null||n===void 0?void 0:n.correctResponseMode),t._options[e])}))}}]);return e}(iQ);ui=new WeakSet,uo=function t(t){this.dispatchEvent(new CustomEvent("item-switch-correct-response-mode",{detail:t,bubbles:!0}))},rr([P({context:oe,subscribe:!0})],ua.prototype,"itemContext",2),rr([n({type:String})],ua.prototype,"label",2),rr([i()],ua.prototype,"_options",2),ua=rr([iG("item-correct-response-mode")],ua);var us=rG(er()),ul=rG(ei(),us),uu=rG(eo()),uc=rG(ea(),us);var ud,uh,up,uf,uv,um=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,up);t.shown=!1;t.disabled=!1;t.showCandidateCorrectionText="Show candidate correction";t.hideCandidateCorrectionText="Hide candidate correction";t.noCorrectResponseText="No correct response specified";ra(t,ud,!1);ra(t,uh,"");return t}d(e,[{key:"updated",value:function t(){var t;if(!ro(this,ud)||ro(this,uh)!==((t=this.computedContext)===null||t===void 0?void 0:t.identifier)){var e,n,i;rs(this,uh,(e=this.computedContext)===null||e===void 0?void 0:e.identifier);var o=!!((n=this.computedContext)===null||n===void 0?void 0:n.variables.some(function(t){return t.correctResponse})),a=!!((i=this.computedContext)===null||i===void 0?void 0:i.variables.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));rs(this,ud,o||a)}this.disabled=!ro(this,ud)}},{key:"render",value:function t(){return iC(es(),rl(this,up,uf),rl(this,up,uv).call(this))}}]);return e}(iQ);ud=new WeakMap,uh=new WeakMap,up=new WeakSet,uf=function t(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-candidate-correction",{detail:!this.shown,bubbles:!0}))},uv=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCandidateCorrectionText:this.showCandidateCorrectionText},um.styles=rG(el(),ul,uu),rr([P({context:i9,subscribe:!0})],um.prototype,"computedContext",2),rr([n({type:Boolean,reflect:!0})],um.prototype,"shown",2),rr([n({type:Boolean,reflect:!0})],um.prototype,"disabled",2),rr([n({type:String})],um.prototype,"showCandidateCorrectionText",2),rr([n({type:String})],um.prototype,"hideCandidateCorrectionText",2),rr([n({type:String})],um.prototype,"noCorrectResponseText",2),um=rr([iG("item-show-candidate-correction")],um);var ug,ub,uy,uw,uq,uk=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,uy);t.shown=!1;t.disabled=!1;t.showCorrectText="Show correct response";t.hideCorrectText="Hide correct response";t.noCorrectResponseText="No correct response specified";ra(t,ug,!1);ra(t,ub,"");return t}d(e,[{key:"updated",value:function t(){var t;if(!ro(this,ug)||ro(this,ub)!==((t=this.computedContext)===null||t===void 0?void 0:t.identifier)){var e,n,i;rs(this,ub,(e=this.computedContext)===null||e===void 0?void 0:e.identifier);var o=!!((n=this.computedContext)===null||n===void 0?void 0:n.variables.some(function(t){return t.correctResponse})),a=!!((i=this.computedContext)===null||i===void 0?void 0:i.variables.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));rs(this,ug,o||a)}this.disabled=!ro(this,ug)}},{key:"render",value:function t(){return iC(eu(),rl(this,uy,uw),rl(this,uy,uq).call(this))}}]);return e}(iQ);ug=new WeakMap,ub=new WeakMap,uy=new WeakSet,uw=function t(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-correct-response",{detail:!this.shown,bubbles:!0}))},uq=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText},uk.styles=rG(ec(),ul,uu),rr([P({context:i9,subscribe:!0})],uk.prototype,"computedContext",2),rr([n({type:Boolean,reflect:!0})],uk.prototype,"shown",2),rr([n({type:Boolean,reflect:!0})],uk.prototype,"disabled",2),rr([n({type:String})],uk.prototype,"showCorrectText",2),rr([n({type:String})],uk.prototype,"hideCorrectText",2),rr([n({type:String})],uk.prototype,"noCorrectResponseText",2),uk=rr([iG("item-show-correct-response")],uk);var ux=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t=this.computedContext;if(!t||!t.variables)return iC(ed());var e=t.variables.filter(function(t){return t.type==="response"}),n=t.variables.filter(function(t){return t.type==="outcome"}),i=function t(t,e){return iC(ep(),e,t.map(function(t){var e,n,i,o;var a=t.correctResponse?Array.isArray(t.correctResponse)?t.correctResponse.join(", "):t.correctResponse:"",s=((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.map(function(t){return"".concat(t.mapKey,"=").concat(t.mappedValue,"pt")}).join(", "))||"",l=((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.map(function(t){return"".concat(t.shape,"(").concat(t.coords,")=").concat(t.mappedValue,"pt")}).join(", "))||"";return iC(eh(),t.identifier,Array.isArray(t.value)?t.value.join(", "):t.value,t.cardinality,t.baseType,a||s||l)}))};return iC(ef(),i(e,"Response Variables"),i(n,"Outcome Variables"))}}]);return e}(iQ);ux.styles=rG(ev()),rr([P({context:i9,subscribe:!0})],ux.prototype,"computedContext",2),ux=rr([iG("item-print-variables")],ux);var u_,uC,uE,uS,uA,uR,uI,uM,uT,uP,uO,uL,uU,uN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,uI);ra(t,u_);t.configContext={};ra(t,uC,rl(t,uI,uM).bind(t));ra(t,uE,rl(t,uI,uT).bind(t));ra(t,uS,rl(t,uI,uP).bind(t));ra(t,uA,rl(t,uI,uO).bind(t));ra(t,uR,rl(t,uI,uL).bind(t));t.addEventListener("qti-item-context-updated",ro(t,uC)),t.addEventListener("qti-assessment-item-connected",ro(t,uE)),t.addEventListener("item-show-correct-response",ro(t,uS)),t.addEventListener("item-show-candidate-correction",ro(t,uA)),t.addEventListener("item-switch-correct-response-mode",ro(t,uR));return t}d(e,[{key:"render",value:function t(){return iC(em())}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-item-context-changed",ro(this,uC)),this.removeEventListener("qti-assessment-item-connected",ro(this,uE))}}]);return e}(iQ);u_=new WeakMap,uC=new WeakMap,uE=new WeakMap,uS=new WeakMap,uA=new WeakMap,uR=new WeakMap,uI=new WeakSet,uM=function t(t){var e,n;rl(this,uI,uU).call(this,t.detail.itemContext.identifier,((n=t.detail)===null||n===void 0?void 0:(e=n.itemContext)===null||e===void 0?void 0:e.variables)||[])},uT=function t(t){var e,n;var i=t.detail._context.variables;rs(this,u_,t.detail),this.computedContext=((e=this.computedContext)===null||e===void 0?void 0:e.identifier)===ro(this,u_).identifier?_(k({},this.computedContext),{title:ro(this,u_).title}):{identifier:ro(this,u_).identifier,title:ro(this,u_).title,adaptive:((n=ro(this,u_).getAttribute("adaptive"))===null||n===void 0?void 0:n.toLowerCase())==="true"||!1,variables:i,correctResponseMode:"internal"},rl(this,uI,uU).call(this,ro(this,u_).identifier,i||[])},uP=function t(t){ro(this,u_)&&ro(this,u_).showCorrectResponse(t.detail)},uO=function t(t){ro(this,u_)&&ro(this,u_).showCandidateCorrection(t.detail)},uL=function t(t){rl(this,uI,uP).call(this,new CustomEvent("item-show-correct-response",{detail:!1,bubbles:!0})),this.configContext=_(k({},this.configContext),{correctResponseMode:t.detail})},uU=function t(t,e){var n,i;var o=e===null||e===void 0?void 0:(n=e.find(function(t){return t.identifier=="SCORE"}))===null||n===void 0?void 0:n.value,a=parseFloat(o===null||o===void 0?void 0:o.toString()),s=e===null||e===void 0?void 0:(i=e.find(function(t){return t.identifier==="completionStatus"}))===null||i===void 0?void 0:i.value,l=a!==void 0&&!isNaN(a)&&a>0,u=a!==void 0&&!isNaN(a)&&a<=0,c=s==="completed";this.computedContext=_(k({},this.computedContext),{identifier:t,correct:l,incorrect:u,completed:c,variables:e})},rr([i(),T({context:i9})],uN.prototype,"computedContext",2),rr([i(),T({context:oe})],uN.prototype,"configContext",2),uN=rr([iG("qti-item")],uN);var uD=function t(t,e,n){var i=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(t);return i};var uV=function t(t,e,i,o){var u=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){l(this,n);var t;t=s(this,n,arguments);t.observer=null;t.droppableObsever=null;t.resizeObserver=null;t.draggables=[];t.droppables=[];t.dragContainers=[];t.dragClone=null;t.dragSource=null;t.touchStartPoint=null;t.isDraggable=!1;t.cloneOffset={x:0,y:0};t.isDragging=!1;t.allDropzones=[];t.lastTarget=null;t.currentDropTarget=null;t.dragMoveRaf=0;t.pendingMove=null;t.dragBounds=null;t.dragCloneRect=null;t.dropzoneRects=new Map;t.dropzoneRectsDirty=!1;t.dragBoundsDirty=!1;t.dragCloneStyleCache=new WeakMap;t.onScrollOrResize=function(){t.dropzoneRectsDirty=!0,t.dragBoundsDirty=!0,t.dragBoundsDirty=!0};t.onMove=t.handleTouchMove.bind(t);t.onEnd=t.handleTouchEnd.bind(t);t.onCancel=t.handleTouchCancel.bind(t);t.MIN_DRAG_DISTANCE=5;t.DRAG_CLONE_OPACITY=1;t.MAX_DRAGGABLE_WIDTH=600;t.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"};t.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};t.minAssociations=1;t.maxAssociations=0;t.draggablesModified=function(e,n){if(t.isMatchTabular())return;var i=true,o=false,a=undefined;try{var s=function(){var e=u.value;t.draggables.includes(e)&&(t.draggables=t.draggables.filter(function(t){return t!==e}),e.removeAttribute("tabindex"),e.removeEventListener("touchstart",t.handleTouchStart.bind(t)),e.removeEventListener("mousedown",t.handleTouchStart.bind(t)))};for(var l=n[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}var c=true,d=false,h=undefined;try{for(var p=e[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;t.draggables.includes(v)||(t.draggables.push(v),v.setAttribute("tabindex","0"),v.hasTouchStartListener||(v.addEventListener("touchstart",t.handleTouchStart.bind(t),{passive:!1}),v.addEventListener("mousedown",t.handleTouchStart.bind(t),{passive:!1}),v.hasTouchStartListener=!0))}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}var m=0;t.draggables.forEach(function(e){e.style.viewTransitionName="drag-".concat(m,"-").concat(t.getAttribute("identifier")||crypto.randomUUID()),e.setAttribute("qti-draggable","true"),m++})};t.droppablesModified=function(e,n){if(!t.isMatchTabular()){var i=true,o=false,a=undefined;try{var s=function(){var e=u.value;t.droppables.includes(e)&&(t.droppables=t.droppables.filter(function(t){return t!==e}),t.allDropzones=t.allDropzones.filter(function(t){return t!==e}))};for(var l=n[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}var c=true,d=false,h=undefined;try{for(var p=e[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;t.droppables.includes(v)||(t.droppables.push(v),t.allDropzones.push(v))}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}var m=true,g=false,b=undefined;try{for(var y=t.droppables[Symbol.iterator](),w;!(m=(w=y.next()).done);m=true){var q=w.value;t.dataset.choicesContainerWidth&&(q.style.width="".concat(t.dataset.choicesContainerWidth,"px"),q.style.boxSizing="border-box")}}catch(t){g=true;b=t}finally{try{if(!m&&y.return!=null){y.return()}}finally{if(g){throw b}}}t.dropzoneRectsDirty=!0,t.dragBoundsDirty=!0}};return t}d(n,[{key:"handleDraggableContainerChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.dragContainersModified(t||[],e||[])}},{key:"dragContainersModified",value:function t(t,e){var n=true,i=false,o=undefined;try{var a,s=function(){var t=u.value;a.dragContainers.includes(t)&&(a.dragContainers=a.dragContainers.filter(function(e){return e!==t}),a.allDropzones=a.allDropzones.filter(function(e){return e!==t}))};for(var l=e[Symbol.iterator](),u;!(n=(u=l.next()).done);n=true)a=this,s()}catch(t){i=true;o=t}finally{try{if(!n&&l.return!=null){l.return()}}finally{if(i){throw o}}}var c=true,d=false,h=undefined;try{for(var p=t[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;this.dragContainers.includes(v)||(this.dragContainers.push(v),this.allDropzones.push(v))}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}this.dropzoneRectsDirty=!0,this.dragBoundsDirty=!0}},{key:"handleDraggablesChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.draggablesModified(t||[],e||[])}},{key:"handleDroppablesChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.droppablesModified(t||[],e||[])}},{key:"firstUpdated",value:function t(){var t=this;var a,s,l;if(p(f(n.prototype),"firstUpdated",this).call(this),this.isMatchTabular())return;this.hasAttribute("disabled")||(document.addEventListener("mousemove",this.onMove,{passive:!1}),document.addEventListener("mouseup",this.onEnd,{passive:!1}),document.addEventListener("touchmove",this.onMove,{passive:!1}),document.addEventListener("touchend",this.onEnd,{passive:!1}),document.addEventListener("touchcancel",this.onCancel,{passive:!1}));var u=Array.from(this.querySelectorAll(e)||[]).concat(Array.from(((a=this.shadowRoot)===null||a===void 0?void 0:a.querySelectorAll(e))||[])),c=Array.from(this.querySelectorAll(i)||[]).concat(Array.from(((s=this.shadowRoot)===null||s===void 0?void 0:s.querySelectorAll(i))||[])),d=Array.from(this.querySelectorAll(o)||[]).concat(Array.from(((l=this.shadowRoot)===null||l===void 0?void 0:l.querySelectorAll(o))||[]));this.dragContainersModified(d,[]),this.droppablesModified(c,[]),this.draggablesModified(u,[]),this.updateMinDimensionsForDropZones(),this.observer=new MutationObserver(function(){return t.updateMinDimensionsForDropZones()}),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(function(){return t.updateMinDimensionsForDropZones()}),this.querySelectorAll("qti-gap-text").forEach(function(e){var n;return(n=t.resizeObserver)===null||n===void 0?void 0:n.observe(e)})}},{key:"moveDraggableToDroppable",value:function t(t,e){return a(function(){return z(this,function(n){if(this.isMatchTabular())return[2];t.style.transform="translate(0, 0)",e.tagName==="SLOT"?t.setAttribute("slot",e.getAttribute("name")):e.appendChild(t),this.checkAllMaxAssociations(),this.saveResponse();return[2]})}).call(this)}},{key:"activateDroppable",value:function t(t){this.dragContainers.includes(t)?(this._internals.states.add("--dragzone-active"),t.setAttribute("active","")):(this._internals.states.delete("--dragzone-active"),t.setAttribute("active",""))}},{key:"deactivateDroppable",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e&&this._internals.states.add("--dragzone-active"),t.removeAttribute("active")}},{key:"connectedCallback",value:function t(){p(f(n.prototype),"connectedCallback",this).call(this)}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"updateMinDimensionsForDropZones",value:function t(){return a(function(){var t,n,a,s,l,u,c,d,h,p,f,v,m,g,b,y,w,q,k,x,_,C,E,S,A,R,I;return z(this,function(M){switch(M.label){case 0:return[4,this.updateComplete];case 1:if(M.sent(),this.isMatchTabular())return[2];this.dropzoneRectsDirty=!0;a=this.querySelectorAll(e),s=this.querySelector(o)||((t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector(o)),l=this.querySelectorAll(i),u=(n=l[0])===null||n===void 0?void 0:n.parentElement,c=this.determineMaxWidth(s,u),d=0,h=0;p=true,f=false,v=undefined;M.label=2;case 2:M.trys.push([2,7,8,9]);m=a[Symbol.iterator]();M.label=3;case 3:if(!!(p=(g=m.next()).done))return[3,6];b=g.value;b.style.maxWidth=c+"px";return[4,this.measureIntrinsicSize(b)];case 4:y=M.sent(),w=y.width,q=y.height;d=Math.max(d,q),h=Math.max(h,w);M.label=5;case 5:p=true;return[3,3];case 6:return[3,9];case 7:k=M.sent();f=true;v=k;return[3,9];case 8:try{if(!p&&m.return!=null){m.return()}}finally{if(f){throw v}}return[7];case 9:u&&(u.style.gridTemplateColumns="repeat(auto-fit, minmax(calc(min(".concat(c,"px,").concat(h,"px + 2 * var(--qti-dropzone-padding))), 1fr))")),s&&(s.style.minHeight="".concat(d,"px"));x=true,_=false,C=undefined;try{for(E=l[Symbol.iterator]();!(x=(S=E.next()).done);x=true){A=S.value;A.style.minHeight="".concat(d,"px"),A.style.minWidth="".concat(h,"px");I=(R=A.shadowRoot)===null||R===void 0?void 0:R.querySelector('slot[part="dropslot"]');I&&(I.style.minHeight="".concat(d,"px"))}}catch(t){_=true;C=t}finally{try{if(!x&&E.return!=null){E.return()}}finally{if(_){throw C}}}return[2]}})}).call(this)}},{key:"determineMaxWidth",value:function t(t,e){var n=e!==null&&e!==void 0?e:t;if(!n||n.clientWidth==0)return this.MAX_DRAGGABLE_WIDTH;var i=window.getComputedStyle(n),o=parseFloat(i.paddingLeft),a=parseFloat(i.paddingRight);return Math.min(this.MAX_DRAGGABLE_WIDTH,n.clientWidth-o-a)}},{key:"measureIntrinsicSize",value:function t(t){return a(function(){var e,n;return z(this,function(i){e=t.style.position;t.style.position="fixed";n=t.getBoundingClientRect();return[2,(t.style.position=e,{width:n.width,height:n.height})]})})()}},{key:"activateDroppables",value:function t(t){if(this.isMatchTabular())return;this.dragContainers.forEach(function(e){e.setAttribute("enabled",""),e.hasAttribute("disabled")&&(e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t))&&e.removeAttribute("disabled")}),this.droppables.forEach(function(e){e.setAttribute("enabled",""),e.hasAttribute("disabled")&&(e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t))&&e.removeAttribute("disabled")})}},{key:"activateDragLocation",value:function t(){this._internals.states.add("--dragzone-enabled")}},{key:"deactivateDragLocation",value:function t(){this._internals.states.delete("--dragzone-enabled")}},{key:"deactivateDroppables",value:function t(){this.dragContainers.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active")}),this.droppables.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active")})}},{key:"disconnectedCallback",value:function t(){p(f(n.prototype),"disconnectedCallback",this).call(this),this.observer&&(this.observer.disconnect(),this.observer=null),this.droppableObsever&&(this.droppableObsever.disconnect(),this.droppableObsever=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),document.removeEventListener("mousemove",this.onMove),document.removeEventListener("mouseup",this.onEnd),document.removeEventListener("touchmove",this.onMove),document.removeEventListener("touchend",this.onEnd),document.removeEventListener("touchcancel",this.onCancel),window.removeEventListener("scroll",this.onScrollOrResize,!0),window.removeEventListener("resize",this.onScrollOrResize)}},{key:"handleTouchMove",value:function t(t){if(!this.isMatchTabular()&&this.isDraggable&&this.dragClone){var e=this.getEventCoordinates(t),n=e.x,i=e.y;this.pendingMove={clientX:n,clientY:i},this.scheduleDragMove(),t.preventDefault()}}},{key:"scheduleDragMove",value:function t(){var t=this;this.dragMoveRaf||(this.dragMoveRaf=requestAnimationFrame(function(){if(t.dragMoveRaf=0,!t.pendingMove)return;var e=t.pendingMove;t.pendingMove=null,t.processDragMove(e),t.pendingMove&&t.scheduleDragMove()}))}},{key:"processDragMove",value:function t(t){if(!this.isDraggable||!this.dragClone||!this.touchStartPoint||(this.calculateDragDistance(t)>=this.MIN_DRAG_DISTANCE&&(this.isDragging=!0),!this.isDragging))return;this.updateDragClonePosition(t),this.dropzoneRectsDirty&&this.refreshDropzoneRects();var e=this.findClosestDropzone();this.currentDropTarget=e,e!==this.lastTarget&&(this.lastTarget&&(this.deactivateDroppable(this.lastTarget),this.dispatchCustomEvent(this.lastTarget,"dragleave")),e&&(this.activateDroppable(e),this.dispatchCustomEvent(e,"dragenter")),this.lastTarget=e),this.currentDropTarget&&this.dispatchCustomEvent(this.currentDropTarget,"dragover")}},{key:"handleTouchEnd",value:function t(t){this.isMatchTabular()||((this.isDragging||this.isDraggable||this.dragClone)&&this.resetDragState(),this._internals.states.delete("--dragzone-active"),this.checkAllMaxAssociations(),this._internals.states.delete("--dragzone-enabled"),this._internals.states.delete("--dragzone-active"),this.deactivateDragLocation(),this.deactivateDroppables(),this.draggables.forEach(function(t){t.removeAttribute("dragging")}),t.preventDefault())}},{key:"handleTouchCancel",value:function t(t){this.resetDragState()}},{key:"validate",value:function t(){if(this.isMatchTabular())return null;if(!this.shadowRoot)return!1;var t=this.getValidAssociations(),e=!0,n="";this.maxAssociations>0&&t>this.maxAssociations?(e=!1,n=this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,".")):this.minAssociations>0&&t<this.minAssociations&&(e=!1,n=this.dataset.minSelectionsMessage||"You haven't selected enough associations. Minimum required is ".concat(this.minAssociations,"."));var i=this.lastElementChild;return this._internals.setValidity(e?{}:{customError:!0},n,i),e}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("#validation-message");return t&&(this._internals.validity.valid?(t.textContent="",t.style.display="none"):(t.textContent=this._internals.validationMessage,t.style.setProperty("display","block","important"))),this._internals.validity.valid}},{key:"checkMaxAssociations",value:function t(t){var e=this.getMatchMaxValue(t),n=t.querySelectorAll('[qti-draggable="true"]').length;return!(e===0)&&n>=e}},{key:"dropDraggableInDroppable",value:function t(t,e){var n=t.cloneNode(!0);n.removeAttribute("style"),this.moveDraggableToDroppable(n,e),this.draggablesModified([n],[]);var i=this.getMatchMaxValue(t),o=this.draggables.filter(function(e){return e.getAttribute("identifier")===t.getAttribute("identifier")});i!==0&&o.length>=i?(t.style.opacity="0.0",t.style.pointerEvents="none"):t.style.opacity="1.0"}},{key:"resetDragState",value:function t(){if(this.dragMoveRaf&&(cancelAnimationFrame(this.dragMoveRaf),this.dragMoveRaf=0),this.pendingMove=null,this.dragClone){var t=this.currentDropTarget!==null,e=!t||this.dragContainers.includes(this.currentDropTarget);t&&this.currentDropTarget&&!e&&this.dropDraggableInDroppable(this.dragSource,this.currentDropTarget),e&&(this.dragSource.style.opacity="1.0",this.dragSource.style.display="block",this.dragSource.style.position="static",this.dragSource.style.pointerEvents="auto",this.saveResponse()),this.dragClone.remove(),this.draggablesModified([],[this.dragClone])}this.isDragging=!1,this.isDraggable=!1,this.dragSource=null,this.dragClone=null,this.touchStartPoint=null,this.currentDropTarget=null,this.lastTarget=null,this.dragBounds=null,this.dragCloneRect=null,this.dropzoneRects.clear(),this.dropzoneRectsDirty=!1,this.dragBoundsDirty=!1,window.removeEventListener("scroll",this.onScrollOrResize,!0),window.removeEventListener("resize",this.onScrollOrResize),this.deactivateDroppables()}},{key:"checkAllMaxAssociations",value:function t(){var t=this;var e=this.getValidAssociations(),n=this.maxAssociations!==0&&e>=this.maxAssociations;this.droppables.forEach(function(e){n?t.disableDroppable(e):t.checkMaxAssociations(e)?t.disableDroppable(e):t.enableDroppable(e)})}},{key:"getMatchMaxValue",value:function t(t){var e=t.getAttribute("match-max");return e?parseInt(e,10):1}},{key:"disableDroppable",value:function t(t){t.setAttribute("disabled","")}},{key:"enableDroppable",value:function t(t){t.removeAttribute("disabled")}},{key:"response",get:function t(){var t;return typeof this.getResponse=="function"?t=this.getResponse():t=this.collectResponseData(),t.join(",")},set:function t(t){var e=this;if(!this.isMatchTabular())if(typeof this.getValue=="function"&&(t=this.getValue(t)),Array.isArray(t)){this.reset(!1),t===null||t===void 0?void 0:t.forEach(function(t){return e.placeResponse(t)});var n=new FormData;t.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(t||"")}},{key:"placeResponse",value:function t(t){var e=this;var n=O(t.split(" ").reverse()),i=n[0],o=n.slice(1),a=Array.from(this.draggables),s=Array.from(this.droppables);o.forEach(function(t){if(t==="")return;var n=a.find(function(e){return e.getAttribute("identifier")===t}),o=s.find(function(t){return t.getAttribute("identifier")===i});e.dropDraggableInDroppable(n,o)})}},{key:"getValidAssociations",value:function t(){var t=0;var e=true,n=false,i=undefined;try{for(var o=this.droppables[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;t=t+this.getDraggablesFromDroppable(s).length}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}return t}},{key:"saveResponse",value:function t(){var t;typeof this.getResponse=="function"?t=this.getResponse():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(){var t=this;return this.droppables.map(function(e){var n=t.getDraggablesFromDroppable(e).map(function(t){return t.getAttribute("identifier")}),i=e.getAttribute("identifier");return n.map(function(t){return"".concat(t," ").concat(i)})}).flat()}},{key:"getDraggablesFromDroppable",value:function t(t){return this.draggables.map(function(t){return t.getAttribute("identifier")}).filter(function(t,e,n){return n.indexOf(t)===e}).flatMap(function(e){return Array.from(t.querySelectorAll("[identifier='".concat(e,"']")))}).filter(function(t){return!!t}).map(function(t){return t})}},{key:"reset",value:function t(){var t=this;var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.droppables.forEach(function(e){t.getDraggablesFromDroppable(e).forEach(function(e){e.remove(),t.draggablesModified([],[e])})}),this.dragContainers.forEach(function(t){Array.from(t.querySelectorAll('[qti-draggable="true"]')).forEach(function(t){t.style.opacity="1.0"})}),this.dragClone=null,this.dragSource=null,this.isDragging=!1,this.isDraggable=!1,this.currentDropTarget=null,this.lastTarget=null,e&&this.saveResponse()}},{key:"updateDragClonePosition",value:function t(t){var e,n;var i,o,a,s;if(!this.isDragging||!this.dragClone)return;(this.dragBoundsDirty||!this.dragBounds)&&this.refreshDragBounds();var l=t.clientX-this.cloneOffset.x,u=t.clientY-this.cloneOffset.y,c=this.applyInteractionBoundaries(l,u),d=c.newLeft,h=c.newTop;this.dragClone.style.left="".concat(d,"px"),this.dragClone.style.top="".concat(h,"px");var p=(e=(i=this.dragBounds)===null||i===void 0?void 0:i.width)!==null&&e!==void 0?e:(o=this.dragCloneRect)===null||o===void 0?void 0:o.width,f=(n=(a=this.dragBounds)===null||a===void 0?void 0:a.height)!==null&&n!==void 0?n:(s=this.dragCloneRect)===null||s===void 0?void 0:s.height;if(!p||!f){var v=this.dragClone.getBoundingClientRect();p=v.width,f=v.height}this.dragCloneRect={left:d,top:h,right:d+p,bottom:h+f,width:p,height:f}}},{key:"applyInteractionBoundaries",value:function t(t,e){if(!this.dragBounds)return{newLeft:t,newTop:e};var n=Math.max(this.dragBounds.minLeft,Math.min(t,this.dragBounds.maxLeft)),i=Math.max(this.dragBounds.minTop,Math.min(e,this.dragBounds.maxTop));return{newLeft:n,newTop:i}}},{key:"refreshDragBounds",value:function t(){if(!this.dragClone)return;var t=this.getBoundingClientRect(),e=this.dragClone.getBoundingClientRect();this.dragBounds={minLeft:t.left,maxLeft:t.right-e.width,minTop:t.top,maxTop:t.bottom-e.height,width:e.width,height:e.height},this.dragCloneRect={left:e.left,top:e.top,right:e.left+e.width,bottom:e.top+e.height,width:e.width,height:e.height},this.dragBoundsDirty=!1}},{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:"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:"refreshDropzoneRects",value:function t(){this.dropzoneRects.clear();var t=this.allDropzones.filter(function(t){return!t.hasAttribute("disabled")});var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;this.dropzoneRects.set(s,this.getDropzoneRect(s))}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}this.dropzoneRectsDirty=!1}},{key:"getCachedDropzoneRect",value:function t(t){var e=this.dropzoneRects.get(t);if(e)return e;var n=this.getDropzoneRect(t);return this.dropzoneRects.set(t,n),n}},{key:"getDropzoneRect",value:function t(t){var e;var n;return((e=(n=t.shadowRoot)===null||n===void 0?void 0:n.querySelector('slot[part="dropslot"]'))!==null&&e!==void 0?e:t).getBoundingClientRect()}},{key:"findClosestDropzone",value:function t(){var t=this;var e;var n=this.allDropzones.filter(function(t){return!t.hasAttribute("disabled")});if(!this.dragClone||n.length===0)return null;var i=(e=this.dragCloneRect)!==null&&e!==void 0?e:this.dragClone.getBoundingClientRect(),o=null,a=0,s=function e(e){var n=true,s=false,l=undefined;try{for(var u=e[Symbol.iterator](),c;!(n=(c=u.next()).done);n=true){var d=c.value;var h=t.getCachedDropzoneRect(d),p=t.calculateOverlapArea(i,h);p>a&&(a=p,o=d)}}catch(t){s=true;l=t}finally{try{if(!n&&u.return!=null){u.return()}}finally{if(s){throw l}}}};if(s(this.droppables.filter(function(t){return!t.hasAttribute("disabled")})),o||s(this.dragContainers.filter(function(t){return!t.hasAttribute("disabled")})),!o){var l=Number.POSITIVE_INFINITY;var u=true,c=false,d=undefined;try{for(var h=n[Symbol.iterator](),p;!(u=(p=h.next()).done);u=true){var f=p.value;var v=this.getCachedDropzoneRect(f),m=Math.hypot(i.left-v.left,i.top-v.top);m<l&&(l=m,o=f)}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}}return o}},{key:"calculateOverlapArea",value:function t(t,e){var n=Math.max(0,Math.min(t.right,e.right)-Math.max(t.left,e.left)),i=Math.max(0,Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top));return n*i}},{key:"getComputedStyleText",value:function t(t){var e=this.dragCloneStyleCache.get(t);if(e)return e;var n=window.getComputedStyle(t),i="";for(var o=0;o<n.length;o++){var a=n[o];i+="".concat(a,":").concat(n.getPropertyValue(a),";")}return this.dragCloneStyleCache.set(t,i),i}},{key:"dispatchCustomEvent",value:function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t)return;var i=new CustomEvent(e,{bubbles:n,cancelable:!0});i.dataTransfer=this.dataTransfer,t.dispatchEvent(i)}},{key:"appendClone",value:function t(){var t;((t=document.fullscreenElement)!==null&&t!==void 0?t:document.body).appendChild(this.dragClone)}},{key:"handleTouchStart",value:function t(t){var e=this;if(this.isMatchTabular()||m(t,MouseEvent)&&t.button!==0||this.isDragging)return;var n=this.getEventCoordinates(t),i=n.x,o=n.y;this.touchStartPoint={x:i,y:o},this.dragSource=t.currentTarget,this.isDraggable=!0,this._internals.states.add("--dragzone-enabled"),this._internals.states.add("--dragzone-active"),this.activateDragLocation(),this.activateDroppables(this.dragSource);var a=this.findDraggableInDraggableContainer(this.dragSource.getAttribute("identifier")),s=this.droppables.some(function(t){return Array.from(t.children).some(function(t){return t===e.dragSource})}),l=this.dragSource.getBoundingClientRect();s&&(this.dragSource.remove(),this.draggablesModified([],[this.dragSource]),this.dragSource=a),this.cloneOffset.x=i-l.left,this.cloneOffset.y=o-l.top,this.dragClone=a.cloneNode(!0),this.configuration.copyStylesDragClone&&(this.dragClone.style.cssText=this.getComputedStyleText(a));var u=a.getBoundingClientRect();this.dragClone.style.width="".concat(u.width,"px"),this.dragClone.style.height="".concat(u.height,"px"),l&&this.setDragCloneStyles(l),this.dragClone.style.display="block",this.dragClone.style.opacity="1",this.appendClone(),this.refreshDragBounds(),this.refreshDropzoneRects(),window.addEventListener("scroll",this.onScrollOrResize,!0),window.addEventListener("resize",this.onScrollOrResize);var c=this.getMatchMaxValue(this.dragSource),d=this.draggables.filter(function(t){return t.getAttribute("identifier")===e.dragSource.getAttribute("identifier")});c!==0&&d.length>=c?(a.style.opacity="0.0",a.style.pointerEvents="none"):a.style.opacity="1.0",t.preventDefault(),this.dragClone.setAttribute("dragging","")}},{key:"findDraggableInDraggableContainer",value:function t(t){var n=this.dragContainers.flat();var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;if(u.getAttribute("identifier")===t)return u;var c=void 0;m(u,HTMLSlotElement)?c=Array.from((u===null||u===void 0?void 0:u.assignedElements())||[]):c=Array.from(u.querySelectorAll(e));var d=c.find(function(e){return e.getAttribute("identifier")===t});if(d)return d}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}},{key:"setDragCloneStyles",value:function t(t){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(t.top,"px"),this.dragClone.style.left="".concat(t.left,"px"),this.dragClone.style.setProperty("box-sizing","border-box","important"),this.dragClone.style.zIndex="9999",this.dragClone.style.pointerEvents="none",this.dragClone.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone.style.display="block"}}]);return n}(uD(t,i,e));return rr([n({attribute:!1,type:Object})],u.prototype,"configuration",2),rr([n({type:Number,reflect:!0,attribute:"min-associations"})],u.prototype,"minAssociations",2),rr([n({type:Number,reflect:!0,attribute:"max-associations"})],u.prototype,"maxAssociations",2),rr([N(o)],u.prototype,"handleDraggableContainerChange",1),rr([N(e)],u.prototype,"handleDraggablesChange",1),rr([N(i)],u.prototype,"handleDroppablesChange",1),u};var uz=rG(eg());var u$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._childrenMap=[];t._registerChoiceHandler=t._registerChoice.bind(t),t.addEventListener("register-qti-simple-associable-choice",t._registerChoiceHandler);return t}d(e,[{key:"_registerChoice",value:function t(t){var e=t.target;this._childrenMap.push(e)}},{key:"render",value:function t(){return iC(ey(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(t,e){return iC(eb(),e,e,e,e)}))}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return e}(uV(oT,"qti-simple-associable-choice",".dl","slot[name='qti-simple-associable-choice']"));u$.styles=uz,rr([i()],u$.prototype,"_childrenMap",2);customElements.define("qti-associate-interaction",u$);var uW=function t(t,e){var a=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){l(this,n);var t;t=s(this,n,arguments);t._choiceElements=[];t._mutationObserver=null;t._validationMessageShown=!1;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.response="";t._handleValueChange=function(){t._internals.setFormValue(t.value),t._updateChoiceSelection()};return t}d(n,[{key:"_handleMaxChoicesChange",value:function t(t,e){this._determineInputType()}},{key:"value",get:function t(){return Array.isArray(this.response)&&this.response.length===0||this.response===""?null:Array.isArray(this.response)?this.response.join(","):this.response},set:function t(t){this.maxChoices>1&&(typeof t=="string"||t===null)?this.response=t?t.toString().split(","):[]:this.response=t||""}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.correctResponse;if(e){var n=Array.isArray(e)?e:[e];this._choiceElements.forEach(function(e){e.internals.states.delete("correct-response"),e.internals.states.delete("incorrect-response"),t&&n.length>0&&(n.includes(e.identifier)?e.internals.states.add("correct-response"):e.internals.states.add("incorrect-response"))})}}},{key:"toggleCandidateCorrection",value:function t(t){var e=this.correctResponse;if(!e)return;var i=Array.isArray(e)?e:[e],o=this.response,a=Array.isArray(o)?o:o?[o]:[];this._choiceElements.forEach(function(e){e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),t&&a.includes(e.identifier)&&(i.includes(e.identifier)?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect"))}),p(f(n.prototype),"toggleCandidateCorrection",this).call(this,t)}},{key:"connectedCallback",value:function t(){var t=this;p(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-".concat(e),this._choiceElementSelectedHandler),this._mutationObserver=new MutationObserver(function(){return t._syncChoicesFromDOM()}),this._mutationObserver.observe(this,{childList:!0,subtree:!0}),this._syncChoicesFromDOM()}},{key:"disconnectedCallback",value:function t(){p(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-".concat(e),this._choiceElementSelectedHandler),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)}},{key:"_syncChoicesFromDOM",value:function t(){var t=this;var n=new Set(this._choiceElements);this._choiceElements=Array.from(this.querySelectorAll(e)),this._choiceElements.forEach(function(e){n.has(e)||(t.disabled&&(e.disabled=!0),e.readonly=t.readonly,e.internals&&!e.internals.ariaChecked&&(e.internals.ariaChecked="false"),t._setInputType(e))});var i=new Set(this._choiceElements.map(function(t){return t.identifier}));if(Array.isArray(this.response)){var o=this.response.filter(function(t){return i.has(t)});o.length!==this.response.length&&(this.response=o)}else this.response&&!i.has(this.response)&&(this.response="");this._updateChoiceSelection()}},{key:"validate",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).length,n=!0,i="";this.maxChoices!==0&&e>this.maxChoices?(n=!1,i=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"option":"options",".")):e<this.minChoices&&(n=!1,i=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"option":"options","."));var o=this._choiceElements.find(function(e){return t.contains(e)})||this;return this._internals.setValidity(n?{}:{customError:!0},i,o),n}},{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.setProperty("display","block","important"),this._validationMessageShown=!0)),this._internals.validity.valid}},{key:"_determineInputType",value:function t(){var t=this;this._choiceElements.forEach(function(e){t._setInputType(e)})}},{key:"_setInputType",value:function t(t){if(this._internals.role=this.maxChoices===1?"radiogroup":null,t.internals){var e=this.maxChoices===1?"radio":"checkbox";t.internals.role=e,t.internals.states.delete(e==="radio"?"checkbox":"radio"),t.internals.states.add(e)}}},{key:"_choiceElementSelectedHandler",value:function t(t){var e=this;var n;this._toggleChoiceChecked(t.target),this.maxChoices===1?this._choiceElements.forEach(function(n){n.identifier!==t.detail.identifier&&e._setChoiceChecked(n,!1)}):this.maxChoices!==0&&((n=this._configContext)===null||n===void 0?void 0:n.disableAfterIfMaxChoicesReached)&&(this._choiceElements.filter(function(t){return e._getChoiceChecked(t)}).length>=this.maxChoices?this._choiceElements.forEach(function(t){e._getChoiceChecked(t)||(t.disabled=!0)}):this._choiceElements.forEach(function(t){return t.disabled=!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.response=this.maxChoices===1?e[0]||"":e,this.validate(),this._validationMessageShown&&(this.reportValidity(),this._internals.validity.valid&&(this._validationMessageShown=!1)),this.saveResponse(this.response)}},{key:"_updateChoiceSelection",value:function t(){var t=this;var e=Array.isArray(this.response)?this.response:[this.response];this._choiceElements.forEach(function(n){var i=e.includes(n.identifier);t._setChoiceChecked(n,i)})}}]);return n}(t);return rr([o("#validation-message")],a.prototype,"_validationMessageElement",2),rr([n({type:Number,attribute:"min-choices"})],a.prototype,"minChoices",2),rr([n({type:Number,attribute:"max-choices"})],a.prototype,"maxChoices",2),rr([V("maxChoices",{waitUntilFirstUpdate:!0})],a.prototype,"_handleMaxChoicesChange",1),rr([V("disabled",{waitUntilFirstUpdate:!0})],a.prototype,"_handleDisabledChange",2),rr([V("readonly",{waitUntilFirstUpdate:!0})],a.prototype,"_handleReadonlyChange",2),rr([i()],a.prototype,"response",2),rr([V("response",{waitUntilFirstUpdate:!0})],a.prototype,"_handleValueChange",2),rr([i(),P({context:oe,subscribe:!0})],a.prototype,"_configContext",2),a};var uB=function t(t,e){var i=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(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"];t._mutationObserver=null;return t}d(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){p(f(e.prototype),"updated",this).call(this,t),this._addLabels()}},{key:"connectedCallback",value:function t(){var t=this;p(f(e.prototype),"connectedCallback",this).call(this),this._mutationObserver=new MutationObserver(function(){return t._addLabels()}),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}},{key:"disconnectedCallback",value:function t(){var t;p(f(e.prototype),"disconnectedCallback",this).call(this),(t=this._mutationObserver)===null||t===void 0?void 0:t.disconnect(),this._mutationObserver=null}},{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(t){return!isNaN(+t)};if(e){var i=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 o=0;o<i.length;o++)i[o].marker=this._getLabel(o+1)}}},{key:"_getLabel",value:function t(t){var e=this;var n=this._classes.filter(function(t){return e._allLabels.includes(t)}).pop(),i=this._classes.filter(function(t){return e._allLabelSuffixes.includes(t)}).pop();!n&&i&&(n="qti-labels-upper-alpha");var o="";switch(n){case"qti-labels-decimal":o="".concat(t);break;case"qti-labels-lower-alpha":o="".concat(String.fromCharCode(97+t-1));break;case"qti-labels-upper-alpha":o="".concat(String.fromCharCode(65+t-1));break}return i==="qti-labels-suffix-period"?o+=".":i==="qti-labels-suffix-parenthesis"&&(o+=")"),o}}]);return e}(t);return rr([n({type:String})],i.prototype,"class",1),i};var uj=rG(ew());var uF,uQ,uH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,uF);t.orientation="vertical";return t}d(e,[{key:"render",value:function t(){return iC(eq(),rl(this,uF,uQ))}}]);return e}(uB(uW(oT,"qti-simple-choice"),"qti-simple-choice"));uF=new WeakSet,uQ=function t(){var t=this.querySelectorAll("qti-simple-choice");this.style.setProperty("--item-count",t.length.toString())},uH.styles=uj,rr([n({type:String})],uH.prototype,"orientation",2);customElements.define("qti-choice-interaction",uH);var uG='\nconst postToParentWindows = (type, data) => {\n window.top.postMessage(data ? { type, data } : { type }, \'*\');\n let w = window.parent;\n while (w) {\n if (w !== window.top) {\n w.postMessage({ type, data }, \'*\');\n }\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n};\n\nwindow.CES = {\n media: null,\n response: null,\n load: () => {\n let resolveCount = 0;\n\n const handleMessage = (event) => {\n if (event.data.type === "mediaData") {\n const media = event.data.data;\n CES.media = media;\n resolveCount++;\n } else if (event.data.type === "responseData") {\n const response = event.data.data;\n if (response && Array.isArray(response) && response.length > 0) {\n // state is stored in the first element of the array\n CES.response = response[0];\n // Wait a short moment to ensure CES.response is set\n setTimeout(() => {\n // Re-create the Controller instance if it exists\n if (typeof Controller === \'function\') {\n console.log("Re-creating Controller instance");\n ctrl = new Controller();\n }\n }, 50);\n } else { \n CES.response = response;\n }\n resolveCount++;\n }\n if (resolveCount === 2) {\n //window.removeEventListener("message", handleMessage);\n }\n };\n window.addEventListener("message", handleMessage);\n postToParentWindows("getMedia");\n postToParentWindows("getResponse");\n },\n setResponse: (data) => {\n postToParentWindows("setResponse", data);\n },\n getResponse: () => {\n return CES.response;\n },\n getMedia: () => {\n return CES.media;\n },\n setStageHeight: () => {\n postToParentWindows("setStageHeight");\n },\n};\nCES.load();\n',uX="\n (function() {\n var blobUrlReceived = null;\n \n const createIframe = () => {\n if (!blobUrlReceived || !document.body) return;\n var n = document.createElement('iframe');\n n.frameBorder = '0';\n n.scrolling = 'no';\n n.src = blobUrlReceived;\n n.style.width = '100%';\n n.style.height = '100%';\n document.body.appendChild(n);\n };\n \n const handleMessage = (event) => {\n if (event.data.type === 'blobUrl') {\n blobUrlReceived = event.data.data;\n window.removeEventListener('message', handleMessage);\n createIframe();\n }\n };\n \n window.addEventListener('message', handleMessage);\n \n // Wait for document ready before requesting blobUrl\n const requestBlobUrl = () => {\n let w = window.parent;\n while (w) {\n w.postMessage({ type: 'getBlobUrl' }, '*');\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n };\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', requestBlobUrl);\n } else {\n requestBlobUrl();\n }\n })();\n",uJ,uK,uY,uZ,u0,u1,u2,u3,u5,u4,u6,u8,u7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,u0);ra(t,uJ,"");ra(t,uK,null);ra(t,uY,null);t._errorMessage=null;ra(t,uZ,null);t.handlePostMessage=t.handlePostMessage.bind(t);return t}d(e,[{key:"connectedCallback",value:function t(){var t=this;p(f(e.prototype),"connectedCallback",this).call(this);var n=this.data;if(!n){var i=this.querySelector("object[data]");if(i){n=i.getAttribute("data");var o=i.getAttribute("width"),a=i.getAttribute("height");o&&this.setAttribute("width",o),a&&this.setAttribute("height",a)}}if(!n){this._errorMessage="No manifest path found (neither data attribute nor object child)";return}var s=n.startsWith("http")||n.startsWith("blob")?n:nB((this.baseItemUrl||"")+"/"+n);rs(this,uK,new URL(s,window.location.href).toString()),fetch(s).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(){return a(function(){var t,e,n,i,o,a,s,l,u,c,d,h,p,f,v,m,g,b,y,w,q,k,x,_,C,E,S,A,R,I,M,T,P,O,L,U,N;return z(this,function(D){switch(D.label){case 0:return[4,this.updateComplete];case 1:D.sent();l=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelector("#pciContainer");if(!l){this._errorMessage="pciContainer iframe not found";return[2]}l.getAttribute("src")||l.setAttribute("src","about:blank");u=(t=(e=l.contentDocument)!==null&&e!==void 0?e:(a=l.contentWindow)===null||a===void 0?void 0:a.document)!==null&&t!==void 0?t:null;c=u;if(c)return[3,3];return[4,new Promise(function(t){return l.addEventListener("load",function(){return t()},{once:!0})})];case 2:c=(D.sent(),u=(n=(i=l.contentDocument)!==null&&i!==void 0?i:(s=l.contentWindow)===null||s===void 0?void 0:s.document)!==null&&n!==void 0?n:null);D.label=3;case 3:if(c,!u){this._errorMessage="pciContainer iframe document not available";return[2]}if(!this.manifest.script||this.manifest.script.length===0){this._errorMessage="No script found in manifest";return[2]}if(!this.manifest.style||this.manifest.style.length===0){this._errorMessage="No style found in manifest";return[2]}d=this.manifest.style[0],h=rl(this,u0,u5).call(this);return[4,rl(this,u0,u8).call(this,d,h)];case 4:p=D.sent(),f=p.url;if(!(p.baseUrl&&!ro(this,uY)&&rs(this,uY,p.baseUrl),!0))return[3,15];v="";if(!(this.manifest.media&&this.manifest.media.length>0))return[3,6];m=this.manifest.media[0];return[4,rl(this,u0,u8).call(this,m,h,{returnText:!0})];case 5:g=D.sent();if(v=g.url,g.baseUrl&&!ro(this,uY)&&rs(this,uY,g.baseUrl),g.text){b=g.text;if(!(b.includes("postToParentWindows")||b.includes("window.CES"))){y="<script>"+uG+"<\/script>",w=b.indexOf("<head>");w!==-1?b=b.slice(0,w+6)+y+b.slice(w+6):b=y+b}q=new Blob([b],{type:"text/html"});rs(this,uZ,URL.createObjectURL(q))}return[3,8];case 6:k=this.data||"manifest.json",x=k.includes("/")?k.substring(0,k.lastIndexOf("/")):"",_=x?"".concat(x,"/index.html"):"index.html";return[4,rl(this,u0,u8).call(this,_,h,{returnText:!0})];case 7:C=D.sent();if(v=C.url,C.baseUrl&&!ro(this,uY)&&rs(this,uY,C.baseUrl),C.text){E=C.text;if(!(E.includes("postToParentWindows")||E.includes("window.CES"))){S="<script>"+uG+"<\/script>",A=E.indexOf("<head>");A!==-1?E=E.slice(0,A+6)+S+E.slice(A+6):E=S+E}R=new Blob([E],{type:"text/html"});rs(this,uZ,URL.createObjectURL(R))}D.label=8;case 8:if(!(v&&!ro(this,uZ)))return[3,15];D.label=9;case 9:D.trys.push([9,14,,15]);return[4,fetch(v)];case 10:I=D.sent();if(!I.ok)return[3,12];return[4,I.text()];case 11:M=D.sent();if(!(M.includes("postToParentWindows")||M.includes("window.CES"))){T="<script>"+uG+"<\/script>",P=M.indexOf("<head>");P!==-1?M=M.slice(0,P+6)+T+M.slice(P+6):M=T+M}O=new Blob([M],{type:"text/html"});rs(this,uZ,URL.createObjectURL(O));return[3,13];case 12:console.error("Failed to fetch index.html: ".concat(I.status));D.label=13;case 13:return[3,15];case 14:L=D.sent();console.error("Error fetching index.html: ".concat(L));return[3,15];case 15:U="<script>".concat(uX,"<\/script>");window.addEventListener("message",this.handlePostMessage);N="\n <!DOCTYPE html>\n <html>\n <head>\n ".concat(f?"<link href='".concat(f,'\' rel="stylesheet" />'):"","\n ").concat(U,"\n </head>\n <body></body>\n </html>\n ");l.srcdoc=N;return[2]}})}).call(this)}},{key:"handlePostMessage",value:function t(t){var e=this;var n=t.data,i=n.type,o=n.data;switch(i){case"setResponse":(o===null||!(Array.isArray(o)&&o.length===1&&o[0]===""))&&(rs(this,uJ,o),this.saveResponse(o));break;case"getResponse":{rl(this,u0,u3).call(this,"responseData",ro(this,uJ));break}case"getBlobUrl":{ro(this,uZ)&&(rl(this,u0,u3).call(this,"blobUrl",ro(this,uZ)),t.source&&t.source!==window&&t.source.postMessage({type:"blobUrl",data:ro(this,uZ)},"*"));break}case"getMedia":{var a=rl(this,u0,u5).call(this),s=this.manifest.media.map(function(t){if(t.startsWith("http")||t.startsWith("blob"))return t;var n=ro(e,uY)||a[0];return n?new URL(t,n.endsWith("/")?n:"".concat(n,"/")).toString():t});rl(this,u0,u3).call(this,"mediaData",s);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function t(){if(!ro(this,uJ))return!1;if(Array.isArray(ro(this,uJ))){if(ro(this,uJ).length===0)return!1;var t=true,e=false,n=undefined;try{for(var i=ro(this,uJ)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;if(a!==""&&a!==null)return!0}}catch(t){e=true;n=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw n}}}}return!0}},{key:"response",get:function t(){return ro(this,uJ)||null},set:function t(t){if(typeof t=="string")rs(this,uJ,t),this.saveResponse(t);else if(Array.isArray(t))rs(this,uJ,t);else if(t)throw new Error("Value must be a string or an array of strings")}},{key:"disconnectedCallback",value:function t(){window.removeEventListener("message",this.handlePostMessage),p(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function t(){return iC(ex(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&iC(ek(),this._errorMessage))}}]);return e}(oT);uJ=new WeakMap,uK=new WeakMap,uY=new WeakMap,uZ=new WeakMap,u0=new WeakSet,u1=function t(){var t=this.shadowRoot.querySelectorAll("iframe"),e=this.querySelectorAll("iframe"),n=L(t).concat(L(e));var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.src;if(new URL(c,window.location.href).origin===window.location.origin)try{var d=u.contentDocument||u.contentWindow.document;d&&rl(this,u0,u2).call(this,d,n)}catch(t){console.error("Error accessing nested iframe:",t)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return n.forEach(function(t,e){n.indexOf(t)!==e&&n.splice(e,1)}),n},u2=function(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 i=t.src;if(new URL(i,window.location.href).origin===window.location.origin)try{var o=t.contentDocument||t.contentWindow.document;rl(e,u0,u2).call(e,o,n)}catch(t){console.error("Error accessing nested iframe:",t)}else console.warn("Skipped cross-origin iframe:",i)}),n},u3=function t(t,e){window.postMessage({type:t,data:e},"*");var n=rl(this,u0,u1).call(this);var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;u.contentWindow&&u.contentWindow.postMessage({type:t,data:e},"*")}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}},u5=function t(){var t=[ro(this,uY),this.baseRefUrl,this.baseItemUrl,rl(this,u0,u4).call(this)].filter(Boolean).map(function(t){return new URL(t,window.location.href).toString()}),e=rl(this,u0,u6).call(this);return e&&t.push(e),L(new Set(t))},u4=function t(){return ro(this,uK)?new URL(".",ro(this,uK)).toString():null},u6=function t(){return ro(this,uK)?new URL("..",ro(this,uK)).toString():null},u8=function t(t,e){return a(function(t,e){var n,i,o,a,s,l,u,c,d,h,p,f,v;var m=arguments;return z(this,function(g){switch(g.label){case 0:n=m.length>2&&m[2]!==void 0?m[2]:{};if(!t)return[2,{url:"",baseUrl:null}];if(t.startsWith("http")||t.startsWith("blob"))return[2,{url:t,baseUrl:null}];i=true,o=false,a=undefined;g.label=1;case 1:g.trys.push([1,11,12,13]);s=e[Symbol.iterator]();g.label=2;case 2:if(!!(i=(l=s.next()).done))return[3,10];u=l.value;c=new URL(u,window.location.href).toString(),d=new URL(t,c.endsWith("/")?c:"".concat(c,"/")).toString();g.label=3;case 3:g.trys.push([3,8,,9]);return[4,fetch(d)];case 4:h=g.sent();if(!h.ok)return[3,7];if(!n.returnText)return[3,6];return[4,h.text()];case 5:p=g.sent();return[2,{url:d,baseUrl:c,text:p}];case 6:return[2,{url:d,baseUrl:c}];case 7:return[3,9];case 8:f=g.sent();return[3,9];case 9:i=true;return[3,2];case 10:return[3,13];case 11:v=g.sent();o=true;a=v;return[3,13];case 12:try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}return[7];case 13:return[2,{url:"",baseUrl:null}]}})}).apply(this,arguments)},rr([n({type:String,attribute:"data"})],u7.prototype,"data",2),rr([n({type:String,attribute:"data-base-item"})],u7.prototype,"baseItemUrl",2),rr([n({type:String,attribute:"data-base-ref"})],u7.prototype,"baseRefUrl",2),rr([n({type:String,attribute:"id"})],u7.prototype,"id",2),rr([i()],u7.prototype,"_errorMessage",2);customElements.define("qti-custom-interaction",u7);var u9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.disabled=!1;t.countAttempt=null;t.title="end attempt";return t}d(e,[{key:"render",value:function t(){return iC(e_(),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}(iQ);rr([n({type:String,attribute:"response-identifier"})],u9.prototype,"responseIdentifier",2),rr([n({reflect:!0,type:Boolean})],u9.prototype,"disabled",2),rr([n({type:String,attribute:"count-attempt"})],u9.prototype,"countAttempt",2),rr([n({type:String})],u9.prototype,"title",2);customElements.define("qti-end-attempt-interaction",u9);var ct=rG(eC());var ce=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t._rows=5;t.response=null;t._handleResponseChange=function(){t._internals.setFormValue(t.value),t.validate()};return t}d(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;var i=e.split(" "),o=!1;if(i.forEach(function(t){if(t.startsWith("qti-height-lines-")){var e=t.replace("qti-height-lines-","");n._rows=parseInt(e),o=!0}}),!o&&this.expectedLength){var a=Math.ceil(this.expectedLength/50);this._rows=a}}},{key:"value",get:function t(){return this.response||null},set:function t(t){this.response=t||null}},{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 i=t.checkValidity();this._internals.setValidity(i?{}:{customError:!1})}return!!this.response&&t.checkValidity()}},{key:"toggleCorrectResponse",value:function t(){}},{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 iC(eE(),this.responseIdentifier,5e3,function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,function(e){t.reportValidity()},am(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this.response)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;this.setEmptyAttribute(e.value),this.response!==e.value&&(this.value=e.value,this.saveResponse(e.value))}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(oT);ce.styles=ct,rr([i()],ce.prototype,"_rows",2),rr([n({type:Number,attribute:"expected-length"})],ce.prototype,"expectedLength",2),rr([n({type:String,attribute:"pattern-mask"})],ce.prototype,"patternMask",2),rr([n({type:String,attribute:"placeholder-text"})],ce.prototype,"placeholderText",2),rr([n({type:String,attribute:"data-patternmask-message"})],ce.prototype,"dataPatternmaskMessage",2),rr([n({type:String,attribute:"class"})],ce.prototype,"classNames",2),rr([V("classNames")],ce.prototype,"handleclassNamesChange",1),rr([i()],ce.prototype,"response",2),rr([V("response",{waitUntilFirstUpdate:!0})],ce.prototype,"_handleResponseChange",2);customElements.define("qti-extended-text-interaction",ce);var cn=rG(eS());var cr,ci,co=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,cr);return t}d(e,[{key:"render",value:function t(){return iC(eA())}},{key:"toggleCorrectResponse",value:function t(t){var e=this;var n=this.responseVariable;if(t&&(n===null||n===void 0?void 0:n.correctResponse)){var i=[],o=Array.isArray(n.correctResponse)?n.correctResponse:[n.correctResponse];o&&(i=o.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-gap").forEach(function(t){var n,o,a;var s=t.getAttribute("identifier"),l=(n=i.find(function(t){return t.gap===s}))===null||n===void 0?void 0:n.text,u=(o=e.querySelector('qti-gap-text[identifier="'.concat(l,'"]')))===null||o===void 0?void 0:o.textContent.trim();if(l&&u){var c;if(!((c=t.nextElementSibling)===null||c===void 0?void 0:c.classList.contains("correct-option"))){var d=document.createElement("span");d.classList.add("correct-option"),d.textContent=u,d.style.border="1px solid var(--qti-correct)",d.style.borderRadius="4px",d.style.padding="2px 4px",d.style.display="inline-block",t.insertAdjacentElement("afterend",d)}}else((a=t.nextElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}},{key:"toggleCandidateCorrection",value:function t(t){var e=this.responseVariable;if(!(e===null||e===void 0?void 0:e.correctResponse))return;var n=rl(this,cr,ci).call(this,e);Array.from(this.querySelectorAll("qti-gap")).forEach(function(e){var i=e.getAttribute("identifier"),o=n.filter(function(t){return t.target===i});e.querySelectorAll("qti-gap-text").forEach(function(e){var n;if(e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),!t)return;((n=o.find(function(t){return t.source===e.identifier}))===null||n===void 0?void 0:n.source)!==void 0?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect")})})}}]);return e}(uV(oT,"qti-gap-text","qti-gap","slot[part='drags']"));cr=new WeakSet,ci=function t(t){if(!t.correctResponse)return[];var e=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse],n=[];return e&&e.forEach(function(t){var e=t.split(" ");n.push({source:e[0],target:e[1]})}),n},co.styles=cn;customElements.define("qti-gap-match-interaction",co);var ca=function t(t,e,n){var i=new Map;for(var o=e;o<=n;o++)i.set(t[o],o);return i},cs=oc(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){l(this,e);var n;if(n=s(this,e,[t]),t.type!==ou.CHILD)throw Error("repeat() can only be used in text expressions");return n}d(e,[{key:"dt",value:function t(t,e,n){var i;n===void 0?n=e:e!==void 0&&(i=e);var o=[],a=[],s=0;var l=true,u=false,c=undefined;try{for(var d=t[Symbol.iterator](),h;!(l=(h=d.next()).done);l=true){var p=h.value;o[s]=i?i(p,s):s,a[s]=n(p,s),s++}}catch(t){u=true;c=t}finally{try{if(!l&&d.return!=null){d.return()}}finally{if(u){throw c}}}return{values:a,keys:o}}},{key:"render",value:function t(t,e,n){return this.dt(t,e,n).values}},{key:"update",value:function t(t,e){var n=M(e,3),i=n[0],o=n[1],a=n[2];var s;var l=ow(t),u=this.dt(i,o,a),c=u.values,d=u.keys;if(!Array.isArray(l))return this.ut=d,c;var h=(s=this.ut)!==null&&s!==void 0?s:this.ut=[],p=[],f,v,m=0,g=l.length-1,b=0,y=c.length-1;for(;m<=g&&b<=y;)if(l[m]===null)m++;else if(l[g]===null)g--;else if(h[m]===d[b])p[b]=og(l[m],c[b]),m++,b++;else if(h[g]===d[y])p[y]=og(l[g],c[y]),g--,y--;else if(h[m]===d[y])p[y]=og(l[m],c[y]),om(t,p[y+1],l[m]),m++,y--;else if(h[g]===d[b])p[b]=og(l[g],c[b]),om(t,l[m],l[g]),g--,b++;else if(f===void 0&&(f=ca(d,b,y),v=ca(h,m,g)),f.has(h[m]))if(f.has(h[g])){var w=v.get(d[b]),q=w!==void 0?l[w]:null;if(q===null){var k=om(t,l[m]);og(k,c[b]),p[b]=k}else p[b]=og(q,c[b]),om(t,l[m],q),l[w]=null;b++}else oq(l[g]),g--;else oq(l[m]),m++;for(;b<=y;){var x=om(t,p[y+1]);og(x,c[b]),p[b++]=x}for(;m<=g;){var _=l[m++];_!==null&&oq(_)}return this.ut=d,oy(t,p),iA}}]);return e}(od));var cl=rG(eR());var cu,cc,cd,ch,cp,cf,cv,cm=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,ch);ra(t,cu);ra(t,cc,null);ra(t,cd,null);t._correctLines=[];t._response=[];t.addEventListener("qti-register-hotspot",rl(t,ch,cv));return t}d(e,[{key:"reset",value:function t(){this._response=[],this._correctLines=[]}},{key:"validate",value:function t(){return rl(this,ch,cf).call(this).length>0}},{key:"response",get:function t(){return this._response},set:function t(t){this._response=rl(this,ch,cp).call(this,t)}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.responseVariable;if(!t||!e){this._correctLines=[];return}if(!e.correctResponse){console.error("No correct response found for this interaction.");return}var n=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];this._correctLines=n}},{key:"render",value:function t(){var t=this;var e,n,i,o;return iC(eP(),am((e=this.grImage[0])===null||e===void 0?void 0:e.width),am((n=this.grImage[0])===null||n===void 0?void 0:n.height),(i=this.grImage[0])===null||i===void 0?void 0:i.width,(o=this.grImage[0])===null||o===void 0?void 0:o.height,cs(rl(this,ch,cf).call(this),function(t){return t},function(e,n){return iE(eI(),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.top),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.top),function(e){e.stopPropagation(),t._response=t._response.filter(function(t,e){return e!==n}),t.saveResponse(t.response)})}),cs(this._correctLines||[],function(t){return t},function(e,n){return iE(eM(),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.top),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.top))}),ro(this,cc)&&iE(eT(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"firstUpdated",value:function t(){var t=this;rs(this,cu,this.querySelectorAll("qti-associable-hotspot")),this.addEventListener("mousemove",function(e){var n=t.grImage[0];if(!n)return;var i=n.getBoundingClientRect();t.mouseCoord={x:e.clientX-i.left,y:e.clientY-i.top}}),ro(this,cu).forEach(function(e){e.style.left=e.getAttribute("coords").split(",")[0]+"px",e.style.top=e.getAttribute("coords").split(",")[1]+"px",e.addEventListener("click",function(e){ro(t,cc)?ro(t,cd)||(rs(t,cd,e.target),t._response=rl(t,ch,cf).call(t),t._response=L(t._response).concat(["".concat(ro(t,cc).getAttribute("identifier")," ").concat(ro(t,cd).getAttribute("identifier"))]),t.saveResponse(t.response),rs(t,cc,null),rs(t,cd,null)):(rs(t,cc,e.target),t.startCoord={x:parseInt(ro(t,cc).getAttribute("coords").split(",")[0]),y:parseInt(ro(t,cc).getAttribute("coords").split(",")[1])})})})}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",rl(this,ch,cv))}}]);return e}(oT);cu=new WeakMap,cc=new WeakMap,cd=new WeakMap,ch=new WeakSet,cp=function t(t){return t==null||t===""?[]:Array.isArray(t)?t:[t]},cf=function t(){return rl(this,ch,cp).call(this,this._response)},cv=function t(t){var e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});nj(o,a,e,n)},cm.styles=cl,rr([i()],cm.prototype,"_correctLines",2),rr([i()],cm.prototype,"startCoord",2),rr([i()],cm.prototype,"mouseCoord",2),rr([u({selector:"img"})],cm.prototype,"grImage",2),rr([i()],cm.prototype,"_response",2);customElements.define("qti-graphic-associate-interaction",cm);var cg=rG(eO());var cb,cy,cw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,cb);return t}d(e,[{key:"render",value:function t(){return iC(eL())}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",rl(this,cb,cy))}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",rl(this,cb,cy))}}]);return e}(uV(oT,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part='drags']"));cb=new WeakSet,cy=function t(t){var e=t.target,n=e.getAttribute("coords"),i=e.getAttribute("shape"),o=n.split(",").map(function(t){return parseInt(t)});switch(i){case"circle":{var a=M(o,3),s=a[0],l=a[1],u=a[2];e.style.left=s-u+"px",e.style.top=l-u+"px",e.style.width=e.style.height=2*u+"px"}break;case"rect":{var c=M(o,4),d=c[0],h=c[1],p=c[2],f=c[3];e.style.left=d+"px",e.style.top=h+"px",e.style.width=p-d+"px",e.style.height=f-h+"px"}break;default:break}},cw.styles=cg;customElements.define("qti-graphic-gap-match-interaction",cw);var cq=rG(eU());var ck,cx,c_,cC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,ck);t._choiceElements=[];return t}d(e,[{key:"render",value:function t(){return iC(eN())}},{key:"toggleCorrectResponse",value:function t(t){var e;var n=this.responseVariable,i=this._choiceElements;var o=true,a=false,s=undefined;try{var l=function(){var i=c.value;if(t&&(n===null||n===void 0?void 0:(e=n.correctResponse)===null||e===void 0?void 0:e.length)>0&&Array.isArray(n.correctResponse)){var o=n.correctResponse.findIndex(function(t){return t===i.identifier});o>=0?i.orderCorrect=o+1:i.orderCorrect=null}else i.orderCorrect=null};for(var u=i[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",rl(this,ck,cx)),this.addEventListener("register-qti-hotspot-choice",rl(this,ck,c_))}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",rl(this,ck,cx)),this.removeEventListener("register-qti-hotspot-choice",rl(this,ck,c_))}}]);return e}(uW(oT,"qti-hotspot-choice"));ck=new WeakSet,cx=function t(t){var e=t.detail,n=e.identifier,i=this._choiceElements.find(function(t){return t.getAttribute("identifier")===n});if(!i)return;var o=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,i.order==null){var a=this._choiceElements.filter(function(t){return t.order!=null}).length;if(a>=o){this.choiceOrdering=!1;return}i.order=a+1}else{var s=i.order;i.order=null,this._choiceElements.forEach(function(t){t.order!=null&&t.order>s&&t.order--})}this.choiceOrdering=!1}},c_=function t(t){var e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});nj(o,a,e,n)},cC.styles=cq;customElements.define("qti-graphic-order-interaction",cC);var cE=rG(eD());var cS,cA,cR,cI,cM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,cA);ra(t,cS,null);return t}d(e,[{key:"render",value:function t(){return iC(eV())}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",rl(this,cA,cI))}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",rl(this,cA,cI))}}]);return e}(uW(oT,"qti-hotspot-choice"));cS=new WeakMap,cA=new WeakSet,cR=function t(t){return ro(this,cS)||(t.naturalWidth>0&&t.naturalHeight>0?rs(this,cS,Promise.resolve(t)):rs(this,cS,new Promise(function(e){var n=function i(){t.removeEventListener("load",n),e(t)};t.addEventListener("load",n)}))),ro(this,cS)},cI=function t(t){return a(function(){var e,n,i,o,a,s;return z(this,function(l){switch(l.label){case 0:e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});return[4,rl(this,cA,cR).call(this,e)];case 1:s=l.sent();nj(o,a,s,n);return[2]}})}).call(this)},cM.styles=cE;customElements.define("qti-hotspot-interaction",cM);var cT,cP,cO,cL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,cT);t.class="";t.render=function(){return iC(ez())};return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),rl(this,cT,cO).call(this)}},{key:"updated",value:function t(t){p(f(e.prototype),"updated",this).call(this,t),rl(this,cT,cO).call(this)}}]);return e}(uW(oT,"qti-hottext"));cT=new WeakSet,cP=function t(){var t={"qti-input-control-hidden":!0};return this.class&&this.class.split(" ").forEach(function(e){e.trim()&&(t[e.trim()]=!0)}),t},cO=function t(){var t=Object.keys(ro(this,cT,cP)).join(" ");this.className=t},rr([n({type:String,reflect:!0})],cL.prototype,"class",2);customElements.define("qti-hottext-interaction",cL);var cU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){l(this,e);var n;if(n=s(this,e,[t]),n.it=iR,t.type!==ou.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}d(e,[{key:"render",value:function t(t){if(t===iR||t==null)return this._t=void 0,this.it=t;if(t===iA)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}(od);cU.directiveName="unsafeHTML",cU.resultType=1;var cN=oc(cU);var cD,cV,cz,c$,cW,cB,cj,cF,cQ,cH,cG,cX,cJ,cK,cY=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,cD);t.options=[];t.correctOption="";t._dropdownOpen=!1;t._calculatedMinWidth=0;t._widthCalculationTimer=null;t.dataPrompt="";ra(t,cW,function(e){if(t.readonly)return;var n=e.target.value;rl(t,cD,cB).call(t,n)});ra(t,cF,function(){t.disabled||t.readonly||rl(t,cD,cj).call(t,!t._dropdownOpen)});ra(t,cQ,function(e){t.disabled||t.readonly||(e.key==="ArrowDown"||e.key==="Enter"||e.key===" ")&&(e.preventDefault(),rl(t,cD,cj).call(t,!0))});ra(t,cH,function(e){var n,i;if(!t._dropdownOpen)return;if(e.key==="Escape"){e.preventDefault(),rl(t,cD,cj).call(t,!1),rl(t,cD,cG).call(t);return}var o=Array.from(t.renderRoot.querySelectorAll('button[part="option"]')),a=t.renderRoot.activeElement,s=o.findIndex(function(t){return t===a});e.key==="ArrowDown"&&(e.preventDefault(),(n=o[Math.min(o.length-1,Math.max(0,s+1))])===null||n===void 0?void 0:n.focus()),e.key==="ArrowUp"&&(e.preventDefault(),(i=o[Math.max(0,s-1)])===null||i===void 0?void 0:i.focus())});ra(t,cX,function(e){var n;if(!t._dropdownOpen)return;var i=(n=e.composedPath)===null||n===void 0?void 0:n.call(e);i&&i.includes(t)||rl(t,cD,cj).call(t,!1)});ra(t,cJ,function(e){t._dropdownOpen&&e.key==="Escape"&&(e.preventDefault(),rl(t,cD,cj).call(t,!1),rl(t,cD,cG).call(t))});return t}d(e,[{key:"isInline",get:function t(){return!0}},{key:"render",value:function t(){var t=this;var e,n;var i=rl(this,cD,cV).call(this),o=rl(this,cD,cz).call(this);return iC(eH(),o?iC(eB(),ro(this,cW),this.disabled||this.readonly,(e=i===null||i===void 0?void 0:i.value)!==null&&e!==void 0?e:"",this.options.map(function(t){return iC(eW(),t.value,cN(t.textContent))})):iC(eQ(),ro(this,cF),ro(this,cQ),this._dropdownOpen?"true":"false",this.disabled,this.readonly?"true":"false",cN((n=i===null||i===void 0?void 0:i.textContent)!==null&&n!==void 0?n:""),this._dropdownOpen?iC(eF(),ro(this,cH),this.options.map(function(e){return iC(ej(),e.selected?"true":"false",function(){return rl(t,cD,cB).call(t,e.value)},cN(e.textContent))})):null),cN(this.correctOption))}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),rl(this,cD,c$).call(this),rl(this,cD,cz).call(this)||(document.addEventListener("pointerdown",ro(this,cX),!0),document.addEventListener("keydown",ro(this,cJ),!0)),this._estimateOptimalWidth()}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),rl(this,cD,cz).call(this)||(document.removeEventListener("pointerdown",ro(this,cX),!0),document.removeEventListener("keydown",ro(this,cJ),!0)),this._widthCalculationTimer!==null&&(window.clearTimeout(this._widthCalculationTimer),this._widthCalculationTimer=null)}},{key:"willUpdate",value:function t(t){(t.has("configContext")||t.has("dataPrompt"))&&rl(this,cD,c$).call(this)}},{key:"updated",value:function t(t){var e;t.has("_dropdownOpen")&&this._dropdownOpen&&(rl(this,cD,cK).call(this),(e=this.renderRoot.querySelector('button[part="option"][aria-selected="true"]'))===null||e===void 0?void 0:e.focus())}},{key:"_estimateOptimalWidth",value:function t(){if(this.options.length===0)return;var t=0;var e=true,n=false,i=undefined;try{for(var o=this.options[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;var l=s.textContent.replace(/<[^>]*>/g,"").trim();t=Math.max(t,l.length)}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}var u=Math.max(t*.6+4,8.75),c=Math.min(u,40);this._calculatedMinWidth=c,this.style.setProperty("--qti-calculated-min-width","".concat(c,"em"))}},{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(){rl(this,cD,cj).call(this,!1),this.options=this.options.map(function(t,e){return _(k({},t),{selected:e===0})})}},{key:"response",get:function t(){var t;var e;var n=(t=(e=this.options.find(function(t){return t.selected}))===null||e===void 0?void 0:e.value)!==null&&t!==void 0?t:"";return n===""?null:n},set:function t(t){var e=t!==null&&t!==void 0?t:"";this.options=this.options.map(function(t){return _(k({},t),{selected:t.value===e})})}},{key:"toggleInternalCorrectResponse",value:function t(t){p(f(e.prototype),"toggleInternalCorrectResponse",this).call(this,t);var n=this.correctResponse;if(!t||!n){this.correctOption="";return}var i=this.options.find(function(t){return n===t.value});if(!i){this.correctOption="";return}this.correctOption='<span part="correct-option" style="border:1px solid var(--qti-correct); border-radius:4px; padding: 2px 4px; margin: 4px; display:inline-block">'.concat(i.textContent,"</span>")}}],[{key:"styles",get:function t(){return[rG(e$())]}}]);return e}(oT);cD=new WeakSet,cV=function t(){var t;return(t=this.options.find(function(t){return t.selected}))!==null&&t!==void 0?t:this.options[0]},cz=function t(){if(cY._supportsCustomizableSelectCache!==null)return cY._supportsCustomizableSelectCache;if((typeof CSS==="undefined"?"undefined":U(CSS))>"u"||typeof CSS.supports!="function")return cY._supportsCustomizableSelectCache=!1,!1;var t=CSS.supports("selector(::picker(select))")||CSS.supports("selector(select::picker(select))"),e=CSS.supports("appearance: base-select")||CSS.supports("-webkit-appearance: base-select");if(!t||!e)return cY._supportsCustomizableSelectCache=!1,!1;try{var n=document.createElement("div");n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px";var i=document.createElement("select");i.style.appearance="base-select",i.style.webkitAppearance="base-select";var o=document.createElement("button");o.type="button";var a=document.createElement("selectedcontent");a.textContent="probe",o.appendChild(a);var s=document.createElement("option");s.value="probe",s.textContent="probe",i.appendChild(o),i.appendChild(s),n.appendChild(i),(document.body||document.documentElement).appendChild(n);var l=o.getBoundingClientRect();n.remove();var u=l.width>0&&l.height>0;return cY._supportsCustomizableSelectCache=u,u}catch(t){return cY._supportsCustomizableSelectCache=!1,!1}},c$=function t(){var t;var e,n;var i=Array.from(this.querySelectorAll("qti-inline-choice")),o=this.dataPrompt||((e=this.configContext)===null||e===void 0?void 0:e.inlineChoicePrompt)||"select",a=(t=(n=this.options.find(function(t){return t.selected}))===null||n===void 0?void 0:n.value)!==null&&t!==void 0?t:"",s=[{textContent:o,value:"",selected:a===""}].concat(L(i.map(function(t){var e;var n=(e=t.getAttribute("identifier"))!==null&&e!==void 0?e:"";return{textContent:t.innerHTML,value:n,selected:n!==""&&n===a}}))),l=s.some(function(t){return t.selected});this.options=l?s:s.map(function(t,e){return _(k({},t),{selected:e===0})}),this._estimateOptimalWidth()},cW=new WeakMap,cB=function t(t){this.options=this.options.map(function(e){return _(k({},e),{selected:e.value===t})}),this.saveResponse(t),rl(this,cD,cj).call(this,!1)},cj=function t(t){this._dropdownOpen!==t&&(this._dropdownOpen=t)},cF=new WeakMap,cQ=new WeakMap,cH=new WeakMap,cG=function t(){var t;(t=this.renderRoot.querySelector('button[part="trigger"]'))===null||t===void 0?void 0:t.focus()},cX=new WeakMap,cJ=new WeakMap,cK=function t(){var t,e;if(!this._dropdownOpen)return;var n=this.renderRoot.querySelector('[part="menu"]'),i=this.renderRoot.querySelector('button[part="trigger"]');if(!n||!i)return;n.dataset.placement="bottom",n.style.setProperty("--qti-menu-shift-x","0px"),n.style.setProperty("--qti-menu-shift-y","0px"),n.style.left="0px",n.style.right="auto";var o=((t=document.documentElement)===null||t===void 0?void 0:t.clientWidth)||window.innerWidth,a=((e=document.documentElement)===null||e===void 0?void 0:e.clientHeight)||window.innerHeight,s=8,l=i.getBoundingClientRect(),u=Math.max(0,o-s*2);n.style.maxWidth="".concat(u,"px"),n.style.minWidth="".concat(Math.min(l.width,u),"px");var c=n.getBoundingClientRect(),d=a-l.bottom,h=l.top;c.bottom>a-s&&h>d&&(n.dataset.placement="top",c=n.getBoundingClientRect());var p=Math.max(s,o-s-c.width),f=Math.min(p,Math.max(s,l.left))-l.left;n.style.left="".concat(f,"px")},cY._supportsCustomizableSelectCache=null,cY.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"],rr([i()],cY.prototype,"options",2),rr([i()],cY.prototype,"correctOption",2),rr([i()],cY.prototype,"_dropdownOpen",2),rr([i()],cY.prototype,"_calculatedMinWidth",2),rr([n({attribute:"data-prompt",type:String})],cY.prototype,"dataPrompt",2),rr([P({context:oe,subscribe:!0}),n({attribute:!1})],cY.prototype,"configContext",2);var cZ=cY;customElements.define("qti-inline-choice-interaction",cZ);var c0=rG(eG());var c1,c2,c3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,c1);t.lastCheckedRadio=null;t.class="";t._response=[];t.responseIdentifier="";t.correctOptions=null;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,i=n.value,o=n.name,a=n.type;n.checked?(t.response?t.response.indexOf(i)===-1&&(a==="radio"&&(t.response=(t.response||[]).filter(function(t){return t.indexOf(o)===-1})),t.response=L(t.response).concat([i])):t.response=[i],t.lastCheckedRadio=n):(t.response=(t.response||[]).filter(function(t){return t!==i}),t.lastCheckedRadio=null),t.requestUpdate(),t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t.responseIdentifier,response:Array.isArray(t.response)?L(t.response):t.response}}))};return t}d(e,[{key:"response",get:function t(){return this.classList.contains("qti-match-tabular")?this._response:p(f(e.prototype),"response",this)},set:function t(t){this.classList.contains("qti-match-tabular")?this._response=t:R(f(e.prototype),"response",t,this,true)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){i().call(n),this.sourceChoices=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.targetChoices=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[];return[2]})}).call(this)}},{key:"validate",value:function t(){var t;return this.class.split(" ").includes("qti-match-tabular")?((t=this.response)===null||t===void 0?void 0:t.length)===this.sourceChoices.length:p(f(e.prototype),"validate",this).call(this)}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this;var n=this.responseVariable;if(!(n===null||n===void 0?void 0:n.correctResponse)){this.querySelectorAll(".correct-option").forEach(function(t){return t.remove()});return}var i=rl(this,c1,c2).call(this,n);this.class.split(" ").includes("qti-match-tabular")?t?this.correctOptions=i||[]:this.correctOptions=null:t?(this.querySelectorAll(".correct-option").forEach(function(t){return t.remove()}),this.targetChoices.forEach(function(t){var n=t.getAttribute("identifier"),o=i.find(function(t){return t.target===n});if(o===null||o===void 0?void 0:o.source){var a,s,l;var u=(s=e.querySelector('qti-simple-associable-choice[identifier="'.concat(o.source,'"]')))===null||s===void 0?void 0:(a=s.textContent)===null||a===void 0?void 0:a.trim();if(u&&!((l=t.previousElementSibling)===null||l===void 0?void 0:l.classList.contains("correct-option"))){var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=u,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",t.insertAdjacentElement("beforebegin",c)}}})):this.correctOptions=null}},{key:"toggleCandidateCorrection",value:function t(t){var e=this.responseVariable;if(!(e===null||e===void 0?void 0:e.correctResponse))return;var n=rl(this,c1,c2).call(this,e);this.targetChoices.forEach(function(e){var i=e.getAttribute("identifier"),o=n.filter(function(t){return t.target===i});e.querySelectorAll("qti-simple-associable-choice").forEach(function(e){var n;if(e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),!t)return;((n=o.find(function(t){return t.source===e.identifier}))===null||n===void 0?void 0:n.source)!==void 0?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect")})})}},{key:"render",value:function t(){var t=this;var e=this.class.split(" ").includes("qti-match-tabular"),n=this.correctOptions!==null;return iC(e0(),e,e?iC(eZ(),this.targetChoices.map(function(t){return iC(eX(),cN(t.innerHTML))}),this.sourceChoices.map(function(e){return iC(eY(),cN(e.innerHTML),t.targetChoices.map(function(i){var o,a,s;var l=e.getAttribute("identifier"),u=i.getAttribute("identifier"),c="".concat(l," ").concat(u),d=(t.response||[]).filter(function(t){return t.split(" ")[0]===l}).length||0,h=((o=t.response)===null||o===void 0?void 0:o.includes(c))||!1,p=e.matchMax===1?"radio":"checkbox",f=!!((a=t.correctOptions)===null||a===void 0?void 0:a.find(function(t){return t.source===l&&t.target===u})),v=p==="radio"?"rb ".concat(h?"rb-checked":""," ").concat(n?f?"rb-correct":"rb-incorrect":""):"cb ".concat(h?"cb-checked":""," ").concat(n?f?"cb-correct":"cb-incorrect":""),m=((s=t.correctOptions)===null||s===void 0?void 0:s.length)>0?!0:e.matchMax===1?!1:e.matchMax!==0&&d>=e.matchMax&&!h;return iC(eK(),p,v,l,c,m,function(e){return t.handleRadioChange(e)},function(n){return e.matchMax===1?t.handleRadioClick(n):null},p==="checkbox"&&h?iC(eJ()):"")}))})):iR)}}]);return e}(uV(oT,"qti-simple-match-set:first-of-type qti-simple-associable-choice, qti-simple-match-set:last-of-type > qti-simple-associable-choice > qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice","qti-simple-match-set:first-of-type"));c1=new WeakSet,c2=function t(t){if(!t.correctResponse)return[];var e=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse],n=[];return e&&e.forEach(function(t){var e=t.split(" ");n.push({source:e[0],target:e[1]})}),n},c3.styles=c0,rr([n({type:String})],c3.prototype,"class",2),rr([i()],c3.prototype,"_response",2),rr([n({type:String,attribute:"response-identifier"})],c3.prototype,"responseIdentifier",2),rr([i()],c3.prototype,"correctOptions",2);customElements.define("qti-match-interaction",c3);var c5,c4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,c5,null);return t}d(e,[{key:"reset",value:function t(){rs(this,c5,null)}},{key:"validate",value:function t(){return!0}},{key:"response",get:function t(){return ro(this,c5)?ro(this,c5).toString():null},set:function t(t){if(t)if(!isNaN(parseInt(t===null||t===void 0?void 0:t.toString())))rs(this,c5,parseInt(t.toString()));else throw new Error("Value must be a number ".concat(t))}},{key:"render",value:function t(){return iC(e1())}},{key:"connectedCallback",value:function t(){var t=this;p(f(e.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){ru(t,c5)._++,t.saveResponse(t.value)})}}],[{key:"properties",get:function t(){return _(k({},oT.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return e}(oT);c5=new WeakMap,c4.styles=[rG(e2())];customElements.define("qti-media-interaction",c4);var c6=rG(e3());var c8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.nrChoices=0;t.correctResponses=[];t.showCorrectResponses=!1;return t}d(e,[{key:"render",value:function t(){var t=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<t.length&&(this.nrChoices=t.length),iC(e4(),L(Array(this.nrChoices)).map(function(t,e){return iC(e5(),e)}))}},{key:"toggleCorrectResponse",value:function t(t){var e=this;var n=this.responseVariable;if(this.shadowRoot.querySelectorAll(".correct-option").forEach(function(t){return t.remove()}),t&&(n===null||n===void 0?void 0:n.correctResponse)){var i=(Array.isArray(n.correctResponse)?n.correctResponse:[n.correctResponse]).map(function(t){return t.split(" ")[0]}),o=new Set;this.querySelectorAll("qti-simple-choice").forEach(function(t,n){var a;var s=t.getAttribute("identifier");if(!s||!i.includes(s)||o.has(s))return;o.add(s);var l=(a=t.textContent)===null||a===void 0?void 0:a.trim();if(!l)return;var u=e.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(n,'"]'));if(!u)return;var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=l,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",c.style.marginTop="4px",u.insertAdjacentElement("afterend",c)})}}},{key:"getValue",value:function t(t){return(t===null||t===void 0?void 0:t.map(function(t,e){return"".concat(t," droplist").concat(e)}))||[]}},{key:"getResponse",value:function t(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]');return L(Array.from(e).map(function(t){return t.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"firstUpdated",t)};return a(function(){return z(this,function(t){i().call(n),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(function(t){return t.setAttribute("part","qti-simple-choice")});return[2]})}).call(this)}}]);return e}(uV(oT,"qti-simple-choice","drop-list","slot[part='drags']"));c8.styles=c6,rr([i()],c8.prototype,"nrChoices",2),rr([i()],c8.prototype,"correctResponses",2),rr([i()],c8.prototype,"showCorrectResponses",2),rr([n({type:String})],c8.prototype,"orientation",2);customElements.define("qti-order-interaction",c8);var c7=rG(e6());var c9,dt,de,dn,dr,di,da,ds,dl,du,dc,dd,dh,dp,df,dv,dm,dg,db,dy,dw,dq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,dn);ra(t,c9);t._iframeLoaded=!1;t._pendingMessages=[];t._iframeMessageOrigin=null;t._iframeObjectUrl=null;t.requirePathsJson="";t.requireShimJson="";t.requireJsUrl="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js";t.baseUrl="";t.useDefaultShims=!1;t.useDefaultPaths=!1;t._errorMessage=null;t.response=null;ra(t,dt,null);ra(t,de,null);t.handleIframeMessage=function(e){var n;var i=e.data;if(!(!i||i.source!=="qti-pci-iframe")&&!(!((n=t.iframe)===null||n===void 0?void 0:n.contentWindow)||e.source!==t.iframe.contentWindow)&&!(i.responseIdentifier&&i.responseIdentifier!==t.responseIdentifier)){if(t._iframeMessageOrigin===null)t._iframeMessageOrigin=e.origin;else if(e.origin!==t._iframeMessageOrigin)return;switch(i.method){case"iframeReady":rl(t,dn,dy).call(t),rl(t,dn,dv).call(t),t.dispatchEvent(new CustomEvent("qti-portable-custom-interaction-loaded",{bubbles:!0}));break;case"resize":typeof i.height=="number"&&t.iframe&&(t.iframe.style.height="".concat(i.height,"px"),t.iframe.style.width="".concat(i.width,"px"));break;case"console":t.dispatchEvent(new CustomEvent("qti-pci-console",{detail:{level:i.level,args:i.args},bubbles:!0}));break;case"interactionChanged":{var o,a;var s=i===null||i===void 0?void 0:(o=i.params)===null||o===void 0?void 0:o.value,l=s&&(typeof s==="undefined"?"undefined":U(s))=="object"?rl(t,dn,dc).call(t,s):null,u=i===null||i===void 0?void 0:(a=i.params)===null||a===void 0?void 0:a.state,c;if(u===void 0)c=void 0;else if(u===null)c=null;else if(typeof u=="string")c=u;else try{c="__qti_json__::".concat(JSON.stringify(u))}catch(t){c=null}if(l===null){var d;var h=((d=t.responseVariable)===null||d===void 0?void 0:d.cardinality)==="single"?"":[];t.response=h,t.validate(),t.saveResponse(h,c);break}t.response=l,t.validate(),t.saveResponse(l,c);break}case"error":t._errorMessage=i.params.message,console.error("Error from PCI iframe:",i.params.message);break}}};ra(t,dw,null);return t}d(e,[{key:"getDirectChildrenByTag",value:function t(t){var e=t.toLowerCase();return Array.from(this.children).filter(function(t){return t.tagName.toLowerCase()===e})}},{key:"coerceBaseValue",value:function t(t,e){if(t==null)return t;switch(e){case"integer":{if(typeof t=="number")return t;var n=parseInt(String(t),10);return Number.isNaN(n)?t:n}case"float":case"duration":{if(typeof t=="number")return t;var i=parseFloat(String(t));return Number.isNaN(i)?t:i}case"boolean":{if(typeof t=="boolean")return t;if(typeof t=="string"){var o=t.toLowerCase();if(o==="true")return!0;if(o==="false")return!1}return t}default:return String(t)}}},{key:"normalizeListValue",value:function t(t){return t==null?[]:Array.isArray(t)?t:[t]}},{key:"variableToQtiVariableJSON",value:function t(t,e,n){var i=this;if(e==="record"||n==="record")return this.recordToQtiVariableJSON(t);if(e!=="single"){var o=this.normalizeListValue(t).map(function(t){return i.coerceBaseValue(t,n)});return{list:h({},n,o)}}return{base:h({},n,this.coerceBaseValue(t,n))}}},{key:"recordToQtiVariableJSON",value:function t(t){if(!t||(typeof t==="undefined"?"undefined":U(t))!="object")return{record:[]};var e=[];var n=true,i=false,o=undefined;try{for(var a=Object.entries(t)[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=M(s.value,2),u=l[0],c=l[1];e.push(this.recordEntryFromValue(u,c))}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return{record:e}}},{key:"recordEntryFromValue",value:function t(t,e){if(Array.isArray(e)){var n=e.filter(function(t){return t!=null});if(n.length&&n.every(function(t){return typeof t=="boolean"}))return{name:t,list:{boolean:n}};if(n.length&&n.every(function(t){return typeof t=="number"})){var i=n,o=i.every(function(t){return Number.isInteger(t)});return{name:t,list:h({},o?"integer":"float",i)}}return{name:t,list:{string:e.map(function(t){return t==null?"":String(t)})}}}if(typeof e=="boolean")return{name:t,base:{boolean:e}};if(typeof e=="number")return Number.isInteger(e)?{name:t,base:{integer:e}}:{name:t,base:{float:e}};if(e==null)return{name:t,base:{string:""}};if((typeof e==="undefined"?"undefined":U(e))=="object")try{return{name:t,base:{string:JSON.stringify(e)}}}catch(n){return{name:t,base:{string:String(e)}}}return{name:t,base:{string:String(e)}}}},{key:"getQtiContextDefaultsFromItem",value:function t(){var t=this;var e=this.closest("qti-assessment-item");if(!e)return{};var n={};return e.querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(function(e){var i=e.querySelector("qti-default-value");if(!i)return;i.querySelectorAll("qti-value[field-identifier]").forEach(function(e){var i;var o=e.getAttribute("field-identifier");if(!o)return;var a=e.getAttribute("base-type")||"string",s=((i=e.textContent)===null||i===void 0?void 0:i.trim())||"";n[o]=t.coerceBaseValue(s,a)})}),n}},{key:"getQtiContextRecord",value:function t(){var t,e,n;var i;var o=this.getQtiContextDefaultsFromItem(),a=((i=this.qtiContext)===null||i===void 0?void 0:i.QTI_CONTEXT)||{},s=k({},o,a);if(!Object.keys(s).length)return null;var l=k({candidateIdentifier:(t=s.candidateIdentifier)!==null&&t!==void 0?t:"",testIdentifier:(e=s.testIdentifier)!==null&&e!==void 0?e:"",environmentIdentifier:(n=s.environmentIdentifier)!==null&&n!==void 0?n:""},s);return this.recordToQtiVariableJSON(l)}},{key:"getTemplateVariables",value:function t(){var t=this;var e={},n=this.getDirectChildrenByTag("qti-template-variable");return n.length&&n.forEach(function(n){var i,o;var a=n.getAttribute("template-identifier")||n.getAttribute("identifier")||"";if(!a)return;var s=(o=t.context)===null||o===void 0?void 0:(i=o.variables)===null||i===void 0?void 0:i.find(function(t){return t.identifier===a});if(!s)return;var l=s.cardinality||"single",u=s.baseType||"string";e[a]=t.variableToQtiVariableJSON(s.value,l,u)}),e}},{key:"getContextVariables",value:function t(){var t=this;var e={},n=this.getDirectChildrenByTag("qti-context-variable");return n.length&&n.forEach(function(n){var i,o;var a=n.getAttribute("identifier")||"";if(!a)return;if(a==="QTI_CONTEXT"){var s=t.getQtiContextRecord();s&&(e[a]=s);return}var l=(o=t.context)===null||o===void 0?void 0:(i=o.variables)===null||i===void 0?void 0:i.find(function(t){return t.identifier===a});if(!l)return;var u=l.cardinality||"single",c=l.baseType||"string";e[a]=t.variableToQtiVariableJSON(l.value,u,c)}),e}},{key:"responseVariablesToQtiVariableJSON",value:function t(t,e,n){if(e!=="single"){var i={list:{}};return i.list[n]=t,i}else{var o={base:{}};return o.base[n]=t,o}}},{key:"validate",value:function t(){return this.response===null||this.response===void 0?!1:Array.isArray(this.response)?this.response.length===0?!1:this.response.some(function(t){return t!==""&&t!==null&&t!==void 0}):this.response!==""}},{key:"value",get:function t(){return ro(this,c9)===null||ro(this,c9)===void 0?null:Array.isArray(ro(this,c9))?ro(this,c9).join(","):String(ro(this,c9))},set:function t(t){t===null?rs(this,c9,[]):rs(this,c9,Array.isArray(t)?t:t.split(","))}},{key:"boundTo",get:function t(){var t=this;var e,n;var i={};if((n=this.context)===null||n===void 0?void 0:(e=n.variables)===null||e===void 0?void 0:e.find(function(e){return e.identifier===t.responseIdentifier})){var o,a,s,l,u,c,d,h,p;var f=((s=this.context)===null||s===void 0?void 0:(a=s.variables)===null||a===void 0?void 0:(o=a.find(function(e){return e.identifier===t.responseIdentifier}))===null||o===void 0?void 0:o.cardinality)||"single",v=((c=this.context)===null||c===void 0?void 0:(u=c.variables)===null||u===void 0?void 0:(l=u.find(function(e){return e.identifier===t.responseIdentifier}))===null||l===void 0?void 0:l.baseType)||"string",m=((p=this.context)===null||p===void 0?void 0:(h=p.variables)===null||h===void 0?void 0:(d=h.find(function(e){return e.identifier===t.responseIdentifier}))===null||d===void 0?void 0:d.value)||null,g=this.responseVariablesToQtiVariableJSON(m,f,v);i[this.responseIdentifier]=g}return i},set:function t(t){if(!t||!t[this.responseIdentifier])return;var e=rl(this,dn,dc).call(this,t[this.responseIdentifier]);rs(this,c9,e),this.saveResponse(e)}},{key:"resolveStylesheetHref",value:function t(t){if(!t||t.startsWith("http://")||t.startsWith("https://"))return t;if(t.startsWith("//"))return"".concat(window.location.protocol).concat(t);var e=this.baseUrl&&this.baseUrl.length>0?this.baseUrl.startsWith("http")||this.baseUrl.startsWith("blob")||this.baseUrl.startsWith("base64")?this.baseUrl:nB("".concat(window.location.origin).concat(this.baseUrl)):window.location.origin,n=e.endsWith("/")?e:"".concat(e,"/");try{return new URL(t,n).toString()}catch(e){return t}}},{key:"getStylesheetConfigs",value:function t(){var t=this;var e=this.getDirectChildrenByTag("qti-stylesheet");return e.length?e.map(function(e,n){var i;var o=e.getAttribute("href");if(o){var a=t.resolveStylesheetHref(o);return{href:a,scoped:!1,key:a}}var s=(i=e.textContent)===null||i===void 0?void 0:i.trim();return s?{content:s,scoped:!1,key:"inline-".concat(n)}:null}).filter(Boolean):[]}},{key:"getSharedStylesheetContent",value:function t(){var t="",e=new Set,n=Array.from(document.styleSheets||[]);var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;try{if(u.href&&!u.href.startsWith(window.location.origin))continue;var c=u.ownerNode;if(c&&c.tagName==="STYLE"){var d=c.textContent||"";d&&!e.has(d)&&(t+="".concat(d,"\n"),e.add(d));continue}var h=u.cssRules?Array.from(u.cssRules):[];if(h.length){var p=h.map(function(t){return t.cssText}).join("\n");p&&!e.has(p)&&(t+="".concat(p,"\n"),e.add(p))}}catch(t){}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}var f=t.trim();return f.length?f:null}},{key:"getSharedStylesheetConfig",value:function t(){var t=this.getSharedStylesheetContent();return t?{content:t,scoped:!1,key:"__qti_shared_css__"}:null}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("message",this.handleIframeMessage),this._iframeObjectUrl&&(URL.revokeObjectURL(this._iframeObjectUrl),this._iframeObjectUrl=null)}},{key:"sendMessageToIframe",value:function t(t,e){var n;var i=(n=this.iframe)===null||n===void 0?void 0:n.contentWindow;if(!this._iframeLoaded||!i){this._pendingMessages.push({method:t,params:e});return}i.postMessage({source:"qti-portable-custom-interaction",responseIdentifier:this.responseIdentifier,method:t,params:e},"*")}},{key:"createIframe",value:function t(){var t=this;this._iframeObjectUrl&&(URL.revokeObjectURL(this._iframeObjectUrl),this._iframeObjectUrl=null),this.iframe=document.createElement("iframe"),this.iframe.id="pci-iframe-".concat(this.responseIdentifier),this.iframe.setAttribute("title","QTI PCI Iframe"),this.iframe.setAttribute("aria-label","QTI PCI Iframe"),this.iframe.setAttribute("aria-hidden","false"),this.iframe.setAttribute("role","application"),this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.display="block",this.iframe.onload=function(){t._iframeLoaded=!0,t._iframeObjectUrl&&(URL.revokeObjectURL(t._iframeObjectUrl),t._iframeObjectUrl=null),rl(t,dn,db).call(t),rl(t,dn,df).call(t),rl(t,dn,dm).call(t)};var e="qti-pci-".concat(this.responseIdentifier,"-").concat(Date.now());this.iframe.name=e;var n=this.generateIframeContent();try{var i=new Blob([n],{type:"text/html"});this._iframeObjectUrl=URL.createObjectURL(i),this.iframe.src=this._iframeObjectUrl}catch(t){var o=encodeURIComponent(n);this.iframe.src="data:text/html;charset=utf-8,".concat(o)}this.appendChild(this.iframe)}},{key:"connectedCallback",value:function t(){var t;var n;p(f(e.prototype),"connectedCallback",this).call(this),this.response=(t=(n=this.responseVariable)===null||n===void 0?void 0:n.value)!==null&&t!==void 0?t:null,window.addEventListener("message",this.handleIframeMessage),this.createIframe()}},{key:"generateIframeContent",value:function t(){var t=window.getComputedStyle(document.body),e=JSON.stringify(rl(this,dn,dl).call(this)),n=JSON.stringify(rl(this,dn,du).call(this)),i=this.dataset.baseUrl?this.dataset.baseUrl.startsWith("/")?"".concat(window.location.origin).concat(this.dataset.baseUrl):this.dataset.baseUrl:"",o=this.dataset.forwardConsole==="true",a="\n font-family: ".concat(t.getPropertyValue("font-family"),";\n font-size: ").concat(t.getPropertyValue("font-size"),";\n line-height: ").concat(t.getPropertyValue("line-height"),";\n font-weight: ").concat(t.getPropertyValue("font-weight"),";\n color: ").concat(t.getPropertyValue("color"),";\n ");return'<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="utf-8" />\n <title>QTI PCI Container</title>\n <base href="'.concat(window.location.origin,'" />\n <style>\n body, html {\n margin: 0;\n padding: 0;\n width: 100%;\n height: auto;\n overflow: hidden;\n /* Add the extracted font styles here */\n ').concat(a,'\n }\n .qti-customInteraction {\n width: 100%;\n height: 100%;\n }\n #pci-container {\n width: 100%;\n }\n qti-interaction-markup {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n </style>\n <script src="').concat(this.requireJsUrl,'"><\/script>\n <script>\n const forwardConsole = ').concat(o?"true":"false",";\n if (forwardConsole) {\n const originalLog = console.log.bind(console);\n const originalError = console.error.bind(console);\n const stringifyArgs = args =>\n args.map(arg => {\n if (typeof arg === 'string') return arg;\n try {\n return JSON.stringify(arg);\n } catch (e) {\n return String(arg);\n }\n });\n console.log = (...args) => {\n originalLog(...args);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'console',\n level: 'log',\n args: stringifyArgs(args)\n },\n '*'\n );\n };\n console.error = (...args) => {\n originalError(...args);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'console',\n level: 'error',\n args: stringifyArgs(args)\n },\n '*'\n );\n };\n }\n // Define standard paths and shims\n window.requirePaths = ").concat(e,";\n\n window.requireShim = ").concat(n,";\n\n // Single initial RequireJS configuration with error handling\n window.requirejs.config({\n catchError: true,\n waitSeconds: 30,\n paths: window.requirePaths,\n baseUrl: '").concat(i,"',\n shim: window.requireShim,\n onNodeCreated: function(node, config, moduleName, url) {\n // Add error handler to script node\n node.addEventListener('error', function(evt) {\n console.error('Script load error for module:', moduleName, 'URL:', url, 'Event:', evt);\n });\n },\n onError: function(err) {\n console.error('RequireJS error:', {\n type: err.requireType,\n modules: err.requireModules,\n error: err\n });\n\n if (err.requireType === 'scripterror') {\n console.error('Script error usually indicates a network or CORS issue with:', err.requireModules);\n }\n\n // Notify parent window about the error\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'error',\n params: {\n message: 'RequireJS ' + err.requireType + ' error for modules: ' + err.requireModules,\n details: {\n type: err.requireType,\n modules: err.requireModules,\n error: err.toString()\n }\n }\n }, '*');\n }\n });\n\n // PCI Manager for iframe implementation\n window.PCIManager = {\n pciInstance: null,\n container: null,\n markupEl: null,\n propertiesEl: null,\n customInteractionTypeIdentifier: null,\n responseIdentifier: null,\n pendingBoundTo: null,\n pendingMarkup: null,\n pendingProperties: null,\n pendingState: null,\n pendingStylesheets: null,\n stylesheetKeys: {},\n interactionChangedViaEvent: false,\n eventBridgeAttached: false,\n lastResponseStr: null,\n hadResponse: false,\n\n initialize: function(config) {\n this.customInteractionTypeIdentifier = config.customInteractionTypeIdentifier;\n this.responseIdentifier = config.responseIdentifier;\n this.container = document.getElementById('pci-container');\n this.container.classList.add('qti-customInteraction');\n\n function qtiVariableHasValue(qtiVar) {\n if (!qtiVar) return false;\n if (qtiVar.base) {\n for (const k in qtiVar.base) {\n if (!Object.prototype.hasOwnProperty.call(qtiVar.base, k)) continue;\n const v = qtiVar.base[k];\n if (v !== null && v !== undefined && v !== '') return true;\n }\n }\n if (qtiVar.list) {\n for (const k in qtiVar.list) {\n if (!Object.prototype.hasOwnProperty.call(qtiVar.list, k)) continue;\n const v = qtiVar.list[k];\n if (Array.isArray(v) && v.some(x => x !== null && x !== undefined && x !== '')) return true;\n }\n }\n if (Array.isArray(qtiVar.record) && qtiVar.record.length > 0) return true;\n return false;\n }\n\n const initialBoundTo = config.boundTo && config.boundTo[this.responseIdentifier];\n this.hadResponse = qtiVariableHasValue(initialBoundTo);\n this.lastResponseStr = this.hadResponse ? JSON.stringify(initialBoundTo) : null;\n // Ensure expected DOM structure exists (markup + properties)\n this.markupEl = this.container.querySelector('qti-interaction-markup');\n if (!this.markupEl) {\n this.markupEl = document.createElement('qti-interaction-markup');\n this.container.appendChild(this.markupEl);\n }\n this.markupEl.classList.add('qti-customInteraction');\n this.propertiesEl = this.container.querySelector('properties');\n if (!this.propertiesEl) {\n this.propertiesEl = document.createElement('properties');\n this.propertiesEl.style.display = 'none';\n this.container.appendChild(this.propertiesEl);\n } else {\n this.propertiesEl.style.display = 'none';\n }\n\n // Apply any markup/properties that arrived before initialization\n if (this.pendingMarkup !== null) {\n this.setMarkup(this.pendingMarkup);\n this.pendingMarkup = null;\n }\n if (this.pendingProperties !== null) {\n this.setProperties(this.pendingProperties);\n this.pendingProperties = null;\n }\n if (this.pendingStylesheets !== null) {\n this.setStylesheets(this.pendingStylesheets);\n this.pendingStylesheets = null;\n }\n\n // Bridge qti-interaction-changed events (preferred over polling)\n if (!this.eventBridgeAttached) {\n this.eventBridgeAttached = true;\n const self = this;\n this.container.addEventListener(\n 'qti-interaction-changed',\n function(evt) {\n try {\n self.interactionChangedViaEvent = true;\n const value = evt && evt.detail ? evt.detail.value : undefined;\n if (value !== undefined) {\n const state = self.pciInstance && typeof self.pciInstance.getState === 'function' ? self.pciInstance.getState() : null;\n self.notifyInteractionChanged(value, state);\n }\n } catch (e) {\n // ignore bridge errors, polling fallback may still work\n }\n },\n true\n );\n }\n\n function getResolvablePath(path, basePath) {\n if (Array.isArray(path)) {\n return path.map(p => getResolvablePathString(p, basePath));\n } else {\n return getResolvablePathString(path, basePath);\n }\n }\n\n function removeDoubleSlashes(str) {\n return str\n .replace(/([^:\\/])\\/\\/+/g, '$1/')\n .replace(/\\/\\//g, '/')\n .replace('http:/', 'http://')\n .replace('https:/', 'https://');\n }\n\n function getResolvablePathString(path, basePath) {\n path = path.replace(/\\.js$/, '');\n return path?.toLocaleLowerCase().startsWith('http') || !basePath\n ? path\n : removeDoubleSlashes(`${basePath}/${path}`);\n }\n\n function combineRequireResolvePaths(path1, path2, baseUrl) {\n path1 = getResolvablePath(path1, baseUrl);\n const path1Array = Array.isArray(path1) ? path1 : [path1];\n if (!path2) {\n return path1Array;\n }\n path2 = getResolvablePath(path2, baseUrl);\n const path2Array = Array.isArray(path2) ? path2 : [path2];\n return path1Array.concat(path2Array).filter((value, index, self) => self.indexOf(value) === index);\n }\n\n // Update paths with modules from the config\n if (config.interactionModules && config.interactionModules.length > 0) {\n config.interactionModules.forEach(module => {\n if (module.id && module.primaryPath) {\n const currentPath = window.requirePaths[module.id] || [];\n const currentPaths = Array.isArray(currentPath) ? currentPath : [currentPath];\n const newPath = combineRequireResolvePaths(\n module.primaryPath, module.fallbackPath, config.baseUrl\n );\n window.requirePaths[module.id] = currentPaths.concat(newPath).filter((value, index, self) => self.indexOf(value) === index);\n }\n });\n }\n\n // The ONLY other requirejs.config call - with the context for this specific PCI\n window.requirejs.config({\n context: this.customInteractionTypeIdentifier,\n paths: window.requirePaths,\n shim: window.requireShim\n });\n\n // Define qtiCustomInteractionContext for the PCI\n define('qtiCustomInteractionContext', () => {\n return {\n register: pciInstance => {\n this.pciInstance = pciInstance;\n // Configure PCI instance\n const pciConfig = {\n properties: config.properties || {},\n contextVariables: config.contextVariables || {},\n templateVariables: config.templateVariables || {},\n onready: pciInstance => {\n this.pciInstance = pciInstance;\n // Apply any pending updates that arrived before onready\n if (this.pendingBoundTo) {\n this.applyBoundTo(this.pendingBoundTo);\n this.pendingBoundTo = null;\n }\n if (this.pendingState && typeof this.pciInstance.setState === 'function') {\n this.pciInstance.setState(this.pendingState);\n this.pendingState = null;\n }\n this.notifyReady();\n },\n ondone: (pciInstance, response, state, status) => {\n this.notifyInteractionChanged(response, typeof state === 'string' ? state : null);\n },\n responseIdentifier: config.responseIdentifier,\n boundTo: config.boundTo,\n };\n\n if (pciInstance.getInstance) {\n const dom = this.markupEl || this.container;\n // Round-trip support for object states (stored as a prefixed JSON string by the host).\n // For strict string-based PCIs we pass the original string through unchanged.\n let restoredState = config.state;\n if (typeof restoredState === 'string' && restoredState.indexOf('__qti_json__::') === 0) {\n try {\n restoredState = JSON.parse(restoredState.substring('__qti_json__::'.length));\n } catch (e) {\n // If parsing fails, fall back to the raw string.\n restoredState = config.state;\n }\n }\n pciInstance.getInstance(dom, pciConfig, restoredState || undefined);\n } else {\n // TAO custom interaction initialization\n const restoreTAOConfig = (dataset) => {\n const config = {};\n const parseDataAttributes = () => {\n const result = {};\n\n // Separate direct attributes from nested ones\n Object.entries(dataset || {}).forEach(([key, value]) => {\n if (!key.includes('__')) {\n // Direct attributes (like version)\n result[key] = value;\n }\n });\n\n // Parse nested attributes\n const nestedData = {};\n\n Object.entries(dataset || {}).forEach(([key, value]) => {\n const parts = key.split('__');\n if (parts.length > 1) {\n const [group, index, prop] = parts;\n nestedData[group] = nestedData[group] || {};\n nestedData[group][index] = nestedData[group][index] || {};\n nestedData[group][index][prop] = value;\n }\n });\n\n // Convert nested groups to arrays\n Object.entries(nestedData).forEach(([key, group]) => {\n result[key] = Object.values(group);\n });\n return result;\n };\n const data = parseDataAttributes();\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n const value = data[key];\n if (key === 'config') {\n config[key] = JSON.parse(value);\n } else {\n config[key] = value;\n }\n }\n }\n return config;\n };\n const taoConfig = restoreTAOConfig(config.dataAttributes);\n\n this.pciInstance.initialize(\n this.customInteractionTypeIdentifier,\n (this.markupEl || this.container).firstElementChild || (this.markupEl || this.container),\n Object.keys(taoConfig).length ? taoConfig : null\n );\n }\n },\n notifyReady: () => {\n PCIManager.notifyReady();\n }\n };\n });\n\n // Load the PCI module\n this.loadModule(config.module);\n },\n\n loadModule: function(modulePath) {\n try {\n // Get the context-specific require\n const contextRequire = window.requirejs.config({\n context: this.customInteractionTypeIdentifier\n });\n contextRequire(['require'], require => {\n // Now load the actual module\n require([modulePath], () => {\n }, err => {\n console.error('Error loading module:', modulePath, err);\n this.notifyError('Module load error: ' + err.toString());\n });\n });\n } catch (error) {\n console.error('Exception in loadModule:', modulePath);\n console.error(error);\n this.notifyError('Error in require call: ' + error.toString());\n }\n },\n\n notifyReady: function() {\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'iframeReady'\n }, '*');\n },\n\n notifyInteractionChanged: function(response, state) {\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'interactionChanged',\n params: { value: response, state: state }\n }, '*');\n },\n\n notifyError: function(message) {\n console.error('PCI Error:', message);\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'error',\n params: { message: message }\n }, '*');\n },\n\n setMarkup: function(markupHtml) {\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n if (!this.container) {\n this.pendingMarkup = markupHtml;\n return;\n }\n this.markupEl = this.container.querySelector('qti-interaction-markup');\n if (!this.markupEl) {\n this.markupEl = document.createElement('qti-interaction-markup');\n this.container.appendChild(this.markupEl);\n }\n this.markupEl.classList.add('qti-customInteraction');\n this.markupEl.innerHTML = markupHtml || '';\n },\n\n setProperties: function(propertiesHtml) {\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n if (!this.container) {\n this.pendingProperties = propertiesHtml;\n return;\n }\n this.propertiesEl = this.container.querySelector('properties');\n if (!this.propertiesEl) {\n this.propertiesEl = document.createElement('properties');\n this.container.appendChild(this.propertiesEl);\n }\n this.propertiesEl.style.display = 'none';\n this.propertiesEl.innerHTML = propertiesHtml || '';\n },\n\n minifyCss: function(cssContent) {\n return cssContent\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n .replace(/\\s+/g, ' ')\n .replace(/\\s*([{}:;])\\s*/g, '$1')\n .trim();\n },\n\n injectStylesheet: function(cssContent, key, scoped) {\n if (!cssContent) return;\n const head = document.head || document.getElementsByTagName('head')[0] || document.body;\n if (!head) return;\n const resolvedKey = key || '';\n if (resolvedKey && this.stylesheetKeys[resolvedKey]) return;\n const shouldScope = scoped !== false;\n const styleEl = document.createElement('style');\n styleEl.media = 'screen';\n if (resolvedKey) styleEl.setAttribute('data-qti-stylesheet', resolvedKey);\n const minified = this.minifyCss(cssContent);\n styleEl.textContent = shouldScope ? '@scope {' + minified + '}' : minified;\n head.appendChild(styleEl);\n if (resolvedKey) this.stylesheetKeys[resolvedKey] = true;\n },\n\n setStylesheets: function(stylesheets) {\n if (!Array.isArray(stylesheets)) return;\n stylesheets.forEach((sheet, index) => {\n if (!sheet) return;\n const key = sheet.key || sheet.href || ('inline-' + index);\n const scoped = sheet.scoped !== false;\n if (sheet.content) {\n this.injectStylesheet(sheet.content, key, scoped);\n return;\n }\n if (sheet.href) {\n fetch(sheet.href)\n .then(resp => resp.text())\n .then(css => this.injectStylesheet(css, key, scoped))\n .catch(() => {\n // ignore stylesheet load errors\n });\n }\n });\n },\n\n applyBoundTo: function(boundTo) {\n if (!this.pciInstance || typeof this.pciInstance.setResponse !== 'function') return;\n const value = boundTo && (boundTo[this.responseIdentifier] || boundTo[Object.keys(boundTo)[0]]);\n if (value) this.pciInstance.setResponse(value);\n },\n };\n\n // Set up message listener for communication with parent\n let expectedParentOrigin = null;\n window.addEventListener('message', function(event) {\n const { data } = event;\n\n // Ensure the message is from our parent\n if (event.source !== window.parent || !data || data.source !== 'qti-portable-custom-interaction') {\n return;\n }\n if (expectedParentOrigin === null) {\n expectedParentOrigin = event.origin;\n } else if (event.origin !== expectedParentOrigin) {\n return;\n }\n\n function deepQuerySelector(root, selector) {\n if (!root) return null;\n try {\n const direct = root.querySelector ? root.querySelector(selector) : null;\n if (direct) return direct;\n } catch (e) {\n // ignore invalid selector for this root\n }\n if (!root.querySelectorAll) return null;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n const found = deepQuerySelector(node.shadowRoot, selector);\n if (found) return found;\n }\n }\n return null;\n }\n\n function deepFindElementByExactText(root, text) {\n if (!root || !text) return null;\n if (root.querySelectorAll) {\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if ((node.textContent || '').trim() === text) return node;\n if (node.shadowRoot) {\n const found = deepFindElementByExactText(node.shadowRoot, text);\n if (found) return found;\n }\n }\n }\n return null;\n }\n\n switch(data.method) {\n case 'initialize':\n PCIManager.initialize(data.params);\n break;\n\n case 'setMarkup':\n PCIManager.setMarkup(data.params);\n break;\n\n case 'setBoundTo':\n if (PCIManager.pciInstance) {\n PCIManager.applyBoundTo(data.params);\n } else {\n PCIManager.pendingBoundTo = data.params;\n }\n break;\n\n case 'setProperties':\n PCIManager.setProperties(data.params);\n break;\n\n case 'setStylesheets':\n PCIManager.setStylesheets(data.params);\n break;\n\n case 'setState':\n if (PCIManager.pciInstance && typeof PCIManager.pciInstance.setState === 'function') {\n PCIManager.pciInstance.setState((data.params && data.params.state) || data.params);\n } else {\n PCIManager.pendingState = (data.params && data.params.state) || data.params;\n }\n break;\n\n case 'getContent': {\n const messageId = data.params && data.params.messageId;\n const collectShadowHtml = root => {\n const parts = [];\n if (!root || !root.querySelectorAll) return parts;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n parts.push(node.shadowRoot.innerHTML || '');\n parts.push(...collectShadowHtml(node.shadowRoot));\n }\n }\n return parts;\n };\n const shadowHtml = collectShadowHtml(document).join('\\n');\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'getContentResponse',\n messageId: messageId,\n content: (document.documentElement ? document.documentElement.outerHTML : '') + '\\n' + shadowHtml\n },\n '*'\n );\n break;\n }\n\n case 'simulateClick': {\n const messageId = data.params && data.params.messageId;\n const x = data.params && data.params.x;\n const y = data.params && data.params.y;\n const el = typeof x === 'number' && typeof y === 'number' ? document.elementFromPoint(x, y) : null;\n const target = (el && el.closest && el.closest('.hitbox')) || document.querySelector('.hitbox') || el;\n if (target) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n clientX: x,\n clientY: y,\n screenX: x,\n screenY: y,\n view: window\n });\n target.dispatchEvent(evt);\n }\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickResponse',\n messageId: messageId\n },\n '*'\n );\n break;\n }\n\n case 'getBoundingRect': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const el = selector ? deepQuerySelector(document, selector) : null;\n const rect = el && typeof el.getBoundingClientRect === 'function' ? el.getBoundingClientRect() : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'getBoundingRectResponse',\n messageId: messageId,\n rect: rect\n ? {\n left: rect.left,\n top: rect.top,\n width: rect.width,\n height: rect.height\n }\n : null\n },\n '*'\n );\n break;\n }\n\n case 'clickOnSelector': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const el = selector ? deepQuerySelector(document, selector) : null;\n const success = !!el;\n if (el && typeof el.click === 'function') el.click();\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickSelectorResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'clickOnElementByText': {\n const messageId = data.params && data.params.messageId;\n const text = data.params && data.params.text;\n const target = text ? deepFindElementByExactText(document, text) : null;\n const success = !!target;\n if (target && typeof target.click === 'function') target.click();\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickTextResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'setValueElement': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const value = data.params && data.params.value;\n const el = selector ? deepQuerySelector(document, selector) : null;\n let success = false;\n if (el && 'value' in el) {\n try {\n el.value = value;\n el.dispatchEvent(new Event('input', { bubbles: true }));\n el.dispatchEvent(new Event('change', { bubbles: true }));\n success = true;\n } catch (e) {\n success = false;\n }\n }\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'console':\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'console',\n level: data.level,\n args: data.args\n },\n '*'\n );\n break;\n }\n });\n\n let resizeTimeout;\n let previousHeight = 0;\n const notifyResize = () => {\n const container = document.getElementById('pci-container');\n const newHeight = container.scrollHeight + 100;\n if (newHeight !== previousHeight) {\n previousHeight = newHeight;\n clearTimeout(resizeTimeout);\n resizeTimeout = setTimeout(() => {\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'resize',\n height: newHeight,\n width: container.scrollWidth\n }, '*');\n }, 100); // Adjust debounce time as needed\n }\n };\n\n function setupResizeObserver() {\n const container = document.getElementById('pci-container');\n if (!container || !(container instanceof Element)) {\n console.warn('ResizeObserver: document.container is not an Element');\n return;\n }\n\n const resizeObserver = new ResizeObserver(() => {\n notifyResize();\n });\n\n resizeObserver.observe(container);\n }\n\n // Run setup once DOM is ready\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n notifyResize(); // initial resize\n setupResizeObserver();\n });\n } else {\n notifyResize();\n setupResizeObserver();\n }\n\n window.addEventListener('load', () => {\n notifyResize();\n });\n let lastResponseStr = '';\n setInterval(() => {\n if (PCIManager.interactionChangedViaEvent) return;\n if (PCIManager.pciInstance && PCIManager.pciInstance.getResponse) {\n const response = PCIManager.pciInstance.getResponse();\n if (response === undefined) {\n // Don't emit an initial empty on load; only emit a clear if we previously had a value\n if (!PCIManager.hadResponse) return;\n PCIManager.hadResponse = false;\n PCIManager.lastResponseStr = null;\n const state = PCIManager.pciInstance && typeof PCIManager.pciInstance.getState === 'function' ? PCIManager.pciInstance.getState() : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'interactionChanged',\n params: { value: null, state: state }\n },\n '*'\n );\n return;\n }\n\n const responseStr = JSON.stringify(response);\n\n if (responseStr !== PCIManager.lastResponseStr) {\n PCIManager.lastResponseStr = responseStr;\n PCIManager.hadResponse = true;\n const state = PCIManager.pciInstance && typeof PCIManager.pciInstance.getState === 'function' ? PCIManager.pciInstance.getState() : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'interactionChanged',\n params: { value: response, state: state }\n },\n '*'\n );\n }\n }\n }, 500); // Check every 500ms\n <\/script>\n</head>\n<body>\n <div id=\"pci-container\"></div>\n</body>\n</html>")}},{key:"toggleInternalCorrectResponse",value:function t(t){var e;var n=this.responseVariable;this.correctResponse=t?n===null||n===void 0?void 0:n.correctResponse:n.cardinality==="single"?"":[];var i="correct-response-container-".concat(this.responseIdentifier),o=(e=this.parentElement)===null||e===void 0?void 0:e.querySelectorAll("#".concat(i));if(o&&o.forEach(function(t){t.remove()}),t)this.disable();else{this.enable();return}if(!t||!(n===null||n===void 0?void 0:n.correctResponse))return;var a=document.createElement("div");a.id=i,a.className="pci-correct-response-container",a.style.position="relative",a.style.marginTop="20px",a.style.border="2px solid green",a.style.padding="16px",a.style.borderRadius="4px",a.style.backgroundColor="rgba(0, 128, 0, 0.05)";var s=document.createElement("div");s.textContent="Correct Response:",s.style.fontWeight="bold",s.style.marginBottom="10px",s.style.color="green",a.appendChild(s);var l=document.createElement("qti-portable-custom-interaction");Array.from(this.attributes).forEach(function(t){t.name!=="id"&&t.name!=="response-identifier"&&l.setAttribute(t.name,t.value)});var u=this.responseIdentifier;l.responseIdentifier="".concat(u,"-correct"),Array.from(this.children).forEach(function(t){var e=t.cloneNode(!0);l.appendChild(e)});var c=n.correctResponse,d=l.connectedCallback;l.connectedCallback=function(){var t=this;d.call(this);var e=function e(){return t._iframeLoaded?(setTimeout(function(){var e=t.responseVariablesToQtiVariableJSON(c,n.cardinality,n.baseType);t.sendMessageToIframe("setBoundTo",h({},u,e)),t.sendMessageToIframe("setState",{state:"review"})},1e3),!0):!1};if(!e()){var i=setInterval(function(){e()&&clearInterval(i)},100);setTimeout(function(){clearInterval(i)},1e4)}},l.style.pointerEvents="none",a.appendChild(l),this.after(a)}},{key:"disable",value:function t(){if(rs(this,dw,{pointerEvents:this.style.pointerEvents,position:this.style.position}),this.sendMessageToIframe("setState",{state:"disabled"}),!this.querySelector(".pci-interaction-overlay")){var t=document.createElement("div");t.className="pci-interaction-overlay",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.backgroundColor="rgba(200, 200, 200, 0.3)",t.style.zIndex="100",t.style.pointerEvents="all",t.style.cursor="not-allowed",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.appendChild(t)}}},{key:"enable",value:function t(){var t=this.querySelector(".pci-interaction-overlay");t&&t.remove(),ro(this,dw)&&(ro(this,dw).pointerEvents&&(this.style.pointerEvents=ro(this,dw).pointerEvents),ro(this,dw).position&&(this.style.position=ro(this,dw).position),rs(this,dw,null)),this.sendMessageToIframe("setState",{state:"interacting"})}},{key:"render",value:function t(){return iC(e7(),this._errorMessage?iC(e8(),this._errorMessage):"")}}]);return e}(oT);c9=new WeakMap,dt=new WeakMap,de=new WeakMap,dn=new WeakSet,dr=function t(){var t=this;if(ro(this,dt)===null&&this.requirePathsJson)try{var e=JSON.parse(this.requirePathsJson);Array.isArray(e)?(rs(this,dt,{}),e.forEach(function(e){e.name&&e.value&&(ro(t,dt)[e.name]=e.value)})):rs(this,dt,e)}catch(t){console.error("Error parsing require paths JSON:",t),this._errorMessage="Error parsing require paths JSON: ".concat(t.message),rs(this,dt,{})}return ro(this,dt)||{}},di=function t(){if(ro(this,de)===null&&this.requireShimJson)try{rs(this,de,JSON.parse(this.requireShimJson))}catch(t){console.error("Error parsing require shim JSON:",t),this._errorMessage="Error parsing require shim JSON: ".concat(t.message),rs(this,de,{})}return ro(this,de)||{}},da=function t(){return{"taoQtiItem/portableLib/OAT/util/event":"/assets/pci-scripts/portableLib/OAT/util/event","taoQtiItem/portableLib/OAT/util/html":"/assets/pci-scripts/portableLib/OAT/util/html","taoQtiItem/portableLib/OAT/util/EventMgr":"/assets/pci-scripts/portableLib/OAT/util/EventMgr","taoQtiItem/portableLib/OAT/util/math":"/assets/pci-scripts/portableLib/OAT/util/math","taoQtiItem/portableLib/OAT/util/xml":"/assets/pci-scripts/portableLib/OAT/util/xml","taoQtiItem/portableLib/OAT/util/tooltip":"/assets/pci-scripts/portableLib/OAT/util/tooltip","taoQtiItem/portableLib/OAT/util/tpl":"/assets/pci-scripts/portableLib/OAT/util/tpl","taoQtiItem/portableLib/OAT/util/asset":"/assets/pci-scripts/portableLib/OAT/util/asset","taoQtiItem/portableLib/OAT/waitForMedia":"/assets/pci-scripts/portableLib/OAT/waitForMedia","taoQtiItem/portableLib/OAT/mediaPlayer":"/assets/pci-scripts/portableLib/OAT/mediaPlayer","taoQtiItem/portableLib/OAT/scale.raphael":"/assets/pci-scripts/portableLib/OAT/scale.raphael","taoQtiItem/portableLib/OAT/interact-rotate":"/assets/pci-scripts/portableLib/OAT/interact-rotate","taoQtiItem/portableLib/OAT/promise":"/assets/pci-scripts/portableLib/OAT/promise","taoQtiItem/portableLib/OAT/sts/common":"/assets/pci-scripts/portableLib/OAT/sts/common","taoQtiItem/portableLib/OAT/sts/transform-helper":"/assets/pci-scripts/portableLib/OAT/sts/transform-helper","taoQtiItem/portableLib/OAT/sts/stsEventManager":"/assets/pci-scripts/portableLib/OAT/sts/stsEventManager","taoQtiItem/portableLib/async":"/assets/pci-scripts/portableLib/async","taoQtiItem/portableLib/interact":"/assets/pci-scripts/portableLib/interact","taoQtiItem/portableLib/es6-promise":"/assets/pci-scripts/portableLib/es6-promise","taoQtiItem/portableLib/jquery_2_1_1":"/assets/pci-scripts/portableLib/jquery_2_1_1","taoQtiItem/portableLib/jquery.qtip":"/assets/pci-scripts/portableLib/jquery.qtip","taoQtiItem/portableLib/lodash":"/assets/pci-scripts/portableLib/lodash","taoQtiItem/portableLib/handlebars":"/assets/pci-scripts/portableLib/handlebars","taoQtiItem/portableLib/raphael":"/assets/pci-scripts/portableLib/raphael","taoQtiItem/pci-scripts/portableLib/jquery.qtip":"/assets/pci-scripts/portableLib/jquery.qtip","taoQtiItem/pci-scripts/portableLib/lodash":"/assets/pci-scripts/portableLib/lodash","taoQtiItem/pci-scripts/portableLib/raphael":"/assets/pci-scripts/portableLib/raphael","IMSGlobal/jquery_2_1_1":"/assets/pci-scripts/IMSGlobal/jquery_2_1_1","OAT/util/event":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/event","OAT/util/html":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/html","OAT/util/EventMgr":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/EventMgr","OAT/util/math":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/math","OAT/util/xml":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/xml","OAT/util/tooltip":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/tooltip","OAT/lodash":"/assets/pci-scripts/legacyPortableSharedLib/lodash",mathJax:"/assets/pci-scripts/mathjax/mathJax",css:"/assets/pci-scripts/css/css"}},ds=function t(){return{mathJax:{exports:"MathJax",init:function t(){var t=window;if(t.MathJax)return t.MathJax.Hub.Config({showMathMenu:!1,showMathMenuMSIE:!1,menuSettings:{inTabOrder:!1}}),t.MathJax.Hub.Startup.MenuZoom=function(){},t.MathJax.Hub.Startup.onload(),t.MathJax}}}},dl=function t(){var t=rl(this,dn,da).call(this),e=rl(this,dn,dr).call(this);return this.useDefaultPaths?k({},t,e):e},du=function t(){var t=rl(this,dn,di).call(this),e=rl(this,dn,ds).call(this);return this.useDefaultShims?k({},e,t):t},dc=function t(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n){for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];if(Array.isArray(o))return o.map(String);if(o!=null)return String(o)}}}return null},dd=function t(t){var e=k({},t);for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var i=n.replace(/[A-Z]/g,function(t){return"-".concat(t.toLowerCase())});e[i]=t[n]}return e},dh=function t(t){return t&&t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/").replace(/&#x60;/g,"`").replace(/&#x3D;/g,"=")},dp=function t(t){var e={};var n=true,i=false,o=undefined;try{for(var a=Object.entries(t)[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=M(s.value,2),u=l[0],c=l[1];typeof c=="string"?e[u]=rl(this,dn,dh).call(this,c):e[u]=c}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e},df=function t(){var t=this.getStylesheetConfigs(),e=this.getSharedStylesheetConfig(),n=e?[e].concat(L(t)):t;n.length>0&&this.sendMessageToIframe("setStylesheets",n)},dv=function t(){var t=this;this._pendingMessages.length&&(this._pendingMessages.forEach(function(e){t.sendMessageToIframe(e.method,e.params)}),this._pendingMessages=[])},dm=function t(){var t,e;var n=rl(this,dn,dd).call(this,rl(this,dn,dp).call(this,k({},this.dataset))),i=(e=this.context)===null||e===void 0?void 0:(t=e.state)===null||t===void 0?void 0:t[this.responseIdentifier],o=typeof i=="string"&&i.length>0?i:null,a={module:this.module,customInteractionTypeIdentifier:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl?this.baseUrl.startsWith("http")||this.baseUrl.startsWith("blob")||this.baseUrl.startsWith("base64")?this.baseUrl:nB("".concat(window.location.origin).concat(this.baseUrl)):window.location.origin,responseIdentifier:this.responseIdentifier,properties:n,contextVariables:this.getContextVariables(),templateVariables:this.getTemplateVariables(),dataAttributes:k({},this.dataset),interactionModules:rl(this,dn,dg).call(this),boundTo:o?null:this.boundTo,state:o};this.sendMessageToIframe("initialize",a)},dg=function t(){var t=[],e=this.querySelector("qti-interaction-modules");if(e){var n=e.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;t.push({id:u.getAttribute("id"),primaryPath:u.getAttribute("primary-path"),fallbackPath:u.getAttribute("fallback-path")})}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return t},db=function t(){var t=this.querySelector("qti-interaction-markup");t&&this.sendMessageToIframe("setMarkup",t.innerHTML);var e=this.querySelector("properties");e&&this.sendMessageToIframe("setProperties",e.innerHTML)},dy=function t(){},dw=new WeakMap,dq.styles=[c7,rG(e9())],rr([n({type:String,attribute:"module"})],dq.prototype,"module",2),rr([n({type:String,attribute:"custom-interaction-type-identifier"})],dq.prototype,"customInteractionTypeIdentifier",2),rr([n({type:String,attribute:"data-require-paths"})],dq.prototype,"requirePathsJson",2),rr([n({type:String,attribute:"data-require-shim"})],dq.prototype,"requireShimJson",2),rr([n({type:String,attribute:"data-require-js-url"})],dq.prototype,"requireJsUrl",2),rr([n({type:String,attribute:"data-base-url"})],dq.prototype,"baseUrl",2),rr([n({type:Boolean,attribute:"data-use-default-shims"})],dq.prototype,"useDefaultShims",2),rr([n({type:Boolean,attribute:"data-use-default-paths"})],dq.prototype,"useDefaultPaths",2),rr([i()],dq.prototype,"_errorMessage",2),rr([P({context:or,subscribe:!0}),i()],dq.prototype,"context",2),rr([P({context:oi,subscribe:!0}),i()],dq.prototype,"qtiContext",2),rr([i()],dq.prototype,"response",2);var dk,dx=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,dk,!1);return t}d(e,[{key:"getIFrameContent",value:function t(){return a(function(){var t;return z(this,function(e){t=this;return[2,new Promise(function(e){var n="get-content-".concat(Date.now()),i=function o(o){var a=o.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===t.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="getContentResponse"&&(a===null||a===void 0?void 0:a.messageId)===n&&(window.removeEventListener("message",i),e(a.content))};window.addEventListener("message",i),t.sendMessageToIframe("getContent",{messageId:n}),setTimeout(function(){window.removeEventListener("message",i),e("")},5e3)})]})}).call(this)}},{key:"setTestContext",value:function t(t){var e=this;this.context=t,this.updateComplete.then(function(){var n;e.value=t===null||t===void 0?void 0:(n=t.variables)===null||n===void 0?void 0:n.find(function(t){return t.identifier===e.responseIdentifier}).value})}},{key:"recreateIframe",value:function t(){return a(function(){var t;return z(this,function(e){t=this;rs(this,dk,!0);try{return[2,(this.iframe&&(this._iframeLoaded=!1,this.iframe.remove()),this._pendingMessages=[],this.createIframe(),new Promise(function(e){var n=function i(){t.removeEventListener("qti-portable-custom-interaction-loaded",n),e()};t.addEventListener("qti-portable-custom-interaction-loaded",n),setTimeout(function(){t.removeEventListener("qti-portable-custom-interaction-loaded",n),e()},5e3)}))]}finally{rs(this,dk,!1)}return[2]})}).call(this)}},{key:"disconnectedCallback",value:function t(){ro(this,dk)||p(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"iFrameMouseClick",value:function t(t,e){return a(function(){var n;return z(this,function(i){n=this;return[2,new Promise(function(i){var o="click-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="clickResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i())};window.addEventListener("message",a),n.sendMessageToIframe("simulateClick",{x:t,y:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i()},5e3)})]})}).call(this)}},{key:"iFrameClickOnElement",value:function t(t){return a(function(){var e;return z(this,function(n){e=this;return[2,new Promise(function(n){var i="click-selector-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="clickSelectorResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("clickOnSelector",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"iFrameClickOnElementByText",value:function t(t){return a(function(){var e;return z(this,function(n){e=this;return[2,new Promise(function(n){var i="click-text-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="clickTextResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("clickOnElementByText",{text:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"iFrameSetValueElement",value:function t(t,e){return a(function(){var n;return z(this,function(i){n=this;return[2,new Promise(function(i){var o="set-value-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="setValueResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i(e.success))};window.addEventListener("message",a),n.sendMessageToIframe("setValueElement",{selector:t,value:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i(!1)},5e3)})]})}).call(this)}},{key:"iFrameGetBoundingClientRect",value:function t(t){return a(function(){var e;return z(this,function(n){e=this;return[2,new Promise(function(n){var i="get-bounding-rect-".concat(Date.now()),o=function t(t){var a;var s=t.data;(s===null||s===void 0?void 0:s.source)==="qti-pci-iframe"&&(!(s===null||s===void 0?void 0:s.responseIdentifier)||(s===null||s===void 0?void 0:s.responseIdentifier)===e.responseIdentifier)&&(s===null||s===void 0?void 0:s.method)==="getBoundingRectResponse"&&(s===null||s===void 0?void 0:s.messageId)===i&&(window.removeEventListener("message",o),n((a=s.rect)!==null&&a!==void 0?a:null))};window.addEventListener("message",o),e.sendMessageToIframe("getBoundingRect",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(null)},5e3)})]})}).call(this)}},{key:"iFrameSetValueElementByText",value:function t(t,e){return a(function(){var n;return z(this,function(i){n=this;return[2,new Promise(function(i){var o="set-value-text-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="setValueByTextResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i(e.success))};window.addEventListener("message",a),n.sendMessageToIframe("setValueElementByText",{text:t,value:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i(!1)},5e3)})]})}).call(this)}},{key:"iFrameMousedownOnElement",value:function t(t){return a(function(){var e;return z(this,function(n){e=this;return[2,new Promise(function(n){var i="mousedown-selector-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="mousedownSelectorResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("mousedownOnSelector",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"generateIframeContent",value:function t(){var t=p(f(e.prototype),"generateIframeContent",this).call(this),n="\n // Test helper functions for QtiPortableCustomInteractionTest\n // Base iframe implementation already provides PCIManager.getContent\n \n // Base iframe implementation already provides PCIManager.simulateClick\n \n // Base iframe implementation already provides PCIManager.clickOnSelector\n \n // Base iframe implementation already provides PCIManager.clickOnElementByText\n \n // Base iframe implementation already provides PCIManager.setValueElement\n \n function deepQuerySelector(root, selector) {\n if (!root) return null;\n try {\n const direct = root.querySelector ? root.querySelector(selector) : null;\n if (direct) return direct;\n } catch (e) {\n // ignore invalid selector for this root\n }\n if (!root.querySelectorAll) return null;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n const found = deepQuerySelector(node.shadowRoot, selector);\n if (found) return found;\n }\n }\n return null;\n }\n\n function deepFindElementByExactText(root, text) {\n if (!root || !text) return null;\n if (root.querySelectorAll) {\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if ((node.textContent || '').trim() === text) return node;\n if (node.shadowRoot) {\n const found = deepFindElementByExactText(node.shadowRoot, text);\n if (found) return found;\n }\n }\n }\n return null;\n }\n\n function escapeSelectorId(id) {\n try {\n if (window.CSS && typeof window.CSS.escape === 'function') return window.CSS.escape(id);\n } catch (e) {\n // ignore\n }\n return String(id).replace(/([ #;?%&,.+*~\\':\"!^$[\\]()=>|\\/])/g, '\\\\$1');\n }\n\n PCIManager.setValueElementByText = function(params) {\n const messageId = params && params.messageId;\n try {\n const text = params && params.text;\n const value = params && params.value;\n\n const textEl = text ? deepFindElementByExactText(document, text) : null;\n let target = null;\n\n if (textEl) {\n const tag = (textEl.tagName || '').toUpperCase();\n if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') {\n target = textEl;\n } else if (tag === 'LABEL' && textEl.htmlFor) {\n const id = escapeSelectorId(textEl.htmlFor);\n target = deepQuerySelector(document, '#' + id);\n }\n\n if (!target) {\n let parent = textEl.parentElement;\n while (parent) {\n const candidate = parent.querySelector ? parent.querySelector('input, textarea, select') : null;\n if (candidate) {\n target = candidate;\n break;\n }\n parent = parent.parentElement;\n }\n }\n }\n\n const success = !!target && setValueOnElement(target, value);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueByTextResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n } catch (error) {\n console.error('Error setting value by text:', error);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueByTextResponse',\n messageId: messageId,\n success: false,\n error: error.toString()\n },\n '*'\n );\n }\n };\n \n PCIManager.mousedownOnSelector = function(params) {\n try {\n const element = params && params.selector ? deepQuerySelector(document, params.selector) : null;\n \n let success = false;\n \n if (element) {\n const rect = element.getBoundingClientRect();\n const mousedownEvent = new MouseEvent('mousedown', {\n bubbles: true,\n cancelable: true,\n view: window,\n clientX: rect.left + rect.width / 2,\n clientY: rect.top + rect.height / 2\n });\n element.dispatchEvent(mousedownEvent);\n success = true;\n }\n \n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'mousedownSelectorResponse',\n messageId: params.messageId,\n success\n }, '*');\n } catch (error) {\n console.error('Error performing mousedown on selector:', error);\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'mousedownSelectorResponse',\n messageId: params.messageId,\n success: false,\n error: error.toString()\n }, '*');\n }\n };\n \n // Helper function for setting values on elements\n function setValueOnElement(element, value) {\n if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') {\n element.value = value;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n element.dispatchEvent(new Event('change', { bubbles: true }));\n return true;\n } else if (element.tagName === 'SELECT') {\n element.value = value;\n element.dispatchEvent(new Event('change', { bubbles: true }));\n return true;\n } else if (element.isContentEditable) {\n element.textContent = value;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n return true;\n }\n return false;\n }\n \n // Add test-related message handlers (do not override global handlers)\n let expectedParentOriginTest = null;\n window.addEventListener(\n 'message',\n function(event) {\n const { data } = event;\n\n if (event.source !== window.parent || !data || data.source !== 'qti-portable-custom-interaction') return;\n if (expectedParentOriginTest === null) expectedParentOriginTest = event.origin;\n else if (event.origin !== expectedParentOriginTest) return;\n if (data.responseIdentifier && data.responseIdentifier !== PCIManager.responseIdentifier) return;\n\n switch (data.method) {\n case 'setValueElementByText':\n PCIManager.setValueElementByText(data.params);\n return;\n case 'mousedownOnSelector':\n PCIManager.mousedownOnSelector(data.params);\n return;\n }\n },\n true\n );",i=t.lastIndexOf("<\/script>");return t.substring(0,i)+n+t.substring(i)}}]);return e}(dq);dk=new WeakMap;customElements.define("qti-portable-custom-interaction",dq);customElements.define("qti-portable-custom-interaction-test",dx);var d_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(nt())}}]);return e}(iQ);d_.styles=[rG(ne())];var dC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.removeMoveListener=t.removeMoveListener.bind(t),t.dragElementHandler=t.dragElementHandler.bind(t);return t}d(e,[{key:"render",value:function t(){return iC(nn())}},{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;p(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(){document.removeEventListener("mousemove",this.dragElementHandler,!0)}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return e}(iQ);dC.styles=[rG(nr())];customElements.define("qti-position-object-interaction",d_);customElements.define("qti-position-object-stage",dC);var dE="important",dS=" !"+dE,dA=oc(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){l(this,e);var n;var i;if(n=s(this,e,[t]),t.type!==ou.ATTRIBUTE||t.name!=="style"||((i=t.strings)===null||i===void 0?void 0:i.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}d(e,[{key:"render",value:function t(t){return Object.keys(t).reduce(function(e,n){var i=t[n];return i==null?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(i,";")},"")}},{key:"update",value:function t(t,e){var n=M(e,1),i=n[0];var o=t.element,a=o.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);var s=true,l=false,u=undefined;try{for(var c=this.ft[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;i[h]==null&&(this.ft.delete(h),h.includes("-")?a.removeProperty(h):a[h]=null)}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}for(var p in i){var f=i[p];if(f!=null){this.ft.add(p);var v=typeof f=="string"&&f.endsWith(dS);p.includes("-")||v?a.setProperty(p,v?f.slice(0,-11):f,v?dE:""):a[p]=f}}return iA}}]);return e}(od));var dR,dI,dM,dT,dP,dO,dL,dU,dN,dD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,dU);t.maxChoices=1/0;t.minChoices=0;t.response=null;t._correctAreas=[];t._responseCorrection=[];ra(t,dR,null);ra(t,dI,1);ra(t,dM,1);ra(t,dT,0);ra(t,dP,0);ra(t,dO,function(e){if(t.disabled)return;if(!ro(t,dR)){console.warn("No <img> element found in <qti-select-point-interaction>");return}rl(t,dU,dN).call(t);var n=ro(t,dR).getBoundingClientRect(),i=(e.clientX-n.left)*ro(t,dI),o=(e.clientY-n.top)*ro(t,dM),a="".concat(i.toFixed()," ").concat(o.toFixed());t.maxChoices===1?t.response=[a]:(t.maxChoices===0||(t.response||[]).length<t.maxChoices)&&(t.response=L(t.response||[]).concat([a])),t.saveResponse(t.response)});ra(t,dL,function(){rl(t,dU,dN).call(t)});return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",ro(this,dL))}},{key:"responsePoints",get:function t(){return(this.response||[]).filter(function(t){return t}).map(function(t){var e=M(t.split(" ").map(Number),2),n=e[0],i=e[1];return{x:n,y:i}})}},{key:"toggleCandidateCorrection",value:function t(t){var e=this;this._responseCorrection=[],t&&this.responsePoints.forEach(function(t){var n=e.responseVariable.areaMapping.areaMapEntries.some(function(n){return oW.isPointInArea("".concat(t.x," ").concat(t.y),"".concat(n.shape,",").concat(n.coords),e.responseVariable.baseType)});e._responseCorrection.push(n)})}},{key:"toggleCorrectResponse",value:function t(t){var e=this.responseVariable;if(!t||!e){this._correctAreas=[];return}var n=e.areaMapping,i=[];if(!n||n.areaMapEntries.length===0)if(e.correctResponse){var o=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];if(o.length===0||o.find(function(t){return t.split(" ").length<2}))return console.error("No valid correct responses found for the response variable."),null;console.warn("No area mapping found for the response variable. Using the correct responses to display the correct response but it probably won't score correct."),i=o.map(function(t){return{shape:"circle",coords:t.split(" ").join(",").concat(",10"),defaultValue:1,mappedValue:1}})}else{console.error("No area mapping found for the response variable.");return}else i=n.areaMapEntries;this._correctAreas=i.map(function(t){return{coords:t.coords,shape:t.shape}})}},{key:"updated",value:function t(t){p(f(e.prototype),"updated",this).call(this,t);var n=ro(this,dR);n&&t.has("_correctAreas")&&this._correctAreas.length>0&&(rl(this,dU,dN).call(this),this.shadowRoot.querySelectorAll("div").forEach(function(t){var e=t.dataset.coord,i=t.dataset.shape;e&&i&&nj(i,e.split(",").map(function(t){return+t}),n,t)}))}},{key:"render",value:function t(){var t=this;var e;return iC(na(),cs((this.response||[]).filter(function(t){return t}),function(t){return t},function(e,n){var i=M(e.split(" ").map(Number),2),o=i[0],a=i[1],s=o/(ro(t,dT)||1)*100,l=a/(ro(t,dP)||1)*100,u=16,c=u/(ro(t,dT)||1)*100,d=u/(ro(t,dP)||1)*100,h="";return t._responseCorrection[n]===!0?h=" correct":t._responseCorrection[n]===!1&&(h=" incorrect"),iC(ni(),h,dA({pointerEvents:t.maxChoices===1?"none":"auto",position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(s,"%"),top:"".concat(l,"%"),width:"min(".concat(c,"%, 1rem)"),height:"min(".concat(d,"%, 1rem)"),minWidth:"min(".concat(c,"%, 1rem)"),minHeight:"min(".concat(d,"%, 1rem)"),borderRadius:"50%",background:"red"}),e,t.disabled,function(e){e.stopPropagation(),t.response=(t.response||[]).filter(function(t,e){return e!==n}),t.saveResponse(t.response)})}),cs(((e=this._correctAreas)===null||e===void 0?void 0:e.filter(function(t){return t}))||[],function(t){return t},function(t,e){return iC(no(),dA({position:"absolute",pointerEvents:"none",backgroundColor:"var(--qti-correct)",opacity:"0.5"}),t.coords,"correct-response-".concat(e+1),t.shape)}))}},{key:"validate",value:function t(){return this.response!==null&&this.response.length>=this.minChoices&&this.response.length<=this.maxChoices}},{key:"firstUpdated",value:function t(){rs(this,dR,this.querySelector("img")),ro(this,dR)?(rl(this,dU,dN).call(this),ro(this,dR).addEventListener("click",ro(this,dO))):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",ro(this,dL)),ro(this,dR)&&ro(this,dR).removeEventListener("click",ro(this,dO))}}]);return e}(oT);dR=new WeakMap,dI=new WeakMap,dM=new WeakMap,dT=new WeakMap,dP=new WeakMap,dO=new WeakMap,dL=new WeakMap,dU=new WeakSet,dN=function t(){rs(this,dT,ro(this,dR).getAttribute("width")?parseFloat(ro(this,dR).getAttribute("width")):ro(this,dR).naturalWidth),rs(this,dP,ro(this,dR).getAttribute("height")?parseFloat(ro(this,dR).getAttribute("height")):ro(this,dR).naturalHeight);var t=ro(this,dR).getBoundingClientRect();rs(this,dI,t.width===0?1:ro(this,dT)/t.width),rs(this,dM,t.height===0?1:ro(this,dP)/t.height)},dD.styles=[rG(ns())],rr([n({type:Number,attribute:"max-choices"})],dD.prototype,"maxChoices",2),rr([n({type:Number,attribute:"min-choices"})],dD.prototype,"minChoices",2),rr([i()],dD.prototype,"response",2),rr([i()],dD.prototype,"_correctAreas",2),rr([i()],dD.prototype,"_responseCorrection",2);customElements.define("qti-select-point-interaction",dD);var dV=rG(nl());var dz,d$,dW,dB,dj,dF,dQ,dH,dG,dX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,dW);ra(t,dz,0);ra(t,d$,null);t.min=0;t.max=100;t.step=1;return t}d(e,[{key:"validate",value:function t(){return!0}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),rl(this,dW,dB).call(this,this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"response",get:function t(){return ro(this,dz).toString()},set:function t(t){var e=parseInt(t,10);isNaN(e)||rl(this,dW,dB).call(this,e)}},{key:"toggleCorrectResponse",value:function t(t){var e=this.responseVariable;if(e===null||e===void 0?void 0:e.correctResponse){if(t){this._correctResponse=e.correctResponse.toString();var n=parseFloat(e.correctResponse.toString());if(isNaN(n))rs(this,d$,null);else{rs(this,d$,n);var i=(ro(this,d$)-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage-correct","".concat(i,"%"))}}else rs(this,d$,null);this.requestUpdate()}}},{key:"render",value:function t(){return iC(nc(),this.min,this.max,rl(this,dW,dj),rl(this,dW,dF),this.response,ro(this,d$)!==null?iC(nu(),ro(this,d$)):null)}}]);return e}(oT);dz=new WeakMap,d$=new WeakMap,dW=new WeakSet,dB=function t(t){var e=ro(this,dz);if(rs(this,dz,Math.min(this.max,Math.max(this.min,t))),ro(this,dz)===e)return;var n=(ro(this,dz)-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage","".concat(n,"%")),this._internals.setFormValue(this.value),this.saveResponse(this.response),this.requestUpdate()},dj=function t(t){var e=this;rl(this,dW,dQ).call(this,t.pageX);var n=function t(t){return rl(e,dW,dH).call(e,t.pageX)},i=function t(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",i),rl(e,dW,dG).call(e)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",i)},dF=function t(t){var e=this;rl(this,dW,dQ).call(this,t.touches[0].pageX);var n=function t(t){return rl(e,dW,dH).call(e,t.touches[0].pageX)},i=function t(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",i),rl(e,dW,dG).call(e)};document.addEventListener("touchmove",n,{passive:!1}),document.addEventListener("touchend",i)},dQ=function t(t){rl(this,dW,dH).call(this,t)},dH=function t(t){var e=this._rail.getBoundingClientRect(),n=t-e.left,i=Math.min(1,Math.max(0,n/e.width)),o=this.min+Math.round(i*(this.max-this.min)/this.step)*this.step;rl(this,dW,dB).call(this,o)},dG=function t(){this.dispatchEvent(new Event("change",{bubbles:!0}))},dX.styles=dV,rr([o("#rail")],dX.prototype,"_rail",2),rr([n({type:Number,attribute:"lower-bound"})],dX.prototype,"min",2),rr([n({type:Number,attribute:"upper-bound"})],dX.prototype,"max",2),rr([n({type:Number,attribute:"step"})],dX.prototype,"step",2);customElements.define("qti-slider-interaction",dX);var dJ=function t(){return new dK},dK=function t(){"use strict";l(this,t)},dY=new WeakMap,dZ=oc(/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(t){return iR}},{key:"update",value:function t(t,e){var n=M(e,1),i=n[0];var o;var a=i!==this.G;return a&&this.G!==void 0&&this.rt(void 0),(a||this.lt!==this.ct)&&(this.G=i,this.ht=(o=t.options)===null||o===void 0?void 0:o.host,this.rt(this.ct=t.element)),iR}},{key:"rt",value:function t(t){if(this.isConnected||(t=void 0),typeof this.G=="function"){var e;var n=(e=this.ht)!==null&&e!==void 0?e:globalThis,i=dY.get(n);i===void 0&&(i=new WeakMap,dY.set(n,i)),i.get(this.G)!==void 0&&this.G.call(this.ht,void 0),i.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}},{key:"lt",get:function t(){var t;var e,n;return typeof this.G=="function"?(e=dY.get((t=this.ht)!==null&&t!==void 0?t:globalThis))===null||e===void 0?void 0:e.get(this.G):(n=this.G)===null||n===void 0?void 0:n.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}(oE));var d0=rG(nd());var d1,d2,d3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,d1);t.inputRef=dJ();t.response=null;t._handleValueChange=function(){t._internals.setFormValue(t.value),t.validate()};return t}d(e,[{key:"value",get:function t(){return this.response||null},set:function t(t){this.response=t||null}},{key:"correctness",get:function t(){var t=this.responseVariable;if(!t)return null;if(t.value===null)return"incorrect";if(t.mapping){var e=t.mapping.mapEntries.reduce(function(t,e){return Math.max(e.mappedValue,t)},0);var n=true,i=false,o=undefined;try{for(var a=t.mapping.mapEntries[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;var u=l.mapKey,c=t.value;if(l.caseSensitive||(u=u.toLowerCase(),c=c.toLowerCase()),u===c)return l.mappedValue===e?"correct":l.mappedValue<=(t.mapping.defaultValue||0)?"incorrect":"partially-correct"}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}return t.correctResponse===t.value?"correct":"incorrect"}},{key:"isInline",get:function t(){return!0}},{key:"validate",value:function t(){if(!this._input)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),this._input.setCustomValidity(""),this._input.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),this._input.setCustomValidity(this.dataPatternmaskMessage));else{var t=this._input.checkValidity();this._internals.setValidity(t?{}:{customError:!1})}return this.response!==""&&this._input.checkValidity()}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.responseVariable;if(t&&(e===null||e===void 0?void 0:e.correctResponse)){var n=e.correctResponse.toString();this._correctResponse=n}else this._correctResponse=null}},{key:"render",value:function t(){var t=this;return iC(np(),this.responseIdentifier,function(e){t.reportValidity()},function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",am(this.placeholderText?this.placeholderText:void 0),this.response,am(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse?iC(nh(),this._correctResponse):iR)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;rl(this,d1,d2).call(this,e.value),this.response!==e.value&&(this.value=e.value,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.response=""}}]);return e}(oT);d1=new WeakSet,d2=function t(t){this.setAttribute("empty",t===""?"true":"false")},d3.styles=d0,rr([n({type:Number,attribute:"expected-length"})],d3.prototype,"expectedLength",2),rr([n({type:String,attribute:"pattern-mask"})],d3.prototype,"patternMask",2),rr([n({type:String,attribute:"placeholder-text"})],d3.prototype,"placeholderText",2),rr([n({type:String,attribute:"data-patternmask-message"})],d3.prototype,"dataPatternmaskMessage",2),rr([i()],d3.prototype,"response",2),rr([o("input")],d3.prototype,"_input",2),rr([V("response",{waitUntilFirstUpdate:!0})],d3.prototype,"_handleValueChange",2);customElements.define("qti-text-entry-interaction",d3);var d5,d4,d6,d8,d7,d9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,d6);ra(t,d5,null);ra(t,d4,null);return t}d(e,[{key:"reset",value:function t(){rs(this,d5,null),rs(this,d4,null),this.saveResponse(null)}},{key:"validate",value:function t(){return ro(this,d4)!==null}},{key:"response",get:function t(){return ro(this,d4)},set:function t(t){if(typeof t=="string")rs(this,d4,t),this.saveResponse(t);else if(t===null)this.reset();else throw new Error("Value must be a Base64-encoded string or null")}},{key:"render",value:function t(){return iC(nf(),rl(this,d6,d8),this.disabled,this.readonly)}}],[{key:"properties",get:function t(){return k({},oT.properties)}}]);return e}(oT);d5=new WeakMap,d4=new WeakMap,d6=new WeakSet,d8=function t(t){return a(function(){var e,n,i;return z(this,function(o){switch(o.label){case 0:e=t.target;n=e.files&&e.files.length>0;if(!n)return[3,2];rs(this,d5,e.files[0]);i=[this,d4];return[4,rl(this,d6,d7).call(this,ro(this,d5))];case 1:n=(rs.apply(void 0,i.concat([o.sent()])),this.saveResponse(ro(this,d4)),this.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:ro(this,d4)}})));o.label=2;case 2:n;return[2]}})}).call(this)},d7=function t(t){return new Promise(function(e,n){var i=new FileReader;i.onload=function(){return e(i.result)},i.onerror=function(){return n(i.error)},i.readAsDataURL(t)})},d9.styles=[rG(nv())];customElements.define("qti-upload-interaction",d9);var ht=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"render",value:function t(){return iC(nm())}}]);return e}(iQ);ht.styles=rG(ng());customElements.define("qti-associable-hotspot",ht);var he=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"render",value:function t(){return iC(nb())}}]);return e}(iQ);he.styles=rG(ny()),rr([n({type:Number,reflect:!0})],he.prototype,"tabindex",2);customElements.define("qti-gap",he);var hn=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"connectedCallback",value:function t(){this.setAttribute("slot","drags")}}]);return e}(iQ);hn.styles=rG(nw()),rr([n({type:Number,reflect:!0})],hn.prototype,"tabindex",2);customElements.define("qti-gap-img",hn);var hr={toAttribute:function t(t){return t?"true":"false"},fromAttribute:function t(t){return t==="true"}};var hi=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","drags")}},{key:"render",value:function t(){return iC(nq())}}]);return e}(nF(iQ,"qti-gap-text"));hi.styles=rG(nk()),rr([n({type:Number,reflect:!0})],hi.prototype,"tabindex",2);customElements.define("qti-gap-text",hi);var ho=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(nF(iQ,"qti-hotspot-choice"));ho.styles=rG(nx()),rr([n({attribute:"aria-ordervalue",type:Number,reflect:!0})],ho.prototype,"order",2),rr([n({attribute:"aria-ordercorrectvalue",type:Number,reflect:!0})],ho.prototype,"orderCorrect",2);customElements.define("qti-hotspot-choice",ho);var ha=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(n_())}}]);return e}(nF(iQ,"qti-hottext"));ha.styles=rG(nC());customElements.define("qti-hottext",ha);var hs,hl,hu=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,hs);return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("click",rl(this,hs,hl)),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("click",rl(this,hs,hl))}},{key:"render",value:function t(){return iC(nS())}}],[{key:"styles",get:function t(){return[rG(nE())]}}]);return e}(iQ);hs=new WeakSet,hl=function t(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))},rr([n({type:String})],hu.prototype,"identifier",2);customElements.define("qti-inline-choice",hu);var hc=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(nA())}},{key:"connectedCallback",value:function t(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return e}(iQ);customElements.define("qti-prompt",hc);var hd=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.matchMin=0;t.matchMax=1;t.fixed=!1;return t}d(e,[{key:"connectedCallback",value:function t(){p(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 iC(nR())}}]);return e}(nF(iQ,"qti-simple-associable-choice"));hd.styles=rG(nI()),rr([n({type:Number,attribute:"match-min"})],hd.prototype,"matchMin",2),rr([n({type:Number,attribute:"match-max"})],hd.prototype,"matchMax",2),rr([n({type:String,attribute:"fixed",converter:{fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return String(t)}}})],hd.prototype,"fixed",2);customElements.define("qti-simple-associable-choice",hd);var hh=rG(nM());var hp=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.templateIdentifier=null;t.showHide="show";t.fixed=!1;return t}d(e,[{key:"checked",get:function t(){return this.internals.states.has("--checked")}},{key:"render",value:function t(){return iC(nP(),this.marker?iC(nT(),this.marker):iR)}}]);return e}(nF(iQ,"qti-simple-choice"));hp.styles=hh,rr([n({type:String,attribute:"template-identifier"})],hp.prototype,"templateIdentifier",2),rr([n({type:String,attribute:"show-hide"})],hp.prototype,"showHide",2),rr([n({type:Boolean,converter:{fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return String(t)}}})],hp.prototype,"fixed",2),rr([n({type:String,attribute:!1})],hp.prototype,"marker",2);customElements.define("qti-simple-choice",hp);var hf=function t(t){return a(function(){var e,n,i,o,a,s;return z(this,function(l){switch(l.label){case 0:e=t.substring(0,t.lastIndexOf("/"));return[4,i0().load("".concat(t)).then(function(t){return t.assessmentTest()})];case 1:n=l.sent();return[4,i1().load("".concat(e,"/").concat(n.href)).then(function(t){return t.htmlDoc()})];case 2:i=l.sent();return[4,i1().load("".concat(e,"/").concat(n.href)).then(function(t){return t.items()})];case 3:o=l.sent(),a="".concat(e,"/").concat(n.href),s="".concat(e,"/").concat(n.href.substring(0,n.href.lastIndexOf("/")));return[2,{testHTMLDoc:i,testURI:s,testURL:a,items:o,testIdentifier:n.identifier}]}})})()},hv=function t(t){return a(function(){return z(this,function(e){return[2,iZ().load(t).then(function(t){return t.htmlDoc().firstElementChild})]})})()};var hm=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(nO())}},{key:"process",value:function t(){throw new Error("Not implemented")}}]);return e}(iQ);hm=rr([iG("qti-rule")],hm);var hg=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"childExpression",get:function t(){return this.firstElementChild}},{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.context.variables.find(function(e){return e.identifier===t})||null,n;return e.interpolationTable&&(n=e.interpolationTable.get(parseFloat(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:oN(n)}})),n)}}]);return e}(hm);rr([n({type:String})],hg.prototype,"identifier",2),rr([P({context:or,subscribe:!0}),i()],hg.prototype,"context",2);customElements.define("qti-lookup-outcome-value",hg);var hb=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(nL())}},{key:"process",value:function t(){var t=L(this.children);for(var e=0;e<t.length;e++){var n=t[e];if(n.calculate()){n.process();return}}}}]);return e}(hm);customElements.define("qti-response-condition",hb);var hy,hw,hq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,hy);return t}d(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier");if(!t){console.warn('QtiSetOutcomeValue: Missing "identifier" attribute.');return}var e=this.firstElementChild;if(!e){console.warn("QtiSetOutcomeValue: No expression found.");return}var n=new hk(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:rl(this,hy,hw).call(this,n)}}))}}]);return e}(hm);hy=new WeakSet,hw=function t(t){return Array.isArray(t)?t.map(oN):t!==null?oN(t):null};var hk=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.expression=e}d(t,[{key:"process",value:function t(){var t;var e=(t=this.expression.calculate())!==null&&t!==void 0?t:null;return e===null&&console.warn("QtiSetOutcomeValueRule: Evaluated value is null."),Array.isArray(e)?e.map(function(t){return t.value?t.value:t}):e}}]);return t}();customElements.define("qti-set-outcome-value",hq);var hx=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(nU())}},{key:"calculate",value:function t(){return!0}},{key:"getSubRules",value:function t(){return L(this.children)}},{key:"process",value:function t(){var t=this.getSubRules();for(var e=0;e<t.length;e++)t[e].process()}}]);return e}(iQ);customElements.define("qti-response-else",hx);var h_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(hx);customElements.define("qti-response-if",h_);var hC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(nN(),p(f(e.prototype),"render",this).call(this))}}]);return e}(h_);customElements.define("qti-response-else-if",hC);var hE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"calculate",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(nQ(oL));hE=rr([iG("qti-and")],hE);var hS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.baseType="string";return t}d(e,[{key:"getResult",value:function t(){return this.textContent.trim()}}]);return e}(oO);rr([n({type:String,attribute:"base-type"})],hS.prototype,"baseType",2);customElements.define("qti-base-value",hS);var hA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t;if(((t=this.children)===null||t===void 0?void 0:t.length)!==1)return console.error("qti-container-size must have exactly one child expression"),0;var e=this.getVariables();if(!e||(e===null||e===void 0?void 0:e.length)===0)return 0;var n=e[0];return n.value===null||n.value===void 0?0:n.cardinality!=="multiple"&&n.cardinality!=="ordered"?(console.error("qti-container-size requires multiple or ordered cardinality"),0):Array.isArray(n.value)?n.value.length:(console.error("qti-container-size: expected array value for multiple/ordered cardinality"),0)}}]);return e}(oO);customElements.define("qti-container-size",hA);var hR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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 i=e.value,o=n.value;return i.filter(function(t){return o.includes(t)}).length>0}else if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="single"){var a=e.value;return n.value.includes(a)}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}(oL);customElements.define("qti-contains",hR);var hI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"interpretation",get:function t(){return this.getAttribute("interpretation")||""}},{key:"getResult",value:function t(){var t=this.getAttribute("identifier")||"",e=this.context.variables.find(function(e){return e.identifier===t})||null;return e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}}]);return e}(oO);customElements.define("qti-correct",hI);var hM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";return t}d(e,[{key:"getResult",value:function t(){var t;if(!this.identifier)return console.error("qti-default requires an identifier attribute"),null;var e=this.identifier.split("."),n=null,i;if(e.length===2)n=e[0],i=e[1];else if(e.length===1)i=e[0];else return console.error("qti-default: invalid identifier format"),null;if(n){var o;var a=this._testContext.items.find(function(t){return t.identifier===n});if(console.debug("itemContext: ".concat(JSON.stringify(a))),!this._testContext||!a)return console.warn('qti-default: item "'.concat(n,'" not found in test context')),null;var s=(o=this._testContext.items.find(function(t){return t.identifier===n}))===null||o===void 0?void 0:o.variables.find(function(t){return t.identifier===i});return s?s.defaultValue||null:(console.warn('qti-default: variable "'.concat(i,'" not found in item "').concat(n,'"')),null)}if(!((t=this.context)===null||t===void 0?void 0:t.variables))return console.warn("qti-default: no variables found in item context"),null;var l=this.context.variables.find(function(t){return t.identifier===i});return l?l.defaultValue||null:(console.warn('qti-default: variable "'.concat(i,'" not found in item context')),null)}}]);return e}(oO);rr([n({type:String})],hM.prototype,"identifier",2),rr([P({context:or,subscribe:!0}),i()],hM.prototype,"context",2),rr([i(),P({context:ol,subscribe:!0})],hM.prototype,"_testContext",2);customElements.define("qti-default",hM);var hT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.roundingMode="significantFigures";return t}d(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 i=parseFloat(e.value),o=parseFloat(n.value);if(!isNaN(i)&&!isNaN(o))return this.roundingMode==="significantFigures"?i.toPrecision(this.figures)===o.toPrecision(this.figures):Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(i,", ").concat(o));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}(oO);rr([n({type:String})],hT.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",hT);var hP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length!==1)return console.error("qti-round must have exactly one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=t[0];if(e.cardinality!=="single")return console.error("qti-round requires single cardinality"),null;if(Array.isArray(e.value))return console.error("qti-round unexpected array value for single cardinality"),null;if(e.value===null||e.value===void 0)return null;if(e.baseType!=="integer"&&e.baseType!=="float")return console.error("qti-round requires numerical base-type (integer or float)"),null;var n=parseFloat(e.value);return isNaN(n)?(console.warn("qti-round: NaN input results in NULL"),null):isFinite(n)?Math.floor(n+.5):n===1/0?1/0:n===-1/0?-1/0:null}}]);return e}(oO);customElements.define("qti-round",hP);var hO,hL,hU,hN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,hO);t.roundingMode="significantFigures";t.figures=3;return t}d(e,[{key:"getResult",value:function t(){if(this.children.length!==1)return console.error("qti-round-to must have exactly one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=t[0];if(e.cardinality!=="single")return console.error("qti-round-to requires single cardinality"),null;if(Array.isArray(e.value))return console.error("qti-round-to unexpected array value for single cardinality"),null;if(e.value===null||e.value===void 0)return null;if(e.baseType!=="integer"&&e.baseType!=="float")return console.error("qti-round-to requires numerical base-type"),null;var n=parseFloat(e.value);return isNaN(n)?null:isFinite(n)?this.figures<0?(console.error("qti-round-to: figures must be non-negative"),null):this.roundingMode==="significantFigures"&&this.figures<1?(console.error("qti-round-to: figures must be at least 1 for significantFigures mode"),null):this.roundingMode==="decimalPlaces"?rl(this,hO,hL).call(this,n,this.figures):rl(this,hO,hU).call(this,n,this.figures):n===1/0?1/0:n===-1/0?-1/0:null}}]);return e}(oO);hO=new WeakSet,hL=function t(t,e){if(t===0)return 0;var n=Math.pow(10,e);return Math.round(t*n)/n},hU=function t(t,e){if(t===0)return 0;var n=Math.floor(Math.log10(Math.abs(t))),i=Math.pow(10,e-n-1);return Math.round(t*i)/i},rr([n({type:String,attribute:"rounding-mode"})],hN.prototype,"roundingMode",2),rr([n({type:Number})],hN.prototype,"figures",2);customElements.define("qti-round-to",hN);var hD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.toleranceMode="exact";return t}d(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):oW.compareSingleValues(e.value,n.value,e.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return e}(oO);rr([n({type:String})],hD.prototype,"toleranceMode",2);customElements.define("qti-equal",hD);var hV,hz,h$,hW=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,hV);return t}d(e,[{key:"getResult",value:function t(){if(this.children.length===0)return console.error("qti-gcd must have at least one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-gcd requires integer base-type"),null;if(l.value===null||l.value===void 0)return null;if(l.cardinality==="single"){if(Array.isArray(l.value))return console.error("qti-gcd unexpected array value for single cardinality"),null;var u=parseInt(l.value,10);if(isNaN(u))return console.error("qti-gcd non-numerical value"),null;e.push(u)}else if(l.cardinality==="multiple"||l.cardinality==="ordered"){if(!Array.isArray(l.value))return console.error("qti-gcd expected array value for multiple/ordered cardinality"),null;var c=true,d=false,h=undefined;try{for(var p=l.value[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;if(v==null)return null;var m=parseInt(v,10);if(isNaN(m))return console.error("qti-gcd non-numerical value"),null;e.push(m)}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}}else return console.error("qti-gcd unsupported cardinality"),null}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e.length===0?null:rl(this,hV,hz).call(this,e)}}]);return e}(oO);hV=new WeakSet,hz=function t(t){if(t.length===0)return 0;if(t.length===1)return Math.abs(t[0]);var e=Math.abs(t[0]);for(var n=1;n<t.length&&(e=rl(this,hV,h$).call(this,e,Math.abs(t[n])),e!==1);n++);return e},h$=function t(t,e){if(t===0&&e===0)return 0;if(t===0)return e;if(e===0)return t;for(;e!==0;){var n=e;e=t%e,t=n}return t};customElements.define("qti-gcd",hW);var hB=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if((e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.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}(oO);customElements.define("qti-gt",hB);var hj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return(e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.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}(oL);customElements.define("qti-gte",hj);var hF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return null}}]);return e}(oO);customElements.define("qti-null",hF);var hQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(oO);customElements.define("qti-is-null",hQ);var hH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getAttribute("field-identifier");if(!t)throw new Error("field-identifier attribute is required");if(Array.from(this.children).length!==1)throw new Error("qti-field-value must have exactly one child expression");var e=this.getVariables()[0];if(e.baseType!=="record"||e.value===null)throw new Error("qti-field-value child expression must return a record");var n=e.value[t];if(n===void 0)throw new Error('Field "'.concat(t,'" not found in record'));return n}}]);return e}(oO);customElements.define("qti-field-value",hH);var hG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if((e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.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}(oO);customElements.define("qti-lt",hG);var hX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return(e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.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}(oL);customElements.define("qti-lte",hX);var hJ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e||!e.mapping)return console.error("Response ".concat(this.identifier," can not be found")),null;var n=e.mapping,i=Array.isArray(e.value)?e.value:[e.value],o=0;var a=true,s=false,l=undefined;try{var u=function(){var t=d.value;var i=n.mapEntries.filter(function(n){return e.baseType==="string"&&!n.caseSensitive?oW.compareSingleValues(n.mapKey.toLowerCase(),t.toLowerCase(),e.baseType):oW.compareSingleValues(n.mapKey,t,e.baseType)}),a=i.reduce(function(t,e){return t.mappedValue>e.mappedValue?t:e},i.length>0?i[0]:{mapKey:null,mappedValue:null});a===null||a.mappedValue==null?o+=n.defaultValue:o+=a.mappedValue};for(var c=i[Symbol.iterator](),d;!(a=(d=c.next()).done);a=true)u()}catch(t){s=true;l=t}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw l}}}return(n===null||n===void 0?void 0:n.lowerBound)!==null&&(n===null||n===void 0?void 0:n.lowerBound)!==void 0&&(o=Math.max(n.lowerBound,o)),(n===null||n===void 0?void 0:n.upperBound)!==null&&(n===null||n===void 0?void 0:n.upperBound)!==void 0&&(o=Math.min(n.upperBound,o)),o}}]);return e}(oO);rr([n({type:String})],hJ.prototype,"identifier",2);customElements.define("qti-map-response",hJ);var hK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e)return console.warn("Response ".concat(this.identifier," cannot be found")),null;var n=e.areaMapping;if(!n)return console.warn("Area mapping not found for response ".concat(this.identifier)),null;var i=Array.isArray(e.value)?e.value:[e.value];if(!i||i.length===0)return console.warn("No candidate responses for response ".concat(this.identifier)),null;var o=0,a=new Set;var s=true,l=false,u=undefined,c=true,d=false,h=undefined;try{for(var p=i[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;try{for(var m=n.areaMapEntries[Symbol.iterator](),g;!(s=(g=m.next()).done);s=true){var b=g.value;var y;if(a.has(b.coords))continue;oW.isPointInArea(v,"".concat(b.shape,",").concat(b.coords),e.baseType)&&(o+=(y=b.mappedValue)!==null&&y!==void 0?y:0,a.add(b.coords))}}catch(t){l=true;u=t}finally{try{if(!s&&m.return!=null){m.return()}}finally{if(l){throw u}}}}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}return a.size<i.length&&(o+=n.defaultValue),n.lowerBound!=null&&(o=Math.max(n.lowerBound,o)),n.upperBound!=null&&(o=Math.min(n.upperBound,o)),o}}]);return e}(oO);rr([n({type:String})],hK.prototype,"identifier",2);customElements.define("qti-map-response-point",hK);var hY,hZ,h0=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,hY);t.name="";return t}d(e,[{key:"getResult",value:function t(){if(!this.name)return console.error("qti-math-operator requires a name attribute"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.cardinality!=="single")return console.error("qti-math-operator requires single cardinality"),null;if(Array.isArray(l.value))return console.error("qti-math-operator unexpected array value for single cardinality"),null;if(l.value===null||l.value===void 0)return null;if(l.baseType!=="integer"&&l.baseType!=="float")return console.error("qti-math-operator requires numerical base-type"),null;var u=parseFloat(l.value);if(isNaN(u))return console.error("qti-math-operator non-numerical value"),null;e.push(u)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return rl(this,hY,hZ).call(this,this.name,e)}}]);return e}(oO);hY=new WeakSet,hZ=function t(t,e){try{switch(t.toLowerCase()){case"sin":return e.length!==1?null:Math.sin(e[0]);case"cos":return e.length!==1?null:Math.cos(e[0]);case"tan":return e.length!==1?null:Math.tan(e[0]);case"asin":return e.length!==1||e[0]<-1||e[0]>1?null:Math.asin(e[0]);case"acos":return e.length!==1||e[0]<-1||e[0]>1?null:Math.acos(e[0]);case"atan":return e.length!==1?null:Math.atan(e[0]);case"sinh":return e.length!==1?null:Math.sinh(e[0]);case"cosh":return e.length!==1?null:Math.cosh(e[0]);case"tanh":return e.length!==1?null:Math.tanh(e[0]);case"log":return e.length!==1||e[0]<=0?null:Math.log(e[0]);case"ln":return e.length!==1||e[0]<=0?null:Math.log(e[0]);case"log10":return e.length!==1||e[0]<=0?null:Math.log10(e[0]);case"exp":return e.length!==1?null:Math.exp(e[0]);case"abs":return e.length!==1?null:Math.abs(e[0]);case"sqrt":return e.length!==1||e[0]<0?null:Math.sqrt(e[0]);case"signum":return e.length!==1?null:Math.sign(e[0]);case"floor":return e.length!==1?null:Math.floor(e[0]);case"ceil":return e.length!==1?null:Math.ceil(e[0]);case"round":return e.length!==1?null:Math.round(e[0]);case"atan2":return e.length!==2?null:Math.atan2(e[0],e[1]);case"pow":{if(e.length!==2)return null;var n=e[0],i=e[1];return n===0&&i<=0||n<0&&!Number.isInteger(i)?null:Math.pow(n,i)}case"log_base":{if(e.length!==2)return null;var o=e[0],a=e[1];return o<=0||a<=0||a===1?null:Math.log(o)/Math.log(a)}case"mod":return e.length!==2||e[1]===0?null:e[0]%e[1];case"max":var s;return e.length<1?null:(s=Math).max.apply(s,L(e));case"min":var l;return e.length<1?null:(l=Math).min.apply(l,L(e));default:return console.error('qti-math-operator: unknown operation "'.concat(t,'"')),null}}catch(e){return console.error('qti-math-operator: error performing operation "'.concat(t,'":'),e),null}},rr([n({type:String})],h0.prototype,"name",2);customElements.define("qti-math-operator",h0);var h1=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),n=t[0],i=t[1];return e.match(n,i)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function t(t,e){if(t.value===null)return!1;switch(e.cardinality){case"single":var n;return Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):oW.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 i=0;i<t.value.length;i++)if(!oW.compareSingleValues(e.value[i],t.value[i],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 o=0;var a=true,s=false,l=undefined;try{for(var u=e.value[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;var h=null,p=L(t.value);var f=true,v=false,m=undefined;try{for(var g=p[Symbol.iterator](),b;!(f=(b=g.next()).done);f=true){var y=b.value;if(oW.compareSingleValues(d,y,e.baseType)){h=y;break}}}catch(t){v=true;m=t}finally{try{if(!f&&g.return!=null){g.return()}}finally{if(v){throw m}}}if(h!==null)p.splice(p.indexOf(h),1);else return!1;o++}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return e}(oO);customElements.define("qti-match",h1);var h2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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=M(t,2),n=e[0],i=e[1];if(n.baseType===i.baseType||n.baseType==="integer"&&i.baseType==="float"||n.baseType==="float"&&i.baseType==="integer"||console.warn("Which must both have the same base-type"),i.cardinality==="multiple"||i.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(n.baseType==="float"||i.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(n.baseType==="duration"||i.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),n.value===null||i.value===null)return null;var o=n.value;return i.value.includes(o)}}]);return e}(oO);customElements.define("qti-member",h2);var h3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){console.debug("qti-multiple getResult called",this.innerHTML);var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;if(s.cardinality!=="multiple"&&s.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}return t}}]);return e}(oO);customElements.define("qti-multiple",h3);var h5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iC(nD(),p(f(e.prototype),"render",this).call(this))}},{key:"getResult",value:function t(){return!this.firstElementChild.calculate()}}]);return e}(oO);customElements.define("qti-not",h5);var h4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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(),i=!1;if(typeof n=="string")if(n==="true")i=!0;else if(n==="false")i=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(i=n);return i}).some(function(t){return typeof t=="boolean"&&t})}}]);return e}(oL);customElements.define("qti-or",h4);var h6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;if(s.cardinality!=="ordered"&&s.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}return t}}]);return e}(oO);customElements.define("qti-ordered",h6);var h8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length!==2)return console.error("qti-power must have exactly two child expressions"),null;var t=this.getVariables();if(!t||t.length!==2)return null;var e=M(t,2),n=e[0],i=e[1];if(n.cardinality!=="single"||i.cardinality!=="single")return console.error("qti-power requires single cardinality for both expressions"),null;if(Array.isArray(n.value)||Array.isArray(i.value))return console.error("qti-power unexpected array value for single cardinality"),null;if(n.value===null||n.value===void 0||i.value===null||i.value===void 0)return null;if(n.baseType!=="integer"&&n.baseType!=="float"||i.baseType!=="integer"&&i.baseType!=="float")return console.error("qti-power requires numerical base-types"),null;var o=parseFloat(n.value),a=parseFloat(i.value);if(isNaN(o)||isNaN(a))return console.error("qti-power: non-numerical values encountered"),null;if(o===0&&a<=0||o<0&&!Number.isInteger(a))return null;var s;try{s=Math.pow(o,a)}catch(t){return console.error("qti-power: error calculating power:",t),null}if(isNaN(s))return null;if(s===1/0||s===-1/0)return s;if(!isFinite(s)||Math.abs(s)>Number.MAX_VALUE||s!==0&&Math.abs(s)<Number.MIN_VALUE)return null;if(isFinite(s)&&s!==0){var l=Math.floor(Math.log10(Math.abs(s))),u=Math.max(0,14-l),c=Math.pow(10,u);s=Math.round(s*c)/c}return s}}]);return e}(oO);customElements.define("qti-power",h8);var h7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(n=this.context)===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 i===null?iR:iC(nV(),JSON.stringify(i,null,2))}},{key:"calculate",value:function t(){var t=this;return this.context.variables.find(function(e){return e.identifier===t.identifier})||null}}]);return e}(iQ);rr([n({type:String})],h7.prototype,"identifier",2),rr([P({context:or,subscribe:!0}),i()],h7.prototype,"context",2);customElements.define("qti-printed-variable",h7);var h9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return this.getVariables().reduce(function(t,e){if(e.baseType=="float"||e.baseType=="integer")try{return t*parseFloat(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}(oO);customElements.define("qti-product",h9);var pt=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(nH(oO));customElements.define("qti-subtract",pt);var pe=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.caseSensitive="true";return t}d(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 i=this.caseSensitive==="true"?e.value:e.value.toLowerCase(),o=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return oW.compareSingleValues(i,o,e.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return e}(oO);rr([n({type:String,attribute:"case-sensitive"})],pe.prototype,"caseSensitive",2);customElements.define("qti-string-match",pe);var pn,pr=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);ra(t,pn);rs(t,pn,new pi(Array.from(t.children)));return t}d(e,[{key:"getResult",value:function t(){return ro(this,pn).calculate()}}]);return e}(oO);pn=new WeakMap;var pi=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.expressions=e}d(t,[{key:"calculate",value:function t(){return this.expressions.filter(function(t){return t.calculate!==void 0}).some(function(t){return t.calculate()===null})?null:this.expressions.map(function(t){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",pr);var po=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getAttribute("identifier");return this.context.variables.find(function(e){return e.identifier===t}).value}}]);return e}(oO);customElements.define("qti-variable",po);var pa=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.min=0;t.max=10;t.step=1;return t}d(e,[{key:"getResult",value:function t(){if(this.min>this.max)return console.error("qti-random-integer: min cannot be greater than max"),this.min;if(this.step<=0)return console.error("qti-random-integer: step must be positive"),this.min;var t=[],e=0;for(;;){var n=this.min+this.step*e;if(n>this.max)break;Number.isInteger(n)&&t.push(n),e++}if(t.length===0)return console.warn("qti-random-integer: no valid integer values in range"),Number.isInteger(this.min)?this.min:Math.floor(this.min);var i=Math.floor(Math.random()*t.length);return t[i]}},{key:"getPossibleValues",value:function t(){var t=[];if(this.min>this.max||this.step<=0)return[Number.isInteger(this.min)?this.min:Math.floor(this.min)];var e=0;for(;;){var n=this.min+this.step*e;if(n>this.max)break;Number.isInteger(n)&&t.push(n),e++}return t.length>0?t:[Number.isInteger(this.min)?this.min:Math.floor(this.min)]}}]);return e}(oO);rr([n({type:Number})],pa.prototype,"min",2),rr([n({type:Number})],pa.prototype,"max",2),rr([n({type:Number})],pa.prototype,"step",2);customElements.define("qti-random-integer",pa);var ps=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===1){var e=t[0].value;if(Array.isArray(e)){var n=Math.floor(Math.random()*e.length);return e[n]}return e}return console.error("unexpected number of children in match"),null}}]);return e}(oO);customElements.define("qti-random",ps);var pl=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.cardinality!=="single"||!Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),null):t[0].baseType!==t[1].baseType?(console.error("The baseType of the two variables is different"),null):n.value.filter(function(t){return!e.value.includes(t)})}return null}}]);return e}(oO);customElements.define("qti-delete",pl);var pu,pc,pd=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);ra(t,pu);return t}d(e,[{key:"getResult",value:function t(){if(!this.n)return console.error('qti-index: missing required attribute "n"'),null;if(this.children.length!==1)return console.error("qti-index: must have exactly one child container element"),null;var t=this.getVariables()[0];if(!t)return console.error("qti-index: missing container"),null;var e;if(!isNaN(Number(this.n)))e=Number(this.n);else{var n=rl(this,pu,pc).call(this,this.n);if(n===null)return console.error('qti-index: variable "'.concat(this.n,'" is not a valid number')),null;e=Number(n)}if(e<=0||!Number.isInteger(e))return console.error("qti-index: index must be a positive integer"),null;if(t.cardinality==="ordered"){var i=Array.isArray(t.value)?t.value:[t.value];return t.value===null||e>i.length?null:i[e-1]}else return console.error("qti-index: child must have ordered cardinality"),null}}]);return e}(oO);pu=new WeakSet,pc=function t(t){var e;var n=(e=this.context.variables.find(function(e){return e.identifier===t}))===null||e===void 0?void 0:e.value;return n===null||isNaN(Number(n))?null:Number(n)},rr([n({type:String})],pd.prototype,"n",2),pd=rr([iG("qti-index")],pd);return rn(rc)}();
1
+ function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function i(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function o(t,e,n,i,o,a,s){try{var l=t[a](s);var u=l.value}catch(t){n(t);return}if(l.done){e(u)}else{Promise.resolve(u).then(i,o)}}function a(t){return function(){var e=this,n=arguments;return new Promise(function(i,a){var s=t.apply(e,n);function l(t){o(s,i,a,l,u,"next",t)}function u(t){o(s,i,a,l,u,"throw",t)}l(undefined)})}}function s(t,e,n){e=f(e);return S(t,V()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function l(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function u(t,e,n){if(V()){u=Reflect.construct}else{u=function t(t,e,n){var i=[null];i.push.apply(i,e);var o=Function.bind.apply(t,i);var a=new o;if(n)I(a,n.prototype);return a}}return u.apply(null,arguments)}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(t,i.key,i)}}function d(t,e,n){if(e)c(t.prototype,e);if(n)c(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 p(t,e,n){if(typeof Reflect!=="undefined"&&Reflect.get){p=Reflect.get}else{p=function t(t,e,n){var i=T(t,e);if(!i)return;var o=Object.getOwnPropertyDescriptor(i,e);if(o.get){return o.get.call(n||t)}return o.value}}return p(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 v(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)I(t,e)}function m(t,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](t)}else{return t instanceof e}}function g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function b(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function y(t,e){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var i=[];var o=true;var a=false;var s,l;try{for(n=n.call(t);!(o=(s=n.next()).done);o=true){i.push(s.value);if(e&&i.length===e)break}}catch(t){a=true;l=t}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return i}function w(){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 q(){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 i=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}i.forEach(function(e){h(t,e,n[e])})}return t}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);if(e){i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})}n.push.apply(n,i)}return n}function _(t,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}else{x(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function C(t,e){if(t==null)return{};var n={},i,o,a;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){i=Reflect.ownKeys(t);for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}return n}n=E(t,e);if(Object.getOwnPropertySymbols){i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}}return n}function E(t,e){if(t==null)return{};var n={},i=Object.getOwnPropertyNames(t),o,a;for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}return n}function S(t,e){if(e&&(U(e)==="object"||typeof e==="function")){return e}return i(t)}function A(t,e,n,i){if(typeof Reflect!=="undefined"&&Reflect.set){A=Reflect.set}else{A=function t(t,e,n,i){var o=T(t,e);var a;if(o){a=Object.getOwnPropertyDescriptor(o,e);if(a.set){a.set.call(i,n);return true}else if(!a.writable){return false}}a=Object.getOwnPropertyDescriptor(i,e);if(a){if(!a.writable){return false}a.value=n;Object.defineProperty(i,e,a)}else{h(i,e,n)}return true}}return A(t,e,n,i)}function R(t,e,n,i,o){var a=A(t,e,n,i||t);if(!a&&o){throw new Error("failed to set property")}return n}function I(t,e){I=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return I(t,e)}function M(t,n){return e(t)||y(t,n)||N(t,n)||w()}function T(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 O(t){return e(t)||b(t)||N(t)||w()}function L(t){return n(t)||b(t)||N(t)||q()}function U(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function N(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor)i=e.constructor.name;if(i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return t(e,n)}function D(t){var e=typeof Map==="function"?new Map:undefined;D=function t(t){if(t===null||!g(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 I(n,t)};return D(t)}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(V=function(){return!!t})()}function z(t,e){var n,i,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),typeof Symbol==="function"&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(t){return function(e){return c([t,e])}}function c(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(a=0)),a)try{if(n=1,i&&(o=l[0]&2?i["return"]:l[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;if(i=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;i=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=e.call(t,a)}catch(t){l=[6,t];i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}function $(){var t=P(["<slot></slot>"]);$=function e(){return t};return t}function B(){var t=P(["<slot></slot>"]);B=function e(){return t};return t}function j(){var t=P(["<pre>","</pre>\n <slot></slot>"]);j=function e(){return t};return t}function W(){var t=P(["\n slot {\n display: none;\n }\n "]);W=function e(){return t};return t}function F(){var t=P(["<slot></slot>"]);F=function e(){return t};return t}function Q(){var t=P(['<slot name="qti-rubric-block"></slot><slot></slot>']);Q=function e(){return t};return t}function H(){var t=P([" <slot></slot>"]);H=function e(){return t};return t}function G(){var t=P([" <slot></slot>"]);G=function e(){return t};return t}function X(){var t=P(["<slot></slot>"]);X=function e(){return t};return t}function J(){var t=P(["<slot @slotchange=","></slot>"]);J=function e(){return t};return t}function Y(){var t=P([' <slot part="feedback" class="feedback ','"></slot> ']);Y=function e(){return t};return t}function K(){var t=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);K=function e(){return t};return t}function Z(){var t=P([' <slot part="feedback" class="','"></slot> ']);Z=function e(){return t};return t}function tt(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);tt=function e(){return t};return t}function te(){var t=P(['\n <dialog class="qti-dialog" part="feedback" ?open="','">\n <slot></slot>\n <div style="margin-top: var(--qti-gap-size); text-align: center;">\n <button class="button close-button" @click="','">Close</button>\n </div>\n </dialog>\n ']);te=function e(){return t};return t}function tn(){var t=P(["\n .qti-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n .button:hover {\n background-color: var(--qti-hover-bg);\n }\n\n .button:disabled {\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n "]);tn=function e(){return t};return t}function tr(){var t=P(["\n :host {\n display: block;\n }\n"]);tr=function e(){return t};return t}function ti(){var t=P(['<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>']);ti=function e(){return t};return t}function to(){var t=P(["<slot></slot>"]);to=function e(){return t};return t}function ta(){var t=P(["<slot></slot>"]);ta=function e(){return t};return t}function ts(){var t=P(["\n :host {\n display: block;\n }\n "]);ts=function e(){return t};return t}function tl(){var t=P(["",""]);tl=function e(){return t};return t}function tu(){var t=P(["\n :host {\n display: none;\n }\n "]);tu=function e(){return t};return t}function tc(){var t=P(["",""]);tc=function e(){return t};return t}function td(){var t=P(["\n :host {\n display: none;\n }\n "]);td=function e(){return t};return t}function th(){var t=P(["<slot></slot>"]);th=function e(){return t};return t}function tp(){var t=P(["\n :host {\n display: none;\n }\n "]);tp=function e(){return t};return t}function tf(){var t=P(["<slot></slot>"]);tf=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 tm(){var t=P(["<slot></slot>"]);tm=function e(){return t};return t}function tg(){var t=P(["\n :host {\n display: none;\n }\n "]);tg=function e(){return t};return t}function tb(){var t=P([""]);tb=function e(){return t};return t}function ty(){var t=P(["\n :host {\n color: gray;\n }\n "]);ty=function e(){return t};return t}function tw(){var t=P(["<slot></slot>"]);tw=function e(){return t};return t}function tq(){var t=P(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n"]);tq=function e(){return t};return t}function tk(){var t=P(["\n background-color: lightgray;\n ",";\n"]);tk=function e(){return t};return t}function tx(){var t=P(["\n cursor: not-allowed;\n opacity: 0.8;\n"]);tx=function e(){return t};return t}function t_(){var t=P(["\n ",";\n border: 1px solid gray;\n"]);t_=function e(){return t};return t}function tC(){var t=P(["<slot></slot>"]);tC=function e(){return t};return t}function tE(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tE=function e(){return t};return t}function tS(){var t=P(["<slot></slot>"]);tS=function e(){return t};return t}function tA(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tA=function e(){return t};return t}function tR(){var t=P(['<option value="','" ?selected=',">","</option>"]);tR=function e(){return t};return t}function tI(){var t=P(['\n <label part="label" for="viewSelect">','</label>\n <select\n part="select"\n id="viewSelect"\n @change=',"\n >\n ","\n </select>\n "]);tI=function e(){return t};return t}function tM(){var t=P([" <slot></slot> "]);tM=function e(){return t};return t}function tT(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tT=function e(){return t};return t}function tP(){var t=P([" <slot></slot> "]);tP=function e(){return t};return t}function tO(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tO=function e(){return t};return t}function tL(){var t=P([' <div @click="','">',"</div> "]);tL=function e(){return t};return t}function tU(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tU=function e(){return t};return t}function tN(){var t=P([""]);tN=function e(){return t};return t}function tD(){var t=P([" "," "]);tD=function e(){return t};return t}function tV(){var t=P(["<span>Loading...</span>"]);tV=function e(){return t};return t}function tz(){var t=P(["\n ","\n <slot></slot>\n ","\n "]);tz=function e(){return t};return t}function t$(){var t=P([""]);t$=function e(){return t};return t}function tB(){var t=P([""]);tB=function e(){return t};return t}function tj(){var t=P(["\n <tr>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n </tr>\n "]);tj=function e(){return t};return t}function tW(){var t=P(["\n <h3>","</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ","\n </tbody>\n </table>\n "]);tW=function e(){return t};return t}function tF(){var t=P(["\n "," ","\n "]);tF=function e(){return t};return t}function tQ(){var t=P(["\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n "]);tQ=function e(){return t};return t}function tH(){var t=P([""]);tH=function e(){return t};return t}function tG(){var t=P([" "," "]);tG=function e(){return t};return t}function tX(){var t=P([" <slot></slot> "]);tX=function e(){return t};return t}function tJ(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tJ=function e(){return t};return t}function tY(){var t=P([" <small><pre>","</pre></small> "]);tY=function e(){return t};return t}function tK(){var t=P(["<small><pre>","</pre></small>"]);tK=function e(){return t};return t}function tZ(){var t=P([" ","\n ",""]);tZ=function e(){return t};return t}function t0(){var t=P([""]);t0=function e(){return t};return t}function t1(){var t=P(["",""]);t1=function e(){return t};return t}function t2(){var t=P(["",""]);t2=function e(){return t};return t}function t3(){var t=P([""]);t3=function e(){return t};return t}function t5(){var t=P(["<div>","</div>"]);t5=function e(){return t};return t}function t4(){var t=P(["<div>","</div>"]);t4=function e(){return t};return t}function t6(){var t=P([" <slot></slot> "]);t6=function e(){return t};return t}function t8(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);t8=function e(){return t};return t}function t7(){var t=P(["<span>Loading...</span>"]);t7=function e(){return t};return t}function t9(){var t=P(["\n ","\n <slot></slot>\n ","\n "]);t9=function e(){return t};return t}function et(){var t=P([""]);et=function e(){return t};return t}function ee(){var t=P(['<option value="','" ?selected=',">\n ","\n </option>"]);ee=function e(){return t};return t}function en(){var t=P(['\n <label part="label" for="modeSelect">','</label>\n <select\n part="select"\n id="modeSelect"\n @change=',"\n >\n ","\n </select>\n "]);en=function e(){return t};return t}function er(){var t=P(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n"]);er=function e(){return t};return t}function ei(){var t=P(["\n background-color: lightgray;\n ",";\n"]);ei=function e(){return t};return t}function eo(){var t=P(["\n cursor: not-allowed;\n opacity: 0.8;\n"]);eo=function e(){return t};return t}function ea(){var t=P(["\n ",";\n border: 1px solid gray;\n"]);ea=function e(){return t};return t}function es(){var t=P([' <div @click="','">',"</div> "]);es=function e(){return t};return t}function el(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);el=function e(){return t};return t}function eu(){var t=P([' <div @click="','">',"</div> "]);eu=function e(){return t};return t}function ec(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);ec=function e(){return t};return t}function ed(){var t=P([""]);ed=function e(){return t};return t}function eh(){var t=P(["\n <tr>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n </tr>\n "]);eh=function e(){return t};return t}function ep(){var t=P(["\n <h3>","</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ","\n </tbody>\n </table>\n "]);ep=function e(){return t};return t}function ef(){var t=P(["\n "," ","\n "]);ef=function e(){return t};return t}function ev(){var t=P(["\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n "]);ev=function e(){return t};return t}function em(){var t=P(["<slot></slot>"]);em=function e(){return t};return t}function eg(){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 align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n margin: 1rem 0;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n\n [part='drop-list'][active] {\n border-color: var(--qti-border-active) !important;\n background-color: var(--qti-bg-active) !important;\n }\n\n [part='drop-container'] {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n [part='drop-list'][enabled] {\n background-color: var(--qti-bg-active) !important;\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) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);eg=function e(){return t};return t}function eb(){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>']);eb=function e(){return t};return t}function ey(){var t=P([' <slot name="prompt"></slot>\n <slot name="qti-simple-associable-choice"></slot>\n <div part="drop-container">\n ','\n\n <div role="alert" part="message" id="validation-message"></div>\n </div>']);ey=function e(){return t};return t}function ew(){var t=P(["\n :host {\n display: block;\n }\n\n [part='slot'] {\n display: grid;\n gap: 10px;\n }\n\n /* Define the number of columns dynamically */\n :host([class*='qti-choices-stacking-']) [part='slot'] {\n grid-template-columns: repeat(var(--stacking-count, 1), 1fr);\n }\n\n /* Apply dynamic stacking count based on class */\n :host(.qti-choices-stacking-1) {\n --stacking-count: 1;\n }\n :host(.qti-choices-stacking-2) {\n --stacking-count: 2;\n }\n :host(.qti-choices-stacking-3) {\n --stacking-count: 3;\n }\n :host(.qti-choices-stacking-4) {\n --stacking-count: 4;\n }\n :host(.qti-choices-stacking-5) {\n --stacking-count: 5;\n }\n :host(.qti-choices-stacking-6) {\n --stacking-count: 6;\n }\n\n /* Default slot item layout */\n ::slotted(qti-simple-choice) {\n display: flex;\n align-items: center;\n white-space: normal;\n }\n\n /* Orientation styles */\n :host(.qti-orientation-horizontal) [part='slot'] {\n grid-auto-flow: dense column;\n grid-auto-columns: 1fr;\n }\n\n :host(.qti-orientation-vertical) [part='slot'] {\n grid-auto-flow: row;\n }\n\n /* Vertical and horizontal stacking logic */\n :host(.qti-orientation-vertical[class*='qti-choices-stacking-']) [part='slot'] {\n grid-auto-flow: dense column;\n grid-auto-columns: 1fr;\n grid-template-columns: repeat(var(--stacking-count), 1fr);\n grid-template-rows: repeat(calc(var(--item-count) / var(--stacking-count)), 1fr);\n }\n\n :host(.qti-orientation-horizontal[class*='qti-choices-stacking-']) [part='slot'] {\n grid-auto-flow: row;\n grid-template-columns: repeat(var(--stacking-count), 1fr);\n grid-template-rows: unset;\n }\n\n /* Ensure even distribution in vertical mode */\n :host(.qti-orientation-vertical) ::slotted(qti-simple-choice:nth-child(even)) {\n grid-row: auto;\n }\n"]);ew=function e(){return t};return t}function eq(){var t=P(['\n <slot part="prompt" name="prompt"></slot>\n <slot part="slot" @slotchange=','></slot>\n <div part="message" role="alert" id="validation-message"></div>\n ']);eq=function e(){return t};return t}function ek(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);ek=function e(){return t};return t}function ex(){var t=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);ex=function e(){return t};return t}function e_(){var t=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);e_=function e(){return t};return t}function eC(){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"]);eC=function e(){return t};return t}function eE(){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>"]);eE=function e(){return t};return t}function eS(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\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 [name='prompt'] {\n width: 100%;\n }\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n"]);eS=function e(){return t};return t}function eA(){var t=P(['<slot name="prompt"> </slot>\n <slot part="drags" name="drags"></slot>\n <slot part="drops"></slot>\n <div role="alert" part="message" id="validation-message"></div>']);eA=function e(){return t};return t}function eR(){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 width: fit-content;\n }\n svg {\n position: absolute;\n top: 0px;\n left: 0px;\n }\n"]);eR=function e(){return t};return t}function eI(){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 "]);eI=function e(){return t};return t}function eM(){var t=P(['\n <line\n part="correct-line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-correct)"\n stroke-width="3"\n stroke-dasharray="5,5"\n />\n ']);eM=function e(){return t};return t}function eT(){var t=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-border-active)"\n stroke-width="3"\n />']);eT=function e(){return t};return t}function eP(){var t=P(['<slot name="prompt"></slot>\n <line-container>\n <svg\n width=',"\n height=",'\n viewbox="0 0 '," ",'"\n >\n ',"\n ","\n ",'\n </svg>\n <slot></slot>\n </line-container>\n <div role="alert" part="message" id="validation-message"></div>']);eP=function e(){return t};return t}function eO(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column;\n }\n :host(.qti-choices-left) {\n flex-direction: row-reverse;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n :host(.qti-choices-right) {\n flex-direction: row;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n [part='image'] {\n display: block;\n position: relative;\n }\n /* [part='drops'] , */\n\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n ::slotted(img) {\n display: inline-block;\n user-select: none;\n pointer-events: none;\n }\n"]);eO=function e(){return t};return t}function eL(){var t=P([' <slot name="prompt"></slot>\n <slot part="image"></slot>\n <slot part="drags" name="drags" class="hover-border"></slot>\n <div role="alert" part="message" id="validation-message"></div>']);eL=function e(){return t};return t}function eU(){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"]);eU=function e(){return t};return t}function eN(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div role="alert" part="message" id="validation-message"></div>\n ']);eN=function e(){return t};return t}function eD(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: inline-block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n line-height: 0; /* remove gaps below image */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n display: block;\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n"]);eD=function e(){return t};return t}function eV(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n ']);eV=function e(){return t};return t}function ez(){var t=P(['<slot></slot>\n <div part="message" role="alert" id="validation-message"></div>']);ez=function e(){return t};return t}function e$(){var t=P(["\n :host {\n display: inline-block;\n vertical-align: baseline;\n position: relative;\n }\n\n button[part='trigger'] {\n anchor-name: --qti-inline-choice-trigger;\n }\n\n [part='value'] {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n min-width: 0;\n }\n\n [part~='dropdown-icon'] {\n line-height: 1;\n }\n\n [part='menu'] {\n position-anchor: --qti-inline-choice-trigger;\n inset: auto;\n margin: 0;\n z-index: 1000;\n top: calc(anchor(bottom) + 4px);\n left: anchor(left);\n min-width: anchor-size(width);\n max-width: min(90vw, 36rem);\n max-height: min(40vh, 20rem);\n position-try-fallbacks: flip-block, flip-inline;\n }\n\n button[part~='option'] {\n width: 100%;\n }\n\n [part='option-content'] {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: nowrap;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n button[part~='option'] img,\n button[part='trigger'] img,\n [part='menu'] img {\n display: inline-block;\n vertical-align: middle;\n }\n"]);e$=function e(){return t};return t}function eB(){var t=P(['\n <button\n part="trigger"\n type="button"\n @click=',"\n @keydown=",'\n aria-haspopup="listbox"\n aria-expanded="','"\n aria-controls="','"\n popovertarget="','"\n popovertargetaction="toggle"\n ?disabled="','"\n data-readonly="','"\n >\n <span part="value">','</span>\n <span part="','" aria-hidden="true"\n >▾</span\n >\n </button>\n <div\n id="','"\n part="menu"\n role="listbox"\n popover="auto"\n @toggle=',"\n @keydown=",'\n >\n <button\n part="','"\n type="button"\n role="option"\n aria-selected="','"\n @click=','\n >\n <span part="option-content">',"</span>\n </button>\n <slot @slotchange=","></slot>\n </div>\n ","\n "]);eB=function e(){return t};return t}function ej(){var t=P(["\n slot:not([hidden]) {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\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"]);ej=function e(){return t};return t}function eW(){var t=P(['<th part="r-header">',"</th>"]);eW=function e(){return t};return t}function eF(){var t=P(['\n <svg\n part="checkmark"\n viewBox="0 0 24 24"\n style="position: absolute; width: 20px; height: 20px; top: 2px; left: 2px; pointer-events: none;"\n >\n <path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" fill="white" />\n </svg>\n ']);eF=function e(){return t};return t}function eQ(){var t=P(['<td part="input-cell">\n <div\n class="input-container"\n style="position: relative; width: 24px; height: 24px; margin: 0 auto;"\n >\n <input\n type=',"\n part=","\n name=","\n value=","\n .disabled=","\n @change=","\n @click=","\n />\n ","\n </div>\n </td>"]);eQ=function e(){return t};return t}function eH(){var t=P(['<tr part="row">\n <td part="c-header">',"</td>\n ","\n </tr>"]);eH=function e(){return t};return t}function eG(){var t=P(['\n <table part="table">\n <tr part="r-header">\n <td></td>\n ',"\n </tr>\n\n ","\n </table>\n "]);eG=function e(){return t};return t}function eX(){var t=P(['\n <slot name="prompt"></slot>\n <slot ?hidden=',"></slot>\n\n ",'\n\n <div role="alert" part="message" id="validation-message"></div>\n ']);eX=function e(){return t};return t}function eJ(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>']);eJ=function e(){return t};return t}function eY(){var t=P([""]);eY=function e(){return t};return t}function eK(){var t=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n flex-wrap: wrap;\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='drop-list'][active] {\n border-color: var(--qti-border-active) !important;\n background-color: var(--qti-bg-active) !important;\n }\n\n [part='drop-list'][enabled] {\n background-color: var(--qti-bg-active) !important;\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"]);eK=function e(){return t};return t}function eZ(){var t=P(['<drop-list role="region" part="drop-list" identifier="droplist','"></drop-list>']);eZ=function e(){return t};return t}function e0(){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>"]);e0=function e(){return t};return t}function e1(){var t=P(["\n ::slotted(qti-interaction-markup) {\n display: none;\n }\n"]);e1=function e(){return t};return t}function e2(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);e2=function e(){return t};return t}function e3(){var t=P(["\n <slot></slot>\n ","\n "]);e3=function e(){return t};return t}function e5(){var t=P(["\n :host {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n "]);e5=function e(){return t};return t}function e4(){var t=P(["<slot></slot>"]);e4=function e(){return t};return t}function e6(){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 "]);e6=function e(){return t};return t}function e8(){var t=P(["<slot></slot>"]);e8=function e(){return t};return t}function e7(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);e7=function e(){return t};return t}function e9(){var t=P(['\n <button\n part="point','"\n style=','\n aria-label="Remove point at ','"\n ?disabled=',"\n @click=","\n ></button>\n "]);e9=function e(){return t};return t}function nt(){var t=P(["<div\n style=",'\n data-coord="','"\n alt=','\n data-shape="','"\n ></div>']);nt=function e(){return t};return t}function ne(){var t=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n ","\n <slot></slot>\n </point-container>"]);ne=function e(){return t};return t}function nn(){var t=P(["\n :host {\n display: block;\n }\n point-container {\n display: block;\n position: relative;\n width: fit-content;\n }\n\n ::slotted(img) {\n max-width: 100%;\n height: auto;\n display: block;\n }\n "]);nn=function e(){return t};return t}function nr(){var t=P(["\n :host {\n display: block;\n --show-bounds: true;\n --show-ticks: true;\n --show-value: true;\n }\n\n [part='slider'] {\n margin-left: 2rem; /* mx-8 */\n margin-right: 2rem;\n padding-bottom: 1rem; /* pb-4 */\n padding-top: 1.25rem; /* pt-5 */\n }\n\n [part='bounds'] {\n display: flex;\n width: 100%;\n justify-content: space-between;\n margin-bottom: 0.5rem; /* mb-2 */\n }\n\n [part='ticks'] {\n margin-left: 0.125rem; /* mx-0.5 */\n margin-right: 0.125rem;\n margin-bottom: 0.25rem; /* mb-1 */\n height: 0.5rem; /* h-2 */\n background: linear-gradient(to right, var(--qti-border-color) var(--qti-border-thickness), transparent 1px) repeat-x\n 0 center / calc(calc(100% - var(--qti-border-thickness)) / ((var(--max) - var(--min)) / var(--step))) 100%;\n }\n\n [part='rail'] {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 0.375rem; /* h-1.5 */\n width: 100%;\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n border: 1px solid #d1d5db; /* border-gray-300 */\n background-color: #e5e7eb; /* bg-gray-200 */\n }\n\n [part='knob'] {\n background-color: var(--qti-bg-active);\n border: 2px solid var(--qti-border-active);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage);\n }\n [part='knob-correct'] {\n background-color: var(--qti-correct-light);\n border: 2px solid var(--qti-correct);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage-correct);\n }\n\n [part='value'] {\n position: absolute;\n bottom: 2rem; /* bottom-8 */\n left: 0.5rem; /* left-2 */\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 0.25rem; /* rounded */\n background-color: #f3f4f6; /* bg-gray-100 */\n padding: 0.25rem 0.5rem; /* px-2 py-1 */\n text-align: center;\n color: #6b7280; /* text-gray-500 */\n }\n"]);nr=function e(){return t};return t}function ni(){var t=P(['\n <div id="knob-correct" part="knob-correct">\n <div id="value" part="value">',"</div>\n </div>\n "]);ni=function e(){return t};return t}function no(){var t=P(['\n <slot name="prompt"></slot>\n <div id="slider" part="slider">\n <div id="bounds" part="bounds">\n <div>',"</div>\n <div>",'</div>\n </div>\n\n <div id="ticks" part="ticks"></div>\n\n <div id="rail" part="rail" @mousedown='," @touchstart=",'>\n <div id="knob" part="knob">\n <div id="value" part="value">',"</div>\n </div>\n\n ","\n </div>\n </div>\n "]);no=function e(){return t};return t}function na(){var t=P(["\n :host {\n display: inline-block;\n }\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\n :host {\n position: relative;\n }\n input {\n anchor-name: --text-entry-input;\n z-index: 100;\n position: relative;\n }\n\n [part='correct'] {\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg);\n z-index: 0;\n position: absolute;\n left: 0;\n right: 0;\n position-anchor: --text-entry-input;\n bottom: anchor(top);\n left: anchor(left);\n /* opacity: 1; */\n transition: all 1s;\n\n @starting-style {\n display: grid;\n /* opacity: 0; */\n bottom: 0;\n }\n }\n"]);na=function e(){return t};return t}function ns(){var t=P(['<div part="correct">',"</div>"]);ns=function e(){return t};return t}function nl(){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 ',"\n "]);nl=function e(){return t};return t}function nu(){var t=P(['\n <div>\n <slot name="prompt"></slot>\n <input type="file" @change="','" ?disabled="','" ?readonly="','" />\n </div>\n ']);nu=function e(){return t};return t}function nc(){var t=P(["\n :host {\n display: block;\n margin: 1em 0;\n }\n input[type='file'] {\n display: block;\n margin-top: 0.5em;\n }\n "]);nc=function e(){return t};return t}function nd(){var t=P([' <slot name="drags"></slot> ']);nd=function e(){return t};return t}function nh(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);nh=function e(){return t};return t}function np(){var t=P([' <slot name="drags"></slot>']);np=function e(){return t};return t}function nf(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);nf=function e(){return t};return t}function nv(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);nv=function e(){return t};return t}function nm(){var t=P(["<slot></slot>"]);nm=function e(){return t};return t}function ng(){var t=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);ng=function e(){return t};return t}function nb(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);nb=function e(){return t};return t}function ny(){var t=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);ny=function e(){return t};return t}function nw(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);nw=function e(){return t};return t}function nq(){var t=P(["\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n slot {\n display: inline;\n }\n"]);nq=function e(){return t};return t}function nk(){var t=P([" <slot></slot> "]);nk=function e(){return t};return t}function nx(){var t=P(["<slot></slot>"]);nx=function e(){return t};return t}function n_(){var t=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);n_=function e(){return t};return t}function nC(){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: auto;\n }\n "]);nC=function e(){return t};return t}function nE(){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"]);nE=function e(){return t};return t}function nS(){var t=P(['<div id="label">',"</div>"]);nS=function e(){return t};return t}function nA(){var t=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot>']);nA=function e(){return t};return t}function nR(){var t=P(["<slot></slot>"]);nR=function e(){return t};return t}function nI(){var t=P(["<slot></slot>"]);nI=function e(){return t};return t}function nM(){var t=P(["<slot></slot>"]);nM=function e(){return t};return t}function nT(){var t=P(["",""]);nT=function e(){return t};return t}function nP(){var t=P(["",""]);nP=function e(){return t};return t}function nO(){var t=P(["",""]);nO=function e(){return t};return t}var QtiComponents=function(){var t=function t(){var t,e;return{promise:new Promise(function(n,i){t=n,e=i}),resolve:t,reject:e}};var e=function t(t,e){if(!il(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return r9!==void 0?r9.createHTML(e):e};var n=function t(t){return function(e,n){return(typeof n==="undefined"?"undefined":U(n))=="object"?iF(t,e,n):function(t,e,n){var i=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),i?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}};var i=function t(t){return n(_(k({},t),{state:!0,attribute:!1}))};var o=function t(t,e){return function(n,i,o){var a=function e(e){var n;var i;return(n=(i=e.renderRoot)===null||i===void 0?void 0:i.querySelector(t))!==null&&n!==void 0?n:null};if(e){var s=(typeof i==="undefined"?"undefined":U(i))=="object"?n:o!==null&&o!==void 0?o:function(){var t=Symbol();return{get:function e(){return this[t]},set:function e(e){this[t]=e}}}(),l=s.get,u=s.set;return iQ(n,i,{get:function t(){var t=l.call(this);return t===void 0&&(t=a(this),(t!==null||this.hasUpdated)&&u.call(this,t)),t}})}return iQ(n,i,{get:function t(){return a(this)}})}};var u=function t(t){return function(e,n){var i=t!==null&&t!==void 0?t:{},o=i.slot,a=i.selector,s="slot"+(o?"[name=".concat(o,"]"):":not([name])");return iQ(e,n,{get:function e(){var e;var n;var i=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(s),o=(e=i===null||i===void 0?void 0:i.assignedElements(t))!==null&&e!==void 0?e:[];return a===void 0?o:o.filter(function(t){return t.matches(a)})}})}};var c=function t(t,e,n){Array.from(t.getElementsByTagName("*")).filter(function(t){var n;return t.localName===e||((n=t.localName)===null||n===void 0?void 0:n.toLowerCase())===e.toLowerCase()}).forEach(function(t){var i="".concat(e,"-").concat(n),o=b(t,i);t.replaceWith(o)})};var g=function t(t,e){t.querySelectorAll("*").forEach(function(t){var n=t.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(e,":"))){var i=n.slice("".concat(e,":").length),o="".concat(t.nodeName,"-").concat(i),a=b(t,o);t.replaceWith(a)}})})};var b=function t(t,e){var n=t.ownerDocument.createElement(e);var i=true,o=false,a=undefined;try{for(var s=t.attributes[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;n.setAttribute(u.name,u.value)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}for(;t.firstChild;)n.appendChild(t.firstChild);return n};var y=function t(t){var e=[];return t.querySelectorAll("qti-assessment-item-ref").forEach(function(t){var n=t.getAttribute("identifier"),i=t.getAttribute("href"),o=t.getAttribute("category");e.push({identifier:n,href:i,category:o})}),e};var w=function t(t,e){return fetch(t,{signal:e}).then(function(t){if(!t.ok)throw new Error("HTTP error! status: ".concat(t.status));return t.text()}).then(function(t){return new DOMParser().parseFromString(t,"text/xml")}).catch(function(t){throw t.name==="AbortError"?t:new Error("Failed to load XML: ".concat(t.message))})};var q=function t(t){return new DOMParser().parseFromString(t,"text/xml")};var x=function t(t){var e=document.createDocumentFragment();for(var n=0;n<t.childNodes.length;n++)e.appendChild(iH(t.childNodes[n],document));return e};var E=function t(t,e){e.endsWith("/")||(e+="/"),t.querySelectorAll("*").forEach(function(t){for(var n=0,i=["src","href"];n<i.length;n++){var o=i[n];var a;var s=(a=t.getAttribute(o))===null||a===void 0?void 0:a.trim();if(s&&!/^(data:|https?:|blob:)/.test(s)){var l=e+encodeURI(s);t.setAttribute(o,l)}}})};var S=function t(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)})};var A=function t(t){t.querySelectorAll("qti-stylesheet").forEach(function(t){return t.remove()})};var I=function t(t){switch(t){case"qti-choice-interaction":case"qti-order-interaction":return"qti-simple-choice";case"qti-inline-choice-interaction":return"qti-inline-choice";case"qti-match-interaction":return["qti-simple-match-set:first-of-type qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice"];case"qti-gap-match-interaction":return"qti-gap-text";case"qti-associate-interaction":return"qti-simple-associable-choice";default:return null}};var T=function t(t){var e=t.context;return function(t,n){var i=new WeakMap;if((typeof n==="undefined"?"undefined":U(n))=="object")return{get:function e(){return t.get.call(this)},set:function e(e){return i.get(this).setValue(e),t.set.call(this,e)},init:function t(t){return i.set(this,new i3(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer(function(t){i.set(t,new i3(t,{context:e}))});var o=Object.getOwnPropertyDescriptor(t,n),a;if(o===void 0){var s=new WeakMap;a={get:function t(){return s.get(this)},set:function t(t){i.get(this).setValue(t),s.set(this,t)},configurable:!0,enumerable:!0}}else{var l=o.set;a=_(k({},o),{set:function t(t){i.get(this).setValue(t),l===null||l===void 0?void 0:l.call(this,t)}})}return void Object.defineProperty(t,n,a)}}};var P=function t(t){var e=t.context,n=t.subscribe;return function(t,i){(typeof i==="undefined"?"undefined":U(i))=="object"?i.addInitializer(function(){var i=this;new i0(this,{context:e,callback:function e(e){t.set.call(i,e)},subscribe:n})}):t.constructor.addInitializer(function(t){new i0(t,{context:e,callback:function e(e){t[i]=e},subscribe:n})})}};var N=function t(t,e){return function(n,i){var o=n.connectedCallback,s=n.disconnectedCallback;n.connectedCallback=function(){var n=this;o.call(this);var s=this[i],l=function e(e){var i=[],o=[];var a=true,l=false,u=undefined;try{for(var c=e[Symbol.iterator](),d;!(a=(d=c.next()).done);a=true){var h=d.value;h.type==="childList"&&(h.addedNodes.forEach(function(e){var n;var o;var a,s;if(e.nodeType!==1)return;var l=e;((a=l.matches)===null||a===void 0?void 0:a.call(l,t))&&i.push(l),(n=i).push.apply(n,L((o=(s=l.querySelectorAll)===null||s===void 0?void 0:s.call(l,t))!==null&&o!==void 0?o:[]))}),h.removedNodes.forEach(function(e){var n;var i;var a,s;if(e.nodeType!==1)return;var l=e;((a=l.matches)===null||a===void 0?void 0:a.call(l,t))&&o.push(l),(n=o).push.apply(n,L((i=(s=l.querySelectorAll)===null||s===void 0?void 0:s.call(l,t))!==null&&i!==void 0?i:[]))}))}}catch(t){l=true;u=t}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(l){throw u}}}var p=function t(t){return Array.from(new Set(t))},f=p(i),v=p(o);(f.length||v.length)&&s.call(n,f,v)},u=new MutationObserver(l);u.observe(this,{childList:!0,subtree:!0});var c=this.shadowRoot?new MutationObserver(l):null;c===null||c===void 0?void 0:c.observe(this.shadowRoot,{childList:!0,subtree:!0}),this.__lqObservers=[u,c].filter(function(t){return!!t}),function(){return a(function(){var n,i,o,a;return z(this,function(l){switch(l.label){case 0:o=(e===null||e===void 0?void 0:e.waitUntilFirstUpdate)&&"updateComplete"in this;if(!o)return[3,2];return[4,this.updateComplete];case 1:o=l.sent();l.label=2;case 2:o;a=L(this.querySelectorAll(t)).concat(L((n=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll(t))!==null&&n!==void 0?n:[]));a.length&&s.call(this,a,[]);return[2]}})}).call(n)}()},n.disconnectedCallback=function(){var t;s.call(this),(t=this.__lqObservers)===null||t===void 0?void 0:t.forEach(function(t){return t.disconnect()}),this.__lqObservers=void 0}}};var V=function t(t,e){var n=k({waitUntilFirstUpdate:!1},e);return function(e,i){var o=e.update,a=Array.isArray(t)?t:[t];e.update=function(t){var e=this;a.forEach(function(o){var a=o;if(t.has(a)){var s=t.get(a),l=e[a];s!==l&&(!n.waitUntilFirstUpdate||e.hasUpdated)&&e[i](s,l)}}),o.call(this,t)}}};var nL=function t(t){this._$AN!==void 0?(ob(this),this._$AM=t,oy(this)):this._$AM=t};var nU=function t(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 i=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(i))for(var a=n;a<i.length;a++)og(i[a],!1),ob(i[a]);else i!=null&&(og(i,!1),ob(i));else og(this,t)};var nN=function t(t){return t==null};var nD=function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var nV=function t(t,e,n,i){var o=n.getAttribute("width")?parseFloat(n.getAttribute("width")):n.naturalWidth,a=n.getAttribute("height")?parseFloat(n.getAttribute("height")):n.naturalHeight;switch(t){case"circle":{if(e.length!==3){console.error("Invalid circle coordinates:",e);return}var s=M(e,3),l=s[0],u=s[1],c=s[2],d=l/o*100,h=u/a*100,p=c/o*100,f=c/a*100;i.style.left=d-p+"%",i.style.top=h-f+"%",i.style.width=2*p+"%",i.style.height=2*f+"%",i.style.borderRadius="50%"}break;case"rect":{if(e.length!==4){console.error("Invalid rectangle coordinates:",e);return}var v=M(e,4),m=v[0],g=v[1],b=v[2],y=v[3],w=m/o*100,q=g/a*100,k=b/o*100,x=y/a*100;i.style.left=w+"%",i.style.top=q+"%",i.style.width=k-w+"%",i.style.height=x-q+"%"}break;case"ellipse":{if(e.length!==4){console.error("Invalid ellipse coordinates:",e);return}var _=M(e,4),C=_[0],E=_[1],S=_[2],A=_[3],R=C/o*100,I=E/a*100,T=S/o*100,P=A/a*100;i.style.left=R-T+"%",i.style.top=I-P+"%",i.style.width=2*T+"%",i.style.height=2*P+"%",i.style.borderRadius="50%"}break;case"poly":{var O,U,N,D;if(e.length<6||e.length%2!==0){console.error("Invalid polygon coordinates:",e);return}var V=[];for(var z=0;z<e.length;z+=2)V.push({x:e[z],y:e[z+1]});var $=(O=Math).min.apply(O,L(V.map(function(t){return t.x}))),B=(U=Math).max.apply(U,L(V.map(function(t){return t.x}))),j=(N=Math).min.apply(N,L(V.map(function(t){return t.y}))),W=(D=Math).max.apply(D,L(V.map(function(t){return t.y}))),F=$/o*100,Q=j/a*100,H=B/o*100,G=W/a*100;i.style.left=F+"%",i.style.top=Q+"%",i.style.width=H-F+"%",i.style.height=G-Q+"%";var X=V.map(function(t){return{x:(t.x-$)/(B-$)*100,y:(t.y-j)/(W-j)*100}}).map(function(t){return"".concat(t.x,"% ").concat(t.y,"%")}).join(",");i.style.clipPath="polygon(".concat(X,")")}break;default:console.error("Unsupported shape: ".concat(t));break}};var nz=function t(t,e){var i=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++){e[i]=arguments[i]}l(this,n);var o;o=s(this,n,L(e));o.identifier="";o.tabIndex=0;o.disabled=!1;o.readonly=!1;o.internals=o.attachInternals();return o}d(n,[{key:"handleDisabledChange",value:function t(t,e){this.tabIndex=e?-1:0,e&&this.blur()}},{key:"connectedCallback",value:function t(){p(f(n.prototype),"connectedCallback",this).call(this),this.internals.ariaChecked="false",this.disabled&&(this.tabIndex=-1),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(){p(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.code==="Enter")&&(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 iw($())}}]);return n}(t);return n7([n({type:String})],i.prototype,"identifier",2),n7([n({type:Number,reflect:!0,attribute:"tabindex"})],i.prototype,"tabIndex",2),n7([n({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:ho})],i.prototype,"disabled",2),n7([n({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:ho})],i.prototype,"readonly",2),n7([V("disabled",{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),i};var n$=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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(),i=!1;if(typeof n=="string")if(n==="true")i=!0;else if(n==="false")i=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(i=n);return i}).every(function(t){return typeof t=="boolean"&&t})}}]);return e}(t)};var nB=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"calculateChildren",value:function t(t){var e=t.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-subtract, expected number"),null):Number(e)});return e.some(function(t){return t===null})?(console.error("One or more child expressions returned invalid values"),0):e[0]-e[1]}}]);return e}(t)};var nj,nW,nF,nQ,nH,nG,nX,nJ,nY,nK;var nZ;var n0=Object.defineProperty;var n1=Object.getOwnPropertyDescriptor;var n2=Object.getOwnPropertyNames;var n3=Object.prototype.hasOwnProperty;var n5=function t(t){throw TypeError(t)};var n4=function t(t,e){for(var n in e)n0(t,n,{get:e[n],enumerable:!0})},n6=function t(t,e,n,i){var o=true,a=false,s=undefined;if(e&&(typeof e==="undefined"?"undefined":U(e))=="object"||typeof e=="function")try{var l=function(){var o=c.value;!n3.call(t,o)&&o!==n&&n0(t,o,{get:function t(){return e[o]},enumerable:!(i=n1(e,o))||i.enumerable})};for(var u=n2(e)[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return t};var n8=function t(t){return n6(n0({},"__esModule",{value:!0}),t)},n7=function t(t,e,n,i){for(var o=i>1?void 0:i?n1(e,n):e,a=t.length-1,s;a>=0;a--)(s=t[a])&&(o=(i?s(e,n,o):s(o))||o);return i&&o&&n0(e,n,o),o};var n9=function t(t,e,n){return e.has(t)||n5("Cannot "+n)};var rt=function t(t,e,n){return n9(t,e,"read from private field"),n?n.call(t):e.get(t)},re=function t(t,e,n){return e.has(t)?n5("Cannot add the same private member more than once"):m(e,WeakSet)?e.add(t):e.set(t,n)},rn=function t(t,e,n,i){return n9(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n},rr=function t(t,e,n){return n9(t,e,"access private method"),n};var ri=function t(t,e,n,i){return{set _(r){rn(t,e,r,n)},get _(){return rt(t,e,i)}}};var ro={};n4(ro,{Correctness:function t(){return oE},INITIAL_SESSION_CONTEXT:function t(){return ot},INITIAL_TEST_CONTEXT:function t(){return on},Interaction:function t(){return oS},IsNullOrUndefined:function t(){return nN},ItemContainer:function t(){return l7},ItemCorrectResponseMode:function t(){return ue},ItemPrintVariables:function t(){return ub},ItemShowCandidateCorrection:function t(){return ud},ItemShowCorrectResponse:function t(){return ug},QtiAnd:function t(){return hI},QtiAssessmentItem:function t(){return ar},QtiAssessmentItemRef:function t(){return oj},QtiAssessmentSection:function t(){return oQ},QtiAssessmentStimulusRef:function t(){return aa},QtiAssessmentStimulusRefConnectedEvent:function t(){return ao},QtiAssessmentTest:function t(){return oG},QtiAssociableHotspot:function t(){return hn},QtiAssociateInteraction:function t(){return uU},QtiBaseValue:function t(){return hM},QtiChoiceInteraction:function t(){return uB},QtiCompanionMaterialsInfo:function t(){return as},QtiConditionExpression:function t(){return oI},QtiContainerSize:function t(){return hT},QtiContains:function t(){return hP},QtiContentBody:function t(){return am},QtiContextDeclaration:function t(){return az},QtiCorrect:function t(){return hO},QtiCustomInteraction:function t(){return u3},QtiCustomOperator:function t(){return au},QtiDefault:function t(){return hL},QtiDelete:function t(){return ph},QtiEndAttemptInteraction:function t(){return u5},QtiEqual:function t(){return hB},QtiEqualRounded:function t(){return hU},QtiExpression:function t(){return oR},QtiExtendedTextInteraction:function t(){return u6},QtiFeedback:function t(){return oL},QtiFeedbackBlock:function t(){return ac},QtiFeedbackInline:function t(){return ah},QtiFieldValue:function t(){return hY},QtiGap:function t(){return hr},QtiGapImg:function t(){return hi},QtiGapMatchInteraction:function t(){return ct},QtiGapText:function t(){return ha},QtiGcd:function t(){return hQ},QtiGraphicAssociateInteraction:function t(){return cd},QtiGraphicGapMatchInteraction:function t(){return cv},QtiGraphicOrderInteraction:function t(){return cw},QtiGt:function t(){return hH},QtiGte:function t(){return hG},QtiHotspotChoice:function t(){return hs},QtiHotspotInteraction:function t(){return cE},QtiHottext:function t(){return hl},QtiHottextInteraction:function t(){return cI},QtiIndex:function t(){return pv},QtiInlineChoice:function t(){return hp},QtiInlineChoiceInteraction:function t(){return c2},QtiIsNull:function t(){return hJ},QtiItem:function t(){return uT},QtiItemBody:function t(){return av},QtiLookupOutcomeValue:function t(){return hq},QtiLt:function t(){return hK},QtiLte:function t(){return hZ},QtiMapResponse:function t(){return h0},QtiMapResponsePoint:function t(){return h1},QtiMatch:function t(){return h4},QtiMatchInteraction:function t(){return c6},QtiMathOperator:function t(){return h5},QtiMediaInteraction:function t(){return c7},QtiMember:function t(){return h6},QtiModalFeedback:function t(){return ap},QtiMultiple:function t(){return h8},QtiNot:function t(){return h7},QtiNull:function t(){return hX},QtiOr:function t(){return h9},QtiOrderInteraction:function t(){return dt},QtiOrdered:function t(){return pt},QtiOutcomeDeclaration:function t(){return aS},QtiPortableCustomInteraction:function t(){return dx},QtiPositionObjectInteraction:function t(){return dE},QtiPositionObjectStage:function t(){return dS},QtiPower:function t(){return pe},QtiPrintedVariable:function t(){return pn},QtiProduct:function t(){return pr},QtiPrompt:function t(){return hf},QtiRandom:function t(){return pd},QtiRandomInteger:function t(){return pc},QtiResponseCondition:function t(){return hk},QtiResponseDeclaration:function t(){return aE},QtiResponseElse:function t(){return hS},QtiResponseElseIf:function t(){return hR},QtiResponseIf:function t(){return hA},QtiResponseProcessing:function t(){return aP},QtiRound:function t(){return hN},QtiRoundTo:function t(){return h$},QtiRubricBlock:function t(){return ag},QtiRuleElement:function t(){return oU},QtiSelectPointInteraction:function t(){return dz},QtiSetOutcomeValue:function t(){return hC},QtiSetOutcomeValueRule:function t(){return hE},QtiSimpleAssociableChoice:function t(){return hv},QtiSimpleChoice:function t(){return hg},QtiSliderInteraction:function t(){return dY},QtiStringMatch:function t(){return po},QtiStylesheet:function t(){return aq},QtiSubtract:function t(){return pi},QtiSum:function t(){return ps},QtiSumExpression:function t(){return pl},QtiTemplateDeclaration:function t(){return aV},QtiTest:function t(){return o$},QtiTestFeedback:function t(){return a$},QtiTestPart:function t(){return oJ},QtiTextEntryInteraction:function t(){return d4},QtiUploadInteraction:function t(){return he},QtiVariable:function t(){return pu},QtiVariableDeclaration:function t(){return oA},ScoringHelper:function t(){return oN},TestCheckItem:function t(){return l3},TestContainer:function t(){return lj},TestEndAttempt:function t(){return st},TestItemLink:function t(){return a9},TestNavigation:function t(){return aK},TestNext:function t(){return a5},TestPagingButtonsStamp:function t(){return lM},TestPrev:function t(){return a4},TestPrintContext:function t(){return lJ},TestPrintVariables:function t(){return lW},TestScoringButtons:function t(){return l0},TestScoringFeedback:function t(){return l2},TestSectionButtonsStamp:function t(){return lQ},TestSectionLink:function t(){return lX},TestShowCorrectResponse:function t(){return so},TestStamp:function t(){return lY},TestView:function t(){return a7},TestViewToggle:function t(){return l1},computedContext:function t(){return i4},computedItemContext:function t(){return i5},configContext:function t(){return i6},convertNumberToUniversalFormat:function t(){return oT},decimalSeparator:function t(){return oM},getItemByUri:function t(){return hy},getManifestInfo:function t(){return hb},itemContext:function t(){return i7},itemContextVariables:function t(){return i8},qtiAndMixin:function t(){return n$},qtiContext:function t(){return i9},qtiSubtractMixin:function t(){return nB},qtiTransformItem:function t(){return iG},qtiTransformManifest:function t(){return iX},qtiTransformTest:function t(){return iJ},removeDoubleSlashes:function t(){return nD},sessionContext:function t(){return oe},testContext:function t(){return or}});var ra=/*#__PURE__*/function(){"use strict";function t(e){l(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}d(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 rs=function t(t,e,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(t,n):o?o.value=n:e.set(t,n),n},rl=function t(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},ru,rc,rd,rh,rp,rf,rv,rm,rg,rb,ry,rw,rq=function t(t){var e;return typeof t=="boolean"?t:(e=t===null||t===void 0?void 0:t.capture)!==null&&e!==void 0?e:!1};var rk=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.__eventListeners=new Map,this.__captureEventListeners=new Map}d(t,[{key:"addEventListener",value:function t(t,e,n){var i=this;var o;if(e==null)return;var a=rq(n)?this.__captureEventListeners:this.__eventListeners,s=a.get(t);if(s===void 0)s=new Map,a.set(t,s);else if(s.has(e))return;var l=(typeof n==="undefined"?"undefined":U(n))=="object"&&n?n:{};(o=l.signal)===null||o===void 0?void 0:o.addEventListener("abort",function(){return i.removeEventListener(t,e,n)}),s.set(e,l!==null&&l!==void 0?l:{})}},{key:"removeEventListener",value:function t(t,e,n){if(e==null)return;var i=rq(n)?this.__captureEventListeners:this.__eventListeners,o=i.get(t);o!==void 0&&(o.delete(e),o.size||i.delete(t))}},{key:"dispatchEvent",value:function t(t){var e=this;var n=[this],i=this.__eventTargetParent;if(t.composed)for(;i;)n.push(i),i=i.__eventTargetParent;else for(;i&&i!==this.__host;)n.push(i),i=i.__eventTargetParent;var o=!1,a=!1,s=0,l=null,u=null,c=null,d=t.stopPropagation,h=t.stopImmediatePropagation;Object.defineProperties(t,{target:k({get:function t(){return l!==null&&l!==void 0?l:u}},r_),srcElement:k({get:function e(){return t.target}},r_),currentTarget:k({get:function t(){return c}},r_),eventPhase:k({get:function t(){return s}},r_),composedPath:k({value:function t(){return n}},r_),stopPropagation:k({value:function e(){o=!0,d.call(t)}},r_),stopImmediatePropagation:k({value:function e(){a=!0,h.call(t)}},r_)});var p=function e(e,n,i){typeof e=="function"?e(t):typeof(e===null||e===void 0?void 0:e.handleEvent)=="function"&&e.handleEvent(t),n.once&&i.delete(e)},f=function e(){return c=null,s=0,!t.defaultPrevented},v=n.slice().reverse();l=!this.__host||!t.composed?this:null;var m=function t(t){for(u=e;u.__host&&t.includes(u.__host);)u=u.__host};var g=true,b=false,y=undefined;try{for(var w=v[Symbol.iterator](),q;!(g=(q=w.next()).done);g=true){var x=q.value;!l&&(!u||u===x.__host)&&m(v.slice(v.indexOf(x))),c=x,s=x===t.target?2:1;var _=x.__captureEventListeners.get(t.type);if(_){var C=true,E=false,S=undefined;try{for(var A=_[Symbol.iterator](),R;!(C=(R=A.next()).done);C=true){var I=M(R.value,2),T=I[0],P=I[1];if(p(T,P,_),a)return f()}}catch(t){E=true;S=t}finally{try{if(!C&&A.return!=null){A.return()}}finally{if(E){throw S}}}}if(o)return f()}}catch(t){b=true;y=t}finally{try{if(!g&&w.return!=null){w.return()}}finally{if(b){throw y}}}var O=t.bubbles?n:[this];u=null;var L=true,U=false,N=undefined;try{for(var D=O[Symbol.iterator](),V;!(L=(V=D.next()).done);L=true){var z=V.value;!l&&(!u||z===u.__host)&&m(O.slice(0,O.indexOf(z)+1)),c=z,s=z===t.target?2:3;var $=z.__eventListeners.get(t.type);if($){var B=true,j=false,W=undefined;try{for(var F=$[Symbol.iterator](),Q;!(B=(Q=F.next()).done);B=true){var H=M(Q.value,2),G=H[0],X=H[1];if(p(G,X,$),a)return f()}}catch(t){j=true;W=t}finally{try{if(!B&&F.return!=null){F.return()}}finally{if(j){throw W}}}}if(o)return f()}}catch(t){U=true;N=t}finally{try{if(!L&&D.return!=null){D.return()}}finally{if(U){throw N}}}return f()}}]);return t}(),rx=rk;var r_={__proto__:null};r_.enumerable=!0;Object.freeze(r_);var rC=(rb=/*#__PURE__*/function(){"use strict";function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,t);if(ru.set(this,!1),rc.set(this,!1),rd.set(this,!1),rh.set(this,!1),rp.set(this,Date.now()),rf.set(this,!1),rv.set(this,void 0),rm.set(this,void 0),rg.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if((typeof n==="undefined"?"undefined":U(n))!="object"||!n)throw new Error('The "options" argument must be an object');var i=n.bubbles,o=n.cancelable,a=n.composed;rs(this,ru,!!o,"f"),rs(this,rc,!!i,"f"),rs(this,rd,!!a,"f"),rs(this,rv,"".concat(e),"f"),rs(this,rm,null,"f"),rs(this,rg,!1,"f")}d(t,[{key:"initEvent",value:function t(t,e,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function t(){this.stopPropagation()}},{key:"preventDefault",value:function t(){rs(this,rh,!0,"f")}},{key:"target",get:function t(){return rl(this,rm,"f")}},{key:"currentTarget",get:function t(){return rl(this,rm,"f")}},{key:"srcElement",get:function t(){return rl(this,rm,"f")}},{key:"type",get:function t(){return rl(this,rv,"f")}},{key:"cancelable",get:function t(){return rl(this,ru,"f")}},{key:"defaultPrevented",get:function t(){return rl(this,ru,"f")&&rl(this,rh,"f")}},{key:"timeStamp",get:function t(){return rl(this,rp,"f")}},{key:"composedPath",value:function t(){return rl(this,rg,"f")?[rl(this,rm,"f")]:[]}},{key:"returnValue",get:function t(){return!rl(this,ru,"f")||!rl(this,rh,"f")}},{key:"bubbles",get:function t(){return rl(this,rc,"f")}},{key:"composed",get:function t(){return rl(this,rd,"f")}},{key:"eventPhase",get:function t(){return rl(this,rg,"f")?rb.AT_TARGET:rb.NONE}},{key:"cancelBubble",get:function t(){return rl(this,rf,"f")},set:function t(t){t&&rs(this,rf,!0,"f")}},{key:"stopPropagation",value:function t(){rs(this,rf,!0,"f")}},{key:"isTrusted",get:function t(){return!1}}]);return t}(),ru=new WeakMap,rc=new WeakMap,rd=new WeakMap,rh=new WeakMap,rp=new WeakMap,rf=new WeakMap,rv=new WeakMap,rm=new WeakMap,rg=new WeakMap,rb.NONE=0,rb.CAPTURING_PHASE=1,rb.AT_TARGET=2,rb.BUBBLING_PHASE=3,rb);Object.defineProperties(rC.prototype,{initEvent:r_,stopImmediatePropagation:r_,preventDefault:r_,target:r_,currentTarget:r_,srcElement:r_,type:r_,cancelable:r_,defaultPrevented:r_,timeStamp:r_,composedPath:r_,returnValue:r_,bubbles:r_,composed:r_,eventPhase:r_,cancelBubble:r_,stopPropagation:r_,isTrusted:r_});var rE=(rw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,e);var i;var o;i=s(this,e,[t,n]),ry.set(i,void 0),rs(i,ry,(o=n===null||n===void 0?void 0:n.detail)!==null&&o!==void 0?o:null,"f");return i}d(e,[{key:"initCustomEvent",value:function t(t,e,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function t(){return rl(this,ry,"f")}}]);return e}(rC),ry=new WeakMap,rw);Object.defineProperties(rE.prototype,{detail:r_});var rS=rC,rA=rE;(nj=globalThis.Event)!==null&&nj!==void 0?nj:globalThis.Event=rS;(nW=globalThis.CustomEvent)!==null&&nW!==void 0?nW:globalThis.CustomEvent=rA;var rR=new WeakMap,rI=function t(t){var e=rR.get(t);return e===void 0&&rR.set(t,e=new Map),e},rM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.__shadowRootMode=null,t.__shadowRoot=null,t.__internals=null;return t}d(e,[{key:"attributes",get:function t(){return Array.from(rI(this)).map(function(t){var e=M(t,2),n=e[0],i=e[1];return{name:n,value:i}})}},{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){rI(this).set(t,String(e))}},{key:"removeAttribute",value:function t(t){rI(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 rI(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 ra(this);return this.__internals=t,t}},{key:"getAttribute",value:function t(t){var e;return(e=rI(this).get(t))!==null&&e!==void 0?e:null}}]);return e}(rx);var rT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(rM),rP=rT;(nF=globalThis.litServerRoot)!==null&&nF!==void 0?nF:globalThis.litServerRoot=Object.defineProperty(new rP,"localName",{get:function t(){return"lit-server-root"}});var rO=/*#__PURE__*/function(){"use strict";function e(){l(this,e);this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}d(e,[{key:"define",value:function t(t,e){var n;var i;if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn("'CustomElementRegistry' already has \"".concat(t,'" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.'));else throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the name \"".concat(t,'" has already been used with this registry'));if(this.__reverseDefinitions.has(e))throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ".concat(this.__reverseDefinitions.get(e)));e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:(n=e.observedAttributes)!==null&&n!==void 0?n:[]}),this.__reverseDefinitions.set(e,t),(i=this.__pendingWhenDefineds.get(t))===null||i===void 0?void 0:i.resolve(e),this.__pendingWhenDefineds.delete(t)}},{key:"get",value:function t(t){var e;return(e=this.__definitions.get(t))===null||e===void 0?void 0:e.ctor}},{key:"getName",value:function t(t){var e;return(e=this.__reverseDefinitions.get(t))!==null&&e!==void 0?e:null}},{key:"upgrade",value:function t(t){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function e(e){return a(function(){var n,i;return z(this,function(o){n=this.__definitions.get(e);if(n)return[2,n.ctor];i=this.__pendingWhenDefineds.get(e);return[2,(i||(i=t(),this.__pendingWhenDefineds.set(e,i)),i.promise)]})}).call(this)}}]);return e}(),rL=rO;var rU=new rL;var rN=globalThis,rD=rN.ShadowRoot&&(rN.ShadyCSS===void 0||rN.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rV=Symbol(),rz=new WeakMap,r$=/*#__PURE__*/function(){"use strict";function t(e,n,i){l(this,t);if(this._$cssResult$=!0,i!==rV)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}d(t,[{key:"styleSheet",get:function t(){var t=this.o,e=this.t;if(rD&&t===void 0){var n=e!==void 0&&e.length===1;n&&(t=rz.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&rz.set(e,t))}return t}},{key:"toString",value:function t(){return this.cssText}}]);return t}(),rB=function t(t){return new r$(typeof t=="string"?t:t+"",void 0,rV)},rj=function t(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++){n[i-1]=arguments[i]}var o=t.length===1?t[0]:n.reduce(function(e,n,i){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[i+1]},t[0]);return new r$(o,t,rV)},rW=function t(t,e){var n=true,i=false,o=undefined;if(rD)t.adoptedStyleSheets=e.map(function(t){return m(t,CSSStyleSheet)?t:t.styleSheet});else try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;var u=document.createElement("style"),c=rN.litNonce;c!==void 0&&u.setAttribute("nonce",c),u.textContent=l.cssText,t.appendChild(u)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}},rF=rD||rN.CSSStyleSheet===void 0?function(t){return t}:function(t){return m(t,CSSStyleSheet)?function(t){var e="";var n=true,i=false,o=undefined;try{for(var a=t.cssRules[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;e+=l.cssText}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return rB(e)}(t):t};var rQ=Object.is,rH=Object.defineProperty,rG=Object.getOwnPropertyDescriptor,rX=Object.getOwnPropertyNames,rJ=Object.getOwnPropertySymbols,rY=Object.getPrototypeOf,rK=globalThis;(nQ=rK.customElements)!==null&&nQ!==void 0?nQ:rK.customElements=rU;var rZ=rK.trustedTypes,r0=rZ?rZ.emptyScript:"",r1=rK.reactiveElementPolyfillSupport,r2=function t(t,e){return t},r3={toAttribute:function t(t,e){switch(e){case Boolean:t=t?r0: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}},r5=function t(t,e){return!rQ(t,e)},r4={attribute:!0,type:String,converter:r3,reflect:!1,useDefault:!1,hasChanged:r5};(nH=Symbol.metadata)!==null&&nH!==void 0?nH:Symbol.metadata=Symbol("metadata"),(nG=rK.litPropertyMetadata)!==null&&nG!==void 0?nG:rK.litPropertyMetadata=new WeakMap;var r6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev();return t}d(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;((e=this._$EO)!==null&&e!==void 0?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)===null||n===void 0?void 0:n.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,i=false,o=undefined;try{for(var a=e.keys()[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;this.hasOwnProperty(l)&&(t.set(l,this[l]),delete this[l])}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}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 rW(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function t(){var t;var e;(t=this.renderRoot)!==null&&t!==void 0?t:this.renderRoot=this.createRenderRoot(),this.enableUpdating(!0),(e=this._$EO)===null||e===void 0?void 0:e.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:"_$ET",value:function t(t,e){var n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(i!==void 0&&n.reflect===!0){var o;var a=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:r3).toAttribute(e,n.type);this._$Em=t,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}},{key:"_$AK",value:function t(t,e){var n=this.constructor,i=n._$Eh.get(t);if(i!==void 0&&this._$Em!==i){var o;var a,s;var l=n.getPropertyOptions(i),u=typeof l.converter=="function"?{fromAttribute:l.converter}:((a=l.converter)===null||a===void 0?void 0:a.fromAttribute)!==void 0?l.converter:r3;this._$Em=i;var c=u.fromAttribute(e,l.type);this[i]=(o=c!==null&&c!==void 0?c:(s=this._$Ej)===null||s===void 0?void 0:s.get(i))!==null&&o!==void 0?o:c,this._$Em=null}}},{key:"requestUpdate",value:function t(t,e,n){if(t!==void 0){var i;var o;var a=this.constructor,s=this[t];if(n!==null&&n!==void 0?n:n=a.getPropertyOptions(t),!(((i=n.hasChanged)!==null&&i!==void 0?i:r5)(s,e)||n.useDefault&&n.reflect&&s===((o=this._$Ej)===null||o===void 0?void 0:o.get(t))&&!this.hasAttribute(a._$Eu(t,n))))return;this.C(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}},{key:"C",value:function t(t,e,n,i){var o=n.useDefault,a=n.reflect,s=n.wrapped;var l,u,c;o&&!((l=this._$Ej)!==null&&l!==void 0?l:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,(u=i!==null&&i!==void 0?i:e)!==null&&u!==void 0?u:this[t]),s!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),a===!0&&this._$Em!==t&&((c=this._$Eq)!==null&&c!==void 0?c:this._$Eq=new Set).add(t))}},{key:"_$EP",value:function t(){return a(function(){var t,e,n;return z(this,function(i){switch(i.label){case 0:this.isUpdatePending=!0;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this._$ES];case 2:i.sent();return[3,4];case 3:t=i.sent();Promise.reject(t);return[3,4];case 4:e=this.scheduleUpdate();n=e!=null;if(!n)return[3,6];return[4,e];case 5:n=i.sent();i.label=6;case 6:return[2,(n,!this.isUpdatePending)]}})}).call(this)}},{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,i=undefined;try{for(var o=this._$Ep[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=M(a.value,2),l=s[0],u=s[1];this[l]=u}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}this._$Ep=void 0}var c=this.constructor.elementProperties;var d=true,h=false,p=undefined;if(c.size>0)try{for(var f=c[Symbol.iterator](),v;!(d=(v=f.next()).done);d=true){var m=M(v.value,2),g=m[0],b=m[1];var y=b.wrapped,w=this[g];y!==!0||this._$AL.has(g)||w===void 0||this.C(g,void 0,b,w)}}catch(t){h=true;p=t}finally{try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}}}var q=!1,k=this._$AL;try{var x;q=this.shouldUpdate(k),q?(this.willUpdate(k),(x=this._$EO)===null||x===void 0?void 0:x.forEach(function(t){var e;return(e=t.hostUpdate)===null||e===void 0?void 0:e.call(t)}),this.update(k)):this._$EM()}catch(t){throw q=!1,this._$EM(),t}q&&this._$AE(k)}},{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:"_$EM",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._$Eq&&(this._$Eq=this._$Eq.forEach(function(t){return e._$ET(t,e[t])})),this._$EM()}},{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&&L(this._$Eh.keys())}},{key:"createProperty",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r4;if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(t,n,e);i!==void 0&&rH(this.prototype,t,i)}}},{key:"getPropertyDescriptor",value:function t(t,e,n){var i;var o=(i=rG(this.prototype,t))!==null&&i!==void 0?i:{get:function t(){return this[e]},set:function t(t){this[e]=t}},a=o.get,s=o.set;return{get:a,set:function e(e){var i=a===null||a===void 0?void 0:a.call(this);s===null||s===void 0?void 0:s.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function t(t){var e;return(e=this.elementProperties.get(t))!==null&&e!==void 0?e:r4}},{key:"_$Ei",value:function t(){if(this.hasOwnProperty(r2("elementProperties")))return;var t=rY(this);t.finalize(),t.l!==void 0&&(this.l=L(t.l)),this.elementProperties=new Map(t.elementProperties)}},{key:"finalize",value:function t(){if(this.hasOwnProperty(r2("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(r2("properties"))){var t=this.properties,e=L(rX(t)).concat(L(rJ(t)));var n=true,i=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;this.createProperty(l,t[l])}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}var u=this[Symbol.metadata];if(u!==null){var c=litPropertyMetadata.get(u);var d=true,h=false,p=undefined;if(c!==void 0)try{for(var f=c[Symbol.iterator](),v;!(d=(v=f.next()).done);d=true){var m=M(v.value,2),g=m[0],b=m[1];this.elementProperties.set(g,b)}}catch(t){h=true;p=t}finally{try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}}}this._$Eh=new Map;var y=true,w=false,q=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),x;!(y=(x=k.next()).done);y=true){var _=M(x.value,2),C=_[0],E=_[1];var S=this._$Eu(C,E);S!==void 0&&this._$Eh.set(S,C)}}catch(t){w=true;q=t}finally{try{if(!y&&k.return!=null){k.return()}}finally{if(w){throw q}}}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 i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;e.unshift(rF(u))}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}else t!==void 0&&e.push(rF(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}((nX=globalThis.HTMLElement)!==null&&nX!==void 0?nX:rP);r6.elementStyles=[],r6.shadowRootOptions={mode:"open"},r6[r2("elementProperties")]=new Map,r6[r2("finalized")]=new Map,r1===null||r1===void 0?void 0:r1({ReactiveElement:r6}),((nJ=rK.reactiveElementVersions)!==null&&nJ!==void 0?nJ:rK.reactiveElementVersions=[]).push("2.1.1");var r8=globalThis,r7=r8.trustedTypes,r9=r7?r7.createPolicy("lit-html",{createHTML:function t(t){return t}}):void 0,it="$lit$",ie="lit$".concat(Math.random().toFixed(9).slice(2),"$"),ir="?"+ie,ii="<".concat(ir,">"),io=r8.document===void 0?{createTreeWalker:function t(){return{}}}:document,ia=function t(){return io.createComment("")},is=function t(t){return t===null||(typeof t==="undefined"?"undefined":U(t))!="object"&&typeof t!="function"},il=Array.isArray,iu=function t(t){return il(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},ic="[ \n\f\r]",id=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ih=/-->/g,ip=/>/g,iv=RegExp(">|".concat(ic,"(?:([^\\s\"'>=/]+)(").concat(ic,"*=").concat(ic,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),im=/'/g,ig=/"/g,ib=/^(?:script|style|textarea|title)$/i,iy=function t(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++){i[o-1]=arguments[o]}return{_$litType$:t,strings:e,values:i}}},iw=iy(1),iq=iy(2),ik=iy(3),ix=Symbol.for("lit-noChange"),i_=Symbol.for("lit-nothing"),iC=new WeakMap,iE=io.createTreeWalker(io,129);var iS=function t(t,n){var i=t.length-1,o=[],a,s=n===2?"<svg>":n===3?"<math>":"",l=id;for(var u=0;u<i;u++){var c=t[u],d=void 0,h=void 0,p=-1,f=0;for(;f<c.length&&(l.lastIndex=f,h=l.exec(c),h!==null);)f=l.lastIndex,l===id?h[1]==="!--"?l=ih:h[1]!==void 0?l=ip:h[2]!==void 0?(ib.test(h[2])&&(a=RegExp("</"+h[2],"g")),l=iv):h[3]!==void 0&&(l=iv):l===iv?h[0]===">"?(l=a!==null&&a!==void 0?a:id,p=-1):h[1]===void 0?p=-2:(p=l.lastIndex-h[2].length,d=h[1],l=h[3]===void 0?iv:h[3]==='"'?ig:im):l===ig||l===im?l=iv:l===ih||l===ip?l=id:(l=iv,a=void 0);var v=l===iv&&t[u+1].startsWith("/>")?" ":"";s+=l===id?c+ii:p>=0?(o.push(d),c.slice(0,p)+it+c.slice(p)+ie+v):c+ie+(p===-2?u:v)}return[e(t,s+(t[i]||"<?>")+(n===2?"</svg>":n===3?"</math>":"")),o]},iA=/*#__PURE__*/function(){"use strict";function t(e,n){var i=e.strings,o=e._$litType$;l(this,t);var a;this.parts=[];var s=0,u=0,c=i.length-1,d=this.parts,h=M(iS(i,o),2),p=h[0],f=h[1];if(this.el=t.createElement(p,n),iE.currentNode=this.el.content,o===2||o===3){var v;var m=this.el.content.firstChild;(v=m).replaceWith.apply(v,L(m.childNodes))}for(;(a=iE.nextNode())!==null&&d.length<c;){if(a.nodeType===1){var g=true,b=false,y=undefined;if(a.hasAttributes())try{for(var w=a.getAttributeNames()[Symbol.iterator](),q;!(g=(q=w.next()).done);g=true){var k=q.value;if(k.endsWith(it)){var x=f[u++],_=a.getAttribute(k).split(ie),C=/([.?@])?(.*)/.exec(x);d.push({type:1,index:s,name:C[2],strings:_,ctor:C[1]==="."?iP:C[1]==="?"?iO:C[1]==="@"?iL:iT}),a.removeAttribute(k)}else k.startsWith(ie)&&(d.push({type:6,index:s}),a.removeAttribute(k))}}catch(t){b=true;y=t}finally{try{if(!g&&w.return!=null){w.return()}}finally{if(b){throw y}}}if(ib.test(a.tagName)){var E=a.textContent.split(ie),S=E.length-1;if(S>0){a.textContent=r7?r7.emptyScript:"";for(var A=0;A<S;A++)a.append(E[A],ia()),iE.nextNode(),d.push({type:2,index:++s});a.append(E[S],ia())}}}else if(a.nodeType===8)if(a.data===ir)d.push({type:2,index:s});else{var R=-1;for(;(R=a.data.indexOf(ie,R+1))!==-1;)d.push({type:7,index:s}),R+=ie.length-1}s++}}d(t,null,[{key:"createElement",value:function t(t,e){var n=io.createElement("template");return n.innerHTML=t,n}}]);return t}();function iR(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0;var o;var a,s;if(e===ix)return e;var l=i!==void 0?(a=n._$Co)===null||a===void 0?void 0:a[i]:n._$Cl,u=is(e)?void 0:e._$litDirective$;return(l===null||l===void 0?void 0:l.constructor)!==u&&(l===null||l===void 0?void 0:(s=l._$AO)===null||s===void 0?void 0:s.call(l,!1),u===void 0?l=void 0:(l=new u(t),l._$AT(t,n,i)),i!==void 0?((o=n._$Co)!==null&&o!==void 0?o:n._$Co=[])[i]=l:n._$Cl=l),l!==void 0&&(e=iR(t,l._$AS(t,e.values),l,i)),e}var iI=/*#__PURE__*/function(){"use strict";function t(e,n){l(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}d(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,i=n.el,o=i.content,a=n.parts,s=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:io).importNode(o,!0);iE.currentNode=s;var l=iE.nextNode(),u=0,c=0,d=a[0];for(;d!==void 0;){if(u===d.index){var h=void 0;d.type===2?h=new iM(l,l.nextSibling,this,t):d.type===1?h=new d.ctor(l,d.name,d.strings,this,t):d.type===6&&(h=new iU(l,this,t)),this._$AV.push(h),d=a[++c]}u!==(d===null||d===void 0?void 0:d.index)&&(l=iE.nextNode(),u++)}return iE.currentNode=io,s}},{key:"p",value:function t(t){var e=0;var n=true,i=false,o=undefined;try{for(var a=this._$AV[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;l!==void 0&&(l.strings!==void 0?(l._$AI(t,l,e),e+=l.strings.length-2):l._$AI(t[e])),e++}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}}]);return t}(),iM=/*#__PURE__*/function(){"use strict";function t(e,n,i,o){l(this,t);var a;this.type=2,this._$AH=i_,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=o,this._$Cv=(a=o===null||o===void 0?void 0:o.isConnected)!==null&&a!==void 0?a:!0}d(t,[{key:"_$AU",get:function t(){var t;var e;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t: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=iR(this,t,e),is(t)?t===i_||t==null||t===""?(this._$AH!==i_&&this._$AR(),this._$AH=i_):t!==this._$AH&&t!==ix&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):iu(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!==i_&&is(this._$AH)?this._$AA.nextSibling.data=t:this.T(io.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var n;var i=t.values,o=t._$litType$,a=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=iA.createElement(e(o.h,o.h[0]),this.options)),o);if(((n=this._$AH)===null||n===void 0?void 0:n._$AD)===a)this._$AH.p(i);else{var s=new iI(a,this),l=s.u(this.options);s.p(i),this.T(l),this._$AH=s}}},{key:"_$AC",value:function t(t){var e=iC.get(t.strings);return e===void 0&&iC.set(t.strings,e=new iA(t)),e}},{key:"k",value:function e(e){il(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,i,o=0;var a=true,s=false,l=undefined;try{for(var u=e[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;o===n.length?n.push(i=new t(this.O(ia()),this.O(ia()),this,this.options)):i=n[o],i._$AI(d),o++}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}o<n.length&&(this._$AR(i&&i._$AB.nextSibling,o),n.length=o)}},{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,i;for((n=(i=this)._$AP)===null||n===void 0?void 0:n.call(i,!1,!0,e);t!==this._$AB;){var o=t.nextSibling;t.remove(),t=o}}},{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}(),iT=/*#__PURE__*/function(){"use strict";function t(e,n,i,o,a){l(this,t);this.type=1,this._$AH=i_,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=i_}d(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,i=arguments.length>3?arguments[3]:void 0;var o=this.strings,a=!1;if(o===void 0)t=iR(this,t,e,0),a=!is(t)||t!==this._$AH&&t!==ix,a&&(this._$AH=t);else{var s=t,l,u;for(t=o[0],l=0;l<o.length-1;l++)u=iR(this,s[n+l],e,l),u===ix&&(u=this._$AH[l]),a||(a=!is(u)||u!==this._$AH[l]),u===i_?t=i_:t!==i_&&(t+=(u!==null&&u!==void 0?u:"")+o[l+1]),this._$AH[l]=u}a&&!i&&this.j(t)}},{key:"j",value:function t(t){t===i_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),iP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.type=3;return t}d(e,[{key:"j",value:function t(t){this.element[this.name]=t===i_?void 0:t}}]);return e}(iT),iO=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.type=4;return t}d(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==i_)}}]);return e}(iT),iL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i,o,a){l(this,e);var u;u=s(this,e,[t,n,i,o,a]),u.type=5;return u}d(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=iR(this,t,e,0))!==null&&n!==void 0?n:i_)===ix)return;var i=this._$AH,o=t===i_&&i!==i_||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==i_&&(i===i_||o);o&&this.element.removeEventListener(this.name,this,i),a&&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((e=(n=this.options)===null||n===void 0?void 0:n.host)!==null&&e!==void 0?e:this.element,t):this._$AH.handleEvent(t)}}]);return e}(iT),iU=/*#__PURE__*/function(){"use strict";function t(e,n,i){l(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}d(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){iR(this,t)}}]);return t}(),iN={M:it,P:ie,A:ir,C:1,L:iS,R:iI,D:iu,V:iR,I:iM,H:iT,N:iO,U:iL,B:iP,F:iU},iD=r8.litHtmlPolyfillSupport;iD===null||iD===void 0?void 0:iD(iA,iM),((nY=r8.litHtmlVersions)!==null&&nY!==void 0?nY:r8.litHtmlVersions=[]).push("3.3.1");var iV=function t(t,e,n){var i;var o=(i=n===null||n===void 0?void 0:n.renderBefore)!==null&&i!==void 0?i:e,a=o._$litPart$;if(a===void 0){var s;var l=(s=n===null||n===void 0?void 0:n.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=a=new iM(e.insertBefore(ia(),l),l,void 0,n!==null&&n!==void 0?n:{})}return a._$AI(t),a};var iz=globalThis,i$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.renderOptions={host:t},t._$Do=void 0;return t}d(e,[{key:"createRenderRoot",value:function t(){var t;var n;var i=p(f(e.prototype),"createRenderRoot",this).call(this);return(t=(n=this.renderOptions).renderBefore)!==null&&t!==void 0?t:n.renderBefore=i.firstChild,i}},{key:"update",value:function t(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),p(f(e.prototype),"update",this).call(this,t),this._$Do=iV(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function t(){var t;p(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;p(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 ix}}]);return e}(r6);i$._$litElement$=!0,i$.finalized=!0,(nZ=iz.litElementHydrateSupport)===null||nZ===void 0?void 0:nZ.call(iz,{LitElement:i$});var iB=iz.litElementPolyfillSupport;iB===null||iB===void 0?void 0:iB({LitElement:i$});((nK=iz.litElementVersions)!==null&&nK!==void 0?nK:iz.litElementVersions=[]).push("4.2.1");var ij=function t(t){return function(e,n){n!==void 0?n.addInitializer(function(){customElements.define(t,e)}):customElements.define(t,e)}};var iW={attribute:!0,type:String,converter:r3,reflect:!1,hasChanged:r5},iF=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iW,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var i=n.kind,o=n.metadata,a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),i==="setter"&&((t=Object.create(t)).wrapped=!0),a.set(n.name,t),i==="accessor"){var s=n.name;return{set:function n(n){var i=e.get.call(this);e.set.call(this,n),this.requestUpdate(s,i,t)},init:function e(e){return e!==void 0&&this.C(s,void 0,t,e),e}}}if(i==="setter"){var l=n.name;return function(n){var i=this[l];e.call(this,n),this.requestUpdate(l,i,t)}}throw Error("Unsupported decorator location: "+i)};var iQ=function t(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof e==="undefined"?"undefined":U(e))!="object"&&Object.defineProperty(t,e,n),n};function iH(t,e){if(t.nodeType===Node.ELEMENT_NODE){var n=t,i=e.createElement(n.localName);for(var o=0;o<n.attributes.length;o++){var a=n.attributes[o];i.setAttribute(a.localName,a.value)}for(var s=0;s<n.childNodes.length;s++)i.appendChild(iH(n.childNodes[s],e));return i}return t.cloneNode(!1)}var iG=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var e,n="",i={load:function o(o,a){n=o;var s=encodeURI(o);return t&&sessionStorage.getItem(s)?Promise.resolve(i.parse(sessionStorage.getItem(s))):w(o,a).then(function(n){return e=n,i.shuffleInteractions(),t&&sessionStorage.setItem(s,new XMLSerializer().serializeToString(e)),i})},parse:function t(t){return e=q(t),i},path:function t(t){return E(e,t),n=null,i},fn:function t(t){return t(e),i},pciHooks:function t(t){var n=["hook","module"],o=t.substring(0,t.lastIndexOf("/"));var a=true,s=false,l=undefined;try{var u=function(){var n=d.value;e.querySelectorAll("["+n+"]").forEach(function(e){var i=e.getAttribute(n);!i.startsWith("data:")&&!i.startsWith("http")&&(e.setAttribute("base-url",t),e.setAttribute("module",o+"/"+encodeURI(i+(i.endsWith(".js")?"":".js"))))})};for(var c=n[Symbol.iterator](),d;!(a=(d=c.next()).done);a=true)u()}catch(t){s=true;l=t}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw l}}}return i},configurePci:function t(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"qti-portable-custom-interaction";return a(function(){var s,l,u,c,d,h,p,f,v,m,g,b,y,w,q,k,x,_,C,E,S,A,R,I,M,T,P,O,L,U,N,D,V,$;return z(this,function(P){switch(P.label){case 0:s=[],l=e.querySelectorAll(o);if(l.length===0)return[2,i];u=null,c=null,d=function e(){return a(function(){var e,i;return z(this,function(o){switch(o.label){case 0:if(!(u===null))return[3,4];o.label=1;case 1:o.trys.push([1,3,,4]);return[4,n(t,"/modules/module_resolution.js")];case 2:u=o.sent();return[3,4];case 3:e=o.sent();u=null;return[3,4];case 4:if(!(c===null))return[3,8];o.label=5;case 5:o.trys.push([5,7,,8]);return[4,n(t,"/modules/fallback_module_resolution.js")];case 6:c=o.sent();return[3,8];case 7:i=o.sent();c=null;return[3,8];case 8:return[2]}})})()};h=true,p=false,f=undefined;P.label=1;case 1:P.trys.push([1,12,13,14]);v=Array.from(l)[Symbol.iterator]();P.label=2;case 2:if(!!(h=(m=v.next()).done))return[3,11];g=m.value;g.setAttribute("data-base-url",t);b=g.getAttribute("custom-interaction-type-identifier");b&&s.includes(b)&&(b=b+s.length,g.setAttribute("custom-interaction-type-identifier",b),s.push(b)),b&&s.push(b);y=g.querySelector("qti-interaction-modules");if(!(y&&y.getAttribute("primary-configuration")))return[3,8];return[4,d()];case 3:P.sent();w=y.getAttribute("primary-configuration");if(!w)return[3,7];P.label=4;case 4:P.trys.push([4,6,,7]);return[4,n(t,"/".concat(w))];case 5:q=P.sent(),k=Array.from(y.querySelectorAll("qti-interaction-module"));x=true,_=false,C=undefined;try{for(E=k[Symbol.iterator]();!(x=(S=E.next()).done);x=true){A=S.value;R=A.getAttribute("id");if(R&&q.paths&&q.paths[R]){I=q.paths[R],M=Array.isArray(I)?I[0]:I;if(A.setAttribute("primary-path",M),c&&c.paths&&c.paths[R]){T=c.paths[R];Array.isArray(T)?A.setAttribute("fallback-path",T[0]):A.setAttribute("fallback-path",T)}}}}catch(t){_=true;C=t}finally{try{if(!x&&E.return!=null){E.return()}}finally{if(_){throw C}}}if(q.paths){for(var V in q.paths)if(!y.querySelector('qti-interaction-module[id="'.concat(V,'"]'))){O=e.createElement("qti-interaction-module");O.setAttribute("id",V);L=Array.isArray(q.paths[V])?q.paths[V][0]:q.paths[V];if(O.setAttribute("primary-path",L),c&&c.paths&&c.paths[V]){U=c.paths[V];Array.isArray(U)?O.setAttribute("fallback-path",U[0]):O.setAttribute("fallback-path",U)}y.appendChild(O)}}q.urlArgs&&y.setAttribute("url-args",q.urlArgs);return[3,7];case 6:N=P.sent();console.warn("Failed to load primary configuration: ".concat(w),N);return[3,7];case 7:return[3,10];case 8:return[4,d()];case 9:if(P.sent(),u){D=function(t){var n=u.paths[t],i="";c&&c.paths&&c.paths[t]&&(i=c.paths[t]);var o=Array.isArray(n)?n:[n],a=Array.isArray(i)?i:[i],s=o.map(function(t,e){var n=a.length>e?a[e]:"";return{primaryPath:t,fallbackPath:n}});var l=true,d=false,h=undefined;try{var p=function(){var t=v.value;s.some(function(e){return e.fallbackPath===t})||s.push({primaryPath:o.length>0?o[0]:t,fallbackPath:t})};for(var f=a[Symbol.iterator](),v;!(l=(v=f.next()).done);l=true)p()}catch(t){d=true;h=t}finally{try{if(!l&&f.return!=null){f.return()}}finally{if(d){throw h}}}var m=true,g=false,b=undefined;try{for(var w=s[Symbol.iterator](),q;!(m=(q=w.next()).done);m=true){var k=q.value;var x=e.createElement("qti-interaction-module");k.fallbackPath&&x.setAttribute("fallback-path",k.fallbackPath),x.setAttribute("id",t),x.setAttribute("primary-path",k.primaryPath),y&&y.appendChild(x)}}catch(t){g=true;b=t}finally{try{if(!m&&w.return!=null){w.return()}}finally{if(g){throw b}}}};g.querySelector("qti-interaction-modules")===null?(y=e.createElement("qti-interaction-modules"),g.appendChild(y)):y=g.querySelector("qti-interaction-modules");for(var B in u.paths)D(B)}P.label=10;case 10:h=true;return[3,2];case 11:return[3,14];case 12:$=P.sent();p=true;f=$;return[3,14];case 13:try{if(!h&&v.return!=null){v.return()}}finally{if(p){throw f}}return[7];case 14:return[2,i]}})})()},shuffleInteractions:function t(){var t=e.querySelectorAll('[shuffle="true"]'),n=Array.from(t).filter(function(t){var e;return(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase().endsWith("-interaction")});var o=true,a=false,s=undefined;try{for(var l=n[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;var d=I(c.tagName.toLowerCase()),h=Array.isArray(d)?d:[d];var p=true,f=false,v=undefined;try{var m=function(){var t=b.value;var e;var n=Array.from(c.querySelectorAll(t)),o=n.map(function(t,e){return{element:t,fixed:t.hasAttribute("fixed")&&t.getAttribute("fixed")==="true",originalOrder:e}}).filter(function(t){return t.fixed}),a=n.filter(function(t){return!t.hasAttribute("fixed")||t.getAttribute("fixed")!=="true"});if(a.length<=1)return{v:(console.warn("Shuffling is not possible with fewer than 2 non-fixed elements."),i)};var s=L(a),l=!1,u=0;for(;!l&&u<20;){u++;for(var d=a.length-1;d>0;d--){var h=Math.floor(Math.random()*(d+1));var p;p=[a[h],a[d]],a[d]=p[0],a[h]=p[1],p}l=!a.every(function(t,e){return t===s[e]})}if(!l)return{v:(console.warn("Failed to shuffle the choices after multiple attempts."),null)};c.removeAttribute("shuffle");var f=0;var v=true,m=false,g=undefined;try{for(var y=a[Symbol.iterator](),w;!(v=(w=y.next()).done);v=true){var q=w.value;q.parentElement.insertBefore(q,(e=o[f])===null||e===void 0?void 0:e.element),f++}}catch(t){m=true;g=t}finally{try{if(!v&&y.return!=null){y.return()}}finally{if(m){throw g}}}var k=true,x=false,_=undefined;try{for(var C=o[Symbol.iterator](),E;!(k=(E=C.next()).done);k=true){var S=E.value;S.element.parentElement.insertBefore(S.element,a[S.originalOrder])}}catch(t){x=true;_=t}finally{try{if(!k&&C.return!=null){C.return()}}finally{if(x){throw _}}}};for(var g=h[Symbol.iterator](),b;!(p=(b=g.next()).done);p=true){var y=m();if(U(y)==="object")return y.v}}catch(t){f=true;v=t}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(f){throw v}}}}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return i},extendElementName:function t(t,n){return c(e,t,n),i},extendElementsWithClass:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return g(e,t),i},customInteraction:function t(t,n){var o=e.querySelector("qti-custom-interaction"),a=o.querySelector("object");return o.setAttribute("data-base-ref",t),o.setAttribute("data-base-item",t+n),o.setAttribute("data",a.getAttribute("data")),o.setAttribute("width",a.getAttribute("width")),o.setAttribute("height",a.getAttribute("height")),o.removeChild(a),i},convertCDATAtoComment:function t(){return S(e),i},stripStyleSheets:function t(){return A(e),i},html:function t(){return n!==null&&E(e,n.substring(0,n.lastIndexOf("/"))),new XMLSerializer().serializeToString(x(e))},xml:function t(){return new XMLSerializer().serializeToString(e)},htmlDoc:function t(){return n!==null&&E(e,n.substring(0,n.lastIndexOf("/"))),x(e)},xmlDoc:function t(){return e}};return i};var iX=function t(){var t,e={load:function n(n,i){return a(function(){return z(this,function(o){return[2,new Promise(function(o){w(n,i).then(function(n){return t=n,o(e)})})]})})()},parse:function e(e){t=q(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 iJ=function t(){var t,e={load:function n(n,i){return a(function(){return z(this,function(o){return[2,new Promise(function(o,a){w(n,i).then(function(i){return t=i,e.path(n.substring(0,n.lastIndexOf("/"))),o(e)})})]})})()},parse:function n(n){return t=q(n),e},path:function n(n){return E(t,n),e},fn:function n(n){return n(t),e},items:function e(){return y(t)},html:function e(){return new XMLSerializer().serializeToString(x(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return x(t)},xmlDoc:function e(){return t}};return e};var iY=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,L(n));o.navigate=null;o.cacheTransform=!1;o.requestTimeout=3e4;o.postLoadTransformCallback=null;o.postLoadTestTransformCallback=null;o._activeController=null;o._loadResults=[];o._navigationId=0;o._loadingState={expectedItems:0,connectedItems:0,expectedStimulus:0,loadedStimulus:0,isComplete:!1};o._loadedStimulusHrefs=new Set;o._loadingStimulusHrefs=new Set;o._bindEventHandlers();return o}d(e,[{key:"navigateTo",value:function t(t,e){var n=e||this._getDefaultNavigationId(t);n&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:n},bubbles:!0,composed:!0}))}},{key:"_bindEventHandlers",value:function t(){this.addEventListener("qti-request-navigation",this._handleNavigationRequest.bind(this)),this.addEventListener("qti-assessment-test-connected",this._handleTestConnected.bind(this)),this.addEventListener("qti-assessment-item-connected",this._handleItemConnected.bind(this)),this.addEventListener("qti-assessment-stimulus-ref-connected",this._handleStimulusRefConnected.bind(this))}},{key:"_handleTestConnected",value:function t(t){this._testElement=t.detail,this._initializeNavigation()}},{key:"_handleItemConnected",value:function t(t){var e=t.detail;this._loadingState.connectedItems++;var n=e.querySelectorAll("qti-assessment-stimulus-ref");this._loadingState.expectedStimulus+=n.length,this._checkLoadingComplete()}},{key:"_handleStimulusRefConnected",value:function t(t){return a(function(){var e,n,i;return z(this,function(o){switch(o.label){case 0:t.preventDefault();e=t.element,n=t.item;if(console.info("Stimulus ref connected:",{identifier:e.identifier,href:e.href,item:n.identifier}),this._loadedStimulusHrefs.has(e.href)){console.info("Stimulus already loaded, skipping:",e.href),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[2]}if(this._loadingStimulusHrefs.has(e.href)){console.info("Stimulus already loading, skipping duplicate:",e.href),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[2]}this._loadingStimulusHrefs.add(e.href),console.info("Starting stimulus load:",e.href);o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this._loadStimulusRef(e,n)];case 2:o.sent(),this._loadedStimulusHrefs.add(e.href),this._loadingState.loadedStimulus++,console.info("Stimulus loaded successfully:",e.href),this._checkLoadingComplete();return[3,5];case 3:i=o.sent();i.name!=="AbortError"&&console.warn("Failed to load stimulus ".concat(e.identifier,":"),i),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[3,5];case 4:this._loadingStimulusHrefs.delete(e.href);return[7];case 5:return[2]}})}).call(this)}},{key:"_getDefaultNavigationId",value:function t(t){var e;var n,i,o,a,s;return t==="section"?(i=this._testElement)===null||i===void 0?void 0:(n=i.querySelector("qti-assessment-section"))===null||n===void 0?void 0:n.identifier:(e=(o=this.sessionContext)===null||o===void 0?void 0:o.navItemRefId)!==null&&e!==void 0?e:(s=this._testElement)===null||s===void 0?void 0:(a=s.querySelector("qti-assessment-item-ref"))===null||a===void 0?void 0:a.identifier}},{key:"_initializeNavigation",value:function t(){if(!this.navigate)return;var t=this._getDefaultNavigationId(this.navigate);t&&this.navigateTo(this.navigate,t)}},{key:"_handleNavigationRequest",value:function t(t){return a(function(t){var e,n,i,o;return z(this,function(a){switch(a.label){case 0:e=t.detail;if(!(e===null||e===void 0?void 0:e.id))return[2];this._cancelPreviousNavigation();n=++this._navigationId,i=new AbortController;a.label=1;case 1:a.trys.push([1,3,4,5]);this._dispatchLoadingStarted(e.type,e.id),this._activeController=i;return[4,this._executeNavigation(e.type,e.id,n,i)];case 2:a.sent();return[3,5];case 3:o=a.sent();this._handleNavigationError(o,e.type,e.id);return[3,5];case 4:this._activeController===i&&(this._activeController=null),this._dispatchLoadingEnded(e.type,e.id);return[7];case 5:return[2]}})}).apply(this,arguments)}},{key:"_handleNavigationError",value:function t(t,e,n){t.name!=="AbortError"&&this._dispatchError(this._createNavigationError(t,e,n))}},{key:"_executeNavigation",value:function t(t,e,n,i){return a(function(){var o;return z(this,function(a){switch(a.label){case 0:if(!(t==="item"))return[3,2];return[4,this._navigateToItem(e,n,i)];case 1:o=a.sent();return[3,4];case 2:return[4,this._navigateToSection(e,n,i)];case 3:o=a.sent();a.label=4;case 4:o;return[2]}})}).call(this)}},{key:"_navigateToItem",value:function t(t,e,n){return a(function(){var i;return z(this,function(o){switch(o.label){case 0:i=this._findItemRef(t);this._updateSessionContext(i,t),this._resetLoadingState(),this._loadingState.expectedItems=1;return[4,this._loadItems([t],e,n)];case 1:o.sent();return[4,this._waitForLoadingComplete(e,n)];case 2:o.sent(),!this._isStaleNavigation(e,n)&&this._dispatchTestLoaded(this._loadResults);return[2]}})}).call(this)}},{key:"_navigateToSection",value:function t(t,e,n){return a(function(){var i,o,a,s;return z(this,function(l){switch(l.label){case 0:a=(o=this._findSection(t))===null||o===void 0?void 0:(i=o.closest("qti-test-part"))===null||i===void 0?void 0:i.identifier;this.sessionContext=_(k({},this.sessionContext),{navPartId:a,navSectionId:t,navItemRefId:null});s=this._getSectionItemIds(t);this._resetLoadingState(),this._loadingState.expectedItems=s.length;return[4,this._loadItems(s,e,n)];case 1:l.sent();return[4,this._waitForLoadingComplete(e,n)];case 2:l.sent(),!this._isStaleNavigation(e,n)&&this._dispatchTestLoaded(this._loadResults);return[2]}})}).call(this)}},{key:"_resetLoadingState",value:function t(){this._loadingState={expectedItems:0,connectedItems:0,expectedStimulus:0,loadedStimulus:0,isComplete:!1},this._loadedStimulusHrefs.clear(),this._loadingStimulusHrefs.clear()}},{key:"_checkLoadingComplete",value:function t(){var t=this._loadingState.connectedItems>=this._loadingState.expectedItems,e=this._loadingState.loadedStimulus>=this._loadingState.expectedStimulus;t&&e&&!this._loadingState.isComplete&&(this._loadingState.isComplete=!0)}},{key:"_waitForLoadingComplete",value:function t(t,e){return a(function(){return z(this,function(n){switch(n.label){case 0:if(!!this._loadingState.isComplete)return[3,3];if(this._isStaleNavigation(t,e))return[2];return[4,new Promise(function(t){return setTimeout(t,10)})];case 1:n.sent();n.label=2;case 2:return[3,0];case 3:return[2]}})}).call(this)}},{key:"getLoadingProgress",value:function t(){return k({},this._loadingState)}},{key:"_loadStimulusRef",value:function t(t,e){return a(function(){var n;return z(this,function(i){switch(i.label){case 0:console.info("Loading stimulus:",t.href);return[4,this._loadStimulus(t.href)];case 1:n=i.sent();console.info("Stimulus loaded, applying content:",n?"has content":"no content"),this._applyStimulusContent(n,t,e);return[2]}})}).call(this)}},{key:"_applyStimulusContent",value:function t(t,e,n){if(!t){console.warn("No stimulus content to apply");return}var i=t.querySelectorAll("qti-stimulus-body, qti-stylesheet");if(console.info("Found ".concat(i.length," stimulus elements to apply for ").concat(e.identifier)),i.length===0){console.warn("No qti-stimulus-body or qti-stylesheet elements found in stimulus");return}var o=[],a=document.querySelector('qti-assessment-item[identifier="'.concat(n.identifier,'"] [data-stimulus-idref="').concat(e.identifier,'"]'));if(a)o.push(a),console.info("Found specific target:",a);else{var s=Array.from(this.querySelectorAll('[data-stimulus-idref="'.concat(e.identifier,'"]')));if(s.length>0)o=s,console.info("Found targets by identifier:",s.length);else{var l=Array.from(this.querySelectorAll("[data-stimulus-idref]"));o=l,console.info("Using fallback targets:",l.length)}}if(o.length===0){console.warn("No targets found for stimulus content");return}o.forEach(function(t,e){var n;t.innerHTML="";var a=Array.from(i).map(function(t){return t.cloneNode(!0)});(n=t).append.apply(n,L(a)),console.info("Applied stimulus content to target ".concat(e+1,"/").concat(o.length))})}},{key:"_cancelPreviousNavigation",value:function t(){this._activeController&&(this._activeController.abort(),console.info("Previous navigation request cancelled")),this._clearNavigationState()}},{key:"_clearNavigationState",value:function t(){this._clearLoadedItems(),this._resetLoadingState(),this._loadResults=[]}},{key:"_loadItems",value:function t(t,e,n){return a(function(){var i,o,a;return z(this,function(s){switch(s.label){case 0:i=this;if(!this._testElement||t.length===0)return[2];o=t.map(function(t){return i._findItemRef(t)});this._clearLoadedItems(),this._clearStimulusRef();return[4,Promise.all(o.map(function(t){return i._loadSingleItem(t,e,n)}))];case 1:a=s.sent().filter(Boolean);this._isStaleNavigation(e,n)||(a.forEach(function(t){var e=t.itemRef,n=t.doc;e&&n&&(e.xmlDoc=n)}),a.forEach(function(t){var e=t.itemRef;var n;var o=e===null||e===void 0?void 0:e.identifier;if(!e||!o)return;var a=(n=i.testContext.items.find(function(t){return t.identifier===o}))===null||n===void 0?void 0:n.state;a!==void 0&&e.updateComplete.then(function(){var t=e.assessmentItem;t&&(t.state=a)})}),this._loadResults=a);return[2]}})}).call(this)}},{key:"_loadSingleItem",value:function t(t,e,n){return a(function(){var i,o,a;return z(this,function(s){switch(s.label){case 0:s.trys.push([0,4,,5]);return[4,iG(this.cacheTransform).load(t.href,n.signal)];case 1:i=s.sent();o=this.postLoadTransformCallback;if(!o)return[3,3];return[4,this.postLoadTransformCallback(i,t)];case 2:o=i=s.sent();s.label=3;case 3:return[2,(o,this._isStaleNavigation(e,n)?null:{itemRef:t,doc:i.htmlDoc()})];case 4:a=s.sent();if(a.name==="AbortError")throw console.info("Item load for ".concat(t.identifier," was aborted")),a;return[2,(console.warn("Failed to load item ".concat(t.identifier,":"),a),null)];case 5:return[2]}})}).call(this)}},{key:"_loadStimulus",value:function t(t){return a(function(){var e;return z(this,function(n){switch(n.label){case 0:return[4,iG().load(t,(e=this._activeController)===null||e===void 0?void 0:e.signal)];case 1:return[2,n.sent().htmlDoc()]}})}).call(this)}},{key:"_findItemRef",value:function t(t){var e;var n=(e=this._testElement)===null||e===void 0?void 0:e.querySelector('qti-assessment-item-ref[identifier="'.concat(t,'"]'));if(!n)throw new Error('Item with identifier "'.concat(t,'" not found'));return n}},{key:"_findSection",value:function t(t){var e;return((e=this._testElement)===null||e===void 0?void 0:e.querySelector('qti-assessment-section[identifier="'.concat(t,'"]')))||null}},{key:"_updateSessionContext",value:function t(t,e){var n,i;var o=(n=t.closest("qti-test-part"))===null||n===void 0?void 0:n.identifier,a=(i=t.closest("qti-assessment-section"))===null||i===void 0?void 0:i.identifier;this.sessionContext=_(k({},this.sessionContext),{navPartId:o,navSectionId:a,navItemRefId:e})}},{key:"_getSectionItemIds",value:function t(t){return Array.from(this._testElement.querySelectorAll('qti-assessment-section[identifier="'.concat(t,'"] > qti-assessment-item-ref'))).map(function(t){return t.identifier}).filter(Boolean)}},{key:"_clearLoadedItems",value:function t(){var t;var e=(t=this._testElement)===null||t===void 0?void 0:t.querySelectorAll("qti-assessment-item-ref");Array.from(e||[]).forEach(function(t){t.xmlDoc=null})}},{key:"_clearStimulusRef",value:function t(){this.querySelectorAll("[data-stimulus-idref]").forEach(function(t){return t.innerHTML=""})}},{key:"_isStaleNavigation",value:function t(t,e){return e.signal.aborted||t!==this._navigationId}},{key:"_createNavigationError",value:function t(t,e,n){return{message:t.message||"Failed to load ".concat(e,": ").concat(n),details:t,itemId:e==="item"?n:void 0,sectionId:e==="section"?n:void 0}}},{key:"_dispatchLoadingStarted",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-navigation-loading-started",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}},{key:"_dispatchLoadingEnded",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-navigation-loading-ended",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}},{key:"_dispatchError",value:function t(t){this.dispatchEvent(new CustomEvent("qti-navigation-error",{detail:t,bubbles:!0,composed:!0}))}},{key:"_dispatchTestLoaded",value:function t(t){var e=this;requestAnimationFrame(function(){e.dispatchEvent(new CustomEvent("qti-test-loaded",{detail:t.map(function(t){var e=t.itemRef;return{identifier:e===null||e===void 0?void 0:e.identifier,element:e}}),bubbles:!0,composed:!0}))})}}]);return e}(t);return n7([n({type:String})],e.prototype,"navigate",2),n7([n({type:Boolean,attribute:"cache-transform"})],e.prototype,"cacheTransform",2),n7([n({type:Number})],e.prototype,"requestTimeout",2),n7([n({attribute:!1})],e.prototype,"postLoadTransformCallback",2),n7([n({attribute:!1})],e.prototype,"postLoadTestTransformCallback",2),e};var iK=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,L(n)),o.sessionContext=_(k({},o.sessionContext),{view:"candidate"}),o.addEventListener("on-test-switch-view",function(t){o.sessionContext=_(k({},o.sessionContext),{view:t.detail}),o._updateElementView()}),o.addEventListener("qti-assessment-test-connected",function(){o._updateElementView()}),o.addEventListener("qti-assessment-item-connected",function(t){o._updateElementView(),o._setCorrectResponseVisibility(t.detail)});return o}d(e,[{key:"willUpdate",value:function t(t){p(f(e.prototype),"willUpdate",this).call(this,t),t.has("sessionContext")&&this._updateElementView()}},{key:"_updateElementView",value:function t(){var t=this;if(this._testElement){var e;Array.from(this._testElement.querySelectorAll("[view]")).forEach(function(e){e.classList.toggle("show",e.getAttribute("view")===t.sessionContext.view)});var n=(e=this._testElement.querySelector('qti-assessment-item-ref[identifier="'.concat(this.sessionContext.navItemRefId,'"]')))===null||e===void 0?void 0:e.assessmentItem;n&&n.showCorrectResponse(this.sessionContext.view==="scorer")}}},{key:"_setCorrectResponseVisibility",value:function t(t){t.showCorrectResponse(this.sessionContext.view==="scorer")}}]);return e}(t);return e};var iZ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i,o){l(this,e);var a;a=s(this,e,["context-request",{bubbles:!0,composed:!0}]),a.context=t,a.contextTarget=n,a.callback=i,a.subscribe=o!==null&&o!==void 0?o:!1;return a}return e}(D(Event));var i0=/*#__PURE__*/function(){"use strict";function t(e,n,i,o){var a=this;l(this,t);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(t,e){a.unsubscribe&&(a.unsubscribe!==e&&(a.provided=!1,a.unsubscribe()),a.subscribe||a.unsubscribe()),a.value=t,a.host.requestUpdate(),a.provided&&!a.subscribe||(a.provided=!0,a.callback&&a.callback(t,e)),a.unsubscribe=e},this.host=e,n.context!==void 0){var s;var u=n;this.context=u.context,this.callback=u.callback,this.subscribe=(s=u.subscribe)!==null&&s!==void 0?s:!1}else this.context=n,this.callback=i,this.subscribe=o!==null&&o!==void 0?o:!1;this.host.addController(this)}d(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 iZ(this.context,this.host,this.t,this.subscribe))}}]);return t}();var i1=/*#__PURE__*/function(){"use strict";function t(e){var n=this;l(this,t);this.subscriptions=new Map,this.updateObservers=function(){var t=true,e=false,i=undefined;try{for(var o=n.subscriptions[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=M(a.value,2),l=s[0],u=s[1],c=u.disposer;l(n.o,c)}}catch(t){e=true;i=t}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(e){throw i}}}},e!==void 0&&(this.value=e)}d(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 i=this;if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:function e(){i.subscriptions.delete(t)},consumerHost:e});var o=this.subscriptions.get(t),a=o.disposer;t(this.value,a)}},{key:"clearCallbacks",value:function t(){this.subscriptions.clear()}}]);return t}();var i2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n){l(this,e);var i;i=s(this,e,["context-provider",{bubbles:!0,composed:!0}]),i.context=t,i.contextTarget=n;return i}return e}(D(Event)),i3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i){l(this,e);var o;var a,u;o=s(this,e,[n.context!==void 0?n.initialValue:i]),o.onContextRequest=function(t){var e;if(t.context!==o.context)return;var n=(e=t.contextTarget)!==null&&e!==void 0?e:t.composedPath()[0];n!==o.host&&(t.stopPropagation(),o.addCallback(t.callback,n,t.subscribe))},o.onProviderRequest=function(t){var e;if(t.context!==o.context||((e=t.contextTarget)!==null&&e!==void 0?e:t.composedPath()[0])===o.host)return;var n=new Set;var i=true,a=false,s=undefined;try{for(var l=o.subscriptions[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true){var c=M(u.value,2),d=c[0],h=c[1],p=h.consumerHost;n.has(d)||(n.add(d),p.dispatchEvent(new iZ(o.context,p,d,!0)))}}catch(t){a=true;s=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(a){throw s}}}t.stopPropagation()},o.host=t,n.context!==void 0?o.context=n.context:o.context=n,o.attachListeners(),(a=(u=o.host).addController)===null||a===void 0?void 0:a.call(u,o);return o}d(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 i2(this.context,this.host))}}]);return e}(i1);var i5=Symbol("computedItemContext");var i4=Symbol("computedContext");var i6=Symbol("configContext");var i8=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}];var i7=Symbol("item");var i9=Symbol("qtiContext");var ot={view:"candidate"},oe=Symbol("testContext");var on={items:[],testOutcomeVariables:[]},or=Symbol("testContext");var oi={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},oo=function t(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++){n[i]=arguments[i]}return{_$litDirective$:t,values:n}}},oa=/*#__PURE__*/function(){"use strict";function t(e){l(this,t)}d(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,L(e))}}]);return t}();var os=iN.I,ol=function t(t){return t===null||(typeof t==="undefined"?"undefined":U(t))!="object"&&typeof t!="function"};var ou=function t(t){return t.strings===void 0},oc=function t(){return document.createComment("")},od=function t(t,e,n){var i=t._$AA.parentNode,o=e===void 0?t._$AB:e._$AA;if(n===void 0){var a=i.insertBefore(oc(),o),s=i.insertBefore(oc(),o);n=new os(a,s,t,t.options)}else{var l=n._$AB.nextSibling,u=n._$AM,c=u!==t;if(c){var d;var h;(d=n._$AQ)===null||d===void 0?void 0:d.call(n,t),n._$AM=t,n._$AP!==void 0&&(h=t._$AU)!==u._$AU&&n._$AP(h)}if(l!==o||c){var p=n._$AA;for(;p!==l;){var f=p.nextSibling;i.insertBefore(p,o),p=f}}}return n},oh=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;return t._$AI(e,n),t},op={},of=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:op;return t._$AH=e},ov=function t(t){return t._$AH},om=function t(t){t._$AR(),t._$AA.remove()};var og=function t(t,e){var n;var i=t._$AN;if(i===void 0)return!1;var o=true,a=false,s=undefined;try{for(var l=i[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;(n=c._$AO)===null||n===void 0?void 0:n.call(c,e,!1),og(c,e)}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return!0},ob=function t(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)},oy=function t(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),ow(e)}};var ow=function t(t){var e,n;t.type==oi.CHILD&&((e=t._$AP)!==null&&e!==void 0?e:t._$AP=nU,(n=t._$AQ)!==null&&n!==void 0?n:t._$AQ=nL)},oq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t._$AN=void 0;return t}d(e,[{key:"_$AT",value:function t(t,n,i){p(f(e.prototype),"_$AT",this).call(this,t,n,i),oy(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,i,o,a;t!==this.isConnected&&(this.isConnected=t,t?(n=(i=this).reconnected)===null||n===void 0?void 0:n.call(i):(o=(a=this).disconnected)===null||o===void 0?void 0:o.call(a)),e&&(og(this,t),ob(this))}},{key:"setValue",value:function t(t){if(ou(this._$Ct))this._$Ct._$AI(t,this);else{var e=L(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}(oa);var ok,ox,o_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,ok);t.prevData={};return t}d(e,[{key:"render",value:function t(t){return i_}},{key:"update",value:function t(t,e){var n=M(e,1),i=n[0];var o;return this.element!==t.element&&(this.element=t.element),this.host=((o=t.options)===null||o===void 0?void 0:o.host)||this.element,this.apply(i),this.groom(i),this.prevData=k({},i),i_}},{key:"apply",value:function t(t){var e=rr(this,ok,ox).call(this,t),n=this,i=n.prevData,o=n.element;for(var a in e){var s=e[a];s!==i[a]&&(s===!0?o.setAttribute(a,""):s===!1?o.removeAttribute(a):s!=null?o.setAttribute(a,String(s)):o.removeAttribute(a))}}},{key:"groom",value:function t(t){var e=this,n=e.prevData,i=e.element;if(!n)return;var o=t?rr(this,ok,ox).call(this,t):{};for(var a in n)(!o||!(a in o))&&i.removeAttribute(a)}}]);return e}(oq);ok=new WeakSet,ox=function t(t){return Object.fromEntries(Object.entries(t).filter(function(t){var e=M(t,2),n=e[0],i=e[1];return typeof i=="function"?!1:n==="max-choices"&&i===0?!0:!(i===""||i===null||i===void 0)}))};var oC=oo(o_);var oE=function(t){return t.Correct="correct",t.PartiallyCorrect="partially-correct",t.Incorrect="incorrect",t}(oE||{}),oS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t.disabled=!1;t.readonly=!1;t.showCorrectResponse=!1;t._handleShowCorrectResponseChange=function(e,n){t.toggleInternalCorrectResponse(n)};t.showFullCorrectResponse=!1;t._handleShowFullCorrectResponseChange=function(e,n){t.toggleFullCorrectResponse(n)};t.showCandidateCorrection=!1;t._handleShowCandidateCorrectionChange=function(e,n){t.toggleCandidateCorrection(n)};t._correctResponse=null;t._internals=t.attachInternals();return t}d(e,[{key:"internals",get:function t(){return this._internals}},{key:"correctResponseAttr",get:function t(){return this._correctResponse===null||this._correctResponse===void 0?null:Array.isArray(this._correctResponse)?this._correctResponse.join(","):this._correctResponse},set:function t(t){t===null?this._correctResponse=null:t.includes(",")?this._correctResponse=t.split(",").map(function(t){return t.trim()}):this._correctResponse=t}},{key:"isFullCorrectResponse",get:function t(){return this._isFullCorrectResponse},set:function t(t){this._isFullCorrectResponse=t,t&&(this.disabled=!0,this.setAttribute("inert",""),this.setAttribute("response-identifier",this.responseIdentifier+"_cr"))}},{key:"correctResponse",get:function t(){var t=this.responseVariable;return(t===null||t===void 0?void 0:t.correctResponse)?t.correctResponse:this._correctResponse},set:function t(t){var e=this._correctResponse;this._correctResponse=t,t==null?this.removeAttribute("correct-response"):this.setAttribute("correct-response",Array.isArray(t)?t.join(","):t),this.requestUpdate("_correctResponse",e)}},{key:"correctness",get:function t(){var t=this.correctResponse;if(!t)return null;var e=this.response;if(e==null||e===""||Array.isArray(e)&&e.length===0)return null;var n=Array.isArray(t)?t:[t],i=(Array.isArray(e)?e:[e]).filter(function(t){return t!==""});if(i.length===0)return null;var o=i.filter(function(t){return n.includes(t)}).length,a=i.filter(function(t){return!n.includes(t)}).length;return o===n.length&&a===0&&i.length===n.length?"correct":o>0&&(o<n.length||a>0)?"partially-correct":"incorrect"}},{key:"isInline",get:function t(){return!1}},{key:"responseVariable",get:function t(){var t;if(!((t=this._context)===null||t===void 0?void 0:t.variables))return;var e=this._context.variables.filter(function(t){return t.type==="response"}),n=this.getAttribute("response-identifier");return e.find(function(t){return t.identifier===n})}},{key:"toggleCorrectResponse",value:function t(t){var e,n;(((n=this)===null||n===void 0?void 0:(e=n.configContext)===null||e===void 0?void 0:e.correctResponseMode)||"internal")==="full"?this.toggleFullCorrectResponse(t):this.toggleInternalCorrectResponse(t)}},{key:"toggleFullCorrectResponse",value:function t(t){return a(function(){var e,n,i,o,a,s,l,u,c;return z(this,function(d){switch(d.label){case 0:o=this.nextSibling,a=m(o,HTMLDivElement)&&(o===null||o===void 0?void 0:o.classList.contains("full-correct-response")),s=this.correctResponse;if(!s)return[2];if(!(t&&(((n=this)===null||n===void 0?void 0:(e=n.configContext)===null||e===void 0?void 0:e.fullCorrectResponseOnlyWhenIncorrect)===!1||this.correctness!=="correct"))){;if(!a)return[2];(l=this.parentElement)===null||l===void 0?void 0:l.removeChild(o);return[2]}if(a)return[2];u=this.cloneNode(!0);u.removeAttribute("show-full-correct-response"),u.removeAttribute("show-correct-response"),u.removeAttribute("show-candidate-correction");c=document.createElement("div");c.classList.add("full-correct-response"),this.isInline?c.classList.add("full-correct-response-inline"):c.classList.add("full-correct-response-block"),c.role="full-correct-response",c.appendChild(u),u.isFullCorrectResponse=!0,(i=this.parentElement)===null||i===void 0?void 0:i.insertBefore(c,this.nextSibling);return[4,u.updateComplete];case 1:d.sent(),u.response=Array.isArray(s)?L(s):s;return[2]}})}).call(this)}},{key:"toggleInternalCorrectResponse",value:function t(t){this._internals.states.delete("show-correct-response"),t&&this.correctResponse&&this._internals.states.add("show-correct-response")}},{key:"toggleCandidateCorrection",value:function t(t){this._internals.states.delete("candidate-correct"),this._internals.states.delete("candidate-partially-correct"),this._internals.states.delete("candidate-incorrect"),t&&(this.correctness==="correct"&&this._internals.states.add("candidate-correct"),this.correctness==="partially-correct"&&this._internals.states.add("candidate-partially-correct"),this.correctness==="incorrect"&&this._internals.states.add("candidate-incorrect"))}},{key:"value",get:function t(){return JSON.stringify(this.response)},set:function t(t){this.response=t?JSON.parse(t):null}},{key:"reportValidity",value:function t(){return this._internals.reportValidity()}},{key:"reset",value:function t(){this.response=null}},{key:"formResetCallback",value:function t(){this.reset()}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),!this.isFullCorrectResponse&&this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1,detail:{interactionElement:this,responseIdentifier:this.responseIdentifier}}))}},{key:"firstUpdated",value:function t(){this.isFullCorrectResponse||(this.showCorrectResponse&&this.toggleInternalCorrectResponse(!0),this.showFullCorrectResponse&&this.toggleFullCorrectResponse(!0),this.showCandidateCorrection&&this.toggleCandidateCorrection(!0))}},{key:"saveResponse",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:k({responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?L(t):t},e!==void 0?{state:e}:{})}))}}]);return e}(i$);oS.formAssociated=!0,n7([P({context:i7,subscribe:!0})],oS.prototype,"_context",2),n7([P({context:i6,subscribe:!0})],oS.prototype,"configContext",2),n7([n({type:String,attribute:"response-identifier"})],oS.prototype,"responseIdentifier",2),n7([n({reflect:!0,type:Boolean})],oS.prototype,"disabled",2),n7([n({reflect:!0,type:Boolean})],oS.prototype,"readonly",2),n7([n({type:String})],oS.prototype,"name",2),n7([n({type:String,attribute:"correct-response",reflect:!0})],oS.prototype,"correctResponseAttr",1),n7([n({type:Boolean,attribute:"show-correct-response",reflect:!0})],oS.prototype,"showCorrectResponse",2),n7([V("showCorrectResponse",{waitUntilFirstUpdate:!0})],oS.prototype,"_handleShowCorrectResponseChange",2),n7([n({type:Boolean,attribute:"show-full-correct-response",reflect:!0})],oS.prototype,"showFullCorrectResponse",2),n7([V("showFullCorrectResponse",{waitUntilFirstUpdate:!0})],oS.prototype,"_handleShowFullCorrectResponseChange",2),n7([n({type:Boolean,attribute:"show-candidate-correction",reflect:!0})],oS.prototype,"showCandidateCorrection",2),n7([V("showCandidateCorrection",{waitUntilFirstUpdate:!0})],oS.prototype,"_handleShowCandidateCorrectionChange",2),n7([i()],oS.prototype,"_isFullCorrectResponse",2),n7([i()],oS.prototype,"_correctResponse",2);var oA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(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==="multiple"||t==="ordered"?n:n[0]}}]);return e}(i$);var oR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(console.debug("getVariables",e.tagName.toLowerCase()),e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n;var i=e.getAttribute("identifier")||"";return i==="QTI_CONTEXT"?((n=t.qtiContext)===null||n===void 0?void 0:n.QTI_CONTEXT)?{identifier:"QTI_CONTEXT",baseType:"record",value:t.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}:(console.warn("QTI_CONTEXT not available"),{identifier:"QTI_CONTEXT",baseType:"record",value:t.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}):t.context.variables.find(function(t){return t.identifier===i})||null}case"qti-multiple":{var o=e.getResult();return console.debug("values",o),(o===null||o===void 0?void 0:o.length)>0?{identifier:"",baseType:o[0].baseType,value:o.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-ordered":{var a=e.getResult();return(a===null||a===void 0?void 0:a.length)>0?{identifier:"",baseType:a[0].baseType,value:a.map(function(t){return t.value}),cardinality:"ordered",type:"response"}:null}case"qti-correct":{var s,l;var u=e.getAttribute("identifier")||"",c=((l=t.context)===null||l===void 0?void 0:(s=l.variables)===null||s===void 0?void 0:s.find(function(t){return t.identifier===u}))||null;return{baseType:c.baseType,value:c.correctResponse,cardinality:c.cardinality}}default:{try{var d;return{baseType:"integer",value:((d=e.getResult())===null||d===void 0?void 0:d.toString())||null,cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}d(e,[{key:"render",value:function t(){return iw(j(),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")}}]);return e}(i$);oR.styles=rj(W()),n7([i()],oR.prototype,"result",2),n7([P({context:i7,subscribe:!0}),i()],oR.prototype,"context",2),n7([P({context:i9,subscribe:!0}),i()],oR.prototype,"qtiContext",2);var oI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(oR);var oM=function t(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},oT=function t(t){if(typeof t=="string")return t;var e=oM();return e==="."?t.toLocaleString():t.toString().replace(".","").replace(e,".")};var oP,oO,oL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,oP);return t}d(e,[{key:"connectedCallback",value:function t(){p(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._context.variables.find(function(e){return e.identifier===t})||null;if(this.outcomeIdentifier!==t||!e)return;var n=!1;Array.isArray(e.value)?n=e.value.includes(this.identifier):n=!nN(this.identifier)&&!nN(e===null||e===void 0?void 0:e.value)&&this.identifier===e.value||!1,rr(this,oP,oO).call(this,n)}}]);return e}(i$);oP=new WeakSet,oO=function t(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"},n7([n({type:String,attribute:"show-hide"})],oL.prototype,"showHide",2),n7([n({type:String,attribute:"outcome-identifier"})],oL.prototype,"outcomeIdentifier",2),n7([n({type:String})],oL.prototype,"identifier",2),n7([n({type:String,attribute:!1})],oL.prototype,"showStatus",2),n7([P({context:i7,subscribe:!0}),i()],oL.prototype,"_context",2);var oU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(i$);var oN=/*#__PURE__*/function(){"use strict";function t(){l(this,t)}d(t,null,[{key:"isPointInArea",value:function t(t,e,n){if(n!=="point")return console.warn("Base type ".concat(n," is not supported for point area mapping.")),!1;var i=M(t.split(" ").map(Number),2),o=i[0],a=i[1],s=O(e.split(",")),l=s[0],u=s.slice(1),c=u.map(Number);switch(l.toLowerCase()){case"circle":case"default":{var d=M(c,3),h=d[0],p=d[1],f=d[2];return c.length!==3?(console.warn("Invalid circle definition: ".concat(e)),!1):Math.sqrt(Math.pow(o-h,2)+Math.pow(a-p,2))<=f}case"rect":{var v=M(c,4),m=v[0],g=v[1],b=v[2],y=v[3];return c.length!==4?(console.warn("Invalid rectangle definition: ".concat(e)),!1):o>=m&&o<=b&&a>=g&&a<=y}case"ellipse":{var w=M(c,4),q=w[0],k=w[1],x=w[2],_=w[3];if(c.length!==4)return console.warn("Invalid ellipse definition: ".concat(e)),!1;var C=Math.pow(o-q,2)/Math.pow(x,2),E=Math.pow(a-k,2)/Math.pow(_,2);return C+E<=1}case"poly":{if(c.length<6||c.length%2!==0)return console.warn("Invalid polygon definition: ".concat(e)),!1;var S=[];for(var A=0;A<c.length;A+=2)S.push({x:c[A],y:c[A+1]});return this.isPointInPolygon({x:o,y:a},S)}default:return console.warn("Unsupported shape type: ".concat(l)),!1}}},{key:"isPointInPolygon",value:function t(t,e){var n=!1;for(var i=0,o=e.length-1;i<e.length;o=i++){var a=e[i].x,s=e[i].y,l=e[o].x,u=e[o].y;s>t.y!=u>t.y&&t.x<(l-a)*(t.y-s)/(u-s)+a&&(n=!n)}return n}},{key:"compareSingleValues",value:function t(t,e,n){switch(n){case"identifier":case"string":return t===e;case"integer":{var i=parseInt(t,10),o=parseInt(e,10);if(!isNaN(i)&&!isNaN(o))return i===o;console.error("Cannot convert ".concat(t," and/or ").concat(e," to int."));break}case"float":{var a=parseFloat(t),s=parseFloat(e);if(!isNaN(a)&&!isNaN(s))return a===s;console.error("couldn't convert ".concat(t," and/or ").concat(e," to float."));break}case"pair":case"directedPair":{var l=t.split(" ").sort(),u=e.split(" ").sort();if(l.length===2&&u.length===2)return n==="pair"&&(l.sort(),u.sort()),l.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 oD=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,L(n));o.testContext=on;o.sessionContext=ot;o._updateItemInTestContext=function(t){var e;var n=t._context,i=n.identifier,a=n.variables,s=o.testContext.items.find(function(t){return(t===null||t===void 0?void 0:t.identifier)===i});if(!s){console.warn("Item IDs between assessment.xml and item.xml should match: ".concat(i," is not found!"));return}if(((e=s.variables)===null||e===void 0?void 0:e.length)===1)o._updateItemVariablesInTestContext(i,a);else{var l=L(t.variables);var u=true,c=false,d=undefined;try{var h=function(){var t=f.value;var e=l.find(function(e){return e.identifier===t.identifier});e?e.value=t.value:l.push(t)};for(var p=s.variables[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true)h()}catch(t){c=true;d=t}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(c){throw d}}}t.variables=l}};o._initializeEventListeners();return o}d(e,[{key:"updateItemVariables",value:function t(t,e){var n=this.testContext.items.find(function(e){return e.identifier===t});n&&(n.variables=n.variables.map(function(t){var n=e.find(function(e){return e.identifier===t.identifier});return n?k({},t,n):t}));var i=this._testElement.querySelector('qti-assessment-item-ref[identifier="'.concat(t,'"]'));i&&i.assessmentItem&&(i.assessmentItem.variables=e)}},{key:"_initializeEventListeners",value:function t(){var t=this;this.addEventListener("qti-assessment-test-connected",function(e){if(t.testContext=on,t.sessionContext=ot,t.testContext&&t.testContext.items.length>0)return;t._testElement=e.detail;var n=Array.from(t._testElement.querySelectorAll("qti-assessment-item-ref")).map(function(t){return{href:t.href,identifier:t.identifier,category:t.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}});t.testContext=_(k({},t.testContext),{items:n})}),this.addEventListener("qti-assessment-item-connected",function(e){var n;var i=e.detail,o=(n=i.closest("qti-assessment-item-ref"))===null||n===void 0?void 0:n.identifier;o&&(i.assessmentItemRefId=o),t._updateItemInTestContext(e.detail)}),this.addEventListener("qti-item-context-updated",function(e){t._updateItemVariablesInTestContext(e.detail.itemContext.identifier,e.detail.itemContext.variables,e.detail.itemContext.state)})}},{key:"_updateItemVariablesInTestContext",value:function t(t,e,n){this.testContext=_(k({},this.testContext),{items:this.testContext.items.map(function(i){return i.identifier!==t?i:k(_(k({},i),{variables:e.map(function(t){var e=i.variables.find(function(e){return e.identifier===t.identifier});return e?k({},e,t):t})}),n!==void 0?{state:n?k({},n):void 0}:{})})}),this.dispatchEvent(new CustomEvent("qti-test-context-updated",{detail:this.testContext,bubbles:!1,composed:!1}))}}]);return e}(t);return n7([n({attribute:!1,type:Object}),T({context:or})],e.prototype,"testContext",2),n7([n({attribute:!1,type:Object}),T({context:oe})],e.prototype,"sessionContext",2),e},oV=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(oD(i$));var oz=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,L(n)),o.addEventListener("qti-register-variable",function(t){o.testContext=_(k({},o.testContext),{testOutcomeVariables:L(o.testContext.testOutcomeVariables||[]).concat([t.detail.variable])}),t.stopPropagation()}),o.addEventListener("qti-set-outcome-value",function(t){var e=t.detail,n=e.outcomeIdentifier,i=e.value;o.updateOutcomeVariable(n,i),t.stopPropagation()});return o}d(e,[{key:"outcomeProcessing",value:function t(){var t=this.querySelector("qti-outcome-processing");return t?(t===null||t===void 0?void 0:t.process(),!0):!1}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var i=this.getOutcome(t);if(!i){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this.testContext=_(k({},this.testContext),{testOutcomeVariables:(n=this.testContext.testOutcomeVariables)===null||n===void 0?void 0:n.map(function(n){return n.identifier!==t?n:_(k({},n),{value:i.cardinality==="single"?e:L(n.value).concat([e])})})})}},{key:"getOutcome",value:function t(t){return this.getVariable(t)}},{key:"getVariable",value:function t(t){var e;return((e=this.testContext.testOutcomeVariables)===null||e===void 0?void 0:e.find(function(e){return e.identifier===t}))||null}}]);return e}(t);return e};var o$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-test-connected",{detail:this}));return[2]}})}).call(this)}},{key:"render",value:function t(){return iw(F())}}]);return e}(iY(iK(oz(oD(i$)))));o$=n7([ij("qti-test")],o$);var oB={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}},oj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.weigths=new Map;return t}d(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,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-assessment-item-ref-connected",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href,category:this.category}}));return[2]}})}).call(this)}},{key:"render",value:function t(){return this.myTemplate?this.myTemplate({xmlDoc:this.xmlDoc}):this.xmlDoc}}]);return e}(i$);n7([n({type:String})],oj.prototype,"category",2),n7([n({type:String})],oj.prototype,"identifier",2),n7([n({type:Boolean,converter:oB})],oj.prototype,"required",2),n7([n({type:Boolean,converter:oB})],oj.prototype,"fixed",2),n7([n({type:String})],oj.prototype,"href",2),n7([n({type:Object,attribute:!1})],oj.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",oj);var oW={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}},oF,oQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,oF,"");return t}d(e,[{key:"title",get:function t(){return rt(this,oF)},set:function t(t){rn(this,oF,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:rn(this,oF,this.getAttribute("title")||""),i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return iw(Q())}}]);return e}(i$);oF=new WeakMap,n7([n({type:String})],oQ.prototype,"identifier",2),n7([n({type:String})],oQ.prototype,"required",2),n7([n({type:Boolean,converter:oW})],oQ.prototype,"fixed",2),n7([n({type:Boolean,converter:oW})],oQ.prototype,"visible",2),n7([n({type:Boolean,converter:oW,attribute:"keep-together"})],oQ.prototype,"keepTogether",2),n7([P({context:or,subscribe:!0})],oQ.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",oQ);var oH,oG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,oH,"");return t}d(e,[{key:"title",get:function t(){return rt(this,oH)},set:function t(t){rn(this,oH,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return iw(H())}}]);return e}(i$);oH=new WeakMap,n7([n({type:String})],oG.prototype,"identifier",2),n7([n({type:String})],oG.prototype,"title",1),n7([P({context:or,subscribe:!0})],oG.prototype,"_testContext",2),oG=n7([ij("qti-assessment-test")],oG);var oX,oJ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.class="";t.navigationMode="nonlinear";t.submissionMode="individual";re(t,oX,"");return t}d(e,[{key:"title",get:function t(){return rt(this,oX)},set:function t(t){rn(this,oX,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return iw(G())}}]);return e}(i$);oX=new WeakMap,n7([n({type:String})],oJ.prototype,"identifier",2),n7([n({type:String})],oJ.prototype,"class",2),n7([n({type:String,attribute:"navigation-mode"})],oJ.prototype,"navigationMode",2),n7([n({type:String,attribute:"submission-mode"})],oJ.prototype,"submissionMode",2),oJ=n7([ij("qti-test-part")],oJ);customElements.get("qti-test-part")||customElements.define("qti-test-part",oJ);var oY,oK,oZ,o0,o1,o2,o3,o5,o4,o6,o8,o7,o9,at,ae,an,ar=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,o2);re(t,oY);re(t,oK,null);t.identifier="";t.adaptive="false";t.timeDependent=null;t._handleDisabledChange=function(e,n){rt(t,o1).forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){return rt(t,o1).forEach(function(t){return t.readonly=n})};t._context={variables:i8};re(t,oZ,_(k({},t._context),{variables:t._context.variables}));re(t,o0,[]);re(t,o1,[]);re(t,o4,function(e){e.stopImmediatePropagation(),t._context=_(k({},t._context),{variables:L(t._context.variables).concat([e.detail.variable])}),rn(t,oZ,t._context),e.stopPropagation()});re(t,o6,function(e){var n;e.stopImmediatePropagation();var i=e.detail;rt(t,o0).push(i),(Number((n=t._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)||0)>0&&i.checkShowFeedback(i.outcomeIdentifier)});re(t,o8,function(e){e.stopImmediatePropagation(),rt(t,o1).push(e.detail.interactionElement)});re(t,o7,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.responseIdentifier,o=n.countAttempt;t.validate(),t.updateResponseVariable(i,"true"),t.processResponse(o)});re(t,o9,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.outcomeIdentifier,o=n.value;t.updateOutcomeVariable(i,o),e.stopPropagation()});re(t,at,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.responseIdentifier,o=n.response,a=n.state;t.updateResponseVariable(i,o),a!==void 0&&(t._context=_(k({},t._context),{state:_(k({},t._context.state||{}),h({},i,a))})),t.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:t._context}}))});return t}d(e,[{key:"title",get:function t(){return rt(this,oY)},set:function t(t){rn(this,oY,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"assessmentItemRefId",get:function t(){return this._context.identifier},set:function t(t){this._context=_(k({},this._context),{identifier:t})}},{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=_(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),{interpolationTable:e.interpolationTable}):e})}),this._context.variables.forEach(function(t){if(t.type==="response"){var n=rt(e,o1).find(function(e){return e.responseIdentifier===t.identifier});n&&(n.response=t.value)}}),this.variables.forEach(function(t){t.type==="outcome"&&rt(e,o0).forEach(function(e){return e.checkShowFeedback(t.identifier)})})}},{key:"state",get:function t(){return this._context.state},set:function t(t){this._context=_(k({},this._context),{state:t?k({},t):void 0})}},{key:"responses",set:function t(t){var e=true,n=false,i=undefined;if(t)try{var o,a=function(){var t=l.value;o.getResponse(t.responseIdentifier)&&o.updateResponseVariable(t.responseIdentifier,t.response);var e=rt(o,o1).find(function(e){return e.getAttribute("response-identifier")===t.responseIdentifier});e&&(e.response=t.response)};for(var s=t[Symbol.iterator](),l;!(e=(l=s.next()).done);e=true)o=this,a()}catch(t){n=true;i=t}finally{try{if(!e&&s.return!=null){s.return()}}finally{if(n){throw i}}}}},{key:"render",value:function t(){return iw(X())}},{key:"connectedCallback",value:function t(){var t=this;rr(this,o2,o3).call(this),p(f(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){t.dispatchEvent(new CustomEvent("qti-assessment-item-connected",{bubbles:!0,composed:!0,detail:t})),rr(t,o2,ae).call(t)})}},{key:"disconnectedCallback",value:function t(){rr(this,o2,o5).call(this),p(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"showCorrectResponse",value:function t(t){var e=true,n=false,i=undefined;try{for(var o=rt(this,o1)[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.toggleCorrectResponse(t)}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}document.querySelectorAll("item-show-correct-response").forEach(function(e){e.shown=t})}},{key:"showCandidateCorrection",value:function t(t){var e=true,n=false,i=undefined;try{for(var o=rt(this,o1)[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.toggleCandidateCorrection(t)}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}document.querySelectorAll("item-show-candidate-correction").forEach(function(e){e.shown=t})}},{key:"processResponse",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n;this.validate(e),t&&this.updateOutcomeVariable("numAttempts",(+((n=this._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)+1).toString());var i=this.querySelector("qti-response-processing"),o=!!(i&&typeof i.process=="function");return o&&i.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",rr(this,o2,an).call(this)),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}})),o}},{key:"resetResponses",value:function t(){this._context=rt(this,oZ)}},{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:"updateResponseVariable",value:function t(t,e){this._context=_(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:_(k({},n),{value:e})})}),this.showCandidateCorrection(!1),this.dispatchEvent(new CustomEvent("qti-interaction-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,responseIdentifier:t,response:Array.isArray(e)?L(e):e}})),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",rr(this,o2,an).call(this))}},{key:"setOutcomeVariable",value:function t(t,e){this.updateOutcomeVariable(t,e),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}}))}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var i=this.getOutcome(t);if(!i){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this._context=_(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:_(k({},n),{value:i.cardinality==="single"||Array.isArray(e)?e:[e]})})}),rt(this,o0).forEach(function(e){return e.checkShowFeedback(t)}),this.dispatchEvent(new CustomEvent("qti-outcome-changed",{bubbles:!0,composed:!0,detail:{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:"validate",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var e=rt(this,o1).every(function(t){return t.validate()});return t&&this.reportValidity(),e}},{key:"reportValidity",value:function t(){var t=true,e=false,n=undefined;try{for(var i=rt(this,o1)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.reportValidity()}}catch(t){e=true;n=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw n}}}}}]);return e}(i$);oY=new WeakMap,oK=new WeakMap,oZ=new WeakMap,o0=new WeakMap,o1=new WeakMap,o2=new WeakSet,o3=function t(){this.addEventListener("qti-register-variable",rt(this,o4)),this.addEventListener("qti-register-feedback",rt(this,o6)),this.addEventListener("qti-register-interaction",rt(this,o8)),this.addEventListener("end-attempt",rt(this,o7)),this.addEventListener("qti-set-outcome-value",rt(this,o9)),this.addEventListener("qti-interaction-response",rt(this,at))},o5=function t(){this.removeEventListener("qti-register-variable",rt(this,o4)),this.removeEventListener("qti-register-feedback",rt(this,o6)),this.removeEventListener("qti-register-interaction",rt(this,o8)),this.removeEventListener("end-attempt",rt(this,o7)),this.removeEventListener("qti-set-outcome-value",rt(this,o9)),this.removeEventListener("qti-interaction-response",rt(this,at))},o4=new WeakMap,o6=new WeakMap,o8=new WeakMap,o7=new WeakMap,o9=new WeakMap,at=new WeakMap,ae=function t(){rn(this,oK,this.querySelector("qti-template-processing")),rt(this,oK)&&rt(this,oK).process()},an=function t(){var t=this.validate(!1);return t===!0?"completed":t===!1?"incomplete":"not_attempted"},n7([n({type:String})],ar.prototype,"identifier",2),n7([n({type:String})],ar.prototype,"adaptive",2),n7([n({type:String})],ar.prototype,"timeDependent",2),n7([n({type:String})],ar.prototype,"title",1),n7([n({type:Boolean})],ar.prototype,"disabled",2),n7([V("disabled",{waitUntilFirstUpdate:!0})],ar.prototype,"_handleDisabledChange",2),n7([n({type:Boolean})],ar.prototype,"readonly",2),n7([V("readonly",{waitUntilFirstUpdate:!0})],ar.prototype,"_handleReadonlyChange",2),n7([T({context:i7})],ar.prototype,"_context",2),ar=n7([ij("qti-assessment-item")],ar);var ai=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n){l(this,e);var i;i=s(this,e,[e.eventName,{bubbles:!0,composed:!0,cancelable:!0}]);i.element=t;i.item=n;return i}return e}(D(Event));ai.eventName="qti-assessment-stimulus-ref-connected";var ao=ai,aa=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.href="";return t}d(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){var t,e,o,a;return z(this,function(s){switch(s.label){case 0:i().call(n);return[4,this.updateComplete];case 1:s.sent();t=this.closest("qti-assessment-item"),e=new ao(this,t);this.dispatchEvent(e);o=t===null||t===void 0?void 0:t.querySelector('[data-stimulus-idref="'.concat(this.identifier,'"]'));a=!e.defaultPrevented&&o;if(!a)return[3,3];return[4,this.updateStimulusRef(o)];case 2:a=s.sent();s.label=3;case 3:a;return[2]}})}).call(this)}},{key:"updateStimulusRef",value:function t(t){return a(function(){var e,n,i;return z(this,function(o){switch(o.label){case 0:return[4,iG().load(this.href).then(function(t){return t.htmlDoc()})];case 1:e=o.sent();if(e){;i=e.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",(n=t).append.apply(n,L(i))}return[2]}})}).call(this)}}]);return e}(i$);n7([n({type:String})],aa.prototype,"identifier",2),n7([n({type:String})],aa.prototype,"href",2),aa=n7([ij("qti-assessment-stimulus-ref")],aa);var as=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(i$);as=n7([ij("qti-companion-materials-info")],as);var al,au=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,al);return t}d(e,[{key:"render",value:function t(){return iw(J(),this.handleSlotChange)}},{key:"handleSlotChange",value:function t(){var t;var e;var n=Array.from((t=(e=this.firstElementChild)===null||e===void 0?void 0:e.childNodes)!==null&&t!==void 0?t:[]).find(function(t){return t.nodeType===Node.COMMENT_NODE});try{var i;rn(this,al,new Function("context","fn","item",(i=n===null||n===void 0?void 0:n.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(e){var n;var i,o;return(n=(o=t._context)===null||o===void 0?void 0:(i=o.variables.find(function(t){return t.identifier===e}))===null||i===void 0?void 0:i.value)!==null&&n!==void 0?n:""},correct:function e(e){var n;var i,o;return(n=(o=t._context)===null||o===void 0?void 0:(i=o.variables.find(function(t){return t.identifier===e}))===null||i===void 0?void 0:i.correctResponse)!==null&&n!==void 0?n:""}},n={getVariable:function e(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(e,n){t.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:n}}))},updateResponseVariable:function e(e,n){t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,response:n}}))}};return rt(this,al).call(this,this._context,e,n)}}]);return e}(i$);al=new WeakMap,n7([P({context:i7,subscribe:!0}),i()],au.prototype,"_context",2),au=n7([ij("qti-custom-operator")],au);var ac=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(Y(),this.showStatus)}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(oL);ac.styles=rj(K()),ac=n7([ij("qti-feedback-block")],ac);var ad=function t(t){return t!==null&&t!==void 0?t:i_};var ah=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.render=function(){return iw(Z(),ad(t.showStatus))};return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(oL);ah.styles=rj(tt()),ah=n7([ij("qti-feedback-inline")],ah);var ap=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(te(),this.showStatus==="on",this.closeFeedback)}},{key:"openFeedback",value:function t(){var t;var e=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("dialog");e&&!e.open&&e.showModal()}},{key:"closeFeedback",value:function t(){var t;var e=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("dialog");e&&e.open&&(e.close(),this.showStatus="off")}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.showStatus==="on"&&this.openFeedback()}},{key:"updated",value:function t(t){t.has("showStatus")&&(this.showStatus==="on"?this.openFeedback():this.closeFeedback())}}]);return e}(oL);ap.styles=rj(tn()),ap=n7([ij("qti-modal-feedback")],ap);var af=rj(tr());var av=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(ti())}}]);return e}(i$);av.styles=af,av=n7([ij("qti-item-body")],av);var am=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(to())}}]);return e}(i$);am=n7([ij("qti-content-body")],am);var ag=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"handleclassNamesChange",value:function t(){var t=this;this.classNames.split(" ").forEach(function(e){switch(e){case"qti-rubric-discretionary-placement":{var n=new CustomEvent("qti-rubric:discretionary-placement",{detail:{className:e,element:t},bubbles:!0,composed:!0,cancelable:!0});if(!t.dispatchEvent(n))return;t.setAttribute("slot","qti-rubric-block")}break;case"qti-rubric-inline":t.setAttribute("slot","");break;default:break}})}},{key:"render",value:function t(){return iw(ta())}}]);return e}(i$);ag.styles=rj(ts()),n7([n({type:String})],ag.prototype,"id",2),n7([n({type:String})],ag.prototype,"use",2),n7([n({type:String})],ag.prototype,"view",2),n7([n({type:String,attribute:"class"})],ag.prototype,"classNames",2),n7([V("classNames",{waitUntilFirstUpdate:!0})],ag.prototype,"handleclassNamesChange",1),ag=n7([ij("qti-rubric-block")],ag);var ab,ay,aw,aq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,ay);re(t,ab,null);return t}d(e,[{key:"firstUpdated",value:function t(t){var n=this;p(f(e.prototype),"firstUpdated",this).call(this,t);var i=this.getAttribute("href");if(i!==null&&fetch(i).then(function(t){return t.text()}).then(function(t){var e=rr(n,ay,aw).call(n,t);rn(n,ab,document.createElement("style")),rt(n,ab).media="screen",rt(n,ab).textContent="@scope {".concat(e,"}"),n.parentElement?n.parentElement.appendChild(rt(n,ab)):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 o=rr(this,ay,aw).call(this,this.textContent);rn(this,ab,document.createElement("style")),rt(this,ab).media="screen",rt(this,ab).textContent="@scope {".concat(o,"}"),this.parentElement?this.parentElement.appendChild(rt(this,ab)):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"disconnectedCallback",value:function t(){if(rt(this,ab))try{rt(this,ab).remove()}catch(t){console.error("Could not remove stylesheet:",t)}p(f(e.prototype),"disconnectedCallback",this).call(this)}}]);return e}(i$);ab=new WeakMap,ay=new WeakSet,aw=function t(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()},aq=n7([ij("qti-stylesheet")],aq);var ak,ax,a_,aC,aE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,ak);return t}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(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 iw(tl(),JSON.stringify(i,null,2))}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.defaultValues(this.cardinality),n={baseType:this.baseType,identifier:this.identifier,correctResponse:rt(this,ak,ax),cardinality:this.cardinality||"single",mapping:rt(this,ak,a_),defaultValue:t,areaMapping:rt(this,ak,aC),value:null,type:"response",candidateResponse:null};n.value=t,this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}}]);return e}(oA);ak=new WeakSet,ax=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.trim(),n[0].remove();else if(this.cardinality!=="single"){t=[];for(var i=0;i<n.length;i++)t.push(n[i].textContent.trim()),n[i].remove()}}return t},a_=function t(){var t=this.querySelector("qti-mapping"),e=parseFloat(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),n=parseFloat(t===null||t===void 0?void 0:t.getAttribute("upper-bound"));return{defaultValue:Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,lowerBound:isNaN(e)?null:e,upperBound:isNaN(n)?null:n,mapEntries:Array.from((t===null||t===void 0?void 0:t.querySelectorAll("qti-map-entry"))||[]).map(function(t){return{mapKey:t.getAttribute("map-key")||"",mappedValue:Number(t.getAttribute("mapped-value"))||0,caseSensitive:t.hasAttribute("case-sensitive")?t.getAttribute("case-sensitive")!=="false":!1}})}},aC=function t(){var t=this.querySelector("qti-area-mapping"),e=Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,n=parseFloat(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),i=parseFloat(t===null||t===void 0?void 0:t.getAttribute("upper-bound")),o=Array.from((t===null||t===void 0?void 0:t.querySelectorAll("qti-area-map-entry"))||[]).map(function(t){return{shape:t.getAttribute("shape")||"default",coords:t.getAttribute("coords")||"",mappedValue:Number(t.getAttribute("mapped-value"))||0,defaultValue:Number(t.getAttribute("default-value"))||0}});return{defaultValue:e,lowerBound:isNaN(n)?null:n,upperBound:isNaN(i)?null:i,areaMapEntries:o}},aE.styles=[rj(tu())],n7([n({type:String,attribute:"base-type"})],aE.prototype,"baseType",2),n7([n({type:String})],aE.prototype,"identifier",2),n7([n({type:String})],aE.prototype,"cardinality",2),n7([P({context:i7,subscribe:!0}),i()],aE.prototype,"itemContext",2),aE=n7([ij("qti-response-declaration")],aE);var aS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.externalScored=null;return t}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(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 iw(tc(),JSON.stringify(i,null,2))}},{key:"interpolationTable",get:function t(){var t=this.querySelector("qti-interpolation-table");if(t){var e=new Map;var n=true,i=false,o=undefined;try{for(var a=t.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;!l.getAttribute("source-value")&&l.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var u=parseFloat(l.getAttribute("source-value")),c=parseFloat(l.getAttribute("target-value"));(isNaN(u)||isNaN(c))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),e.set(u,c)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e}return null}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.defaultValues(this.cardinality),n={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,defaultValue:t,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};n.value=t,(n.value===null||n.value==null)&&(n.baseType==="integer"||n.baseType==="float")&&(n.value="0"),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}}]);return e}(oA);aS.styles=[rj(td())],n7([n({type:String,attribute:"base-type"})],aS.prototype,"baseType",2),n7([n({type:String,attribute:"external-scored"})],aS.prototype,"externalScored",2),n7([n({type:String})],aS.prototype,"identifier",2),n7([n({type:String})],aS.prototype,"cardinality",2),n7([P({context:i7,subscribe:!0}),i()],aS.prototype,"itemContext",2),aS=n7([ij("qti-outcome-declaration")],aS);var aA='<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>',aR='<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>',aI='<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 aM,aT,aP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,aM);return t}d(e,[{key:"render",value:function t(){return iw(th())}},{key:"process",value:function t(){if(!this.closest("qti-assessment-item"))return;var t=L(this.children);var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.process()}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}}},{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(rr(this,aM,aT).call(this,aR).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(rr(this,aM,aT).call(this,aI).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(rr(this,aM,aT).call(this,aA).firstElementChild.firstElementChild);break}}}}]);return e}(i$);aM=new WeakSet,aT=function t(t){return document.createRange().createContextualFragment(t)},aP.styles=[rj(tp())],aP=n7([ij("qti-response-processing")],aP);var aO,aL,aU,aN,aD,aV=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,aL);t.identifier="";t.cardinality="single";t.baseType="string";t.mathVariable=!1;t.paramVariable=!1;re(t,aO,null);return t}d(e,[{key:"render",value:function t(){return iw(tf())}},{key:"connectedCallback",value:function t(){var t=this;p(f(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){rr(t,aL,aU).call(t),rr(t,aL,aD).call(t)})}},{key:"getTemplateVariable",value:function t(){return{identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,value:rt(this,aO),type:"template",mathVariable:this.mathVariable,paramVariable:this.paramVariable}}}]);return e}(i$);aO=new WeakMap,aL=new WeakSet,aU=function t(){var t;var e=this.querySelector("qti-default-value");if(!e)return;var n=((t=e.textContent)===null||t===void 0?void 0:t.trim())||"";rn(this,aO,rr(this,aL,aN).call(this,n))},aN=function t(t){if(!t)return null;switch(this.baseType){case"integer":return parseInt(t,10);case"float":case"duration":return parseFloat(t);case"boolean":return t.toLowerCase()==="true";default:return t}},aD=function t(){var t;var e=_(k({},{identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,defaultValue:rt(this,aO),value:rt(this,aO),type:"template",mathVariable:this.mathVariable,paramVariable:this.paramVariable}),{value:((t=rt(this,aO))===null||t===void 0?void 0:t.toString())||""});this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))},aV.styles=[rj(tv())],n7([n({type:String})],aV.prototype,"identifier",2),n7([n({type:String})],aV.prototype,"cardinality",2),n7([n({type:String,attribute:"base-type"})],aV.prototype,"baseType",2),n7([n({type:Boolean,attribute:"math-variable"})],aV.prototype,"mathVariable",2),n7([n({type:Boolean,attribute:"param-variable"})],aV.prototype,"paramVariable",2),aV=n7([ij("qti-template-declaration")],aV);var az=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.cardinality="record";return t}d(e,[{key:"render",value:function t(){return iw(tm())}}]);return e}(i$);az.styles=[rj(tg())],n7([n({type:String})],az.prototype,"identifier",2),n7([n({type:String})],az.prototype,"cardinality",2),az=n7([ij("qti-context-declaration")],az);var a$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(tb())}}]);return e}(ap);a$.styles=rj(ty()),a$=n7([ij("qti-test-feedback")],a$);var aB,aj,aW,aF,aQ,aH,aG,aX,aJ,aY,aK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,aj);t.identifier=void 0;t.initContext=[];t.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}};t.configContext={};t.autoScoreItems=!1;re(t,aB);t.addEventListener("qti-assessment-test-connected",rr(t,aj,aX).bind(t)),t.addEventListener("qti-assessment-item-connected",rr(t,aj,aY).bind(t)),t.addEventListener("qti-interaction-changed",rr(t,aj,aG).bind(t)),t.addEventListener("test-end-attempt",rr(t,aj,aW).bind(t)),t.addEventListener("test-show-correct-response",rr(t,aj,aF).bind(t)),t.addEventListener("test-show-candidate-correction",rr(t,aj,aQ).bind(t)),t.addEventListener("test-update-outcome-variable",rr(t,aj,aH).bind(t));return t}d(e,[{key:"render",value:function t(){return iw(tw())}},{key:"willUpdate",value:function t(t){var e=this;var n;if(!this.computedContext)return;var i=1;this.computedContext=_(k({},this.computedContext),{view:(n=this._sessionContext)===null||n===void 0?void 0:n.view,testParts:this.computedContext.testParts.map(function(t){var n;return _(k({},t),{active:((n=e._sessionContext)===null||n===void 0?void 0:n.navPartId)===t.identifier||!1,sections:t.sections.map(function(t){var n;return _(k({},t),{active:((n=e._sessionContext)===null||n===void 0?void 0:n.navSectionId)===t.identifier||!1,completed:t.items.every(function(t){var n;return((n=e._testContext.items.find(function(e){return e.identifier===t.identifier}))===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier==="completionStatus"}).value)==="completed"}),items:t.items.map(function(t){var n,o,a,s,l,u,c,d,h,p,f,v,m,g;var b=(n=e._testContext)===null||n===void 0?void 0:n.items.find(function(e){return e.identifier===t.identifier}),y=k({},t,b,(o=e.initContext)===null||o===void 0?void 0:o.find(function(e){return e.identifier===t.identifier})),w=(s=y.variables)===null||s===void 0?void 0:(a=s.find(function(t){return t.identifier=="SCORE"}))===null||a===void 0?void 0:a.value,q=w==null?null:parseFloat(w===null||w===void 0?void 0:w.toString()),x=(u=y.variables)===null||u===void 0?void 0:(l=u.find(function(t){return t.identifier==="completionStatus"}))===null||l===void 0?void 0:l.value,C=((d=y.variables)===null||d===void 0?void 0:(c=d.find(function(t){return t.identifier==="RESPONSE"}))===null||c===void 0?void 0:c.value)||"",E=((p=y.variables)===null||p===void 0?void 0:(h=p.find(function(t){return t.identifier==="numAttempts"}))===null||h===void 0?void 0:h.value)||0,S=((f=e._sessionContext)===null||f===void 0?void 0:f.navItemRefId)===y.identifier||!1,A=t.categories.includes((v=e.configContext)===null||v===void 0?void 0:v.infoItemCategory)?null:i++,R=(g=t.variables)===null||g===void 0?void 0:(m=g.find(function(t){return t.identifier=="MAXSCORE"}))===null||m===void 0?void 0:m.value,I=R==null?null:parseFloat(R===null||R===void 0?void 0:R.toString());return _(k({},y),{completionStatus:x,numAttempts:E,score:q,response:C,index:A,active:S,maxScore:I})})})})})})}),this.dispatchEvent(new CustomEvent("qti-computed-context-updated",{detail:this.computedContext,bubbles:!0}))}}]);return e}(i$);aB=new WeakMap,aj=new WeakSet,aW=function t(t){var e;var n=rt(this,aB).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem,i=((e=this.configContext)===null||e===void 0?void 0:e.reportValidityAfterScoring)===!0;n.processResponse(!0,i)},aF=function t(t){var e=rt(this,aB).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem;e&&e.showCorrectResponse(t.detail)},aQ=function t(t){rt(this,aB).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem.showCandidateCorrection(t.detail)},aH=function t(t){rt(this,aB).querySelector('qti-assessment-item-ref[identifier="'.concat(t.detail.assessmentItemRefId,'"]')).assessmentItem.setOutcomeVariable(t.detail.outcomeVariableId,t.detail.value)},aG=function t(t){if(this.autoScoreItems){var e=t.composedPath()[0].closest("qti-assessment-item"),n=e.variables.find(function(t){return t.identifier==="SCORE"});if(n&&n.externalScored===null&&e.adaptive==="false"){var i;var o=((i=this.configContext)===null||i===void 0?void 0:i.reportValidityAfterScoring)===!0;e.processResponse(!0,o)}}},aX=function t(t){var e=this;var n,i,o;if(rn(this,aB,t.detail),!((n=this.qtiContext.QTI_CONTEXT)===null||n===void 0?void 0:n.testIdentifier)){var a=this.qtiContext.QTI_CONTEXT||{testIdentifier:"",candidateIdentifier:"not set",environmentIdentifier:"default"};this.qtiContext={QTI_CONTEXT:_(k({},a),{testIdentifier:rt(this,aB).identifier,environmentIdentifier:a.environmentIdentifier||"default"})}}rt(this,aB).querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(function(t){var n=rr(e,aj,aJ).call(e,t);Object.keys(n).length>0&&(e.qtiContext={QTI_CONTEXT:k({},n,e.qtiContext.QTI_CONTEXT)})});var s=Array.from(((i=rt(this,aB))===null||i===void 0?void 0:i.querySelectorAll("qti-test-part"))||[]);this.computedContext={identifier:rt(this,aB).identifier,title:rt(this,aB).title,view:(o=this._sessionContext)===null||o===void 0?void 0:o.view,testParts:s.map(function(t){var n=L(t.querySelectorAll("qti-assessment-section"));return{active:!1,identifier:t.identifier,navigationMode:t.navigationMode,submissionMode:t.submissionMode,sections:n.map(function(t){var n=L(t.querySelectorAll("qti-assessment-item-ref"));return{active:!1,identifier:t.identifier,title:t.title,items:n.map(function(t){var n,i;return _(k({},(n=e.initContext)===null||n===void 0?void 0:n.find(function(e){return e.identifier===t.identifier})),{active:!1,identifier:t.identifier,categories:t.category?(i=t.category)===null||i===void 0?void 0:i.split(" "):[],href:t.href,variables:[]})})}})}})}},aJ=function t(t){var e={},n=t.querySelector("qti-default-value");return n&&n.querySelectorAll("qti-value[field-identifier]").forEach(function(t){var n;var i=t.getAttribute("field-identifier"),o=t.getAttribute("base-type")||"string",a=((n=t.textContent)===null||n===void 0?void 0:n.trim())||"";if(i){var s=a;switch(o){case"integer":s=parseInt(a,10);break;case"float":case"duration":s=parseFloat(a);break;case"boolean":s=a.toLowerCase()==="true";break;default:s=a;break}e[i]=s}}),e},aY=function t(t){var e=t.detail;this.computedContext=_(k({},this.computedContext),{testParts:this.computedContext.testParts.map(function(t){return _(k({},t),{sections:t.sections.map(function(t){return _(k({},t),{items:t.items.map(function(t){var n;if(t.identifier!==e.parentElement.getAttribute("identifier"))return t;var i=(n=e.querySelector("qti-outcome-declaration[identifier='SCORE']"))===null||n===void 0?void 0:n.getAttribute("externalScored"),o=e.querySelectorAll("qti-response-declaration"),a=Array.from(o).some(function(t){return t.querySelector("qti-correct-response")}),s=Array.from(o).some(function(t){var e=t.querySelector("qti-mapping"),n=t.querySelector("qti-area-mapping");return(e===null||e===void 0?void 0:e.querySelector("qti-map-entry"))||(n===null||n===void 0?void 0:n.querySelector("qti-area-map-entry"))}),l=a||s,u=!!e.querySelector("qti-response-processing");return _(k({},t),{assessmentItemIdentifier:e.getAttribute("identifier"),label:e.getAttribute("label"),title:e.title,externalScored:i,adaptive:e.adaptive=="true"||!1,timeDependent:e.timeDependent=="true"||!1,variables:e.variables,hasCorrectResponse:l,hasResponseProcessing:u})})})})})})})},n7([n({type:String})],aK.prototype,"identifier",2),n7([i()],aK.prototype,"initContext",2),n7([i(),T({context:i9})],aK.prototype,"qtiContext",2),n7([i(),T({context:i6})],aK.prototype,"configContext",2),n7([i(),P({context:or,subscribe:!0})],aK.prototype,"_testContext",2),n7([i(),P({context:oe,subscribe:!0})],aK.prototype,"_sessionContext",2),n7([i(),T({context:i4})],aK.prototype,"computedContext",2),n7([n({type:Boolean,attribute:"auto-score-items"})],aK.prototype,"autoScoreItems",2),aK=n7([ij("test-navigation")],aK);var aZ=rj(tq()),a0=rj(tk(),aZ),a1=rj(tx()),a2=rj(t_(),aZ);var a3,a5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._internalDisabled=!0;re(t,a3);rn(t,a3,t.attachInternals()),rt(t,a3).role="button",rt(t,a3).ariaLabel="Next item",t.addEventListener("click",function(e){e.preventDefault(),t._internalDisabled||t._requestItem(t.sectionItems[t.itemIndex+1].identifier)});return t}d(e,[{key:"_handleTestElementChange",value:function t(t,e){e&&(this._internalDisabled=!1)}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.checkDisabled()}},{key:"willUpdate",value:function t(t){var e;if(!this.computedContext)return;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.find(function(t){return t.active});n&&(this.sectionItems=n.sections.flatMap(function(t){return t.items}),this.itemIndex=this.sectionItems.findIndex(function(t){return t.active}),this.checkDisabled())}},{key:"checkDisabled",value:function t(){var t;this._internalDisabled=!this.computedContext||this.itemIndex<0||this.itemIndex>=((t=this.sectionItems)===null||t===void 0?void 0:t.length)-1}},{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return iw(tC())}}]);return e}(i$);a3=new WeakMap,a5.styles=rj(tE(),a0,a1),n7([n({type:Boolean,reflect:!0,attribute:"disabled"})],a5.prototype,"_internalDisabled",2),n7([P({context:i4,subscribe:!0})],a5.prototype,"computedContext",2),n7([V("computedContext")],a5.prototype,"_handleTestElementChange",1),a5=n7([ij("test-next")],a5);var a4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._internalDisabled=!0;t.addEventListener("click",function(e){e.preventDefault(),t._internalDisabled||t._requestItem(t.sectionItems[t.itemIndex-1].identifier)});return t}d(e,[{key:"_handleTestElementChange",value:function t(t,e){e&&(this._internalDisabled=!1)}},{key:"willUpdate",value:function t(t){var e;if(!this.computedContext)return;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.find(function(t){return t.active});n&&(this.sectionItems=n.sections.flatMap(function(t){return t.items}),this.itemIndex=this.sectionItems.findIndex(function(t){return t.active}),this.checkDisabled())}},{key:"checkDisabled",value:function t(){this._internalDisabled=!this.computedContext||this.itemIndex===0||this.itemIndex===-1}},{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return iw(tS())}}]);return e}(i$);a4.styles=rj(tA(),a0,a1),n7([n({type:Boolean,reflect:!0,attribute:"disabled"})],a4.prototype,"_internalDisabled",2),n7([P({context:i4,subscribe:!0})],a4.prototype,"computedContext",2),n7([V("computedContext")],a4.prototype,"_handleTestElementChange",1),a4=n7([ij("test-prev")],a4);var a6,a8,a7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,a6);t.label="view";t._handleViewOptionsChange=function(){rr(t,a6,a8).call(t)};t._viewOptions=a7.DEFAULT_VIEW_OPTIONS;return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),rr(this,a6,a8).call(this)}},{key:"_switchView",value:function t(t){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:t}))}},{key:"render",value:function t(){var t=this;return iw(tI(),this.label,function(e){var n=e.target;t._switchView(n.value)},this._viewOptions.map(function(e){return iw(tR(),e,e===t.sessionContext.view,e)}))}}]);return e}(i$);a6=new WeakSet,a8=function t(){if(this.viewOptions){var t=this.viewOptions.split(",").map(function(t){return t.trim()});this._viewOptions=t.filter(function(t){return a7.DEFAULT_VIEW_OPTIONS.includes(t)})}else this._viewOptions=a7.DEFAULT_VIEW_OPTIONS},a7.DEFAULT_VIEW_OPTIONS=["author","candidate","proctor","scorer","testConstructor","tutor"],n7([P({context:oe,subscribe:!0})],a7.prototype,"sessionContext",2),n7([n({type:String})],a7.prototype,"label",2),n7([n({type:String,attribute:"view-options"})],a7.prototype,"viewOptions",2),n7([V("viewOptions",{waitUntilFirstUpdate:!0})],a7.prototype,"_handleViewOptionsChange",2),n7([i()],a7.prototype,"_viewOptions",2),a7=n7([ij("test-view")],a7);var a9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t.itemId=null;t.addEventListener("click",function(){return t._requestItem(t.itemId)});return t}d(e,[{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return iw(tM())}}]);return e}(i$);a9.styles=rj(tT(),a0,a1),n7([n({type:String,attribute:"item-id"})],a9.prototype,"itemId",2),a9=n7([ij("test-item-link")],a9);var st=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.addEventListener("click",function(){return t.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0}))});return t}d(e,[{key:"render",value:function t(){return iw(tP())}}]);return e}(i$);st.styles=rj(tO(),a0,a1),st=n7([ij("test-end-attempt")],st);var se,sn,sr,si,so=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,sn);t.shown=!1;t.disabled=!1;t.showCorrectText="Show correct response";t.hideCorrectText="Hide correct response";t.noCorrectResponseText="No correct response specified";re(t,se);return t}d(e,[{key:"willUpdate",value:function t(t){var e;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(rt(this,se)!==n&&(this.shown=!1,rn(this,se,n)),n){var i,o;var a=!!(n===null||n===void 0?void 0:(i=n.variables)===null||i===void 0?void 0:i.some(function(t){return t.correctResponse})),s=!!(n===null||n===void 0?void 0:(o=n.variables)===null||o===void 0?void 0:o.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));this.disabled=!a&&!s}else this.disabled=!0}},{key:"render",value:function t(){return iw(tL(),rr(this,sn,sr),rr(this,sn,si).call(this))}}]);return e}(i$);se=new WeakMap,sn=new WeakSet,sr=function t(){this.disabled||(this.shown=!this.shown,this.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:this.shown,bubbles:!0})))},si=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText},so.styles=rj(tU(),a0,a1),n7([P({context:i4,subscribe:!0})],so.prototype,"computedContext",2),n7([n({type:Boolean,reflect:!0})],so.prototype,"shown",2),n7([n({type:Boolean,reflect:!0})],so.prototype,"disabled",2),n7([n({type:String})],so.prototype,"showCorrectText",2),n7([n({type:String})],so.prototype,"hideCorrectText",2),n7([n({type:String})],so.prototype,"noCorrectResponseText",2),so=n7([ij("test-show-correct-response")],so);var sa=["this"],ss=["+","-","!"],sl=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],su={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},sc=13;var sd=["==","!=","<=",">=","||","&&","??","|>"],sh=["===","!=="],sp;(function(t){t[t.STRING=1]="STRING",t[t.IDENTIFIER=2]="IDENTIFIER",t[t.DOT=3]="DOT",t[t.COMMA=4]="COMMA",t[t.COLON=5]="COLON",t[t.INTEGER=6]="INTEGER",t[t.DECIMAL=7]="DECIMAL",t[t.OPERATOR=8]="OPERATOR",t[t.GROUPER=9]="GROUPER",t[t.KEYWORD=10]="KEYWORD",t[t.ARROW=11]="ARROW"})(sp||(sp={}));var sf=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return{kind:t,value:e,precedence:n}},sv=function t(t){return t===9||t===10||t===13||t===32},sm=function t(t){return t===95||t===36||(t&=-33,65<=t&&t<=90)},sg=function t(t){return sm(t)||sw(t)},sb=function t(t){return sa.indexOf(t)!==-1},sy=function t(t){return t===34||t===39},sw=function t(t){return 48<=t&&t<=57},sq=function t(t){return t===43||t===45||t===42||t===47||t===33||t===38||t===37||t===60||t===61||t===62||t===63||t===94||t===124},sk=function t(t){return t===40||t===41||t===91||t===93||t===123||t===125},sx=function t(t){return t.replace(/\\(.)/g,function(t,e){switch(e){case"n":return"\n";case"r":return"\r";case"t":return" ";case"b":return"\b";case"f":return"\f";default:return e}})},s_,sC,sE,sS,sA,sR,sI,sM,sT,sP,sO,sL,sU,sN,sD,sV,sz,s$=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);re(this,sA);re(this,s_);re(this,sC,-1);re(this,sE,0);re(this,sS);rn(this,s_,e),rr(this,sA,sR).call(this)}d(t,[{key:"nextToken",value:function t(){for(;sv(rt(this,sS));)rr(this,sA,sR).call(this,!0);if(sy(rt(this,sS)))return rr(this,sA,sT).call(this);if(sm(rt(this,sS)))return rr(this,sA,sP).call(this);if(sw(rt(this,sS)))return rr(this,sA,sO).call(this);if(rt(this,sS)===46)return rr(this,sA,sL).call(this);if(rt(this,sS)===44)return rr(this,sA,sU).call(this);if(rt(this,sS)===58)return rr(this,sA,sN).call(this);if(sq(rt(this,sS)))return rr(this,sA,sV).call(this);if(sk(rt(this,sS)))return rr(this,sA,sz).call(this);if(rr(this,sA,sR).call(this),rt(this,sS)!==void 0)throw new Error("Expected end of input, got ".concat(rt(this,sS)))}}]);return t}();s_=new WeakMap,sC=new WeakMap,sE=new WeakMap,sS=new WeakMap,sA=new WeakSet,sR=function t(t){ri(this,sC)._++,rt(this,sC)<rt(this,s_).length?(rn(this,sS,rt(this,s_).charCodeAt(rt(this,sC))),t===!0&&rn(this,sE,rt(this,sC))):rn(this,sS,void 0)},sI=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;var e=rt(this,s_).substring(rt(this,sE),rt(this,sC)+t);return t===0&&rr(this,sA,sM).call(this),e},sM=function t(){rn(this,sE,rt(this,sC))},sT=function t(){var t="unterminated string",e=rt(this,sS);for(rr(this,sA,sR).call(this,!0);rt(this,sS)!==e;){if(rt(this,sS)===void 0)throw new Error(t);if(rt(this,sS)===92&&(rr(this,sA,sR).call(this),rt(this,sS)===void 0))throw new Error(t);rr(this,sA,sR).call(this)}var n=sf(sp.STRING,sx(rr(this,sA,sI).call(this)));return rr(this,sA,sR).call(this),n},sP=function t(){do rr(this,sA,sR).call(this);while(sg(rt(this,sS)));var t=rr(this,sA,sI).call(this),e=sb(t)?sp.KEYWORD:sp.IDENTIFIER;return sf(e,t)},sO=function t(){do rr(this,sA,sR).call(this);while(sw(rt(this,sS)));return rt(this,sS)===46?rr(this,sA,sL).call(this):sf(sp.INTEGER,rr(this,sA,sI).call(this))},sL=function t(){return rr(this,sA,sR).call(this),sw(rt(this,sS))?rr(this,sA,sD).call(this):(rr(this,sA,sM).call(this),sf(sp.DOT,".",sc))},sU=function t(){return rr(this,sA,sR).call(this,!0),sf(sp.COMMA,",")},sN=function t(){return rr(this,sA,sR).call(this,!0),sf(sp.COLON,":")},sD=function t(){do rr(this,sA,sR).call(this);while(sw(rt(this,sS)));return sf(sp.DECIMAL,rr(this,sA,sI).call(this))},sV=function t(){rr(this,sA,sR).call(this);var t=rr(this,sA,sI).call(this,2);if(sh.indexOf(t)!==-1)rr(this,sA,sR).call(this),rr(this,sA,sR).call(this);else{if(t=rr(this,sA,sI).call(this,1),t==="=>")return rr(this,sA,sR).call(this),sf(sp.ARROW,t);sd.indexOf(t)!==-1&&rr(this,sA,sR).call(this)}return t=rr(this,sA,sI).call(this),sf(sp.OPERATOR,t,su[t])},sz=function t(){var t=String.fromCharCode(rt(this,sS)),e=sf(sp.GROUPER,t,su[t]);return rr(this,sA,sR).call(this,!0),e};var sB=function t(t,e){return new lr(t,e).parse()},sj,sW,sF,sQ,sH,sG,sX,sJ,sY,sK,sZ,s0,s1,s2,s3,s5,s4,s6,s8,s7,s9,lt,le,ln,lr=/*#__PURE__*/function(){"use strict";function t(e,n){l(this,t);re(this,sG);re(this,sj);re(this,sW);re(this,sF);re(this,sQ);re(this,sH);rn(this,sW,new s$(e)),rn(this,sF,n)}d(t,[{key:"parse",value:function t(){return rr(this,sG,sX).call(this),rr(this,sG,sJ).call(this)}},{key:"_matches",value:function t(t,e){return!(t&&rt(this,sj)!==t||e&&rt(this,sH)!==e)}}]);return t}();sj=new WeakMap,sW=new WeakMap,sF=new WeakMap,sQ=new WeakMap,sH=new WeakMap,sG=new WeakSet,sX=function t(t,e){var n,i;if(!this._matches(t,e))throw new Error("Expected kind ".concat(t," (").concat(e,"), was ").concat((n=rt(this,sQ))===null||n===void 0?void 0:n.kind," (").concat((i=rt(this,sQ))===null||i===void 0?void 0:i.value,")"));var o=rt(this,sW).nextToken();rn(this,sQ,o),rn(this,sj,o===null||o===void 0?void 0:o.kind),rn(this,sH,o===null||o===void 0?void 0:o.value)},sJ=function t(){if(!rt(this,sQ))return rt(this,sF).empty();var t=rr(this,sG,s0).call(this);return t===void 0?void 0:rr(this,sG,sY).call(this,t,0)},sY=function t(t,e){if(t===void 0)throw new Error("Expected left to be defined.");for(;rt(this,sQ);)if(this._matches(sp.GROUPER,"(")){var n=rr(this,sG,s8).call(this);t=rt(this,sF).invoke(t,void 0,n)}else if(this._matches(sp.GROUPER,"[")){var i=rr(this,sG,s7).call(this);t=rt(this,sF).index(t,i)}else if(this._matches(sp.DOT)){rr(this,sG,sX).call(this);var o=rr(this,sG,s0).call(this);t=rr(this,sG,sK).call(this,t,o)}else{if(this._matches(sp.KEYWORD))break;if(this._matches(sp.OPERATOR)&&rt(this,sQ).precedence>=e)t=rt(this,sH)==="?"?rr(this,sG,s1).call(this,t):rr(this,sG,sZ).call(this,t,rt(this,sQ));else break}return t},sK=function t(t,e){if(e===void 0)throw new Error("expected identifier");if(e.type==="ID")return rt(this,sF).getter(t,e.value);if(e.type==="Invoke"&&e.receiver.type==="ID"){var n=e.receiver;return rt(this,sF).invoke(t,n.value,e.arguments)}else throw new Error("expected identifier: ".concat(e))},sZ=function t(t,e){if(sl.indexOf(e.value)===-1)throw new Error("unknown operator: ".concat(e.value));rr(this,sG,sX).call(this);var n=rr(this,sG,s0).call(this);for(;(rt(this,sj)===sp.OPERATOR||rt(this,sj)===sp.DOT||rt(this,sj)===sp.GROUPER)&&rt(this,sQ).precedence>e.precedence;)n=rr(this,sG,sY).call(this,n,rt(this,sQ).precedence);return rt(this,sF).binary(t,e.value,n)},s0=function t(){if(this._matches(sp.OPERATOR)){var t=rt(this,sH);if(rr(this,sG,sX).call(this),t==="+"||t==="-"){if(this._matches(sp.INTEGER))return rr(this,sG,le).call(this,t);if(this._matches(sp.DECIMAL))return rr(this,sG,ln).call(this,t)}if(ss.indexOf(t)===-1)throw new Error("unexpected token: ".concat(t));var e=rr(this,sG,sY).call(this,rr(this,sG,s2).call(this),sc);return rt(this,sF).unary(t,e)}return rr(this,sG,s2).call(this)},s1=function t(t){rr(this,sG,sX).call(this,sp.OPERATOR,"?");var e=rr(this,sG,sJ).call(this);rr(this,sG,sX).call(this,sp.COLON);var n=rr(this,sG,sJ).call(this);return rt(this,sF).ternary(t,e,n)},s2=function t(){switch(rt(this,sj)){case sp.KEYWORD:var t=rt(this,sH);if(t==="this")return rr(this,sG,sX).call(this),rt(this,sF).id(t);throw sa.indexOf(t)!==-1?new Error("unexpected keyword: ".concat(t)):new Error("unrecognized keyword: ".concat(t));case sp.IDENTIFIER:return rr(this,sG,s4).call(this);case sp.STRING:return rr(this,sG,lt).call(this);case sp.INTEGER:return rr(this,sG,le).call(this);case sp.DECIMAL:return rr(this,sG,ln).call(this);case sp.GROUPER:return rt(this,sH)==="("?rr(this,sG,s9).call(this):rt(this,sH)==="{"?rr(this,sG,s5).call(this):rt(this,sH)==="["?rr(this,sG,s3).call(this):void 0;case sp.COLON:throw new Error('unexpected token ":"');default:return}},s3=function t(){var t=[];do{if(rr(this,sG,sX).call(this),this._matches(sp.GROUPER,"]"))break;t.push(rr(this,sG,sJ).call(this))}while(this._matches(sp.COMMA));return rr(this,sG,sX).call(this,sp.GROUPER,"]"),rt(this,sF).list(t)},s5=function t(){var t={};do{if(rr(this,sG,sX).call(this),this._matches(sp.GROUPER,"}"))break;var e=rt(this,sH);(this._matches(sp.STRING)||this._matches(sp.IDENTIFIER))&&rr(this,sG,sX).call(this),rr(this,sG,sX).call(this,sp.COLON),t[e]=rr(this,sG,sJ).call(this)}while(this._matches(sp.COMMA));return rr(this,sG,sX).call(this,sp.GROUPER,"}"),rt(this,sF).map(t)},s4=function t(){var t=rt(this,sH);if(t==="true")return rr(this,sG,sX).call(this),rt(this,sF).literal(!0);if(t==="false")return rr(this,sG,sX).call(this),rt(this,sF).literal(!1);if(t==="null")return rr(this,sG,sX).call(this),rt(this,sF).literal(null);if(t==="undefined")return rr(this,sG,sX).call(this),rt(this,sF).literal(void 0);var e=rr(this,sG,s6).call(this),n=rr(this,sG,s8).call(this);return n?rt(this,sF).invoke(e,void 0,n):e},s6=function t(){if(!this._matches(sp.IDENTIFIER))throw new Error("expected identifier: ".concat(rt(this,sH)));var t=rt(this,sH);return rr(this,sG,sX).call(this),rt(this,sF).id(t)},s8=function t(){if(!this._matches(sp.GROUPER,"("))return;var t=[];do{if(rr(this,sG,sX).call(this),this._matches(sp.GROUPER,")"))break;var e=rr(this,sG,sJ).call(this);t.push(e)}while(this._matches(sp.COMMA));return rr(this,sG,sX).call(this,sp.GROUPER,")"),t},s7=function t(){rr(this,sG,sX).call(this);var t=rr(this,sG,sJ).call(this);return rr(this,sG,sX).call(this,sp.GROUPER,"]"),t},s9=function t(){var t=rr(this,sG,s8).call(this);if(this._matches(sp.ARROW)){var e;rr(this,sG,sX).call(this);var n=rr(this,sG,sJ).call(this),i=(e=t===null||t===void 0?void 0:t.map(function(t){return t.value}))!==null&&e!==void 0?e:[];return rt(this,sF).arrowFunction(i,n)}else return rt(this,sF).paren(t[0])},lt=function t(){var t=rt(this,sF).literal(rt(this,sH));return rr(this,sG,sX).call(this),t},le=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var e=rt(this,sF).literal(parseInt("".concat(t).concat(rt(this,sH)),10));return rr(this,sG,sX).call(this),e},ln=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var e=rt(this,sF).literal(parseFloat("".concat(t).concat(rt(this,sH))));return rr(this,sG,sX).call(this),e};var li=Object.hasOwn,lo=Object.fromEntries,la={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"??":function(t,e){return t!==null&&t!==void 0?t:e},"|":function(t,e){return e(t)},"|>":function(t,e){return e(t)}},ls={"+":function(t){return t},"-":function(t){return-t},"!":function(t){return!t}},ll=/*#__PURE__*/function(){"use strict";function t(){l(this,t)}d(t,[{key:"empty",value:function t(){return{type:"Empty",evaluate:function t(t){return t},getIds:function t(t){return t}}}},{key:"literal",value:function t(t){return{type:"Literal",value:t,evaluate:function t(t){return this.value},getIds:function t(t){return t}}}},{key:"id",value:function t(t){return{type:"ID",value:t,evaluate:function t(t){return this.value==="this"?t:t===null||t===void 0?void 0:t[this.value]},getIds:function t(t){return t.push(this.value),t}}}},{key:"unary",value:function t(t,e){var n=ls[t];return{type:"Unary",operator:t,child:e,evaluate:function t(t){return n(this.child.evaluate(t))},getIds:function t(t){return this.child.getIds(t)}}}},{key:"binary",value:function t(t,e,n){var i=la[e];return{type:"Binary",operator:e,left:t,right:n,evaluate:function t(t){if(this.operator==="="){if(this.left.type!=="ID"&&this.left.type!=="Getter"&&this.left.type!=="Index")throw new Error("Invalid assignment target: ".concat(this.left));var e=this.right.evaluate(t),n,o;return this.left.type==="Getter"?(n=this.left.receiver.evaluate(t),o=this.left.name):this.left.type==="Index"?(n=this.left.receiver.evaluate(t),o=this.left.argument.evaluate(t)):this.left.type==="ID"&&(n=t,o=this.left.value),n===void 0?void 0:n[o]=e}return i(this.left.evaluate(t),this.right.evaluate(t))},getIds:function t(t){return this.left.getIds(t),this.right.getIds(t),t}}}},{key:"getter",value:function t(t,e){return{type:"Getter",receiver:t,name:e,evaluate:function t(t){var e;return(e=this.receiver.evaluate(t))===null||e===void 0?void 0:e[this.name]},getIds:function t(t){return this.receiver.getIds(t),t}}}},{key:"invoke",value:function t(t,e,n){if(e!=null&&typeof e!="string")throw new Error("method not a string");return{type:"Invoke",receiver:t,method:e,arguments:n,evaluate:function t(t){var n,i;var o;var a=this.receiver.evaluate(t),s=this.method?a:(n=t===null||t===void 0?void 0:t.this)!==null&&n!==void 0?n:t,l=this.method?a===null||a===void 0?void 0:a[e]:a,u=((i=this.arguments)!==null&&i!==void 0?i:[]).map(function(e){return e===null||e===void 0?void 0:e.evaluate(t)});return l===null||l===void 0?void 0:(o=l.apply)===null||o===void 0?void 0:o.call(l,s,u)},getIds:function t(t){var e;return this.receiver.getIds(t),(e=this.arguments)===null||e===void 0?void 0:e.forEach(function(e){return e===null||e===void 0?void 0:e.getIds(t)}),t}}}},{key:"paren",value:function t(t){return t}},{key:"index",value:function t(t,e){return{type:"Index",receiver:t,argument:e,evaluate:function t(t){var e;return(e=this.receiver.evaluate(t))===null||e===void 0?void 0:e[this.argument.evaluate(t)]},getIds:function t(t){return this.receiver.getIds(t),t}}}},{key:"ternary",value:function t(t,e,n){return{type:"Ternary",condition:t,trueExpr:e,falseExpr:n,evaluate:function t(t){return this.condition.evaluate(t)?this.trueExpr.evaluate(t):this.falseExpr.evaluate(t)},getIds:function t(t){return this.condition.getIds(t),this.trueExpr.getIds(t),this.falseExpr.getIds(t),t}}}},{key:"map",value:function t(t){return{type:"Map",entries:t,evaluate:function e(e){var n={};if(t&&this.entries)for(var i in t){var o=this.entries[i];o&&(n[i]=o.evaluate(e))}return n},getIds:function e(e){if(t&&this.entries)for(var n in t){var i=this.entries[n];i&&i.getIds(e)}return e}}}},{key:"list",value:function t(t){return{type:"List",items:t,evaluate:function t(t){var e;return(e=this.items)===null||e===void 0?void 0:e.map(function(e){return e===null||e===void 0?void 0:e.evaluate(t)})},getIds:function t(t){var e;return(e=this.items)===null||e===void 0?void 0:e.forEach(function(e){return e===null||e===void 0?void 0:e.getIds(t)}),t}}}},{key:"arrowFunction",value:function t(t,e){return{type:"ArrowFunction",params:t,body:e,evaluate:function t(t){var e=this.params,n=this.body;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}var s=lo(e.map(function(t,e){return[t,o[e]]})),l=new Proxy(t!==null&&t!==void 0?t:{},{set:function t(t,e,n){return li(s,e)&&(s[e]=n),t[e]=n},get:function t(t,e){return li(s,e)?s[e]:t[e]}});return n.evaluate(l)}},getIds:function t(t){var e=this;return this.body.getIds(t).filter(function(t){return!e.params.includes(t)})}}}}]);return t}();var lu=null,lc={boundAttributeSuffix:iN.M,marker:iN.P,markerMatch:iN.A,HTML_RESULT:iN.C,getTemplateHtml:iN.L,overrideDirectiveResolve:function t(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){l(this,n);return s(this,n,arguments)}d(n,[{key:"_$AS",value:function t(t,n){return e(this,n)}}]);return n}(t);return n},patchDirectiveResolve:function t(t,e){if(t.prototype._$AS.name!==e.name){lu!==null&&lu!==void 0?lu:lu=t.prototype._$AS.name;for(var n=t.prototype;n!==Object.prototype;n=Object.getPrototypeOf(n))if(n.hasOwnProperty(lu))return void(n[lu]=e);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass:function t(t,e){t._$litDirective$=e},getAttributePartCommittedValue:function t(t,e,n){var i=ix;return t.j=function(t){return i=t},t._$AI(e,t,n),i},connectedDisconnectable:function t(t){return _(k({},t),{_$AU:!0})},resolveDirective:iN.V,AttributePart:iN.H,PropertyPart:iN.B,BooleanAttributePart:iN.N,EventPart:iN.U,ElementPart:iN.F,TemplateInstance:iN.R,isIterable:iN.D,ChildPart:iN.I};var ld=lc.AttributePart,lh=lc.PropertyPart,lp=lc.BooleanAttributePart,lf=lc.EventPart,lv=new ll,lm=new Map,lg=function t(t){return t.replace(/-(-|\w)/g,function(t,e){return e.toUpperCase()})},lb=function t(t,e){var n=lm.get(t);if(n===void 0){if(lm.has(t))return;if(t=t.trim(),t.startsWith("{{")&&t.endsWith("}}")){var i=t.substring(2,t.length-2).trim();n=new lr(i,lv).parse(),lm.set(t,n)}}return n===null||n===void 0?void 0:n.evaluate(e)},ly=function t(t,e,n,i){var o=t.getAttribute("if");if(o!==null&&lb(o,e))return lE(t,e,n,i)},lw=RegExp("(?<!\\\\){{(.*?)(?:(?<!\\\\)}})","g"),lq=function t(t){return/(?:\\{{)|(?:\\}})/g.test(t)},lk=function t(t){return t.replaceAll(/\\{{/g,"{{").replace(/\\}}/g,"}}")},lx=function t(t,e,n,i){var o=t.getAttribute("repeat");if(o!==null){var a=lb(o,e);if(!a[Symbol.iterator])return i_;var s=lA(t),l=-1,u=[];var c=true,d=false,h=undefined;try{for(var p=a[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;var m;l++;var g=Object.create(e);g.item=v,g.index=l,g.this=(m=e.this)!==null&&m!==void 0?m:e;var b=[];var y=true,w=false,q=undefined;try{for(var k=s.parts[Symbol.iterator](),x;!(y=(x=k.next()).done);y=true){var _=x.value;var C;var E=_.update(g,n,i);_.type===1?(C=b).push.apply(C,L(E)):b.push(E)}}catch(t){w=true;q=t}finally{try{if(!y&&k.return!=null){k.return()}}finally{if(w){throw q}}}var S={_$litType$:s,values:b};u.push(S)}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}return u}},l_={if:ly,repeat:lx},lC=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l_,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;var o=lA(t).renderers;if(i){var a=lA(i).renderers,s=o.super;s!==void 0?n=_(k({},o,n),{super:function t(t,e,n){return n=_(k({},a,n),{super:function t(t,e,n){return lE(i,t,e,n)}}),s(t,e,n)}}):(n=k({},a,o,n),t=i)}else n=k({},o,n);return function(i){return lE(t,i,e,n)}};var lE=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l_,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};var o=lA(t),a=[];var s=true,l=false,u=undefined;try{for(var c=o.parts[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;var p;var f=h.update(e,n,i);h.type===1?(p=a).push.apply(p,L(f)):a.push(f)}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}return{_$litType$:o,values:a}},lS=new Map,lA=function t(t){var e=lS.get(t);return e===void 0&&lS.set(t,e=lR(t)),e},lR=function t(t){var e=function(){if(o.nodeType===Node.COMMENT_NODE)a++;else if(o.nodeType===Node.ELEMENT_NODE){a++;var t=o;if(t.tagName==="TEMPLATE"){var e=t.getAttribute("type"),l=t.getAttribute("name"),u=t.getAttribute("call");if(u!==null||e!==null||l!==null){t.parentNode.insertBefore(document.createComment(""),t),s.push(t);var c=void 0;if(u!==null){var d=u.trim(),h=d.startsWith("{{")&&d.endsWith("}}");c=function e(e,n,i){var o;var a=t.getAttribute("data"),s=a===null?void 0:lb(a,e);return(o=h?lb(d,e):i[u])===null||o===void 0?void 0:o(s,n,i)}}else e!==null?c=function n(n,i,o){var a=i[e];return a===null||a===void 0?void 0:a(t,n,i,o)}:(l==="super"?n.renderers.super=function(e,n,i){var o=i.super,a=lA(t);return i=k({},i,a.renderers),o(e,n,i)}:n.renderers[l]=function(e,n,i){return lE(t,e,n,i)},c=function t(t,e,n){var i=n[l];return i===null||i===void 0?void 0:i(t,e,n)});n.parts.push({type:2,index:a,update:c});return"continue"}}var p=t.getAttributeNames();var f=true,v=false,m=undefined;try{var g=function(){var e=y.value;var i=t.getAttribute(e),o=i.split(lw);if(o.length===1){lq(i)&&t.setAttribute(e,lk(i));return"continue"}t.removeAttribute(e);var s=e,l=ld,u=e[0];u==="."?(s=lg(e.substring(1)),l=lh):u==="?"?(s=e.substring(1),l=lp):u==="@"&&(s=lg(e.substring(1)),l=lf);var c=[lk(o[0])],d=[];for(var h=1;h<o.length;h+=2){var p=o[h];d.push(sB(p,lv)),c.push(lk(o[h+1]))}n.parts.push({type:1,index:a,name:s,strings:c,ctor:l,update:function t(t,e,n){return d.map(function(e){return e.evaluate(t)})}})};for(var b=p[Symbol.iterator](),y;!(f=(y=b.next()).done);f=true)g()}catch(t){v=true;m=t}finally{try{if(!f&&b.return!=null){b.return()}}finally{if(v){throw m}}}}else if(o.nodeType===Node.TEXT_NODE){var w=function(t){var e=_[t],o=sB(e,lv);n.parts.push({type:2,index:++a,update:function t(t,e){return o.evaluate(t)}});var s=new Text(_[t+1].replace("\\{{","{{"));q.parentNode.insertBefore(s,q.nextSibling),q.parentNode.insertBefore(document.createComment(""),q.nextSibling),q=s,i.currentNode=s};var q=o,x=q.textContent,_=x.split(lw);_.length>1?q.textContent=lk(_[0]):lq(x)&&(q.textContent=lk(x));for(var C=1;C<_.length;C+=2)w(C)}};var n={h:void 0,el:t.cloneNode(!0),parts:[],renderers:{}},i=document.createTreeWalker(n.el.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),o=i.currentNode,a=-1,s=[];for(;(o=i.nextNode())!==null;)e();var l=true,u=false,c=undefined;try{for(var d=s[Symbol.iterator](),h;!(l=(h=d.next()).done);l=true){var p=h.value;p.remove()}}catch(t){u=true;c=t}finally{try{if(!l&&d.return!=null){d.return()}}finally{if(u){throw c}}}return n};var lI,lM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,lI);rn(t,lI,t.attachInternals()),rt(t,lI).ariaLabel="pagination";return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");this.myTemplate=lC(t)}},{key:"render",value:function t(){var t=this;if(!this.computedContext)return iw(tN());var e=this.computedContext.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})});return iw(tD(),e.map(function(e){return t.myTemplate({item:e,view:t.computedContext.view})}))}}]);return e}(i$);lI=new WeakMap,n7([P({context:i4,subscribe:!0})],lM.prototype,"computedContext",2),lM=n7([ij("test-paging-buttons-stamp")],lM);var lT=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.G=e}d(t,[{key:"disconnect",value:function t(){this.G=void 0}},{key:"reconnect",value:function t(t){this.G=t}},{key:"deref",value:function t(){return this.G}}]);return t}(),lP=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.Y=void 0,this.Z=void 0}d(t,[{key:"get",value:function t(){return this.Y}},{key:"pause",value:function t(){var t=this;var e;(e=this.Y)!==null&&e!==void 0?e:this.Y=new Promise(function(e){return t.Z=e})}},{key:"resume",value:function t(){var t,e;(t=(e=this).Z)===null||t===void 0?void 0:t.call(e),this.Y=this.Z=void 0}}]);return t}();var lO=function t(t){return!ol(t)&&typeof t.then=="function"},lL=0x3fffffff,lU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t._$Cwt=lL,t._$Cbt=[],t._$CK=new lT(t),t._$CX=new lP;return t}d(e,[{key:"render",value:function t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var i;return(i=e.find(function(t){return!lO(t)}))!==null&&i!==void 0?i:ix}},{key:"update",value:function t(t,e){var n,i=function(t){var i=e[t];if(!lO(i))return{v:(n._$Cwt=t,i)};t<s&&i===o[t]||(n._$Cwt=lL,s=0,Promise.resolve(i).then(function(t){return a(function(){var e,n;return z(this,function(o){switch(o.label){case 0:if(!u.get())return[3,3];return[4,u.get()];case 1:o.sent();o.label=2;case 2:return[3,0];case 3:e=l.deref();if(e!==void 0){n=e._$Cbt.indexOf(i);n>-1&&n<e._$Cwt&&(e._$Cwt=n,e.setValue(t))}return[2]}})})()}))};var o=this._$Cbt,s=o.length;this._$Cbt=e;var l=this._$CK,u=this._$CX;this.isConnected||this.disconnected();for(var c=0;c<e.length&&!(c>this._$Cwt);c++){var d=(n=this,i(c));if(U(d)==="object")return d.v}return ix}},{key:"disconnected",value:function t(){this._$CK.disconnect(),this._$CX.pause()}},{key:"reconnected",value:function t(){this._$CK.reconnect(this),this._$CX.resume()}}]);return e}(oq),lN=oo(lU);var lD="@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;\n\n/* https://www.imsglobal.org/sites/default/files/spec/qti/v3/guide/img/qti3p0.css */\n\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n\n@layer qti-base {\n .qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n }\n\n .qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n }\n\n .qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there’s padding or borders */\n }\n\n .qti-layout-col1 {\n width: 6.3829787234%;\n }\n\n .qti-layout-col2 {\n width: 14.8936170213%;\n }\n\n .qti-layout-col3 {\n width: 23.4042553191%;\n }\n\n .qti-layout-col4 {\n width: 31.914893617%;\n }\n\n .qti-layout-col5 {\n width: 40.4255319149%;\n }\n\n .qti-layout-col6 {\n width: 48.9361702128%;\n }\n\n .qti-layout-col7 {\n width: 57.4468085106%;\n }\n\n .qti-layout-col8 {\n width: 65.9574468085%;\n }\n\n .qti-layout-col9 {\n width: 74.4680851064%;\n }\n\n .qti-layout-col10 {\n width: 82.9787234043%;\n }\n\n .qti-layout-col11 {\n width: 91.4893617021%;\n }\n\n .qti-layout-col12 {\n width: 100%;\n }\n\n .qti-layout-offset1 {\n margin-left: 8.5106382979%;\n }\n\n .qti-layout-offset2 {\n margin-left: 17.0212765957%;\n }\n\n .qti-layout-offset3 {\n margin-left: 25.5319148936%;\n }\n\n .qti-layout-offset4 {\n margin-left: 34.0425531915%;\n }\n\n .qti-layout-offset5 {\n margin-left: 42.5531914894%;\n }\n\n .qti-layout-offset6 {\n margin-left: 51.0638297872%;\n }\n\n .qti-layout-offset7 {\n margin-left: 59.5744680851%;\n }\n\n .qti-layout-offset8 {\n margin-left: 68.085106383%;\n }\n\n .qti-layout-offset9 {\n margin-left: 76.5957446809%;\n }\n\n .qti-layout-offset10 {\n margin-left: 85.1063829787%;\n }\n\n .qti-layout-offset11 {\n margin-left: 93.6170212766%;\n }\n\n .qti-layout-offset12 {\n margin-left: 102.1276595745%;\n }\n\n @media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n }\n}\n\n:root,\n:host {\n /* Active colors */\n --qti-bg-active: #ffecec;\n --qti-border-active: #f86d70;\n\n /* Correct colors */\n --qti-correct-light: #c8e6c9;\n --qti-correct: #66bb6a;\n\n /** Partially correct colors */\n --qti-partially-correct-light: #fff3e0;\n --qti-partially-correct: #ffeb3b;\n\n /* Incorrect colors */\n --qti-incorrect-light: #ef9a9a;\n --qti-incorrect: #ef5350;\n\n /* Validation colors */\n --qti-validation-error-bg: #fffbeb;\n --qti-validation-text: #92400e;\n\n /* Gap size */\n --qti-gap-size: 1rem;\n\n /* Background colors */\n --qti-bg: white;\n --qti-hover-bg: #f9fafb;\n\n /* Light theme colors */\n --qti-light-bg-active: #f0f0f0; /* Light gray */\n --qti-light-border-active: #d0d0d0; /* Medium gray */\n\n /* Dark theme colors */\n --qti-dark-bg-active: #1f2937; /* Dark gray */\n --qti-dark-border-active: #64748b; /* Medium gray */\n\n /* Disabled colors */\n --qti-disabled-bg: #f3f4f6;\n --qti-disabled-color: #45484f;\n\n /* Border properties */\n --qti-border-thickness: 2px;\n --qti-border-style: solid;\n --qti-border-color: #c6cad0;\n --qti-border-radius: 0.3rem;\n --qti-drop-border-radius: calc(var(--qti-border-radius) + var(--qti-border-thickness));\n\n /* Focus & active states */\n --qti-focus-border-width: 5px;\n --qti-focus-color: #bddcff7e;\n\n /* Class-specific variables */\n\n /* Form elements */\n --qti-form-size: 1rem;\n\n /* Order buttons */\n --qti-order-size: 2rem;\n\n /* Generic padding for all elements */\n --qti-padding-vertical: 0.5rem; /* py-2 */\n --qti-padding-horizontal: 0.5rem; /* px-2 */\n\n /* Dropzones */\n --qti-dropzone-padding: 0rem;\n}\n\n/* SVG masks and backgrounds */\n\n.chevron {\n background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n.handle {\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n background-repeat: repeat-y;\n background-position: left center;\n background-size: 14px 8px;\n}\n\n.check-mask {\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/*\n Following are classes that can be applied to elements and element states, so they are not used directly\n The @apply directive is used to apply these classes to elements\n*/\n\n/* Apply .bordered to an element */\n\n.bordered {\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .form rules for checkbox and radiobutton */\n\n.form {\n\n /* background-color: var(--qti-bg); */\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .button rules for button-like elements, such as drags and buttons */\n\n.button {\n\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .select for the select dropdown element */\n\n.select {\n\n border-radius: var(--qti-border-radius);\n position: relative;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n padding-right: calc(var(--qti-padding-horizontal) + 1.5rem); /* 1.5rem for the chevron */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n/* Apply .dropdown-trigger for button trigger controls */\n\n.dropdown-trigger {\n\n display: inline-flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .dropdown-menu for popover and listbox containers */\n\n.dropdown-menu {\n background: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: 0.25rem;\n box-sizing: border-box;\n overflow: auto;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .dropdown-option for listbox option rows */\n\n.dropdown-option {\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 2.25rem;\n box-sizing: border-box;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: 0;\n border-radius: calc(var(--qti-border-radius) - 2px);\n background: transparent;\n text-align: left;\n font: inherit;\n color: inherit;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* Apply .dropdown-icon for trigger caret indicators */\n\n.dropdown-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n transition: transform 150ms ease;\n transform-origin: 50% 50%;\n color: var(--qti-border-color);\n line-height: 1;\n}\n\n/* Apply .dropdown-icon-open for expanded trigger caret indicators */\n\n.dropdown-icon-open {\n transform: rotate(180deg);\n color: var(--qti-border-active);\n}\n\n/* Apply .text for the input text and textarea */\n\n.text {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .spot for hotspot shapes */\n\n.spot {\n\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n box-sizing: border-box !important;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .point for circular small hotspots */\n\n.point {\n\n box-sizing: border-box;\n border-radius: 100%;\n border: 1px solid white;\n background-color: black;\n opacity: 0.5;\n padding: 0;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .drag for draggable elements */\n\n.drag {\n\n box-sizing: border-box;\n transition:\n transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n\n /* padding-left: calc(var(--qti-padding-horizontal) + 0.5rem) !important; */\n\n /* 1.5rem for the drag */\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n}\n\n/* Apply .dragging for the dragging state of a draggable element */\n\n.dragging {\n pointer-events: none;\n rotate: -2deg;\n box-shadow:\n 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n}\n\n/* Apply .drop for an element where you can drop the draggable */\n\n.drop {\n /* @apply bordered; */\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n}\n\n/* Apply .dropping for an indicator where you can drop the draggable */\n\n.dropping {\n background-color: var(--qti-bg-active);\n}\n\n/* Apply .order for a small circular button */\n\n.order {\n\n display: grid;\n place-content: center;\n\n /* background-color: var(--qti-bg-active); */\n box-sizing: border-box;\n border-radius: 100%;\n width: var(--qti-order-size);\n height: var(--qti-order-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-size for radio and checkbox size */\n\n.check-size {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n}\n\n/* Apply .check for checkbox */\n\n.check {\n gap: 0.5rem;\n background-color: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n outline: none;\n cursor: pointer;\n}\n\n.validation-message {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n}\n\n/* Apply .check-radio for outer circle of the radio buttons */\n\n.check-radio {\n\n border-radius: 100%;\n\n display: grid;\n\n place-content: center;\n\n width: var(--qti-form-size);\n\n height: var(--qti-form-size);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n}\n\n/* Apply .check-radio-checked for the inner checked radio */\n\n.check-radio-checked {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n}\n\n/* Apply .check-checkbox for outer square of the checkbox */\n\n.check-checkbox {\n\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-checkbox-checked for the inner checkmark */\n\n.check-checkbox-checked {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/* Apply .hov for hover state */\n\n.hov {\n /* background-color: var(--qti-hover-bg); */\n}\n\n/* Apply .foc for focus state */\n\n.foc {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n}\n\n/* Apply .act for active state */\n\n.act {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n}\n\n.act-bg {\n background-color: var(--qti-bg-active);\n}\n\n.act-bor {\n border-color: var(--qti-border-active);\n}\n\n/* Apply .rdo for readonly state */\n\n.rdo {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n}\n\n/* Apply .dis for disabled state */\n\n.dis {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n}\n\n@layer qti-components {\n qti-choice-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n\n &.qti-input-control-hidden {\n & qti-simple-choice {\n position: relative; /* Add position relative here instead of a separate rule */\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n /* Add styling for correct responses with border instead of checkmark */\n &:state(correct-response),\n &[data-correct-response='true'] {\n border: 3px solid var(--qti-correct) !important;\n padding-right: 30px;\n\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n position: absolute;\n top: 5px;\n right: 5px;\n font-size: 1.2em;\n font-weight: bold;\n }\n }\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n }\n\n &:not(.qti-input-control-hidden) {\n & qti-simple-choice {\n\n &:not([aria-disabled='true'], [aria-readonly='true'], :state(--checked)):hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n\n gap: 0.5rem;\n\n background-color: var(--qti-bg);\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n outline: none;\n\n cursor: pointer\n }\n }\n\n & qti-simple-choice {\n width: -moz-fit-content;\n width: fit-content;\n cursor: pointer;\n\n /* Keep the checkmark for non-hidden input controls */\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n }\n }\n }\n\n & qti-simple-choice > p {\n margin: 0 !important;\n padding: 0 !important;\n }\n }\n\n .hover-border {\n border: 2px solid #000; /* Adjust the border style and color as needed */\n }\n\n qti-graphic-gap-match-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n\n position: relative;\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-gap-img,\n qti-gap-text {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: grab;\n }\n\n & qti-associable-hotspot {\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid transparent;\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &[active] {\n\n /* Light theme override */\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n\n &[disabled] {\n\n &:not(:empty) {\n cursor: default !important;\n }\n\n cursor: not-allowed;\n\n background-color: var(--qti-disabled-bg);\n\n color: var(--qti-disabled-color);\n\n border-color: var(--qti-border-color);\n\n outline: 4px solid var(--qti-disabled-bg)\n }\n\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */\n content: '\\0000a0'; /* when empty, put a space in it */\n }\n\n &:not(:empty) {\n padding: 0;\n width: auto;\n }\n\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0); /* rotate-0 */\n box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */\n }\n }\n\n & img {\n margin: 0;\n padding: 0;\n }\n }\n\n qti-text-entry-interaction {\n &:state(candidate-correct) {\n &::part(input) {\n background-color: var(--qti-correct);\n }\n }\n\n &:state(candidate-partially-correct) {\n &::part(input) {\n background-color: var(--qti-partially-correct);\n }\n }\n\n &:state(candidate-incorrect) {\n &::part(input) {\n background-color: var(--qti-incorrect);\n }\n }\n\n &::part(input) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:hover {\n }\n\n &:focus-within {\n &::part(input) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n\n qti-extended-text-interaction {\n &::part(textarea) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:hover {\n }\n\n &:focus-within {\n &::part(textarea) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n\n qti-gap-match-interaction {\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-gap-text {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n & qti-gap {\n\n &[disabled] {\n\n &:not(:empty) {\n cursor: default !important;\n }\n\n cursor: not-allowed;\n\n background-color: var(--qti-disabled-bg);\n\n color: var(--qti-disabled-color);\n\n border-color: var(--qti-border-color);\n\n outline: 4px solid var(--qti-disabled-bg)\n }\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light {\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &[active] {\n\n /* Light theme override */\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n\n display: inline-flex;\n align-items: center;\n\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */\n content: '\\0000a0'; /* when empty, put a space in it */\n }\n\n &:not(:empty) {\n display: inline-flex;\n padding: 0;\n width: auto;\n }\n\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0); /* rotate-0 */\n box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */\n }\n\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n\n border-radius: var(--qti-border-radius);\n\n position: relative;\n\n background-color: var(--qti-bg)\n }\n }\n\n qti-hotspot-interaction {\n & qti-hotspot-choice {\n &[shape='circle'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n\n &:state(--readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &:state(--disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='rect'] {\n\n /* &:hover {\n @apply hov;\n } */\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='poly'] {\n &:hover::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n var(--qti-border-active),\n var(--qti-border-active) 5px,\n transparent 5px,\n transparent 10px\n );\n display: block;\n }\n\n &:state(--checked)::after,\n &[aria-checked='true']::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 5px,\n var(--qti-border-active) 5px,\n var(--qti-border-active) 10px\n );\n display: block;\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n\n qti-hottext-interaction {\n /* &:not(.qti-input-control-hidden),\n &:not(.qti-unselected-hidden) { */\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n\n qti-hottext {\n display: inline-flex;\n align-items: center;\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: #16a34a; /* text-green-600 */\n }\n }\n\n gap: 0.5rem;\n\n background-color: var(--qti-bg);\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n outline: none;\n\n cursor: pointer\n }\n\n &.qti-input-control-hidden {\n qti-hottext {\n /* --qti-padding-md: 0.1rem;\n --qti-padding-lg: 0.2rem;\n --qti-border-radius-md: 0.3rem;\n --qti-border-thickness: 1px;\n --qti-font-weight-semibold: 400; */\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n /* @layer qti-variants { */\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n background: var(--qti-bg);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n /* } */\n }\n\n &.qti-unselected-hidden {\n qti-hottext {\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n cursor: pointer;\n\n &::part(ch) {\n display: none;\n }\n\n &:state(--checked) {\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n\n qti-inline-choice-interaction {\n &:state(candidate-correct) {\n &::part(trigger) {\n background-color: var(--qti-correct);\n }\n }\n\n &:state(candidate-incorrect) {\n &::part(trigger) {\n background-color: var(--qti-incorrect);\n }\n }\n\n &::part(trigger) {\n\n font-size: inherit;\n vertical-align: baseline;\n min-width: var(--qti-calculated-min-width, auto);\n\n &:focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n display: inline-flex;\n\n align-items: center;\n\n justify-content: space-between;\n\n gap: 0.5rem;\n\n border-radius: var(--qti-border-radius);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n background: var(--qti-bg);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &:not(:state(readonly)):not([readonly])::part(trigger):hover {\n }\n\n &:state(disabled)::part(trigger),\n &[disabled]::part(trigger) {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &:state(readonly)::part(trigger),\n &[readonly]::part(trigger) {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &::part(dropdown-icon) {\n\n font-size: 1.75em;\n\n display: inline-flex;\n\n align-items: center;\n\n justify-content: center;\n\n flex: 0 0 auto;\n\n transition: transform 150ms ease;\n\n transform-origin: 50% 50%;\n\n color: var(--qti-border-color);\n\n line-height: 1;\n }\n\n &::part(dropdown-icon-open) {\n transform: rotate(180deg);\n color: var(--qti-border-active);\n }\n\n &::part(menu) {\n background: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: 0.25rem;\n box-sizing: border-box;\n overflow: auto;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n\n &::part(option) {\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 2.25rem;\n box-sizing: border-box;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: 0;\n border-radius: calc(var(--qti-border-radius) - 2px);\n background: transparent;\n text-align: left;\n font: inherit;\n color: inherit;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &::part(option):hover {\n }\n\n &::part(option):focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(option-selected) {\n background-color: var(--qti-bg-active);\n }\n\n & qti-inline-choice {\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 2.25rem;\n box-sizing: border-box;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: 0;\n border-radius: calc(var(--qti-border-radius) - 2px);\n background: transparent;\n text-align: left;\n font: inherit;\n color: inherit;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n & qti-inline-choice:hover {\n }\n\n & qti-inline-choice:focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n & qti-inline-choice:state(--checked) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-match-interaction.qti-match-tabular {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n /* Table element */\n &::part(table) {\n border-collapse: collapse;\n width: 100%;\n }\n\n /* Row headers - take up remaining space */\n &::part(r-header) {\n background-color: var(--qti-bg-active, #f8f8f8);\n font-weight: 500;\n text-align: center;\n padding: 8px 15px;\n border: 1px solid #ddd;\n width: auto; /* Let it expand naturally */\n word-wrap: break-word; /* Allow long words to break */\n white-space: wrap; /* Allow text to wrap to multiple lines */\n min-width: 4rem; /* Allow column to shrink below content width */\n }\n\n /* Column headers - minimal width */\n &::part(c-header) {\n background-color: var(--qti-bg-active, #f8f8f8);\n font-weight: 500;\n text-align: left;\n padding: 8px;\n border: 1px solid #ddd;\n width: 8rem; /* Force minimal width */\n white-space: normal; /* Prevent wrapping */\n }\n\n /* Table rows */\n &::part(row) {\n border-bottom: 1px solid #ddd;\n }\n\n /* Input cells - minimal width */\n &::part(input-cell) {\n text-align: center;\n vertical-align: middle;\n height: 48px;\n border: 1px solid #ddd;\n padding: 8px;\n width: 1%; /* Force minimal width */\n }\n\n /* Radio button styling */\n &::part(rb) {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n border: 2px solid var(--qti-border-active, #2196f3);\n background-color: transparent !important;\n margin: 0 auto;\n cursor: pointer;\n display: block;\n }\n\n /* Radio button checked state */\n &::part(rb-checked) {\n box-shadow: inset 0 0 0 6px var(--qti-border-active, #2196f3);\n }\n\n /* Checkbox styling */\n &::part(cb) {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n width: 24px;\n height: 24px;\n border-radius: 3px;\n border: 2px solid var(--qti-border-active, #2196f3);\n background-color: transparent !important;\n margin: 0 auto;\n cursor: pointer;\n display: block;\n }\n\n /* Checkbox checked state - only change border if we're adding an SVG checkmark */\n &::part(cb-checked) {\n background-color: var(--qti-border-active, #2196f3) !important;\n }\n\n &::part(checkmark) {\n position: absolute;\n width: 18px;\n height: 18px;\n top: 3px;\n left: 3px;\n pointer-events: none;\n }\n\n /* Correct answers for both types */\n &::part(rb-correct) {\n border-color: var(--qti-correct, #4caf50);\n }\n\n &::part(rb-checked rb-correct) {\n box-shadow: inset 0 0 0 6px var(--qti-correct, #4caf50);\n }\n\n &::part(cb-correct) {\n border-color: var(--qti-correct, #4caf50);\n }\n\n &::part(cb-checked cb-correct) {\n background-color: var(--qti-correct, #4caf50) !important;\n }\n\n /* Incorrect answers for both types */\n &::part(rb-incorrect) {\n border-color: var(--qti-incorrect, #f44336);\n }\n\n &::part(rb-checked rb-incorrect) {\n box-shadow: inset 0 0 0 6px var(--qti-incorrect, #f44336);\n }\n\n &::part(cb-incorrect) {\n border-color: var(--qti-incorrect, #f44336);\n }\n\n &::part(cb-checked cb-incorrect) {\n background-color: var(--qti-incorrect, #f44336) !important;\n }\n }\n\n qti-match-interaction:not(.qti-match-tabular) {\n &:state(--dragzone-enabled) qti-simple-match-set:first-of-type {\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-active) qti-simple-match-set:first-of-type {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n /* The draggables */\n & qti-simple-match-set:first-of-type {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start; /* Prevents children from stretching */\n gap: var(--qti-gap-size);\n border: 2px solid transparent;\n\n & qti-simple-associable-choice {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n /* The droppables */\n & qti-simple-match-set:last-of-type {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n grid-auto-flow: unset;\n grid-auto-columns: unset;\n gap: var(--qti-gap-size);\n\n & > qti-simple-associable-choice {\n /* a droppable qti-simple-associable-choice */\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n grid-row: unset;\n box-sizing: border-box;\n\n & img {\n max-width: 100%;\n height: auto;\n }\n\n &[enabled] {\n &::part(dropslot) {\n background-color: var(--qti-bg-active);\n }\n }\n\n &[disabled] {\n &::part(dropslot) {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n\n &[active] {\n &::part(dropslot) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n }\n\n &::part(dropslot) {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n padding: var(--qti-dropzone-padding);\n margin-top: 0.5rem;\n gap: 0.5rem;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n\n & > *:not(qti-simple-associable-choice) {\n pointer-events: none;\n }\n\n & > qti-simple-associable-choice {\n\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n\n &::part(dropslot) {\n display: none;\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n flex-basis: fit-content;\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n }\n }\n }\n }\n\n qti-order-interaction {\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n\n &::part(qti-simple-choice),\n & qti-simple-choice {\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &::part(qti-simple-choice) {\n display: flex;\n overflow: hidden;\n align-items: center;\n width: 100%;\n text-overflow: ellipsis;\n }\n\n &::part(drops) {\n gap: 0.5rem; /* gap-2 */\n }\n\n &::part(drags) {\n gap: 0.5rem; /* gap-2 */\n }\n\n &::part(drop-list) {\n\n &[enabled] {\n\n /* Light theme override */\n .qti-selections-light {\n border-color: var(--qti-light-border-active);\n }\n\n /* Dark theme override */\n .qti-selections-dark {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n display: flex;\n min-height: 4rem;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n\n &::part(active) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n & drop-list {\n &[shape='circle'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='square'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n }\n\n qti-associate-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n /* General styles for active and enabled states */\n &:state(--dragzone-active) slot[name='qti-simple-associable-choice'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled) slot[name='qti-simple-associable-choice'] {\n background-color: var(--qti-bg-active);\n }\n\n & qti-simple-associable-choice, /* drags when in lightdom */\n &::part(qti-simple-associable-choice) /* drags when in shadowdom */ {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n\n box-sizing: border-box;\n\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n\n cursor: grab;\n\n background-color: var(--qti-bg);\n\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n\n border-radius: var(--qti-border-radius);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n /* display: flex;\n overflow: hidden;\n align-items: center; */\n\n /* &::part(drop-container) {\n display: flex;\n flex-direction: column;\n gap: var(--qti-gap-size);\n } */\n\n &::part(drop-list) {\n\n display: grid;\n height: 3rem;\n min-width: 10rem;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n\n &::part(drop-list):focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(drop-list)[dragging] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n /* &::part(drop-list) {\n @apply act;\n } */\n }\n\n qti-graphic-order-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n\n & qti-hotspot-choice {\n width: 100%;\n height: 100%;\n background-color: rgb(128 128 128 / 30%);\n padding: 0;\n\n &:hover {\n background-color: rgb(128 128 128 / 70%);\n }\n\n &:focus {\n background-color: rgb(128 128 128 / 70%);\n }\n\n &:state(--checked),\n &[aria-checked='true'] {\n background-color: rgb(128 128 128 / 70%);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n &[aria-ordervalue] {\n display: grid;\n place-content: center;\n }\n\n &[aria-ordervalue]::after {\n content: attr(aria-ordervalue) !important;\n }\n\n &[aria-ordercorrectvalue] {\n display: grid;\n place-content: center;\n }\n\n /* When both attributes are present */\n &[aria-ordercorrectvalue][aria-ordervalue]::after {\n content: 'C=' attr(aria-ordercorrectvalue) ' R=' attr(aria-ordervalue) !important;\n color: var(--qti-correct);\n }\n\n /* When only aria-ordercorrectvalue is present */\n &[aria-ordercorrectvalue]:not([aria-ordervalue])::after {\n content: 'C=' attr(aria-ordercorrectvalue) !important;\n color: var(--qti-correct);\n }\n }\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-graphic-associate-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n position: relative;\n display: block;\n\n & qti-associable-hotspot {\n &[shape='circle'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n\n &[shape='square'] {\n\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n\n width: 100%;\n\n height: 100%;\n\n background-color: transparent;\n\n margin: 0;\n\n padding: 0;\n\n border: 0;\n\n box-sizing: border-box;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none\n }\n }\n\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n\n /* General styles for active and enabled states */\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-slider-interaction {\n --qti-tick-color: rgb(229 231 235 / 100%);\n --qti-tick-width: 1px;\n }\n\n qti-select-point-interaction {\n &::part(point) {\n &:hover {\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n box-sizing: border-box;\n\n border-radius: 100%;\n\n border: 1px solid white;\n\n background-color: black;\n\n opacity: 0.5;\n\n padding: 0;\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n }\n\n &::part(correct) {\n background-color: var(--qti-correct);\n }\n\n &::part(incorrect) {\n background-color: var(--qti-incorrect);\n }\n }\n\n qti-position-object-stage {\n & qti-position-object-interaction {\n /* no styles necessary, only layout styles, defined in the component */\n }\n }\n\n qti-prompt {\n margin: 0.5rem 0; /* my-2 */\n display: block;\n width: 100%;\n }\n}\n\n[view],\nqti-outcome-declaration,\nqti-response-declaration {\n display: none;\n}\n\n[view].show {\n display: block;\n}\n\n:host {\n box-sizing: border-box;\n}\n\nqti-test-part:not(:has(qti-assessment-item)),\nqti-assessment-section:not(:has(qti-assessment-item)),\nqti-assessment-item-ref:not(:has(qti-assessment-item)) {\n display: none;\n}\n\ndiv.full-correct-response {\n border: 1px solid #39a7c0;\n background-color: #d9e8ee;\n}\n\ndiv.full-correct-response-block {\n display: block;\n margin-top: var(--qti-padding-vertical);\n padding: 0.5rem;\n}\n\ndiv.full-correct-response-inline {\n display: inline-block;\n margin-left: var(--qti-padding-horizontal);\n margin-right: var(--qti-padding-horizontal);\n padding: 0.2rem;\n}\n";var lV,lz,l$,lB,lj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,lz);t.testURL=null;t.testDoc=null;t.testXML=null;re(t,lV,null);return t}d(e,[{key:"handleTestURLChange",value:function t(){return a(function(){var t,e,n,i,o;return z(this,function(a){switch(a.label){case 0:if(!this.testURL)return[3,7];a.label=1;case 1:a.trys.push([1,6,,7]);return[4,iJ().load(this.testURL)];case 2:t=a.sent(),e=this.closest("qti-test");if(!(e===null||e===void 0?void 0:e.postLoadTestTransformCallback))return[3,5];n=t.htmlDoc().querySelector("qti-assessment-test");i=n;if(!i)return[3,4];return[4,e.postLoadTestTransformCallback(t,n)];case 3:i=t=a.sent();a.label=4;case 4:i;a.label=5;case 5:this.testDoc=t.htmlDoc();return[3,7];case 6:o=a.sent();console.error("Error loading or parsing XML:",o);return[3,7];case 7:return[2]}})}).call(this)}},{key:"handleTestXMLChange",value:function t(){if(this.testXML)try{this.testDoc=iJ().parse(this.testXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){i().call(n),rr(this,lz,l$).call(this),rr(this,lz,lB).call(this),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange();return[2]})}).call(this)}},{key:"render",value:function t(){return iw(tz(),rt(this,lV),lN(this.testDoc,iw(tV())))}}]);return e}(i$);lV=new WeakMap,lz=new WeakSet,l$=function t(){var t=this.querySelector("template");rn(this,lV,t?t.content:iw(t$()))},lB=function t(){var t=new CSSStyleSheet;t.replaceSync(lD),this.shadowRoot.adoptedStyleSheets=[t]},n7([n({type:String,attribute:"test-url"})],lj.prototype,"testURL",2),n7([i()],lj.prototype,"testDoc",2),n7([i()],lj.prototype,"testXML",2),n7([V("testURL",{waitUntilFirstUpdate:!0})],lj.prototype,"handleTestURLChange",1),n7([V("testXML",{waitUntilFirstUpdate:!0})],lj.prototype,"handleTestXMLChange",1),lj=n7([ij("test-container")],lj);var lW=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t;var e=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!e||!e.variables)return iw(tB());var n=e.variables.filter(function(t){return t.type==="response"}),i=e.variables.filter(function(t){return t.type==="outcome"}),o=function t(t,e){return iw(tW(),e,t.map(function(t){var e,n,i,o;var a=t.correctResponse?Array.isArray(t.correctResponse)?t.correctResponse.join(", "):t.correctResponse:"",s=((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.map(function(t){return"".concat(t.mapKey,"=").concat(t.mappedValue,"pt")}).join(", "))||"",l=((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.map(function(t){return"".concat(t.shape,"(").concat(t.coords,")=").concat(t.mappedValue,"pt")}).join(", "))||"";return iw(tj(),t.identifier,Array.isArray(t.value)?t.value.join(", "):t.value,t.cardinality,t.baseType,a||s||l)}))};return iw(tF(),o(n,"Response Variables"),o(i,"Outcome Variables"))}}]);return e}(i$);lW.styles=rj(tQ()),n7([P({context:i4,subscribe:!0})],lW.prototype,"computedContext",2),lW=n7([ij("test-print-item-variables")],lW);var lF,lQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,lF);rn(t,lF,t.attachInternals()),rt(t,lF).ariaLabel="pagination";return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");this.myTemplate=lC(t)}},{key:"render",value:function t(){var t=this;if(!this.computedContext)return iw(tH());var e=this.computedContext.testParts.flatMap(function(t){return t.sections});return iw(tG(),e.map(function(e){return t.myTemplate({item:e})}))}}]);return e}(i$);lF=new WeakMap,n7([P({context:i4,subscribe:!0})],lQ.prototype,"computedContext",2),lQ=n7([ij("test-section-buttons-stamp")],lQ);var lH,lG,lX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,lH);t.sectionId=null;t.addEventListener("click",function(){return rr(t,lH,lG).call(t,t.sectionId)});return t}d(e,[{key:"render",value:function t(){return iw(tX())}}]);return e}(i$);lH=new WeakSet,lG=function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"section",id:t}}))},lX.styles=rj(tJ(),a0,a1),n7([n({type:String,attribute:"section-id"})],lX.prototype,"sectionId",2),lX=n7([ij("test-section-link")],lX);var lJ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(tY(),JSON.stringify(this.computedContext,null,2))}}]);return e}(i$);n7([i(),P({context:i4,subscribe:!0})],lJ.prototype,"computedContext",2),lJ=n7([ij("test-print-context")],lJ);var lY=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.debug=!1;t.stampContext={view:"candidate",activeItem:{},activeSection:{items:[]},activeTestpart:{items:[],sections:[]},test:{}};return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=lC(t)}},{key:"willUpdate",value:function t(t){if(!this.computedContext)return;var e=this.computedContext.testParts.find(function(t){return t.active}),n=e===null||e===void 0?void 0:e.sections.find(function(t){return t.active}),i=n===null||n===void 0?void 0:n.items.find(function(t){return t.active}),o=i||{},a=o.variables,s=C(o,["variables"]);if(!e||!n||!i)return;var l=_(k({},e),{items:e.sections.flatMap(function(t){return t.items.map(function(t){var e=t.variables,n=C(t,["variables"]);return n})}),sections:e.sections.map(function(t){return _(k({},t),{items:t.items.map(function(t){var e=t.variables,n=C(t,["variables"]);return n})})})}),u=_(k({},n),{items:n.items.map(function(t){var e=t.variables,n=C(t,["variables"]);return n})}),c=this.computedContext,d=c.testParts,h=C(c,["testParts"]);this.stampContext={view:this.computedContext.view,activeItem:s,activeSection:u,activeTestpart:l,test:h},this.dispatchEvent(new CustomEvent("qti-stamp-context-updated",{detail:this.stampContext,bubbles:!0}))}},{key:"render",value:function t(){return iw(tZ(),this.debug?iw(tK(),JSON.stringify(this.stampContext,null,2)):i_,this.myTemplate?this.myTemplate(this.stampContext):i_)}}]);return e}(i$);n7([n({type:Boolean,reflect:!0})],lY.prototype,"debug",2),n7([i(),P({context:i4,subscribe:!0})],lY.prototype,"computedContext",2),n7([i()],lY.prototype,"stampContext",2),lY=n7([ij("test-stamp")],lY);var lK,lZ,l0=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,lK);t.view="";t.disabled=!1;t.myTemplate=null;t.addEventListener("click",function(e){var n=e.target,i=parseFloat(n.value);n.tagName==="INPUT"&&rr(t,lK,lZ).call(t,i)});return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=lC(t)}},{key:"render",value:function t(){var t,e;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!n||!n.variables)return iw(t0());var i=(e=n.variables.find(function(t){return t.identifier=="MAXSCORE"}))===null||e===void 0?void 0:e.value,o=n.variables.find(function(t){return t.identifier=="SCORE"}),a=o===null||o===void 0?void 0:o.value,s=(o===null||o===void 0?void 0:o.externalScored)!=="human";if(!i||!o)return i_;var l=L(Array(Number(i)+1).keys());return iw(t1(),this.myTemplate?this.myTemplate({scores:l,score:a,disabled:s}):i_)}}]);return e}(i$);lK=new WeakSet,lZ=function t(t){var e,n;var i=(e=((n=this.computedContext)===null||n===void 0?void 0:n.testParts.find(function(t){return t.active})).sections.flatMap(function(t){return t.items}).find(function(t){return t.active}))===null||e===void 0?void 0:e.identifier;this.dispatchEvent(new CustomEvent("test-update-outcome-variable",{detail:{assessmentItemRefId:i,outcomeVariableId:"SCORE",value:t},bubbles:!0}))},n7([n({type:String,attribute:"view"})],l0.prototype,"view",2),n7([n({type:Boolean})],l0.prototype,"disabled",2),n7([P({context:i4,subscribe:!0})],l0.prototype,"computedContext",2),l0=n7([ij("test-scoring-buttons")],l0);var l1=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=lC(t)}},{key:"_switchView",value:function t(t){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:t}))}},{key:"firstUpdated",value:function t(t){var e=this;this.addEventListener("click",function(){var t;((t=e.sessionContext)===null||t===void 0?void 0:t.view)==="scorer"?e._switchView("candidate"):e._switchView("scorer")})}},{key:"render",value:function t(){var t;return iw(t2(),this.myTemplate?this.myTemplate({view:(t=this.sessionContext)===null||t===void 0?void 0:t.view}):i_)}}]);return e}(i$);n7([P({context:oe,subscribe:!0})],l1.prototype,"sessionContext",2),l1=n7([ij("test-view-toggle")],l1);var l2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.view=null;return t}d(e,[{key:"render",value:function t(){var t,e;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!n||!n.variables)return iw(t3());if(n.category==="dep-informational")return iw(t5(),this.dataset.informational);var i=n===null||n===void 0?void 0:(e=n.variables.find(function(t){return t.identifier==="completionStatus"}))===null||e===void 0?void 0:e.value,o=n===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier=="SCORE"}),a=parseFloat(o===null||o===void 0?void 0:o.value),s=n.externalScored;return iw(t4(),i!=="completed"?this.dataset.textNoResponse:!s&&a!==void 0&&!Number.isNaN(a)?a>0?this.dataset.textCorrect:this.dataset.textIncorrect:s==="externalMachine"?Number.isNaN(a)||a===void 0?this.dataset.scoreUnknown:"We hebben je antwoord ".concat(a===0?"geen punten":a==1?"\xe9\xe9n punt":"".concat(a," punten")," gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt."):s==="human"?Number.isNaN(a)?"":"Deze score heb je zelf toegekend.":this.dataset.inProgress)}}]);return e}(i$);n7([P({context:i4,subscribe:!0})],l2.prototype,"computedContext",2),n7([n({type:String,attribute:"view"})],l2.prototype,"view",2),l2=n7([ij("test-scoring-feedback")],l2);var l3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.addEventListener("click",function(){t.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0})),t.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:!0,bubbles:!0}));var e=t.closest("qti-test").querySelector("test-container");Array.from(e.shadowRoot.querySelectorAll("[view]")).forEach(function(t){t.classList.toggle("show",!0)})});return t}d(e,[{key:"render",value:function t(){return iw(t6())}}]);return e}(i$);l3.styles=rj(t8(),a0,a1),l3=n7([ij("test-check-item")],l3);var l5,l4,l6,l8,l7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,l4);t.itemURL=null;t.itemDoc=null;t.itemXML=null;re(t,l5,null);return t}d(e,[{key:"handleItemURLChange",value:function t(){return a(function(){var t,e;return z(this,function(n){switch(n.label){case 0:if(!this.itemURL)return[3,4];n.label=1;case 1:n.trys.push([1,3,,4]);return[4,iG().load(this.itemURL)];case 2:t=n.sent();this.itemDoc=t.htmlDoc();return[3,4];case 3:e=n.sent();console.error("Error loading or parsing XML:",e);return[3,4];case 4:return[2]}})}).call(this)}},{key:"handleItemXMLChange",value:function t(){if(this.itemXML)try{this.itemDoc=iG().parse(this.itemXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){i().call(n),rr(this,l4,l6).call(this),rr(this,l4,l8).call(this),this.itemURL&&this.handleItemURLChange(),this.itemXML&&this.handleItemXMLChange();return[2]})}).call(this)}},{key:"render",value:function t(){return iw(t9(),rt(this,l5),lN(this.itemDoc,iw(t7())))}}]);return e}(i$);l5=new WeakMap,l4=new WeakSet,l6=function t(){var t=this.querySelector("template");rn(this,l5,t?t.content:iw(et()))},l8=function t(){var t=new CSSStyleSheet;t.replaceSync(lD),this.shadowRoot.adoptedStyleSheets=[t]},n7([n({type:String,attribute:"item-url"})],l7.prototype,"itemURL",2),n7([i()],l7.prototype,"itemDoc",2),n7([i()],l7.prototype,"itemXML",2),n7([V("itemURL",{waitUntilFirstUpdate:!0})],l7.prototype,"handleItemURLChange",1),n7([V("itemXML",{waitUntilFirstUpdate:!0})],l7.prototype,"handleItemXMLChange",1),l7=n7([ij("item-container")],l7);var l9,ut,ue=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,l9);t.label="Correct response mode";t._options={internal:"Internal",full:"Full (copy)"};return t}d(e,[{key:"render",value:function t(){var t=this;return iw(en(),this.label,function(e){var n=e.target;rr(t,l9,ut).call(t,n.value)},Object.keys(this._options).map(function(e){var n;return iw(ee(),e,e===((n=t.itemContext)===null||n===void 0?void 0:n.correctResponseMode),t._options[e])}))}}]);return e}(i$);l9=new WeakSet,ut=function t(t){this.dispatchEvent(new CustomEvent("item-switch-correct-response-mode",{detail:t,bubbles:!0}))},n7([P({context:i6,subscribe:!0})],ue.prototype,"itemContext",2),n7([n({type:String})],ue.prototype,"label",2),n7([i()],ue.prototype,"_options",2),ue=n7([ij("item-correct-response-mode")],ue);var un=rj(er()),ur=rj(ei(),un),ui=rj(eo()),uo=rj(ea(),un);var ua,us,ul,uu,uc,ud=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,ul);t.shown=!1;t.disabled=!1;t.showCandidateCorrectionText="Show candidate correction";t.hideCandidateCorrectionText="Hide candidate correction";t.noCorrectResponseText="No correct response specified";re(t,ua,!1);re(t,us,"");return t}d(e,[{key:"updated",value:function t(){var t;if(!rt(this,ua)||rt(this,us)!==((t=this.computedContext)===null||t===void 0?void 0:t.identifier)){var e,n,i;rn(this,us,(e=this.computedContext)===null||e===void 0?void 0:e.identifier);var o=!!((n=this.computedContext)===null||n===void 0?void 0:n.variables.some(function(t){return t.correctResponse})),a=!!((i=this.computedContext)===null||i===void 0?void 0:i.variables.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));rn(this,ua,o||a)}this.disabled=!rt(this,ua)}},{key:"render",value:function t(){return iw(es(),rr(this,ul,uu),rr(this,ul,uc).call(this))}}]);return e}(i$);ua=new WeakMap,us=new WeakMap,ul=new WeakSet,uu=function t(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-candidate-correction",{detail:!this.shown,bubbles:!0}))},uc=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCandidateCorrectionText:this.showCandidateCorrectionText},ud.styles=rj(el(),ur,ui),n7([P({context:i5,subscribe:!0})],ud.prototype,"computedContext",2),n7([n({type:Boolean,reflect:!0})],ud.prototype,"shown",2),n7([n({type:Boolean,reflect:!0})],ud.prototype,"disabled",2),n7([n({type:String})],ud.prototype,"showCandidateCorrectionText",2),n7([n({type:String})],ud.prototype,"hideCandidateCorrectionText",2),n7([n({type:String})],ud.prototype,"noCorrectResponseText",2),ud=n7([ij("item-show-candidate-correction")],ud);var uh,up,uf,uv,um,ug=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,uf);t.shown=!1;t.disabled=!1;t.showCorrectText="Show correct response";t.hideCorrectText="Hide correct response";t.noCorrectResponseText="No correct response specified";re(t,uh,!1);re(t,up,"");return t}d(e,[{key:"updated",value:function t(){var t;if(!rt(this,uh)||rt(this,up)!==((t=this.computedContext)===null||t===void 0?void 0:t.identifier)){var e,n,i;rn(this,up,(e=this.computedContext)===null||e===void 0?void 0:e.identifier);var o=!!((n=this.computedContext)===null||n===void 0?void 0:n.variables.some(function(t){return t.correctResponse})),a=!!((i=this.computedContext)===null||i===void 0?void 0:i.variables.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));rn(this,uh,o||a)}this.disabled=!rt(this,uh)}},{key:"render",value:function t(){return iw(eu(),rr(this,uf,uv),rr(this,uf,um).call(this))}}]);return e}(i$);uh=new WeakMap,up=new WeakMap,uf=new WeakSet,uv=function t(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-correct-response",{detail:!this.shown,bubbles:!0}))},um=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText},ug.styles=rj(ec(),ur,ui),n7([P({context:i5,subscribe:!0})],ug.prototype,"computedContext",2),n7([n({type:Boolean,reflect:!0})],ug.prototype,"shown",2),n7([n({type:Boolean,reflect:!0})],ug.prototype,"disabled",2),n7([n({type:String})],ug.prototype,"showCorrectText",2),n7([n({type:String})],ug.prototype,"hideCorrectText",2),n7([n({type:String})],ug.prototype,"noCorrectResponseText",2),ug=n7([ij("item-show-correct-response")],ug);var ub=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t=this.computedContext;if(!t||!t.variables)return iw(ed());var e=t.variables.filter(function(t){return t.type==="response"}),n=t.variables.filter(function(t){return t.type==="outcome"}),i=function t(t,e){return iw(ep(),e,t.map(function(t){var e,n,i,o;var a=t.correctResponse?Array.isArray(t.correctResponse)?t.correctResponse.join(", "):t.correctResponse:"",s=((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.map(function(t){return"".concat(t.mapKey,"=").concat(t.mappedValue,"pt")}).join(", "))||"",l=((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.map(function(t){return"".concat(t.shape,"(").concat(t.coords,")=").concat(t.mappedValue,"pt")}).join(", "))||"";return iw(eh(),t.identifier,Array.isArray(t.value)?t.value.join(", "):t.value,t.cardinality,t.baseType,a||s||l)}))};return iw(ef(),i(e,"Response Variables"),i(n,"Outcome Variables"))}}]);return e}(i$);ub.styles=rj(ev()),n7([P({context:i5,subscribe:!0})],ub.prototype,"computedContext",2),ub=n7([ij("item-print-variables")],ub);var uy,uw,uq,uk,ux,u_,uC,uE,uS,uA,uR,uI,uM,uT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,uC);re(t,uy);t.configContext={};re(t,uw,rr(t,uC,uE).bind(t));re(t,uq,rr(t,uC,uS).bind(t));re(t,uk,rr(t,uC,uA).bind(t));re(t,ux,rr(t,uC,uR).bind(t));re(t,u_,rr(t,uC,uI).bind(t));t.addEventListener("qti-item-context-updated",rt(t,uw)),t.addEventListener("qti-assessment-item-connected",rt(t,uq)),t.addEventListener("item-show-correct-response",rt(t,uk)),t.addEventListener("item-show-candidate-correction",rt(t,ux)),t.addEventListener("item-switch-correct-response-mode",rt(t,u_));return t}d(e,[{key:"render",value:function t(){return iw(em())}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-item-context-changed",rt(this,uw)),this.removeEventListener("qti-assessment-item-connected",rt(this,uq))}}]);return e}(i$);uy=new WeakMap,uw=new WeakMap,uq=new WeakMap,uk=new WeakMap,ux=new WeakMap,u_=new WeakMap,uC=new WeakSet,uE=function t(t){var e,n;rr(this,uC,uM).call(this,t.detail.itemContext.identifier,((n=t.detail)===null||n===void 0?void 0:(e=n.itemContext)===null||e===void 0?void 0:e.variables)||[])},uS=function t(t){var e,n;var i=t.detail._context.variables;rn(this,uy,t.detail),this.computedContext=((e=this.computedContext)===null||e===void 0?void 0:e.identifier)===rt(this,uy).identifier?_(k({},this.computedContext),{title:rt(this,uy).title}):{identifier:rt(this,uy).identifier,title:rt(this,uy).title,adaptive:((n=rt(this,uy).getAttribute("adaptive"))===null||n===void 0?void 0:n.toLowerCase())==="true"||!1,variables:i,correctResponseMode:"internal"},rr(this,uC,uM).call(this,rt(this,uy).identifier,i||[])},uA=function t(t){rt(this,uy)&&rt(this,uy).showCorrectResponse(t.detail)},uR=function t(t){rt(this,uy)&&rt(this,uy).showCandidateCorrection(t.detail)},uI=function t(t){rr(this,uC,uA).call(this,new CustomEvent("item-show-correct-response",{detail:!1,bubbles:!0})),this.configContext=_(k({},this.configContext),{correctResponseMode:t.detail})},uM=function t(t,e){var n,i;var o=e===null||e===void 0?void 0:(n=e.find(function(t){return t.identifier=="SCORE"}))===null||n===void 0?void 0:n.value,a=parseFloat(o===null||o===void 0?void 0:o.toString()),s=e===null||e===void 0?void 0:(i=e.find(function(t){return t.identifier==="completionStatus"}))===null||i===void 0?void 0:i.value,l=a!==void 0&&!isNaN(a)&&a>0,u=a!==void 0&&!isNaN(a)&&a<=0,c=s==="completed";this.computedContext=_(k({},this.computedContext),{identifier:t,correct:l,incorrect:u,completed:c,variables:e})},n7([i(),T({context:i5})],uT.prototype,"computedContext",2),n7([i(),T({context:i6})],uT.prototype,"configContext",2),uT=n7([ij("qti-item")],uT);var uP=function t(t,e,n){var i=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(t);return i};var uO=function t(t,e,i,o){var u=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){l(this,n);var t;t=s(this,n,arguments);t.observer=null;t.droppableObsever=null;t.resizeObserver=null;t.draggables=[];t.droppables=[];t.dragContainers=[];t.dragClone=null;t.dragSource=null;t.touchStartPoint=null;t.isDraggable=!1;t.cloneOffset={x:0,y:0};t.isDragging=!1;t.allDropzones=[];t.lastTarget=null;t.currentDropTarget=null;t.dragMoveRaf=0;t.pendingMove=null;t.dragBounds=null;t.dragCloneRect=null;t.dropzoneRects=new Map;t.dropzoneRectsDirty=!1;t.dragBoundsDirty=!1;t.dragCloneStyleCache=new WeakMap;t.onScrollOrResize=function(){t.dropzoneRectsDirty=!0,t.dragBoundsDirty=!0,t.dragBoundsDirty=!0};t.onMove=t.handleTouchMove.bind(t);t.onEnd=t.handleTouchEnd.bind(t);t.onCancel=t.handleTouchCancel.bind(t);t.MIN_DRAG_DISTANCE=5;t.DRAG_CLONE_OPACITY=1;t.MAX_DRAGGABLE_WIDTH=600;t.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"};t.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};t.minAssociations=1;t.maxAssociations=0;t.draggablesModified=function(e,n){if(t.isMatchTabular())return;var i=true,o=false,a=undefined;try{var s=function(){var e=u.value;t.draggables.includes(e)&&(t.draggables=t.draggables.filter(function(t){return t!==e}),e.removeAttribute("tabindex"),e.removeEventListener("touchstart",t.handleTouchStart.bind(t)),e.removeEventListener("mousedown",t.handleTouchStart.bind(t)))};for(var l=n[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}var c=true,d=false,h=undefined;try{for(var p=e[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;t.draggables.includes(v)||(t.draggables.push(v),v.setAttribute("tabindex","0"),v.hasTouchStartListener||(v.addEventListener("touchstart",t.handleTouchStart.bind(t),{passive:!1}),v.addEventListener("mousedown",t.handleTouchStart.bind(t),{passive:!1}),v.hasTouchStartListener=!0))}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}var m=0;t.draggables.forEach(function(e){e.style.viewTransitionName="drag-".concat(m,"-").concat(t.getAttribute("identifier")||crypto.randomUUID()),e.setAttribute("qti-draggable","true"),m++})};t.droppablesModified=function(e,n){if(!t.isMatchTabular()){var i=true,o=false,a=undefined;try{var s=function(){var e=u.value;t.droppables.includes(e)&&(t.droppables=t.droppables.filter(function(t){return t!==e}),t.allDropzones=t.allDropzones.filter(function(t){return t!==e}))};for(var l=n[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}var c=true,d=false,h=undefined;try{for(var p=e[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;t.droppables.includes(v)||(t.droppables.push(v),t.allDropzones.push(v))}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}var m=true,g=false,b=undefined;try{for(var y=t.droppables[Symbol.iterator](),w;!(m=(w=y.next()).done);m=true){var q=w.value;t.dataset.choicesContainerWidth&&(q.style.width="".concat(t.dataset.choicesContainerWidth,"px"),q.style.boxSizing="border-box")}}catch(t){g=true;b=t}finally{try{if(!m&&y.return!=null){y.return()}}finally{if(g){throw b}}}t.dropzoneRectsDirty=!0,t.dragBoundsDirty=!0}};return t}d(n,[{key:"handleDraggableContainerChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.dragContainersModified(t||[],e||[])}},{key:"dragContainersModified",value:function t(t,e){var n=true,i=false,o=undefined;try{var a,s=function(){var t=u.value;a.dragContainers.includes(t)&&(a.dragContainers=a.dragContainers.filter(function(e){return e!==t}),a.allDropzones=a.allDropzones.filter(function(e){return e!==t}))};for(var l=e[Symbol.iterator](),u;!(n=(u=l.next()).done);n=true)a=this,s()}catch(t){i=true;o=t}finally{try{if(!n&&l.return!=null){l.return()}}finally{if(i){throw o}}}var c=true,d=false,h=undefined;try{for(var p=t[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;this.dragContainers.includes(v)||(this.dragContainers.push(v),this.allDropzones.push(v))}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}this.dropzoneRectsDirty=!0,this.dragBoundsDirty=!0}},{key:"handleDraggablesChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.draggablesModified(t||[],e||[])}},{key:"handleDroppablesChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.droppablesModified(t||[],e||[])}},{key:"firstUpdated",value:function t(){var t=this;var a,s,l;if(p(f(n.prototype),"firstUpdated",this).call(this),this.isMatchTabular())return;this.hasAttribute("disabled")||(document.addEventListener("mousemove",this.onMove,{passive:!1}),document.addEventListener("mouseup",this.onEnd,{passive:!1}),document.addEventListener("touchmove",this.onMove,{passive:!1}),document.addEventListener("touchend",this.onEnd,{passive:!1}),document.addEventListener("touchcancel",this.onCancel,{passive:!1}));var u=Array.from(this.querySelectorAll(e)||[]).concat(Array.from(((a=this.shadowRoot)===null||a===void 0?void 0:a.querySelectorAll(e))||[])),c=Array.from(this.querySelectorAll(i)||[]).concat(Array.from(((s=this.shadowRoot)===null||s===void 0?void 0:s.querySelectorAll(i))||[])),d=Array.from(this.querySelectorAll(o)||[]).concat(Array.from(((l=this.shadowRoot)===null||l===void 0?void 0:l.querySelectorAll(o))||[]));this.dragContainersModified(d,[]),this.droppablesModified(c,[]),this.draggablesModified(u,[]),this.updateMinDimensionsForDropZones(),this.observer=new MutationObserver(function(){return t.updateMinDimensionsForDropZones()}),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(function(){return t.updateMinDimensionsForDropZones()}),this.querySelectorAll("qti-gap-text").forEach(function(e){var n;return(n=t.resizeObserver)===null||n===void 0?void 0:n.observe(e)})}},{key:"moveDraggableToDroppable",value:function t(t,e){return a(function(){return z(this,function(n){if(this.isMatchTabular())return[2];t.style.transform="translate(0, 0)",e.tagName==="SLOT"?t.setAttribute("slot",e.getAttribute("name")):e.appendChild(t),this.checkAllMaxAssociations(),this.saveResponse();return[2]})}).call(this)}},{key:"activateDroppable",value:function t(t){this.dragContainers.includes(t)?(this._internals.states.add("--dragzone-active"),t.setAttribute("active","")):(this._internals.states.delete("--dragzone-active"),t.setAttribute("active",""))}},{key:"deactivateDroppable",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e&&this._internals.states.add("--dragzone-active"),t.removeAttribute("active")}},{key:"connectedCallback",value:function t(){p(f(n.prototype),"connectedCallback",this).call(this)}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"updateMinDimensionsForDropZones",value:function t(){return a(function(){var t,n,a,s,l,u,c,d,h,p,f,v,m,g,b,y,w,q,k,x,_,C,E,S,A,R,I;return z(this,function(M){switch(M.label){case 0:return[4,this.updateComplete];case 1:if(M.sent(),this.isMatchTabular())return[2];this.dropzoneRectsDirty=!0;a=this.querySelectorAll(e),s=this.querySelector(o)||((t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector(o)),l=this.querySelectorAll(i),u=(n=l[0])===null||n===void 0?void 0:n.parentElement,c=this.determineMaxWidth(s,u),d=0,h=0;p=true,f=false,v=undefined;M.label=2;case 2:M.trys.push([2,7,8,9]);m=a[Symbol.iterator]();M.label=3;case 3:if(!!(p=(g=m.next()).done))return[3,6];b=g.value;b.style.maxWidth=c+"px";return[4,this.measureIntrinsicSize(b)];case 4:y=M.sent(),w=y.width,q=y.height;d=Math.max(d,q),h=Math.max(h,w);M.label=5;case 5:p=true;return[3,3];case 6:return[3,9];case 7:k=M.sent();f=true;v=k;return[3,9];case 8:try{if(!p&&m.return!=null){m.return()}}finally{if(f){throw v}}return[7];case 9:u&&(u.style.gridTemplateColumns="repeat(auto-fit, minmax(calc(min(".concat(c,"px,").concat(h,"px + 2 * var(--qti-dropzone-padding))), 1fr))")),s&&(s.style.minHeight="".concat(d,"px"));x=true,_=false,C=undefined;try{for(E=l[Symbol.iterator]();!(x=(S=E.next()).done);x=true){A=S.value;A.style.minHeight="".concat(d,"px"),A.style.minWidth="".concat(h,"px");I=(R=A.shadowRoot)===null||R===void 0?void 0:R.querySelector('slot[part="dropslot"]');I&&(I.style.minHeight="".concat(d,"px"))}}catch(t){_=true;C=t}finally{try{if(!x&&E.return!=null){E.return()}}finally{if(_){throw C}}}return[2]}})}).call(this)}},{key:"determineMaxWidth",value:function t(t,e){var n=e!==null&&e!==void 0?e:t;if(!n||n.clientWidth==0)return this.MAX_DRAGGABLE_WIDTH;var i=window.getComputedStyle(n),o=parseFloat(i.paddingLeft),a=parseFloat(i.paddingRight);return Math.min(this.MAX_DRAGGABLE_WIDTH,n.clientWidth-o-a)}},{key:"measureIntrinsicSize",value:function t(t){return a(function(){var e,n;return z(this,function(i){e=t.style.position;t.style.position="fixed";n=t.getBoundingClientRect();return[2,(t.style.position=e,{width:n.width,height:n.height})]})})()}},{key:"activateDroppables",value:function t(t){if(this.isMatchTabular())return;this.dragContainers.forEach(function(e){e.setAttribute("enabled",""),e.hasAttribute("disabled")&&(e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t))&&e.removeAttribute("disabled")}),this.droppables.forEach(function(e){e.setAttribute("enabled",""),e.hasAttribute("disabled")&&(e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t))&&e.removeAttribute("disabled")})}},{key:"activateDragLocation",value:function t(){this._internals.states.add("--dragzone-enabled")}},{key:"deactivateDragLocation",value:function t(){this._internals.states.delete("--dragzone-enabled")}},{key:"deactivateDroppables",value:function t(){this.dragContainers.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active")}),this.droppables.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active")})}},{key:"disconnectedCallback",value:function t(){p(f(n.prototype),"disconnectedCallback",this).call(this),this.observer&&(this.observer.disconnect(),this.observer=null),this.droppableObsever&&(this.droppableObsever.disconnect(),this.droppableObsever=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),document.removeEventListener("mousemove",this.onMove),document.removeEventListener("mouseup",this.onEnd),document.removeEventListener("touchmove",this.onMove),document.removeEventListener("touchend",this.onEnd),document.removeEventListener("touchcancel",this.onCancel),window.removeEventListener("scroll",this.onScrollOrResize,!0),window.removeEventListener("resize",this.onScrollOrResize)}},{key:"handleTouchMove",value:function t(t){if(!this.isMatchTabular()&&this.isDraggable&&this.dragClone){var e=this.getEventCoordinates(t),n=e.x,i=e.y;this.pendingMove={clientX:n,clientY:i},this.scheduleDragMove(),t.preventDefault()}}},{key:"scheduleDragMove",value:function t(){var t=this;this.dragMoveRaf||(this.dragMoveRaf=requestAnimationFrame(function(){if(t.dragMoveRaf=0,!t.pendingMove)return;var e=t.pendingMove;t.pendingMove=null,t.processDragMove(e),t.pendingMove&&t.scheduleDragMove()}))}},{key:"processDragMove",value:function t(t){if(!this.isDraggable||!this.dragClone||!this.touchStartPoint||(this.calculateDragDistance(t)>=this.MIN_DRAG_DISTANCE&&(this.isDragging=!0),!this.isDragging))return;this.updateDragClonePosition(t),this.dropzoneRectsDirty&&this.refreshDropzoneRects();var e=this.findClosestDropzone();this.currentDropTarget=e,e!==this.lastTarget&&(this.lastTarget&&(this.deactivateDroppable(this.lastTarget),this.dispatchCustomEvent(this.lastTarget,"dragleave")),e&&(this.activateDroppable(e),this.dispatchCustomEvent(e,"dragenter")),this.lastTarget=e),this.currentDropTarget&&this.dispatchCustomEvent(this.currentDropTarget,"dragover")}},{key:"handleTouchEnd",value:function t(t){this.isMatchTabular()||((this.isDragging||this.isDraggable||this.dragClone)&&this.resetDragState(),this._internals.states.delete("--dragzone-active"),this.checkAllMaxAssociations(),this._internals.states.delete("--dragzone-enabled"),this._internals.states.delete("--dragzone-active"),this.deactivateDragLocation(),this.deactivateDroppables(),this.draggables.forEach(function(t){t.removeAttribute("dragging")}),t.preventDefault())}},{key:"handleTouchCancel",value:function t(t){this.resetDragState()}},{key:"validate",value:function t(){if(this.isMatchTabular())return null;if(!this.shadowRoot)return!1;var t=this.getValidAssociations(),e=!0,n="";this.maxAssociations>0&&t>this.maxAssociations?(e=!1,n=this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,".")):this.minAssociations>0&&t<this.minAssociations&&(e=!1,n=this.dataset.minSelectionsMessage||"You haven't selected enough associations. Minimum required is ".concat(this.minAssociations,"."));var i=this.lastElementChild;return this._internals.setValidity(e?{}:{customError:!0},n,i),e}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("#validation-message");return t&&(this._internals.validity.valid?(t.textContent="",t.style.display="none"):(t.textContent=this._internals.validationMessage,t.style.setProperty("display","block","important"))),this._internals.validity.valid}},{key:"checkMaxAssociations",value:function t(t){var e=this.getMatchMaxValue(t),n=t.querySelectorAll('[qti-draggable="true"]').length;return!(e===0)&&n>=e}},{key:"dropDraggableInDroppable",value:function t(t,e){var n=t.cloneNode(!0);n.removeAttribute("style"),this.moveDraggableToDroppable(n,e),this.draggablesModified([n],[]);var i=this.getMatchMaxValue(t),o=this.draggables.filter(function(e){return e.getAttribute("identifier")===t.getAttribute("identifier")});i!==0&&o.length>=i?(t.style.opacity="0.0",t.style.pointerEvents="none"):t.style.opacity="1.0"}},{key:"resetDragState",value:function t(){if(this.dragMoveRaf&&(cancelAnimationFrame(this.dragMoveRaf),this.dragMoveRaf=0),this.pendingMove=null,this.dragClone){var t=this.currentDropTarget!==null,e=!t||this.dragContainers.includes(this.currentDropTarget);t&&this.currentDropTarget&&!e&&this.dropDraggableInDroppable(this.dragSource,this.currentDropTarget),e&&(this.dragSource.style.opacity="1.0",this.dragSource.style.display="block",this.dragSource.style.position="static",this.dragSource.style.pointerEvents="auto",this.saveResponse()),this.dragClone.remove(),this.draggablesModified([],[this.dragClone])}this.isDragging=!1,this.isDraggable=!1,this.dragSource=null,this.dragClone=null,this.touchStartPoint=null,this.currentDropTarget=null,this.lastTarget=null,this.dragBounds=null,this.dragCloneRect=null,this.dropzoneRects.clear(),this.dropzoneRectsDirty=!1,this.dragBoundsDirty=!1,window.removeEventListener("scroll",this.onScrollOrResize,!0),window.removeEventListener("resize",this.onScrollOrResize),this.deactivateDroppables()}},{key:"checkAllMaxAssociations",value:function t(){var t=this;var e=this.getValidAssociations(),n=this.maxAssociations!==0&&e>=this.maxAssociations;this.droppables.forEach(function(e){n?t.disableDroppable(e):t.checkMaxAssociations(e)?t.disableDroppable(e):t.enableDroppable(e)})}},{key:"getMatchMaxValue",value:function t(t){var e=t.getAttribute("match-max");return e?parseInt(e,10):1}},{key:"disableDroppable",value:function t(t){t.setAttribute("disabled","")}},{key:"enableDroppable",value:function t(t){t.removeAttribute("disabled")}},{key:"response",get:function t(){var t;return typeof this.getResponse=="function"?t=this.getResponse():t=this.collectResponseData(),t.join(",")},set:function t(t){var e=this;if(!this.isMatchTabular())if(typeof this.getValue=="function"&&(t=this.getValue(t)),Array.isArray(t)){this.reset(!1),t===null||t===void 0?void 0:t.forEach(function(t){return e.placeResponse(t)});var n=new FormData;t.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(t||"")}},{key:"placeResponse",value:function t(t){var e=this;var n=O(t.split(" ").reverse()),i=n[0],o=n.slice(1),a=Array.from(this.draggables),s=Array.from(this.droppables);o.forEach(function(t){if(t==="")return;var n=a.find(function(e){return e.getAttribute("identifier")===t}),o=s.find(function(t){return t.getAttribute("identifier")===i});e.dropDraggableInDroppable(n,o)})}},{key:"getValidAssociations",value:function t(){var t=0;var e=true,n=false,i=undefined;try{for(var o=this.droppables[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;t=t+this.getDraggablesFromDroppable(s).length}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}return t}},{key:"saveResponse",value:function t(){var t;typeof this.getResponse=="function"?t=this.getResponse():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(){var t=this;return this.droppables.map(function(e){var n=t.getDraggablesFromDroppable(e).map(function(t){return t.getAttribute("identifier")}),i=e.getAttribute("identifier");return n.map(function(t){return"".concat(t," ").concat(i)})}).flat()}},{key:"getDraggablesFromDroppable",value:function t(t){return this.draggables.map(function(t){return t.getAttribute("identifier")}).filter(function(t,e,n){return n.indexOf(t)===e}).flatMap(function(e){return Array.from(t.querySelectorAll("[identifier='".concat(e,"']")))}).filter(function(t){return!!t}).map(function(t){return t})}},{key:"reset",value:function t(){var t=this;var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.droppables.forEach(function(e){t.getDraggablesFromDroppable(e).forEach(function(e){e.remove(),t.draggablesModified([],[e])})}),this.dragContainers.forEach(function(t){Array.from(t.querySelectorAll('[qti-draggable="true"]')).forEach(function(t){t.style.opacity="1.0"})}),this.dragClone=null,this.dragSource=null,this.isDragging=!1,this.isDraggable=!1,this.currentDropTarget=null,this.lastTarget=null,e&&this.saveResponse()}},{key:"updateDragClonePosition",value:function t(t){var e,n;var i,o,a,s;if(!this.isDragging||!this.dragClone)return;(this.dragBoundsDirty||!this.dragBounds)&&this.refreshDragBounds();var l=t.clientX-this.cloneOffset.x,u=t.clientY-this.cloneOffset.y,c=this.applyInteractionBoundaries(l,u),d=c.newLeft,h=c.newTop;this.dragClone.style.left="".concat(d,"px"),this.dragClone.style.top="".concat(h,"px");var p=(e=(i=this.dragBounds)===null||i===void 0?void 0:i.width)!==null&&e!==void 0?e:(o=this.dragCloneRect)===null||o===void 0?void 0:o.width,f=(n=(a=this.dragBounds)===null||a===void 0?void 0:a.height)!==null&&n!==void 0?n:(s=this.dragCloneRect)===null||s===void 0?void 0:s.height;if(!p||!f){var v=this.dragClone.getBoundingClientRect();p=v.width,f=v.height}this.dragCloneRect={left:d,top:h,right:d+p,bottom:h+f,width:p,height:f}}},{key:"applyInteractionBoundaries",value:function t(t,e){if(!this.dragBounds)return{newLeft:t,newTop:e};var n=Math.max(this.dragBounds.minLeft,Math.min(t,this.dragBounds.maxLeft)),i=Math.max(this.dragBounds.minTop,Math.min(e,this.dragBounds.maxTop));return{newLeft:n,newTop:i}}},{key:"refreshDragBounds",value:function t(){if(!this.dragClone)return;var t=this.getBoundingClientRect(),e=this.dragClone.getBoundingClientRect();this.dragBounds={minLeft:t.left,maxLeft:t.right-e.width,minTop:t.top,maxTop:t.bottom-e.height,width:e.width,height:e.height},this.dragCloneRect={left:e.left,top:e.top,right:e.left+e.width,bottom:e.top+e.height,width:e.width,height:e.height},this.dragBoundsDirty=!1}},{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:"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:"refreshDropzoneRects",value:function t(){this.dropzoneRects.clear();var t=this.allDropzones.filter(function(t){return!t.hasAttribute("disabled")});var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;this.dropzoneRects.set(s,this.getDropzoneRect(s))}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}this.dropzoneRectsDirty=!1}},{key:"getCachedDropzoneRect",value:function t(t){var e=this.dropzoneRects.get(t);if(e)return e;var n=this.getDropzoneRect(t);return this.dropzoneRects.set(t,n),n}},{key:"getDropzoneRect",value:function t(t){var e;var n;return((e=(n=t.shadowRoot)===null||n===void 0?void 0:n.querySelector('slot[part="dropslot"]'))!==null&&e!==void 0?e:t).getBoundingClientRect()}},{key:"findClosestDropzone",value:function t(){var t=this;var e;var n=this.allDropzones.filter(function(t){return!t.hasAttribute("disabled")});if(!this.dragClone||n.length===0)return null;var i=(e=this.dragCloneRect)!==null&&e!==void 0?e:this.dragClone.getBoundingClientRect(),o=null,a=0,s=function e(e){var n=true,s=false,l=undefined;try{for(var u=e[Symbol.iterator](),c;!(n=(c=u.next()).done);n=true){var d=c.value;var h=t.getCachedDropzoneRect(d),p=t.calculateOverlapArea(i,h);p>a&&(a=p,o=d)}}catch(t){s=true;l=t}finally{try{if(!n&&u.return!=null){u.return()}}finally{if(s){throw l}}}};if(s(this.droppables.filter(function(t){return!t.hasAttribute("disabled")})),o||s(this.dragContainers.filter(function(t){return!t.hasAttribute("disabled")})),!o){var l=Number.POSITIVE_INFINITY;var u=true,c=false,d=undefined;try{for(var h=n[Symbol.iterator](),p;!(u=(p=h.next()).done);u=true){var f=p.value;var v=this.getCachedDropzoneRect(f),m=Math.hypot(i.left-v.left,i.top-v.top);m<l&&(l=m,o=f)}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}}return o}},{key:"calculateOverlapArea",value:function t(t,e){var n=Math.max(0,Math.min(t.right,e.right)-Math.max(t.left,e.left)),i=Math.max(0,Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top));return n*i}},{key:"getComputedStyleText",value:function t(t){var e=this.dragCloneStyleCache.get(t);if(e)return e;var n=window.getComputedStyle(t),i="";for(var o=0;o<n.length;o++){var a=n[o];i+="".concat(a,":").concat(n.getPropertyValue(a),";")}return this.dragCloneStyleCache.set(t,i),i}},{key:"dispatchCustomEvent",value:function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t)return;var i=new CustomEvent(e,{bubbles:n,cancelable:!0});i.dataTransfer=this.dataTransfer,t.dispatchEvent(i)}},{key:"appendClone",value:function t(){var t;((t=document.fullscreenElement)!==null&&t!==void 0?t:document.body).appendChild(this.dragClone)}},{key:"handleTouchStart",value:function t(t){var e=this;if(this.isMatchTabular()||m(t,MouseEvent)&&t.button!==0||this.isDragging)return;var n=this.getEventCoordinates(t),i=n.x,o=n.y;this.touchStartPoint={x:i,y:o},this.dragSource=t.currentTarget,this.isDraggable=!0,this._internals.states.add("--dragzone-enabled"),this._internals.states.add("--dragzone-active"),this.activateDragLocation(),this.activateDroppables(this.dragSource);var a=this.findDraggableInDraggableContainer(this.dragSource.getAttribute("identifier")),s=this.droppables.some(function(t){return Array.from(t.children).some(function(t){return t===e.dragSource})}),l=this.dragSource.getBoundingClientRect();s&&(this.dragSource.remove(),this.draggablesModified([],[this.dragSource]),this.dragSource=a),this.cloneOffset.x=i-l.left,this.cloneOffset.y=o-l.top,this.dragClone=a.cloneNode(!0),this.configuration.copyStylesDragClone&&(this.dragClone.style.cssText=this.getComputedStyleText(a));var u=a.getBoundingClientRect();this.dragClone.style.width="".concat(u.width,"px"),this.dragClone.style.height="".concat(u.height,"px"),l&&this.setDragCloneStyles(l),this.dragClone.style.display="block",this.dragClone.style.opacity="1",this.appendClone(),this.refreshDragBounds(),this.refreshDropzoneRects(),window.addEventListener("scroll",this.onScrollOrResize,!0),window.addEventListener("resize",this.onScrollOrResize);var c=this.getMatchMaxValue(this.dragSource),d=this.draggables.filter(function(t){return t.getAttribute("identifier")===e.dragSource.getAttribute("identifier")});c!==0&&d.length>=c?(a.style.opacity="0.0",a.style.pointerEvents="none"):a.style.opacity="1.0",t.preventDefault(),this.dragClone.setAttribute("dragging","")}},{key:"findDraggableInDraggableContainer",value:function t(t){var n=this.dragContainers.flat();var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;if(u.getAttribute("identifier")===t)return u;var c=void 0;m(u,HTMLSlotElement)?c=Array.from((u===null||u===void 0?void 0:u.assignedElements())||[]):c=Array.from(u.querySelectorAll(e));var d=c.find(function(e){return e.getAttribute("identifier")===t});if(d)return d}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}},{key:"setDragCloneStyles",value:function t(t){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(t.top,"px"),this.dragClone.style.left="".concat(t.left,"px"),this.dragClone.style.setProperty("box-sizing","border-box","important"),this.dragClone.style.zIndex="9999",this.dragClone.style.pointerEvents="none",this.dragClone.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone.style.display="block"}}]);return n}(uP(t,i,e));return n7([n({attribute:!1,type:Object})],u.prototype,"configuration",2),n7([n({type:Number,reflect:!0,attribute:"min-associations"})],u.prototype,"minAssociations",2),n7([n({type:Number,reflect:!0,attribute:"max-associations"})],u.prototype,"maxAssociations",2),n7([N(o)],u.prototype,"handleDraggableContainerChange",1),n7([N(e)],u.prototype,"handleDraggablesChange",1),n7([N(i)],u.prototype,"handleDroppablesChange",1),u};var uL=rj(eg());var uU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._childrenMap=[];t._registerChoiceHandler=t._registerChoice.bind(t),t.addEventListener("register-qti-simple-associable-choice",t._registerChoiceHandler);return t}d(e,[{key:"_registerChoice",value:function t(t){var e=t.target;this._childrenMap.push(e)}},{key:"render",value:function t(){return iw(ey(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(t,e){return iw(eb(),e,e,e,e)}))}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return e}(uO(oS,"qti-simple-associable-choice",".dl","slot[name='qti-simple-associable-choice']"));uU.styles=uL,n7([i()],uU.prototype,"_childrenMap",2);customElements.define("qti-associate-interaction",uU);var uN=function t(t,e){var u=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){l(this,n);var t;t=s(this,n,arguments);t._choiceElements=[];t._mutationObserver=null;t._validationMessageShown=!1;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.response="";t._handleValueChange=function(){t._internals.setFormValue(t.value),t._updateChoiceSelection()};return t}d(n,[{key:"_handleMaxChoicesChange",value:function t(t,e){this._determineInputType()}},{key:"value",get:function t(){return Array.isArray(this.response)&&this.response.length===0||this.response===""?null:Array.isArray(this.response)?this.response.join(","):this.response},set:function t(t){this.maxChoices>1&&(typeof t=="string"||t===null)?this.response=t?t.toString().split(","):[]:this.response=t||""}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.correctResponse;if(e){var n=Array.isArray(e)?e:[e];this._choiceElements.forEach(function(e){e.internals.states.delete("correct-response"),e.internals.states.delete("incorrect-response"),t&&n.length>0&&(n.includes(e.identifier)?e.internals.states.add("correct-response"):e.internals.states.add("incorrect-response"))})}}},{key:"toggleCandidateCorrection",value:function t(t){var e=this.correctResponse;if(!e)return;var i=Array.isArray(e)?e:[e],o=this.response,a=Array.isArray(o)?o:o?[o]:[];this._choiceElements.forEach(function(e){e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),t&&a.includes(e.identifier)&&(i.includes(e.identifier)?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect"))}),p(f(n.prototype),"toggleCandidateCorrection",this).call(this,t)}},{key:"connectedCallback",value:function t(){var t=this;p(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-".concat(e),this._choiceElementSelectedHandler),this._mutationObserver=new MutationObserver(function(){return t._syncChoicesFromDOM()}),this._mutationObserver.observe(this,{childList:!0,subtree:!0}),this._syncChoicesFromDOM()}},{key:"disconnectedCallback",value:function t(){p(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-".concat(e),this._choiceElementSelectedHandler),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)}},{key:"_syncChoicesFromDOM",value:function t(){var t=this;var n=new Set(this._choiceElements);this._choiceElements=Array.from(this.querySelectorAll(e)),this._choiceElements.forEach(function(e){n.has(e)||(t.disabled&&(e.disabled=!0),e.readonly=t.readonly,e.internals&&!e.internals.ariaChecked&&(e.internals.ariaChecked="false"),t._setInputType(e))});var i=new Set(this._choiceElements.map(function(t){return t.identifier}));if(Array.isArray(this.response)){var o=this.response.filter(function(t){return i.has(t)});o.length!==this.response.length&&(this.response=o)}else this.response&&!i.has(this.response)&&(this.response="");this._updateChoiceSelection()}},{key:"validate",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).length,n=!0,i="";this.maxChoices!==0&&e>this.maxChoices?(n=!1,i=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"option":"options",".")):e<this.minChoices&&(n=!1,i=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"option":"options","."));var o=this._choiceElements.find(function(e){return t.contains(e)})||this;return this._internals.setValidity(n?{}:{customError:!0},i,o),n}},{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.setProperty("display","block","important"),this._validationMessageShown=!0)),this._internals.validity.valid}},{key:"_determineInputType",value:function t(){var t=this;this._choiceElements.forEach(function(e){t._setInputType(e)})}},{key:"_setInputType",value:function t(t){return a(function(){var e;return z(this,function(n){if(this._internals.role=this.maxChoices===1?"radiogroup":null,t.internals){e=this.maxChoices===1?"radio":"checkbox";t.internals.role=e,t.internals.states.delete(e==="radio"?"checkbox":"radio"),t.internals.states.add(e)}return[2]})}).call(this)}},{key:"_choiceElementSelectedHandler",value:function t(t){var e=this;var n;this._toggleChoiceChecked(t.target),this.maxChoices===1?this._choiceElements.forEach(function(n){n.identifier!==t.detail.identifier&&e._setChoiceChecked(n,!1)}):this.maxChoices!==0&&((n=this._configContext)===null||n===void 0?void 0:n.disableAfterIfMaxChoicesReached)&&(this._choiceElements.filter(function(t){return e._getChoiceChecked(t)}).length>=this.maxChoices?this._choiceElements.forEach(function(t){e._getChoiceChecked(t)||(t.disabled=!0)}):this._choiceElements.forEach(function(t){return t.disabled=!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.response=this.maxChoices===1?e[0]||"":e,this.validate(),this._validationMessageShown&&(this.reportValidity(),this._internals.validity.valid&&(this._validationMessageShown=!1)),this.saveResponse(this.response)}},{key:"_updateChoiceSelection",value:function t(){var t=this;var e=Array.isArray(this.response)?this.response:[this.response];this._choiceElements.forEach(function(n){var i=e.includes(n.identifier);t._setChoiceChecked(n,i)})}}]);return n}(t);return n7([o("#validation-message")],u.prototype,"_validationMessageElement",2),n7([n({type:Number,attribute:"min-choices"})],u.prototype,"minChoices",2),n7([n({type:Number,attribute:"max-choices"})],u.prototype,"maxChoices",2),n7([V("maxChoices")],u.prototype,"_handleMaxChoicesChange",1),n7([V("disabled",{waitUntilFirstUpdate:!0})],u.prototype,"_handleDisabledChange",2),n7([V("readonly",{waitUntilFirstUpdate:!0})],u.prototype,"_handleReadonlyChange",2),n7([i()],u.prototype,"response",2),n7([V("response",{waitUntilFirstUpdate:!0})],u.prototype,"_handleValueChange",2),n7([i(),P({context:i6,subscribe:!0})],u.prototype,"_configContext",2),u};var uD=function t(t,e){var i=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(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"];t._mutationObserver=null;return t}d(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){p(f(e.prototype),"updated",this).call(this,t),this._addLabels()}},{key:"connectedCallback",value:function t(){var t=this;p(f(e.prototype),"connectedCallback",this).call(this),this._mutationObserver=new MutationObserver(function(){return t._addLabels()}),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}},{key:"disconnectedCallback",value:function t(){var t;p(f(e.prototype),"disconnectedCallback",this).call(this),(t=this._mutationObserver)===null||t===void 0?void 0:t.disconnect(),this._mutationObserver=null}},{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(t){return!isNaN(+t)};if(e){var i=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 o=0;o<i.length;o++)i[o].marker=this._getLabel(o+1)}}},{key:"_getLabel",value:function t(t){var e=this;var n=this._classes.filter(function(t){return e._allLabels.includes(t)}).pop(),i=this._classes.filter(function(t){return e._allLabelSuffixes.includes(t)}).pop();!n&&i&&(n="qti-labels-upper-alpha");var o="";switch(n){case"qti-labels-decimal":o="".concat(t);break;case"qti-labels-lower-alpha":o="".concat(String.fromCharCode(97+t-1));break;case"qti-labels-upper-alpha":o="".concat(String.fromCharCode(65+t-1));break}return i==="qti-labels-suffix-period"?o+=".":i==="qti-labels-suffix-parenthesis"&&(o+=")"),o}}]);return e}(t);return n7([n({type:String})],i.prototype,"class",1),i};var uV=rj(ew());var uz,u$,uB=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,uz);t.orientation="vertical";return t}d(e,[{key:"render",value:function t(){return iw(eq(),rr(this,uz,u$))}}]);return e}(uD(uN(oS,"qti-simple-choice"),"qti-simple-choice"));uz=new WeakSet,u$=function t(){var t=this.querySelectorAll("qti-simple-choice");this.style.setProperty("--item-count",t.length.toString())},uB.styles=uV,n7([n({type:String})],uB.prototype,"orientation",2);customElements.define("qti-choice-interaction",uB);var uj='\nconst postToParentWindows = (type, data) => {\n window.top.postMessage(data ? { type, data } : { type }, \'*\');\n let w = window.parent;\n while (w) {\n if (w !== window.top) {\n w.postMessage({ type, data }, \'*\');\n }\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n};\n\nwindow.CES = {\n media: null,\n response: null,\n load: () => {\n let resolveCount = 0;\n\n const handleMessage = (event) => {\n if (event.data.type === "mediaData") {\n const media = event.data.data;\n CES.media = media;\n resolveCount++;\n } else if (event.data.type === "responseData") {\n const response = event.data.data;\n if (response && Array.isArray(response) && response.length > 0) {\n // state is stored in the first element of the array\n CES.response = response[0];\n // Wait a short moment to ensure CES.response is set\n setTimeout(() => {\n // Re-create the Controller instance if it exists\n if (typeof Controller === \'function\') {\n console.log("Re-creating Controller instance");\n ctrl = new Controller();\n }\n }, 50);\n } else { \n CES.response = response;\n }\n resolveCount++;\n }\n if (resolveCount === 2) {\n //window.removeEventListener("message", handleMessage);\n }\n };\n window.addEventListener("message", handleMessage);\n postToParentWindows("getMedia");\n postToParentWindows("getResponse");\n },\n setResponse: (data) => {\n postToParentWindows("setResponse", data);\n },\n getResponse: () => {\n return CES.response;\n },\n getMedia: () => {\n return CES.media;\n },\n setStageHeight: () => {\n postToParentWindows("setStageHeight");\n },\n};\nCES.load();\n',uW="\n (function() {\n var blobUrlReceived = null;\n \n const createIframe = () => {\n if (!blobUrlReceived || !document.body) return;\n var n = document.createElement('iframe');\n n.frameBorder = '0';\n n.scrolling = 'no';\n n.src = blobUrlReceived;\n n.style.width = '100%';\n n.style.height = '100%';\n document.body.appendChild(n);\n };\n \n const handleMessage = (event) => {\n if (event.data.type === 'blobUrl') {\n blobUrlReceived = event.data.data;\n window.removeEventListener('message', handleMessage);\n createIframe();\n }\n };\n \n window.addEventListener('message', handleMessage);\n \n // Wait for document ready before requesting blobUrl\n const requestBlobUrl = () => {\n let w = window.parent;\n while (w) {\n w.postMessage({ type: 'getBlobUrl' }, '*');\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n };\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', requestBlobUrl);\n } else {\n requestBlobUrl();\n }\n })();\n",uF,uQ,uH,uG,uX,uJ,uY,uK,uZ,u0,u1,u2,u3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,uX);re(t,uF,"");re(t,uQ,null);re(t,uH,null);t._errorMessage=null;re(t,uG,null);t.handlePostMessage=t.handlePostMessage.bind(t);return t}d(e,[{key:"connectedCallback",value:function t(){var t=this;p(f(e.prototype),"connectedCallback",this).call(this);var n=this.data;if(!n){var i=this.querySelector("object[data]");if(i){n=i.getAttribute("data");var o=i.getAttribute("width"),a=i.getAttribute("height");o&&this.setAttribute("width",o),a&&this.setAttribute("height",a)}}if(!n){this._errorMessage="No manifest path found (neither data attribute nor object child)";return}var s=n.startsWith("http")||n.startsWith("blob")?n:nD((this.baseItemUrl||"")+"/"+n);rn(this,uQ,new URL(s,window.location.href).toString()),fetch(s).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(){return a(function(){var t,e,n,i,o,a,s,l,u,c,d,h,p,f,v,m,g,b,y,w,q,k,x,_,C,E,S,A,R,I,M,T,P,O,L,U,N;return z(this,function(D){switch(D.label){case 0:return[4,this.updateComplete];case 1:D.sent();l=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelector("#pciContainer");if(!l){this._errorMessage="pciContainer iframe not found";return[2]}l.getAttribute("src")||l.setAttribute("src","about:blank");u=(t=(e=l.contentDocument)!==null&&e!==void 0?e:(a=l.contentWindow)===null||a===void 0?void 0:a.document)!==null&&t!==void 0?t:null;c=u;if(c)return[3,3];return[4,new Promise(function(t){return l.addEventListener("load",function(){return t()},{once:!0})})];case 2:c=(D.sent(),u=(n=(i=l.contentDocument)!==null&&i!==void 0?i:(s=l.contentWindow)===null||s===void 0?void 0:s.document)!==null&&n!==void 0?n:null);D.label=3;case 3:if(c,!u){this._errorMessage="pciContainer iframe document not available";return[2]}if(!this.manifest.script||this.manifest.script.length===0){this._errorMessage="No script found in manifest";return[2]}if(!this.manifest.style||this.manifest.style.length===0){this._errorMessage="No style found in manifest";return[2]}d=this.manifest.style[0],h=rr(this,uX,uZ).call(this);return[4,rr(this,uX,u2).call(this,d,h)];case 4:p=D.sent(),f=p.url;if(!(p.baseUrl&&!rt(this,uH)&&rn(this,uH,p.baseUrl),!0))return[3,15];v="";if(!(this.manifest.media&&this.manifest.media.length>0))return[3,6];m=this.manifest.media[0];return[4,rr(this,uX,u2).call(this,m,h,{returnText:!0})];case 5:g=D.sent();if(v=g.url,g.baseUrl&&!rt(this,uH)&&rn(this,uH,g.baseUrl),g.text){b=g.text;if(!(b.includes("postToParentWindows")||b.includes("window.CES"))){y="<script>"+uj+"<\/script>",w=b.indexOf("<head>");w!==-1?b=b.slice(0,w+6)+y+b.slice(w+6):b=y+b}q=new Blob([b],{type:"text/html"});rn(this,uG,URL.createObjectURL(q))}return[3,8];case 6:k=this.data||"manifest.json",x=k.includes("/")?k.substring(0,k.lastIndexOf("/")):"",_=x?"".concat(x,"/index.html"):"index.html";return[4,rr(this,uX,u2).call(this,_,h,{returnText:!0})];case 7:C=D.sent();if(v=C.url,C.baseUrl&&!rt(this,uH)&&rn(this,uH,C.baseUrl),C.text){E=C.text;if(!(E.includes("postToParentWindows")||E.includes("window.CES"))){S="<script>"+uj+"<\/script>",A=E.indexOf("<head>");A!==-1?E=E.slice(0,A+6)+S+E.slice(A+6):E=S+E}R=new Blob([E],{type:"text/html"});rn(this,uG,URL.createObjectURL(R))}D.label=8;case 8:if(!(v&&!rt(this,uG)))return[3,15];D.label=9;case 9:D.trys.push([9,14,,15]);return[4,fetch(v)];case 10:I=D.sent();if(!I.ok)return[3,12];return[4,I.text()];case 11:M=D.sent();if(!(M.includes("postToParentWindows")||M.includes("window.CES"))){T="<script>"+uj+"<\/script>",P=M.indexOf("<head>");P!==-1?M=M.slice(0,P+6)+T+M.slice(P+6):M=T+M}O=new Blob([M],{type:"text/html"});rn(this,uG,URL.createObjectURL(O));return[3,13];case 12:console.error("Failed to fetch index.html: ".concat(I.status));D.label=13;case 13:return[3,15];case 14:L=D.sent();console.error("Error fetching index.html: ".concat(L));return[3,15];case 15:U="<script>".concat(uW,"<\/script>");window.addEventListener("message",this.handlePostMessage);N="\n <!DOCTYPE html>\n <html>\n <head>\n ".concat(f?"<link href='".concat(f,'\' rel="stylesheet" />'):"","\n ").concat(U,"\n </head>\n <body></body>\n </html>\n ");l.srcdoc=N;return[2]}})}).call(this)}},{key:"handlePostMessage",value:function t(t){var e=this;var n=t.data,i=n.type,o=n.data;switch(i){case"setResponse":(o===null||!(Array.isArray(o)&&o.length===1&&o[0]===""))&&(rn(this,uF,o),this.saveResponse(o));break;case"getResponse":{rr(this,uX,uK).call(this,"responseData",rt(this,uF));break}case"getBlobUrl":{rt(this,uG)&&(rr(this,uX,uK).call(this,"blobUrl",rt(this,uG)),t.source&&t.source!==window&&t.source.postMessage({type:"blobUrl",data:rt(this,uG)},"*"));break}case"getMedia":{var a=rr(this,uX,uZ).call(this),s=this.manifest.media.map(function(t){if(t.startsWith("http")||t.startsWith("blob"))return t;var n=rt(e,uH)||a[0];return n?new URL(t,n.endsWith("/")?n:"".concat(n,"/")).toString():t});rr(this,uX,uK).call(this,"mediaData",s);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function t(){if(!rt(this,uF))return!1;if(Array.isArray(rt(this,uF))){if(rt(this,uF).length===0)return!1;var t=true,e=false,n=undefined;try{for(var i=rt(this,uF)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;if(a!==""&&a!==null)return!0}}catch(t){e=true;n=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw n}}}}return!0}},{key:"response",get:function t(){return rt(this,uF)||null},set:function t(t){if(typeof t=="string")rn(this,uF,t),this.saveResponse(t);else if(Array.isArray(t))rn(this,uF,t);else if(t)throw new Error("Value must be a string or an array of strings")}},{key:"disconnectedCallback",value:function t(){window.removeEventListener("message",this.handlePostMessage),p(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function t(){return iw(ex(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&iw(ek(),this._errorMessage))}}]);return e}(oS);uF=new WeakMap,uQ=new WeakMap,uH=new WeakMap,uG=new WeakMap,uX=new WeakSet,uJ=function t(){var t=this.shadowRoot.querySelectorAll("iframe"),e=this.querySelectorAll("iframe"),n=L(t).concat(L(e));var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.src;if(new URL(c,window.location.href).origin===window.location.origin)try{var d=u.contentDocument||u.contentWindow.document;d&&rr(this,uX,uY).call(this,d,n)}catch(t){console.error("Error accessing nested iframe:",t)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return n.forEach(function(t,e){n.indexOf(t)!==e&&n.splice(e,1)}),n},uY=function(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 i=t.src;if(new URL(i,window.location.href).origin===window.location.origin)try{var o=t.contentDocument||t.contentWindow.document;rr(e,uX,uY).call(e,o,n)}catch(t){console.error("Error accessing nested iframe:",t)}else console.warn("Skipped cross-origin iframe:",i)}),n},uK=function t(t,e){window.postMessage({type:t,data:e},"*");var n=rr(this,uX,uJ).call(this);var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;u.contentWindow&&u.contentWindow.postMessage({type:t,data:e},"*")}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}},uZ=function t(){var t=[rt(this,uH),this.baseRefUrl,this.baseItemUrl,rr(this,uX,u0).call(this)].filter(Boolean).map(function(t){return new URL(t,window.location.href).toString()}),e=rr(this,uX,u1).call(this);return e&&t.push(e),L(new Set(t))},u0=function t(){return rt(this,uQ)?new URL(".",rt(this,uQ)).toString():null},u1=function t(){return rt(this,uQ)?new URL("..",rt(this,uQ)).toString():null},u2=function t(t,e){return a(function(t,e){var n,i,o,a,s,l,u,c,d,h,p,f,v;var m=arguments;return z(this,function(g){switch(g.label){case 0:n=m.length>2&&m[2]!==void 0?m[2]:{};if(!t)return[2,{url:"",baseUrl:null}];if(t.startsWith("http")||t.startsWith("blob"))return[2,{url:t,baseUrl:null}];i=true,o=false,a=undefined;g.label=1;case 1:g.trys.push([1,11,12,13]);s=e[Symbol.iterator]();g.label=2;case 2:if(!!(i=(l=s.next()).done))return[3,10];u=l.value;c=new URL(u,window.location.href).toString(),d=new URL(t,c.endsWith("/")?c:"".concat(c,"/")).toString();g.label=3;case 3:g.trys.push([3,8,,9]);return[4,fetch(d)];case 4:h=g.sent();if(!h.ok)return[3,7];if(!n.returnText)return[3,6];return[4,h.text()];case 5:p=g.sent();return[2,{url:d,baseUrl:c,text:p}];case 6:return[2,{url:d,baseUrl:c}];case 7:return[3,9];case 8:f=g.sent();return[3,9];case 9:i=true;return[3,2];case 10:return[3,13];case 11:v=g.sent();o=true;a=v;return[3,13];case 12:try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}return[7];case 13:return[2,{url:"",baseUrl:null}]}})}).apply(this,arguments)},n7([n({type:String,attribute:"data"})],u3.prototype,"data",2),n7([n({type:String,attribute:"data-base-item"})],u3.prototype,"baseItemUrl",2),n7([n({type:String,attribute:"data-base-ref"})],u3.prototype,"baseRefUrl",2),n7([n({type:String,attribute:"id"})],u3.prototype,"id",2),n7([i()],u3.prototype,"_errorMessage",2);customElements.define("qti-custom-interaction",u3);var u5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.disabled=!1;t.countAttempt=null;t.title="end attempt";return t}d(e,[{key:"render",value:function t(){return iw(e_(),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}(i$);n7([n({type:String,attribute:"response-identifier"})],u5.prototype,"responseIdentifier",2),n7([n({reflect:!0,type:Boolean})],u5.prototype,"disabled",2),n7([n({type:String,attribute:"count-attempt"})],u5.prototype,"countAttempt",2),n7([n({type:String})],u5.prototype,"title",2);customElements.define("qti-end-attempt-interaction",u5);var u4=rj(eC());var u6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t._rows=5;t.response=null;t._handleResponseChange=function(){t._internals.setFormValue(t.value),t.validate()};return t}d(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;var i=e.split(" "),o=!1;if(i.forEach(function(t){if(t.startsWith("qti-height-lines-")){var e=t.replace("qti-height-lines-","");n._rows=parseInt(e),o=!0}}),!o&&this.expectedLength){var a=Math.ceil(this.expectedLength/50);this._rows=a}}},{key:"value",get:function t(){return this.response||null},set:function t(t){this.response=t||null}},{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 i=t.checkValidity();this._internals.setValidity(i?{}:{customError:!1})}return!!this.response&&t.checkValidity()}},{key:"toggleCorrectResponse",value:function t(){}},{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 iw(eE(),this.responseIdentifier,5e3,function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,function(e){t.reportValidity()},ad(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this.response)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;this.setEmptyAttribute(e.value),this.response!==e.value&&(this.value=e.value,this.saveResponse(e.value))}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(oS);u6.styles=u4,n7([i()],u6.prototype,"_rows",2),n7([n({type:Number,attribute:"expected-length"})],u6.prototype,"expectedLength",2),n7([n({type:String,attribute:"pattern-mask"})],u6.prototype,"patternMask",2),n7([n({type:String,attribute:"placeholder-text"})],u6.prototype,"placeholderText",2),n7([n({type:String,attribute:"data-patternmask-message"})],u6.prototype,"dataPatternmaskMessage",2),n7([n({type:String,attribute:"class"})],u6.prototype,"classNames",2),n7([V("classNames")],u6.prototype,"handleclassNamesChange",1),n7([i()],u6.prototype,"response",2),n7([V("response",{waitUntilFirstUpdate:!0})],u6.prototype,"_handleResponseChange",2);customElements.define("qti-extended-text-interaction",u6);var u8=rj(eS());var u7,u9,ct=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,u7);return t}d(e,[{key:"render",value:function t(){return iw(eA())}},{key:"toggleCorrectResponse",value:function t(t){var e=this;var n=this.responseVariable;if(t&&(n===null||n===void 0?void 0:n.correctResponse)){var i=[],o=Array.isArray(n.correctResponse)?n.correctResponse:[n.correctResponse];o&&(i=o.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-gap").forEach(function(t){var n,o,a;var s=t.getAttribute("identifier"),l=(n=i.find(function(t){return t.gap===s}))===null||n===void 0?void 0:n.text,u=(o=e.querySelector('qti-gap-text[identifier="'.concat(l,'"]')))===null||o===void 0?void 0:o.textContent.trim();if(l&&u){var c;if(!((c=t.nextElementSibling)===null||c===void 0?void 0:c.classList.contains("correct-option"))){var d=document.createElement("span");d.classList.add("correct-option"),d.textContent=u,d.style.border="1px solid var(--qti-correct)",d.style.borderRadius="4px",d.style.padding="2px 4px",d.style.display="inline-block",t.insertAdjacentElement("afterend",d)}}else((a=t.nextElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}},{key:"toggleCandidateCorrection",value:function t(t){var e=this.responseVariable;if(!(e===null||e===void 0?void 0:e.correctResponse))return;var n=rr(this,u7,u9).call(this,e);Array.from(this.querySelectorAll("qti-gap")).forEach(function(e){var i=e.getAttribute("identifier"),o=n.filter(function(t){return t.target===i});e.querySelectorAll("qti-gap-text").forEach(function(e){var n;if(e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),!t)return;((n=o.find(function(t){return t.source===e.identifier}))===null||n===void 0?void 0:n.source)!==void 0?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect")})})}}]);return e}(uO(oS,"qti-gap-text","qti-gap","slot[part='drags']"));u7=new WeakSet,u9=function t(t){if(!t.correctResponse)return[];var e=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse],n=[];return e&&e.forEach(function(t){var e=t.split(" ");n.push({source:e[0],target:e[1]})}),n},ct.styles=u8;customElements.define("qti-gap-match-interaction",ct);var ce=function t(t,e,n){var i=new Map;for(var o=e;o<=n;o++)i.set(t[o],o);return i},cn=oo(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){l(this,e);var n;if(n=s(this,e,[t]),t.type!==oi.CHILD)throw Error("repeat() can only be used in text expressions");return n}d(e,[{key:"dt",value:function t(t,e,n){var i;n===void 0?n=e:e!==void 0&&(i=e);var o=[],a=[],s=0;var l=true,u=false,c=undefined;try{for(var d=t[Symbol.iterator](),h;!(l=(h=d.next()).done);l=true){var p=h.value;o[s]=i?i(p,s):s,a[s]=n(p,s),s++}}catch(t){u=true;c=t}finally{try{if(!l&&d.return!=null){d.return()}}finally{if(u){throw c}}}return{values:a,keys:o}}},{key:"render",value:function t(t,e,n){return this.dt(t,e,n).values}},{key:"update",value:function t(t,e){var n=M(e,3),i=n[0],o=n[1],a=n[2];var s;var l=ov(t),u=this.dt(i,o,a),c=u.values,d=u.keys;if(!Array.isArray(l))return this.ut=d,c;var h=(s=this.ut)!==null&&s!==void 0?s:this.ut=[],p=[],f,v,m=0,g=l.length-1,b=0,y=c.length-1;for(;m<=g&&b<=y;)if(l[m]===null)m++;else if(l[g]===null)g--;else if(h[m]===d[b])p[b]=oh(l[m],c[b]),m++,b++;else if(h[g]===d[y])p[y]=oh(l[g],c[y]),g--,y--;else if(h[m]===d[y])p[y]=oh(l[m],c[y]),od(t,p[y+1],l[m]),m++,y--;else if(h[g]===d[b])p[b]=oh(l[g],c[b]),od(t,l[m],l[g]),g--,b++;else if(f===void 0&&(f=ce(d,b,y),v=ce(h,m,g)),f.has(h[m]))if(f.has(h[g])){var w=v.get(d[b]),q=w!==void 0?l[w]:null;if(q===null){var k=od(t,l[m]);oh(k,c[b]),p[b]=k}else p[b]=oh(q,c[b]),od(t,l[m],q),l[w]=null;b++}else om(l[g]),g--;else om(l[m]),m++;for(;b<=y;){var x=od(t,p[y+1]);oh(x,c[b]),p[b++]=x}for(;m<=g;){var _=l[m++];_!==null&&om(_)}return this.ut=d,of(t,p),ix}}]);return e}(oa));var cr=rj(eR());var ci,co,ca,cs,cl,cu,cc,cd=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,cs);re(t,ci);re(t,co,null);re(t,ca,null);t._correctLines=[];t._response=[];t.addEventListener("qti-register-hotspot",rr(t,cs,cc));return t}d(e,[{key:"reset",value:function t(){this._response=[],this._correctLines=[]}},{key:"validate",value:function t(){return rr(this,cs,cu).call(this).length>0}},{key:"response",get:function t(){return this._response},set:function t(t){this._response=rr(this,cs,cl).call(this,t)}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.responseVariable;if(!t||!e){this._correctLines=[];return}if(!e.correctResponse){console.error("No correct response found for this interaction.");return}var n=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];this._correctLines=n}},{key:"render",value:function t(){var t=this;var e,n,i,o;return iw(eP(),ad((e=this.grImage[0])===null||e===void 0?void 0:e.width),ad((n=this.grImage[0])===null||n===void 0?void 0:n.height),(i=this.grImage[0])===null||i===void 0?void 0:i.width,(o=this.grImage[0])===null||o===void 0?void 0:o.height,cn(rr(this,cs,cu).call(this),function(t){return t},function(e,n){return iq(eI(),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.top),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.top),function(e){e.stopPropagation(),t._response=t._response.filter(function(t,e){return e!==n}),t.saveResponse(t.response)})}),cn(this._correctLines||[],function(t){return t},function(e,n){return iq(eM(),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.top),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.top))}),rt(this,co)&&iq(eT(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"firstUpdated",value:function t(){var t=this;rn(this,ci,this.querySelectorAll("qti-associable-hotspot")),this.addEventListener("mousemove",function(e){var n=t.grImage[0];if(!n)return;var i=n.getBoundingClientRect();t.mouseCoord={x:e.clientX-i.left,y:e.clientY-i.top}}),rt(this,ci).forEach(function(e){e.style.left=e.getAttribute("coords").split(",")[0]+"px",e.style.top=e.getAttribute("coords").split(",")[1]+"px",e.addEventListener("click",function(e){rt(t,co)?rt(t,ca)||(rn(t,ca,e.target),t._response=rr(t,cs,cu).call(t),t._response=L(t._response).concat(["".concat(rt(t,co).getAttribute("identifier")," ").concat(rt(t,ca).getAttribute("identifier"))]),t.saveResponse(t.response),rn(t,co,null),rn(t,ca,null)):(rn(t,co,e.target),t.startCoord={x:parseInt(rt(t,co).getAttribute("coords").split(",")[0]),y:parseInt(rt(t,co).getAttribute("coords").split(",")[1])})})})}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",rr(this,cs,cc))}}]);return e}(oS);ci=new WeakMap,co=new WeakMap,ca=new WeakMap,cs=new WeakSet,cl=function t(t){return t==null||t===""?[]:Array.isArray(t)?t:[t]},cu=function t(){return rr(this,cs,cl).call(this,this._response)},cc=function t(t){var e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});nV(o,a,e,n)},cd.styles=cr,n7([i()],cd.prototype,"_correctLines",2),n7([i()],cd.prototype,"startCoord",2),n7([i()],cd.prototype,"mouseCoord",2),n7([u({selector:"img"})],cd.prototype,"grImage",2),n7([i()],cd.prototype,"_response",2);customElements.define("qti-graphic-associate-interaction",cd);var ch=rj(eO());var cp,cf,cv=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,cp);return t}d(e,[{key:"render",value:function t(){return iw(eL())}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",rr(this,cp,cf))}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",rr(this,cp,cf))}}]);return e}(uO(oS,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part='drags']"));cp=new WeakSet,cf=function t(t){var e=t.target,n=e.getAttribute("coords"),i=e.getAttribute("shape"),o=n.split(",").map(function(t){return parseInt(t)});switch(i){case"circle":{var a=M(o,3),s=a[0],l=a[1],u=a[2];e.style.left=s-u+"px",e.style.top=l-u+"px",e.style.width=e.style.height=2*u+"px"}break;case"rect":{var c=M(o,4),d=c[0],h=c[1],p=c[2],f=c[3];e.style.left=d+"px",e.style.top=h+"px",e.style.width=p-d+"px",e.style.height=f-h+"px"}break;default:break}},cv.styles=ch;customElements.define("qti-graphic-gap-match-interaction",cv);var cm=rj(eU());var cg,cb,cy,cw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,cg);t._choiceElements=[];return t}d(e,[{key:"render",value:function t(){return iw(eN())}},{key:"toggleCorrectResponse",value:function t(t){var e;var n=this.responseVariable,i=this._choiceElements;var o=true,a=false,s=undefined;try{var l=function(){var i=c.value;if(t&&(n===null||n===void 0?void 0:(e=n.correctResponse)===null||e===void 0?void 0:e.length)>0&&Array.isArray(n.correctResponse)){var o=n.correctResponse.findIndex(function(t){return t===i.identifier});o>=0?i.orderCorrect=o+1:i.orderCorrect=null}else i.orderCorrect=null};for(var u=i[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",rr(this,cg,cb)),this.addEventListener("register-qti-hotspot-choice",rr(this,cg,cy))}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",rr(this,cg,cb)),this.removeEventListener("register-qti-hotspot-choice",rr(this,cg,cy))}}]);return e}(uN(oS,"qti-hotspot-choice"));cg=new WeakSet,cb=function t(t){var e=t.detail,n=e.identifier,i=this._choiceElements.find(function(t){return t.getAttribute("identifier")===n});if(!i)return;var o=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,i.order==null){var a=this._choiceElements.filter(function(t){return t.order!=null}).length;if(a>=o){this.choiceOrdering=!1;return}i.order=a+1}else{var s=i.order;i.order=null,this._choiceElements.forEach(function(t){t.order!=null&&t.order>s&&t.order--})}this.choiceOrdering=!1}},cy=function t(t){var e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});nV(o,a,e,n)},cw.styles=cm;customElements.define("qti-graphic-order-interaction",cw);var cq=rj(eD());var ck,cx,c_,cC,cE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,cx);re(t,ck,null);return t}d(e,[{key:"render",value:function t(){return iw(eV())}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",rr(this,cx,cC))}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",rr(this,cx,cC))}}]);return e}(uN(oS,"qti-hotspot-choice"));ck=new WeakMap,cx=new WeakSet,c_=function t(t){return rt(this,ck)||(t.naturalWidth>0&&t.naturalHeight>0?rn(this,ck,Promise.resolve(t)):rn(this,ck,new Promise(function(e){var n=function i(){t.removeEventListener("load",n),e(t)};t.addEventListener("load",n)}))),rt(this,ck)},cC=function t(t){return a(function(){var e,n,i,o,a,s;return z(this,function(l){switch(l.label){case 0:e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});return[4,rr(this,cx,c_).call(this,e)];case 1:s=l.sent();nV(o,a,s,n);return[2]}})}).call(this)},cE.styles=cq;customElements.define("qti-hotspot-interaction",cE);var cS,cA,cR,cI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,cS);t.class="";t.render=function(){return iw(ez())};return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),rr(this,cS,cR).call(this)}},{key:"updated",value:function t(t){p(f(e.prototype),"updated",this).call(this,t),rr(this,cS,cR).call(this)}}]);return e}(uN(oS,"qti-hottext"));cS=new WeakSet,cA=function t(){var t={"qti-input-control-hidden":!0};return this.class&&this.class.split(" ").forEach(function(e){e.trim()&&(t[e.trim()]=!0)}),t},cR=function t(){var t=Object.keys(rt(this,cS,cA)).join(" ");this.className=t},n7([n({type:String,reflect:!0})],cI.prototype,"class",2);customElements.define("qti-hottext-interaction",cI);var cM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){l(this,e);var n;if(n=s(this,e,[t]),n.it=i_,t.type!==oi.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}d(e,[{key:"render",value:function t(t){if(t===i_||t==null)return this._t=void 0,this.it=t;if(t===ix)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}(oa);cM.directiveName="unsafeHTML",cM.resultType=1;var cT=oo(cM);var cP=rj(e$()),cO=cP;var cL=0,cU,cN,cD,cV,cz,c$,cB,cj,cW,cF,cQ,cH,cG,cX,cJ,cY,cK,cZ,c0,c1,c2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,cU);t.options=[];t.correctOption="";t._dropdownOpen=!1;t._slotObserver=null;t._menuId="qti-inline-choice-menu-".concat(cL++);re(t,cB,function(e){(t.disabled||t.readonly)&&e.preventDefault()});re(t,cj,function(e){t.disabled||t.readonly||(e.key==="ArrowDown"||e.key==="Enter"||e.key===" ")&&(e.preventDefault(),rr(t,cU,c$).call(t,!0))});re(t,cW,function(e){var n=e.newState==="open";t._dropdownOpen!==n&&(t._dropdownOpen=n)});re(t,cF,function(e){var n,i;if(!t._dropdownOpen)return;if(e.key==="Escape"){e.preventDefault(),rr(t,cU,c$).call(t,!1),rr(t,cU,cQ).call(t);return}var o=rr(t,cU,c1).call(t),a=t.renderRoot.activeElement,s=rr(t,cU,cH).call(t),l=a||(m(s,HTMLElement)&&rr(t,cU,cG).call(t,s)?s:null),u=o.findIndex(function(t){return t===l});if(e.key==="ArrowDown"&&(e.preventDefault(),(n=o[Math.min(o.length-1,Math.max(0,u+1))])===null||n===void 0?void 0:n.focus()),e.key==="ArrowUp"&&(e.preventDefault(),(i=o[Math.max(0,u-1)])===null||i===void 0?void 0:i.focus()),e.key==="Enter"||e.key===" "){if(!l)return;if(e.preventDefault(),m(l,HTMLButtonElement))l.click();else{var c;var d=(c=l.getAttribute("identifier"))!==null&&c!==void 0?c:"";rr(t,cU,cz).call(t,d)}}});re(t,cY,function(){rr(t,cU,cD).call(t)});re(t,cK,function(e){var n;if(t.disabled||t.readonly)return;var i=(n=e.currentTarget.getAttribute("identifier"))!==null&&n!==void 0?n:"";rr(t,cU,cz).call(t,i)});t.internals.role="listbox";return t}d(e,[{key:"isInline",get:function t(){return!0}},{key:"render",value:function t(){var t=this;var e,n;var i,o,a;var s=rr(this,cU,cN).call(this);return iw(eB(),rt(this,cB),rt(this,cj),this._dropdownOpen?"true":"false",this._menuId,this._menuId,this.disabled,this.readonly?"true":"false",cT((e=s===null||s===void 0?void 0:s.textContent)!==null&&e!==void 0?e:""),this._dropdownOpen?"dropdown-icon dropdown-icon-open":"dropdown-icon",this._menuId,rt(this,cW),rt(this,cF),((i=this.options[0])===null||i===void 0?void 0:i.selected)?"option option-prompt option-selected":"option option-prompt",((o=this.options[0])===null||o===void 0?void 0:o.selected)?"true":"false",function(){return rr(t,cU,cz).call(t,"")},cT((n=(a=this.options[0])===null||a===void 0?void 0:a.textContent)!==null&&n!==void 0?n:""),rt(this,cY),cT(this.correctOption))}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){switch(t.label){case 0:i().call(n),rr(this,cU,cD).call(this),rr(this,cU,cJ).call(this);return[4,this.updateComplete];case 1:t.sent(),rr(this,cU,cV).call(this);return[2]}})}).call(this)}},{key:"disconnectedCallback",value:function t(){var t;p(f(e.prototype),"disconnectedCallback",this).call(this),rr(this,cU,cZ).call(this),(t=this._slotObserver)===null||t===void 0?void 0:t.disconnect(),this._slotObserver=null}},{key:"willUpdate",value:function t(t){t.has("configContext")&&rr(this,cU,cD).call(this)}},{key:"updated",value:function t(t){var e;t.has("_dropdownOpen")&&this._dropdownOpen&&(rr(this,cU,c0).call(this),(e=rr(this,cU,c1).call(this)[0])===null||e===void 0?void 0:e.focus()),(t.has("disabled")||t.has("readonly"))&&rr(this,cU,c0).call(this)}},{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(){rr(this,cU,c$).call(this,!1),this.options=this.options.map(function(t,e){return _(k({},t),{selected:e===0})}),rr(this,cU,c0).call(this)}},{key:"response",get:function t(){var t;var e;var n=(t=(e=this.options.find(function(t){return t.selected}))===null||e===void 0?void 0:e.value)!==null&&t!==void 0?t:"";return n===""?null:n},set:function t(t){var e=t!==null&&t!==void 0?t:"";this.options=this.options.map(function(t){return _(k({},t),{selected:t.value===e})}),rr(this,cU,c0).call(this)}},{key:"toggleInternalCorrectResponse",value:function t(t){p(f(e.prototype),"toggleInternalCorrectResponse",this).call(this,t);var n=this.correctResponse;if(!t||!n){this.correctOption="";return}var i=this.options.find(function(t){return n===t.value});if(!i){this.correctOption="";return}this.correctOption='<span part="correct-option" style="border:1px solid var(--qti-correct); border-radius:4px; padding: 2px 4px; margin: 4px; display:inline-block">'.concat(i.textContent,"</span>")}}],[{key:"styles",get:function t(){return[cO]}}]);return e}(oS);cU=new WeakSet,cN=function t(){var t;return(t=this.options.find(function(t){return t.selected}))!==null&&t!==void 0?t:this.options[0]},cD=function t(){var t;var e,n;var i=Array.from(this.querySelectorAll("qti-inline-choice")),o=this.dataset.prompt||((e=this.configContext)===null||e===void 0?void 0:e.inlineChoicePrompt)||"select",a=(t=(n=this.options.find(function(t){return t.selected}))===null||n===void 0?void 0:n.value)!==null&&t!==void 0?t:"",s=[{textContent:o,value:"",selected:a===""}].concat(L(i.map(function(t){var e;var n=(e=t.getAttribute("identifier"))!==null&&e!==void 0?e:"";return{textContent:t.innerHTML,value:n,selected:n!==""&&n===a}}))),l=s.some(function(t){return t.selected});this.options=l?s:s.map(function(t,e){return _(k({},t),{selected:e===0})}),rr(this,cU,c0).call(this),rr(this,cU,cV).call(this)},cV=function t(){var t=rr(this,cU,cX).call(this),e=this.renderRoot.querySelector('button[part="trigger"]');if(!t||!e)return;var n=e.querySelector('span[part~="dropdown-icon"]'),i=n?n.getBoundingClientRect().width:0,o=t.matches(":popover-open"),a=t.style.visibility,s=t.style.display;o||(t.style.visibility="hidden",t.style.display="block",t.showPopover());var l=t.getBoundingClientRect().width,u=Math.max(l,t.scrollWidth);o||(t.hidePopover(),t.style.visibility=a,t.style.display=s),e.style.width="".concat(u+i,"px")},cz=function t(t){this.options=this.options.map(function(e){return _(k({},e),{selected:e.value===t})}),rr(this,cU,c0).call(this),this.saveResponse(t),rr(this,cU,c$).call(this,!1)},c$=function t(t){var e=rr(this,cU,cX).call(this);if(e){if(t){e.matches(":popover-open")||e.showPopover();return}e.matches(":popover-open")&&e.hidePopover()}},cB=new WeakMap,cj=new WeakMap,cW=new WeakMap,cF=new WeakMap,cQ=function t(){var t;(t=this.renderRoot.querySelector('button[part="trigger"]'))===null||t===void 0?void 0:t.focus()},cH=function t(){var t;var e=document.activeElement;for(;e&&m(e,HTMLElement)&&((t=e.shadowRoot)===null||t===void 0?void 0:t.activeElement);)e=e.shadowRoot.activeElement;return e},cG=function t(t){return t===this||this.contains(t)||this.renderRoot.contains(t)},cX=function t(){return this.renderRoot.querySelector("#".concat(this._menuId))},cJ=function t(){var t=this;this._slotObserver=new MutationObserver(function(){return rr(t,cU,cD).call(t)}),this._slotObserver.observe(this,{childList:!0,subtree:!0})},cY=new WeakMap,cK=new WeakMap,cZ=function t(){var t=Array.from(this.querySelectorAll("qti-inline-choice"));var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.removeEventListener("click",rt(this,cK)),s.removeAttribute("tabindex"),s.internals.role=null,s.internals.ariaSelected=null,s.internals.ariaChecked="false",s.internals.states.delete("--checked")}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}},c0=function t(){return a(function(){var t,e,n,i,o,a,s,l,u,c,d,h;return z(this,function(p){switch(p.label){case 0:return[4,this.updateComplete];case 1:p.sent();n=(t=(e=this.options.find(function(t){return t.selected}))===null||e===void 0?void 0:e.value)!==null&&t!==void 0?t:"",i=Array.from(this.querySelectorAll("qti-inline-choice"));o=true,a=false,s=undefined;try{for(l=i[Symbol.iterator]();!(o=(u=l.next()).done);o=true){c=u.value;h=((d=c.getAttribute("identifier"))!==null&&d!==void 0?d:"")===n;c.removeEventListener("click",rt(this,cK)),c.addEventListener("click",rt(this,cK)),c.disabled=this.disabled,c.readonly=this.readonly,c.internals.role="option",c.internals.ariaSelected=h?"true":"false",c.internals.ariaChecked=h?"true":"false",c.internals.ariaDisabled=this.disabled?"true":"false",c.internals.ariaReadOnly=this.readonly?"true":"false",c.removeAttribute("aria-disabled"),c.removeAttribute("aria-readonly"),h?c.internals.states.add("--checked"):c.internals.states.delete("--checked"),c.tabIndex=-1}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return[2]}})}).call(this)},c1=function t(){var t=this.renderRoot.querySelector('button[part~="option"]'),e=Array.from(this.querySelectorAll("qti-inline-choice"));return L(t?[t]:[]).concat(L(e))},n7([i()],c2.prototype,"options",2),n7([i()],c2.prototype,"correctOption",2),n7([i()],c2.prototype,"_dropdownOpen",2),n7([P({context:i6,subscribe:!0}),n({attribute:!1})],c2.prototype,"configContext",2);customElements.define("qti-inline-choice-interaction",c2);var c3=rj(ej());var c5,c4,c6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,c5);t.lastCheckedRadio=null;t.class="";t._response=[];t.responseIdentifier="";t.correctOptions=null;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,i=n.value,o=n.name,a=n.type;n.checked?(t.response?t.response.indexOf(i)===-1&&(a==="radio"&&(t.response=(t.response||[]).filter(function(t){return t.indexOf(o)===-1})),t.response=L(t.response).concat([i])):t.response=[i],t.lastCheckedRadio=n):(t.response=(t.response||[]).filter(function(t){return t!==i}),t.lastCheckedRadio=null),t.requestUpdate(),t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t.responseIdentifier,response:Array.isArray(t.response)?L(t.response):t.response}}))};return t}d(e,[{key:"response",get:function t(){return this.classList.contains("qti-match-tabular")?this._response:p(f(e.prototype),"response",this)},set:function t(t){this.classList.contains("qti-match-tabular")?this._response=t:R(f(e.prototype),"response",t,this,true)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"connectedCallback",t)};return a(function(){return z(this,function(t){i().call(n),this.sourceChoices=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.targetChoices=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[];return[2]})}).call(this)}},{key:"validate",value:function t(){var t;return this.class.split(" ").includes("qti-match-tabular")?((t=this.response)===null||t===void 0?void 0:t.length)===this.sourceChoices.length:p(f(e.prototype),"validate",this).call(this)}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this;var n=this.responseVariable;if(!(n===null||n===void 0?void 0:n.correctResponse)){this.querySelectorAll(".correct-option").forEach(function(t){return t.remove()});return}var i=rr(this,c5,c4).call(this,n);this.class.split(" ").includes("qti-match-tabular")?t?this.correctOptions=i||[]:this.correctOptions=null:t?(this.querySelectorAll(".correct-option").forEach(function(t){return t.remove()}),this.targetChoices.forEach(function(t){var n=t.getAttribute("identifier"),o=i.find(function(t){return t.target===n});if(o===null||o===void 0?void 0:o.source){var a,s,l;var u=(s=e.querySelector('qti-simple-associable-choice[identifier="'.concat(o.source,'"]')))===null||s===void 0?void 0:(a=s.textContent)===null||a===void 0?void 0:a.trim();if(u&&!((l=t.previousElementSibling)===null||l===void 0?void 0:l.classList.contains("correct-option"))){var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=u,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",t.insertAdjacentElement("beforebegin",c)}}})):this.correctOptions=null}},{key:"toggleCandidateCorrection",value:function t(t){var e=this.responseVariable;if(!(e===null||e===void 0?void 0:e.correctResponse))return;var n=rr(this,c5,c4).call(this,e);this.targetChoices.forEach(function(e){var i=e.getAttribute("identifier"),o=n.filter(function(t){return t.target===i});e.querySelectorAll("qti-simple-associable-choice").forEach(function(e){var n;if(e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),!t)return;((n=o.find(function(t){return t.source===e.identifier}))===null||n===void 0?void 0:n.source)!==void 0?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect")})})}},{key:"render",value:function t(){var t=this;var e=this.class.split(" ").includes("qti-match-tabular"),n=this.correctOptions!==null;return iw(eX(),e,e?iw(eG(),this.targetChoices.map(function(t){return iw(eW(),cT(t.innerHTML))}),this.sourceChoices.map(function(e){return iw(eH(),cT(e.innerHTML),t.targetChoices.map(function(i){var o,a,s;var l=e.getAttribute("identifier"),u=i.getAttribute("identifier"),c="".concat(l," ").concat(u),d=(t.response||[]).filter(function(t){return t.split(" ")[0]===l}).length||0,h=((o=t.response)===null||o===void 0?void 0:o.includes(c))||!1,p=e.matchMax===1?"radio":"checkbox",f=!!((a=t.correctOptions)===null||a===void 0?void 0:a.find(function(t){return t.source===l&&t.target===u})),v=p==="radio"?"rb ".concat(h?"rb-checked":""," ").concat(n?f?"rb-correct":"rb-incorrect":""):"cb ".concat(h?"cb-checked":""," ").concat(n?f?"cb-correct":"cb-incorrect":""),m=((s=t.correctOptions)===null||s===void 0?void 0:s.length)>0?!0:e.matchMax===1?!1:e.matchMax!==0&&d>=e.matchMax&&!h;return iw(eQ(),p,v,l,c,m,function(e){return t.handleRadioChange(e)},function(n){return e.matchMax===1?t.handleRadioClick(n):null},p==="checkbox"&&h?iw(eF()):"")}))})):i_)}}]);return e}(uO(oS,"qti-simple-match-set:first-of-type qti-simple-associable-choice, qti-simple-match-set:last-of-type > qti-simple-associable-choice > qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice","qti-simple-match-set:first-of-type"));c5=new WeakSet,c4=function t(t){if(!t.correctResponse)return[];var e=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse],n=[];return e&&e.forEach(function(t){var e=t.split(" ");n.push({source:e[0],target:e[1]})}),n},c6.styles=c3,n7([n({type:String})],c6.prototype,"class",2),n7([i()],c6.prototype,"_response",2),n7([n({type:String,attribute:"response-identifier"})],c6.prototype,"responseIdentifier",2),n7([i()],c6.prototype,"correctOptions",2);customElements.define("qti-match-interaction",c6);var c8,c7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,c8,null);return t}d(e,[{key:"reset",value:function t(){rn(this,c8,null)}},{key:"validate",value:function t(){return!0}},{key:"response",get:function t(){return rt(this,c8)?rt(this,c8).toString():null},set:function t(t){if(t)if(!isNaN(parseInt(t===null||t===void 0?void 0:t.toString())))rn(this,c8,parseInt(t.toString()));else throw new Error("Value must be a number ".concat(t))}},{key:"render",value:function t(){return iw(eJ())}},{key:"connectedCallback",value:function t(){var t=this;p(f(e.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){ri(t,c8)._++,t.saveResponse(t.value)})}}],[{key:"properties",get:function t(){return _(k({},oS.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return e}(oS);c8=new WeakMap,c7.styles=[rj(eY())];customElements.define("qti-media-interaction",c7);var c9=rj(eK());var dt=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.nrChoices=0;t.correctResponses=[];t.showCorrectResponses=!1;return t}d(e,[{key:"render",value:function t(){var t=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<t.length&&(this.nrChoices=t.length),iw(e0(),L(Array(this.nrChoices)).map(function(t,e){return iw(eZ(),e)}))}},{key:"toggleCorrectResponse",value:function t(t){var e=this;var n=this.responseVariable;if(this.shadowRoot.querySelectorAll(".correct-option").forEach(function(t){return t.remove()}),t&&(n===null||n===void 0?void 0:n.correctResponse)){var i=(Array.isArray(n.correctResponse)?n.correctResponse:[n.correctResponse]).map(function(t){return t.split(" ")[0]}),o=new Set;this.querySelectorAll("qti-simple-choice").forEach(function(t,n){var a;var s=t.getAttribute("identifier");if(!s||!i.includes(s)||o.has(s))return;o.add(s);var l=(a=t.textContent)===null||a===void 0?void 0:a.trim();if(!l)return;var u=e.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(n,'"]'));if(!u)return;var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=l,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",c.style.marginTop="4px",u.insertAdjacentElement("afterend",c)})}}},{key:"getValue",value:function t(t){return(t===null||t===void 0?void 0:t.map(function(t,e){return"".concat(t," droplist").concat(e)}))||[]}},{key:"getResponse",value:function t(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]');return L(Array.from(e).map(function(t){return t.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function t(){var t=this;var n=this,i=function n(){return p(f(e.prototype),"firstUpdated",t)};return a(function(){return z(this,function(t){i().call(n),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(function(t){return t.setAttribute("part","qti-simple-choice")});return[2]})}).call(this)}}]);return e}(uO(oS,"qti-simple-choice","drop-list","slot[part='drags']"));dt.styles=c9,n7([i()],dt.prototype,"nrChoices",2),n7([i()],dt.prototype,"correctResponses",2),n7([i()],dt.prototype,"showCorrectResponses",2),n7([n({type:String})],dt.prototype,"orientation",2);customElements.define("qti-order-interaction",dt);var de=rj(e1());var dn,dr,di,da,ds,dl,du,dc,dd,dh,dp,df,dv,dm,dg,db,dy,dw,dq,dk,dx=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,da);re(t,dn);t._iframeLoaded=!1;t._pendingMessages=[];t._iframeMessageOrigin=null;t._iframeObjectUrl=null;t.requirePathsJson="";t.requireShimJson="";t.requireJsUrl="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js";t.baseUrl="";t.useDefaultShims=!1;t.useDefaultPaths=!1;t._errorMessage=null;t.response=null;re(t,dr,null);re(t,di,null);t.handleIframeMessage=function(e){var n;var i=e.data;if(!(!i||i.source!=="qti-pci-iframe")&&!(!((n=t.iframe)===null||n===void 0?void 0:n.contentWindow)||e.source!==t.iframe.contentWindow)&&!(i.responseIdentifier&&i.responseIdentifier!==t.responseIdentifier)){if(t._iframeMessageOrigin===null)t._iframeMessageOrigin=e.origin;else if(e.origin!==t._iframeMessageOrigin)return;switch(i.method){case"iframeReady":rr(t,da,dq).call(t),rr(t,da,dg).call(t),t.dispatchEvent(new CustomEvent("qti-portable-custom-interaction-loaded",{bubbles:!0}));break;case"resize":typeof i.height=="number"&&t.iframe&&(t.iframe.style.height="".concat(i.height,"px"),t.iframe.style.width="".concat(i.width,"px"));break;case"console":t.dispatchEvent(new CustomEvent("qti-pci-console",{detail:{level:i.level,args:i.args},bubbles:!0}));break;case"interactionChanged":{var o,a;var s=i===null||i===void 0?void 0:(o=i.params)===null||o===void 0?void 0:o.value,l=s&&(typeof s==="undefined"?"undefined":U(s))=="object"?rr(t,da,dp).call(t,s):null,u=i===null||i===void 0?void 0:(a=i.params)===null||a===void 0?void 0:a.state,c;if(u===void 0)c=void 0;else if(u===null)c=null;else if(typeof u=="string")c=u;else try{c="__qti_json__::".concat(JSON.stringify(u))}catch(t){c=null}if(l===null){var d;var h=((d=t.responseVariable)===null||d===void 0?void 0:d.cardinality)==="single"?"":[];t.response=h,t.validate(),t.saveResponse(h,c);break}t.response=l,t.validate(),t.saveResponse(l,c);break}case"error":t._errorMessage=i.params.message,console.error("Error from PCI iframe:",i.params.message);break}}};re(t,dk,null);return t}d(e,[{key:"getDirectChildrenByTag",value:function t(t){var e=t.toLowerCase();return Array.from(this.children).filter(function(t){return t.tagName.toLowerCase()===e})}},{key:"coerceBaseValue",value:function t(t,e){if(t==null)return t;switch(e){case"integer":{if(typeof t=="number")return t;var n=parseInt(String(t),10);return Number.isNaN(n)?t:n}case"float":case"duration":{if(typeof t=="number")return t;var i=parseFloat(String(t));return Number.isNaN(i)?t:i}case"boolean":{if(typeof t=="boolean")return t;if(typeof t=="string"){var o=t.toLowerCase();if(o==="true")return!0;if(o==="false")return!1}return t}default:return String(t)}}},{key:"normalizeListValue",value:function t(t){return t==null?[]:Array.isArray(t)?t:[t]}},{key:"variableToQtiVariableJSON",value:function t(t,e,n){var i=this;if(e==="record"||n==="record")return this.recordToQtiVariableJSON(t);if(e!=="single"){var o=this.normalizeListValue(t).map(function(t){return i.coerceBaseValue(t,n)});return{list:h({},n,o)}}return{base:h({},n,this.coerceBaseValue(t,n))}}},{key:"recordToQtiVariableJSON",value:function t(t){if(!t||(typeof t==="undefined"?"undefined":U(t))!="object")return{record:[]};var e=[];var n=true,i=false,o=undefined;try{for(var a=Object.entries(t)[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=M(s.value,2),u=l[0],c=l[1];e.push(this.recordEntryFromValue(u,c))}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return{record:e}}},{key:"recordEntryFromValue",value:function t(t,e){if(Array.isArray(e)){var n=e.filter(function(t){return t!=null});if(n.length&&n.every(function(t){return typeof t=="boolean"}))return{name:t,list:{boolean:n}};if(n.length&&n.every(function(t){return typeof t=="number"})){var i=n,o=i.every(function(t){return Number.isInteger(t)});return{name:t,list:h({},o?"integer":"float",i)}}return{name:t,list:{string:e.map(function(t){return t==null?"":String(t)})}}}if(typeof e=="boolean")return{name:t,base:{boolean:e}};if(typeof e=="number")return Number.isInteger(e)?{name:t,base:{integer:e}}:{name:t,base:{float:e}};if(e==null)return{name:t,base:{string:""}};if((typeof e==="undefined"?"undefined":U(e))=="object")try{return{name:t,base:{string:JSON.stringify(e)}}}catch(n){return{name:t,base:{string:String(e)}}}return{name:t,base:{string:String(e)}}}},{key:"getQtiContextDefaultsFromItem",value:function t(){var t=this;var e=this.closest("qti-assessment-item");if(!e)return{};var n={};return e.querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(function(e){var i=e.querySelector("qti-default-value");if(!i)return;i.querySelectorAll("qti-value[field-identifier]").forEach(function(e){var i;var o=e.getAttribute("field-identifier");if(!o)return;var a=e.getAttribute("base-type")||"string",s=((i=e.textContent)===null||i===void 0?void 0:i.trim())||"";n[o]=t.coerceBaseValue(s,a)})}),n}},{key:"getQtiContextRecord",value:function t(){var t,e,n;var i;var o=this.getQtiContextDefaultsFromItem(),a=((i=this.qtiContext)===null||i===void 0?void 0:i.QTI_CONTEXT)||{},s=k({},o,a);if(!Object.keys(s).length)return null;var l=k({candidateIdentifier:(t=s.candidateIdentifier)!==null&&t!==void 0?t:"",testIdentifier:(e=s.testIdentifier)!==null&&e!==void 0?e:"",environmentIdentifier:(n=s.environmentIdentifier)!==null&&n!==void 0?n:""},s);return this.recordToQtiVariableJSON(l)}},{key:"getTemplateVariables",value:function t(){var t=this;var e={},n=this.getDirectChildrenByTag("qti-template-variable");return n.length&&n.forEach(function(n){var i,o;var a=n.getAttribute("template-identifier")||n.getAttribute("identifier")||"";if(!a)return;var s=(o=t.context)===null||o===void 0?void 0:(i=o.variables)===null||i===void 0?void 0:i.find(function(t){return t.identifier===a});if(!s)return;var l=s.cardinality||"single",u=s.baseType||"string";e[a]=t.variableToQtiVariableJSON(s.value,l,u)}),e}},{key:"getContextVariables",value:function t(){var t=this;var e={},n=this.getDirectChildrenByTag("qti-context-variable");return n.length&&n.forEach(function(n){var i,o;var a=n.getAttribute("identifier")||"";if(!a)return;if(a==="QTI_CONTEXT"){var s=t.getQtiContextRecord();s&&(e[a]=s);return}var l=(o=t.context)===null||o===void 0?void 0:(i=o.variables)===null||i===void 0?void 0:i.find(function(t){return t.identifier===a});if(!l)return;var u=l.cardinality||"single",c=l.baseType||"string";e[a]=t.variableToQtiVariableJSON(l.value,u,c)}),e}},{key:"responseVariablesToQtiVariableJSON",value:function t(t,e,n){if(e!=="single"){var i={list:{}};return i.list[n]=t,i}else{var o={base:{}};return o.base[n]=t,o}}},{key:"validate",value:function t(){return this.response===null||this.response===void 0?!1:Array.isArray(this.response)?this.response.length===0?!1:this.response.some(function(t){return t!==""&&t!==null&&t!==void 0}):this.response!==""}},{key:"value",get:function t(){return rt(this,dn)===null||rt(this,dn)===void 0?null:Array.isArray(rt(this,dn))?rt(this,dn).join(","):String(rt(this,dn))},set:function t(t){t===null?rn(this,dn,[]):rn(this,dn,Array.isArray(t)?t:t.split(","))}},{key:"boundTo",get:function t(){var t=this;var e,n;var i={};if((n=this.context)===null||n===void 0?void 0:(e=n.variables)===null||e===void 0?void 0:e.find(function(e){return e.identifier===t.responseIdentifier})){var o,a,s,l,u,c,d,h,p;var f=((s=this.context)===null||s===void 0?void 0:(a=s.variables)===null||a===void 0?void 0:(o=a.find(function(e){return e.identifier===t.responseIdentifier}))===null||o===void 0?void 0:o.cardinality)||"single",v=((c=this.context)===null||c===void 0?void 0:(u=c.variables)===null||u===void 0?void 0:(l=u.find(function(e){return e.identifier===t.responseIdentifier}))===null||l===void 0?void 0:l.baseType)||"string",m=((p=this.context)===null||p===void 0?void 0:(h=p.variables)===null||h===void 0?void 0:(d=h.find(function(e){return e.identifier===t.responseIdentifier}))===null||d===void 0?void 0:d.value)||null,g=this.responseVariablesToQtiVariableJSON(m,f,v);i[this.responseIdentifier]=g}return i},set:function t(t){if(!t||!t[this.responseIdentifier])return;var e=rr(this,da,dp).call(this,t[this.responseIdentifier]);rn(this,dn,e),this.saveResponse(e)}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("message",this.handleIframeMessage),this._iframeObjectUrl&&(URL.revokeObjectURL(this._iframeObjectUrl),this._iframeObjectUrl=null)}},{key:"sendMessageToIframe",value:function t(t,e){var n;var i=(n=this.iframe)===null||n===void 0?void 0:n.contentWindow;if(!this._iframeLoaded||!i){this._pendingMessages.push({method:t,params:e});return}i.postMessage({source:"qti-portable-custom-interaction",responseIdentifier:this.responseIdentifier,method:t,params:e},"*")}},{key:"createIframe",value:function t(){var t=this;this._iframeObjectUrl&&(URL.revokeObjectURL(this._iframeObjectUrl),this._iframeObjectUrl=null),this.iframe=document.createElement("iframe"),this.iframe.id="pci-iframe-".concat(this.responseIdentifier),this.iframe.setAttribute("title","QTI PCI Iframe"),this.iframe.setAttribute("aria-label","QTI PCI Iframe"),this.iframe.setAttribute("aria-hidden","false"),this.iframe.setAttribute("role","application"),this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.display="block",this.iframe.onload=function(){t._iframeLoaded=!0,t._iframeObjectUrl&&(URL.revokeObjectURL(t._iframeObjectUrl),t._iframeObjectUrl=null),rr(t,da,dw).call(t),rr(t,da,db).call(t)};var e="qti-pci-".concat(this.responseIdentifier,"-").concat(Date.now());this.iframe.name=e;var n=this.generateIframeContent();try{var i=new Blob([n],{type:"text/html"});this._iframeObjectUrl=URL.createObjectURL(i),this.iframe.src=this._iframeObjectUrl}catch(t){var o=encodeURIComponent(n);this.iframe.src="data:text/html;charset=utf-8,".concat(o)}this.appendChild(this.iframe)}},{key:"connectedCallback",value:function t(){var t;var n;p(f(e.prototype),"connectedCallback",this).call(this),this.response=(t=(n=this.responseVariable)===null||n===void 0?void 0:n.value)!==null&&t!==void 0?t:null,window.addEventListener("message",this.handleIframeMessage),this.createIframe()}},{key:"generateIframeContent",value:function t(){var t=window.getComputedStyle(document.body),e=JSON.stringify(rr(this,da,dd).call(this)),n=JSON.stringify(rr(this,da,dh).call(this)),i=this.dataset.baseUrl?this.dataset.baseUrl.startsWith("/")?"".concat(window.location.origin).concat(this.dataset.baseUrl):this.dataset.baseUrl:"",o=this.dataset.forwardConsole==="true",a="\n font-family: ".concat(t.getPropertyValue("font-family"),";\n font-size: ").concat(t.getPropertyValue("font-size"),";\n line-height: ").concat(t.getPropertyValue("line-height"),";\n font-weight: ").concat(t.getPropertyValue("font-weight"),";\n color: ").concat(t.getPropertyValue("color"),";\n ");return'<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8" />\n <title>QTI PCI Container</title>\n <base href="'.concat(window.location.origin,'" />\n <script type="module">\n import \'https://unpkg.com/@citolab/qti-components/cdn\';\n <\/script>\n <style>\n body, html {\n margin: 0;\n padding: 0;\n width: 100%;\n height: auto;\n overflow: hidden;\n /* Add the extracted font styles here */\n ').concat(a,'\n };\n .qti-customInteraction {\n width: 100%;\n height: 100%;\n }\n #pci-container {\n width: 100%;\n }\n qti-interaction-markup {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n </style>\n <link href="https://unpkg.com/@citolab/qti-components@latest/dist/item.css" rel="stylesheet" />\n <script src="').concat(this.requireJsUrl,'"><\/script>\n <script>\n const forwardConsole = ').concat(o?"true":"false",";\n if (forwardConsole) {\n const originalLog = console.log.bind(console);\n const originalError = console.error.bind(console);\n const stringifyArgs = args =>\n args.map(arg => {\n if (typeof arg === 'string') return arg;\n try {\n return JSON.stringify(arg);\n } catch (e) {\n return String(arg);\n }\n });\n console.log = (...args) => {\n originalLog(...args);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'console',\n level: 'log',\n args: stringifyArgs(args)\n },\n '*'\n );\n };\n console.error = (...args) => {\n originalError(...args);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'console',\n level: 'error',\n args: stringifyArgs(args)\n },\n '*'\n );\n };\n }\n // Define standard paths and shims\n window.requirePaths = ").concat(e,";\n\n window.requireShim = ").concat(n,";\n\n // Single initial RequireJS configuration with error handling\n window.requirejs.config({\n catchError: true,\n waitSeconds: 30,\n paths: window.requirePaths,\n baseUrl: '").concat(i,"',\n shim: window.requireShim,\n onNodeCreated: function (node, config, moduleName, url) {\n // Add error handler to script node\n node.addEventListener('error', function (evt) {\n console.error('Script load error for module:', moduleName, 'URL:', url, 'Event:', evt);\n });\n },\n onError: function (err) {\n console.error('RequireJS error:', {\n type: err.requireType,\n modules: err.requireModules,\n error: err\n });\n\n if (err.requireType === 'scripterror') {\n console.error('Script error usually indicates a network or CORS issue with:', err.requireModules);\n }\n\n // Notify parent window about the error\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'error',\n params: {\n message: 'RequireJS ' + err.requireType + ' error for modules: ' + err.requireModules,\n details: {\n type: err.requireType,\n modules: err.requireModules,\n error: err.toString()\n }\n }\n },\n '*'\n );\n }\n });\n\n // PCI Manager for iframe implementation\n window.PCIManager = {\n pciInstance: null,\n container: null,\n markupEl: null,\n propertiesEl: null,\n customInteractionTypeIdentifier: null,\n responseIdentifier: null,\n pendingBoundTo: null,\n pendingMarkup: null,\n pendingProperties: null,\n pendingState: null,\n pendingStylesheets: null,\n stylesheetKeys: {},\n interactionChangedViaEvent: false,\n eventBridgeAttached: false,\n lastResponseStr: null,\n hadResponse: false,\n\n initialize: function (config) {\n this.customInteractionTypeIdentifier = config.customInteractionTypeIdentifier;\n this.responseIdentifier = config.responseIdentifier;\n this.container = document.getElementById('pci-container');\n this.container.classList.add('qti-customInteraction');\n\n function qtiVariableHasValue(qtiVar) {\n if (!qtiVar) return false;\n if (qtiVar.base) {\n for (const k in qtiVar.base) {\n if (!Object.prototype.hasOwnProperty.call(qtiVar.base, k)) continue;\n const v = qtiVar.base[k];\n if (v !== null && v !== undefined && v !== '') return true;\n }\n }\n if (qtiVar.list) {\n for (const k in qtiVar.list) {\n if (!Object.prototype.hasOwnProperty.call(qtiVar.list, k)) continue;\n const v = qtiVar.list[k];\n if (Array.isArray(v) && v.some(x => x !== null && x !== undefined && x !== '')) return true;\n }\n }\n if (Array.isArray(qtiVar.record) && qtiVar.record.length > 0) return true;\n return false;\n }\n\n const initialBoundTo = config.boundTo && config.boundTo[this.responseIdentifier];\n this.hadResponse = qtiVariableHasValue(initialBoundTo);\n this.lastResponseStr = this.hadResponse ? JSON.stringify(initialBoundTo) : null;\n // Ensure expected DOM structure exists (markup + properties)\n this.markupEl = this.container.querySelector('qti-interaction-markup');\n if (!this.markupEl) {\n this.markupEl = document.createElement('qti-interaction-markup');\n this.container.appendChild(this.markupEl);\n }\n this.markupEl.classList.add('qti-customInteraction');\n this.propertiesEl = this.container.querySelector('properties');\n if (!this.propertiesEl) {\n this.propertiesEl = document.createElement('properties');\n this.propertiesEl.style.display = 'none';\n this.container.appendChild(this.propertiesEl);\n } else {\n this.propertiesEl.style.display = 'none';\n }\n\n // Apply any markup/properties that arrived before initialization\n if (this.pendingMarkup !== null) {\n this.setMarkup(this.pendingMarkup);\n this.pendingMarkup = null;\n }\n if (this.pendingProperties !== null) {\n this.setProperties(this.pendingProperties);\n this.pendingProperties = null;\n }\n if (this.pendingStylesheets !== null) {\n this.setStylesheets(this.pendingStylesheets);\n this.pendingStylesheets = null;\n }\n\n // Bridge qti-interaction-changed events (preferred over polling)\n if (!this.eventBridgeAttached) {\n this.eventBridgeAttached = true;\n const self = this;\n this.container.addEventListener(\n 'qti-interaction-changed',\n function (evt) {\n try {\n self.interactionChangedViaEvent = true;\n const value = evt && evt.detail ? evt.detail.value : undefined;\n if (value !== undefined) {\n const state =\n self.pciInstance && typeof self.pciInstance.getState === 'function'\n ? self.pciInstance.getState()\n : null;\n self.notifyInteractionChanged(value, state);\n }\n } catch (e) {\n // ignore bridge errors, polling fallback may still work\n }\n },\n true\n );\n }\n\n function getResolvablePath(path, basePath) {\n if (Array.isArray(path)) {\n return path.map(p => getResolvablePathString(p, basePath));\n } else {\n return getResolvablePathString(path, basePath);\n }\n }\n\n function removeDoubleSlashes(str) {\n return str\n .replace(/([^:\\/])\\/\\/+/g, '$1/')\n .replace(/\\/\\//g, '/')\n .replace('http:/', 'http://')\n .replace('https:/', 'https://');\n }\n\n\n\n function combineRequireResolvePaths(path1, path2, baseUrl) {\n path1 = getResolvablePath(path1, baseUrl);\n const path1Array = Array.isArray(path1) ? path1 : [path1];\n if (!path2) {\n return path1Array;\n }\n path2 = getResolvablePath(path2, baseUrl);\n const path2Array = Array.isArray(path2) ? path2 : [path2];\n return path1Array.concat(path2Array).filter((value, index, self) => self.indexOf(value) === index);\n }\n\n // Update paths with modules from the config\n if (config.interactionModules && config.interactionModules.length > 0) {\n config.interactionModules.forEach(module => {\n if (module.id && module.primaryPath) {\n const currentPath = window.requirePaths[module.id] || [];\n const currentPaths = Array.isArray(currentPath) ? currentPath : [currentPath];\n const newPath = combineRequireResolvePaths(\n module.primaryPath,\n module.fallbackPath,\n config.baseUrl\n );\n window.requirePaths[module.id] = currentPaths\n .concat(newPath)\n .filter((value, index, self) => self.indexOf(value) === index);\n }\n });\n }\n\n // The ONLY other requirejs.config call - with the context for this specific PCI\n window.requirejs.config({\n context: this.customInteractionTypeIdentifier,\n paths: window.requirePaths,\n shim: window.requireShim\n });\n\n // Define qtiCustomInteractionContext for the PCI\n define('qtiCustomInteractionContext', () => {\n return {\n register: pciInstance => {\n this.pciInstance = pciInstance;\n // Configure PCI instance\n const pciConfig = {\n properties: config.properties || {},\n contextVariables: config.contextVariables || {},\n templateVariables: config.templateVariables || {},\n onready: pciInstance => {\n this.pciInstance = pciInstance;\n // Apply any pending updates that arrived before onready\n if (this.pendingBoundTo) {\n this.applyBoundTo(this.pendingBoundTo);\n this.pendingBoundTo = null;\n }\n if (this.pendingState && typeof this.pciInstance.setState === 'function') {\n this.pciInstance.setState(this.pendingState);\n this.pendingState = null;\n }\n this.notifyReady();\n },\n ondone: (pciInstance, response, state, status) => {\n this.notifyInteractionChanged(response, typeof state === 'string' ? state : null);\n },\n responseIdentifier: config.responseIdentifier,\n boundTo: config.boundTo\n };\n\n if (pciInstance.getInstance) {\n const dom = this.markupEl || this.container;\n // Round-trip support for object states (stored as a prefixed JSON string by the host).\n // For strict string-based PCIs we pass the original string through unchanged.\n let restoredState = config.state;\n if (typeof restoredState === 'string' && restoredState.indexOf('__qti_json__::') === 0) {\n try {\n restoredState = JSON.parse(restoredState.substring('__qti_json__::'.length));\n } catch (e) {\n // If parsing fails, fall back to the raw string.\n restoredState = config.state;\n }\n }\n pciInstance.getInstance(dom, pciConfig, restoredState || undefined);\n } else {\n // TAO custom interaction initialization\n const restoreTAOConfig = dataset => {\n const config = {};\n const parseDataAttributes = () => {\n const result = {};\n\n // Separate direct attributes from nested ones\n Object.entries(dataset || {}).forEach(([key, value]) => {\n if (!key.includes('__')) {\n // Direct attributes (like version)\n result[key] = value;\n }\n });\n\n // Parse nested attributes\n const nestedData = {};\n\n Object.entries(dataset || {}).forEach(([key, value]) => {\n const parts = key.split('__');\n if (parts.length > 1) {\n const [group, index, prop] = parts;\n nestedData[group] = nestedData[group] || {};\n nestedData[group][index] = nestedData[group][index] || {};\n nestedData[group][index][prop] = value;\n }\n });\n\n // Convert nested groups to arrays\n Object.entries(nestedData).forEach(([key, group]) => {\n result[key] = Object.values(group);\n });\n return result;\n };\n const data = parseDataAttributes();\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n const value = data[key];\n if (key === 'config') {\n config[key] = JSON.parse(value);\n } else {\n config[key] = value;\n }\n }\n }\n return config;\n };\n const taoConfig = restoreTAOConfig(config.dataAttributes);\n\n this.pciInstance.initialize(\n this.customInteractionTypeIdentifier,\n (this.markupEl || this.container).firstElementChild || this.markupEl || this.container,\n Object.keys(taoConfig).length ? taoConfig : null\n );\n }\n },\n notifyReady: () => {\n PCIManager.notifyReady();\n }\n };\n });\n\n function getResolvablePathString(path, basePath) {\n path = path.replace(/\\.js$/, '');\n return path?.toLocaleLowerCase().startsWith('http') || !basePath\n ? path\n : removeDoubleSlashes(`${basePath}/${path}`);\n }\n\n // Load the PCI module\n this.loadModule(config.module);\n },\n\n loadModule: function (modulePath) {\n try {\n // Get the context-specific require\n const contextRequire = window.requirejs.config({\n context: this.customInteractionTypeIdentifier\n });\n contextRequire(['require'], require => {\n // Now load the actual module\n require([modulePath], () => {}, err => {\n console.error('Error loading module:', modulePath, err);\n this.notifyError('Module load error: ' + err.toString());\n });\n });\n } catch (error) {\n console.error('Exception in loadModule:', modulePath);\n console.error(error);\n this.notifyError('Error in require call: ' + error.toString());\n }\n },\n\n notifyReady: function () {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'iframeReady'\n },\n '*'\n );\n },\n\n notifyInteractionChanged: function (response, state) {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'interactionChanged',\n params: { value: response, state: state }\n },\n '*'\n );\n },\n\n notifyError: function (message) {\n console.error('PCI Error:', message);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'error',\n params: { message: message }\n },\n '*'\n );\n },\n\n setMarkup: function (markupHtml) {\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n if (!this.container) {\n this.pendingMarkup = markupHtml;\n return;\n }\n this.markupEl = this.container.querySelector('qti-interaction-markup');\n if (!this.markupEl) {\n this.markupEl = document.createElement('qti-interaction-markup');\n this.container.appendChild(this.markupEl);\n }\n this.markupEl.classList.add('qti-customInteraction');\n this.markupEl.innerHTML = markupHtml || '';\n },\n\n setProperties: function (propertiesHtml) {\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n if (!this.container) {\n this.pendingProperties = propertiesHtml;\n return;\n }\n this.propertiesEl = this.container.querySelector('properties');\n if (!this.propertiesEl) {\n this.propertiesEl = document.createElement('properties');\n this.container.appendChild(this.propertiesEl);\n }\n this.propertiesEl.style.display = 'none';\n this.propertiesEl.innerHTML = propertiesHtml || '';\n },\n\n minifyCss: function (cssContent) {\n return cssContent\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n .replace(/\\s+/g, ' ')\n .replace(/\\s*([{}:;])\\s*/g, '$1')\n .trim();\n },\n\n setStylesheets: function (stylesheetsHtml) {\n if (!stylesheetsHtml) return;\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n const target = this.container || document.body;\n if (!target) return;\n target.insertAdjacentHTML('afterbegin', stylesheetsHtml);\n },\n\n\n applyBoundTo: function (boundTo) {\n if (!this.pciInstance || typeof this.pciInstance.setResponse !== 'function') return;\n const value = boundTo && (boundTo[this.responseIdentifier] || boundTo[Object.keys(boundTo)[0]]);\n if (value) this.pciInstance.setResponse(value);\n }\n };\n\n // Set up message listener for communication with parent\n let expectedParentOrigin = null;\n window.addEventListener('message', function (event) {\n const { data } = event;\n\n // Ensure the message is from our parent\n if (event.source !== window.parent || !data || data.source !== 'qti-portable-custom-interaction') {\n return;\n }\n if (expectedParentOrigin === null) {\n expectedParentOrigin = event.origin;\n } else if (event.origin !== expectedParentOrigin) {\n return;\n }\n\n function deepQuerySelector(root, selector) {\n if (!root) return null;\n try {\n const direct = root.querySelector ? root.querySelector(selector) : null;\n if (direct) return direct;\n } catch (e) {\n // ignore invalid selector for this root\n }\n if (!root.querySelectorAll) return null;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n const found = deepQuerySelector(node.shadowRoot, selector);\n if (found) return found;\n }\n }\n return null;\n }\n\n function deepFindElementByExactText(root, text) {\n if (!root || !text) return null;\n if (root.querySelectorAll) {\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if ((node.textContent || '').trim() === text) return node;\n if (node.shadowRoot) {\n const found = deepFindElementByExactText(node.shadowRoot, text);\n if (found) return found;\n }\n }\n }\n return null;\n }\n\n switch (data.method) {\n case 'initialize':\n PCIManager.initialize(data.params);\n break;\n\n case 'setMarkup':\n PCIManager.setMarkup(data.params);\n break;\n\n case 'setBoundTo':\n if (PCIManager.pciInstance) {\n PCIManager.applyBoundTo(data.params);\n } else {\n PCIManager.pendingBoundTo = data.params;\n }\n break;\n\n case 'setProperties':\n PCIManager.setProperties(data.params);\n break;\n\n case 'setStylesheets':\n PCIManager.setStylesheets(data.params);\n break;\n\n case 'setState':\n if (PCIManager.pciInstance && typeof PCIManager.pciInstance.setState === 'function') {\n PCIManager.pciInstance.setState((data.params && data.params.state) || data.params);\n } else {\n PCIManager.pendingState = (data.params && data.params.state) || data.params;\n }\n break;\n\n case 'getContent': {\n const messageId = data.params && data.params.messageId;\n const collectShadowHtml = root => {\n const parts = [];\n if (!root || !root.querySelectorAll) return parts;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n parts.push(node.shadowRoot.innerHTML || '');\n parts.push(...collectShadowHtml(node.shadowRoot));\n }\n }\n return parts;\n };\n const shadowHtml = collectShadowHtml(document).join('\\n');\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'getContentResponse',\n messageId: messageId,\n content: (document.documentElement ? document.documentElement.outerHTML : '') + '\\n' + shadowHtml\n },\n '*'\n );\n break;\n }\n\n case 'simulateClick': {\n const messageId = data.params && data.params.messageId;\n const x = data.params && data.params.x;\n const y = data.params && data.params.y;\n const el = typeof x === 'number' && typeof y === 'number' ? document.elementFromPoint(x, y) : null;\n const target = (el && el.closest && el.closest('.hitbox')) || document.querySelector('.hitbox') || el;\n if (target) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n clientX: x,\n clientY: y,\n screenX: x,\n screenY: y,\n view: window\n });\n target.dispatchEvent(evt);\n }\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickResponse',\n messageId: messageId\n },\n '*'\n );\n break;\n }\n\n case 'getBoundingRect': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const el = selector ? deepQuerySelector(document, selector) : null;\n const rect = el && typeof el.getBoundingClientRect === 'function' ? el.getBoundingClientRect() : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'getBoundingRectResponse',\n messageId: messageId,\n rect: rect\n ? {\n left: rect.left,\n top: rect.top,\n width: rect.width,\n height: rect.height\n }\n : null\n },\n '*'\n );\n break;\n }\n\n case 'clickOnSelector': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const el = selector ? deepQuerySelector(document, selector) : null;\n const success = !!el;\n if (el && typeof el.click === 'function') el.click();\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickSelectorResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'clickOnElementByText': {\n const messageId = data.params && data.params.messageId;\n const text = data.params && data.params.text;\n const target = text ? deepFindElementByExactText(document, text) : null;\n const success = !!target;\n if (target && typeof target.click === 'function') target.click();\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickTextResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'setValueElement': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const value = data.params && data.params.value;\n const el = selector ? deepQuerySelector(document, selector) : null;\n let success = false;\n if (el && 'value' in el) {\n try {\n el.value = value;\n el.dispatchEvent(new Event('input', { bubbles: true }));\n el.dispatchEvent(new Event('change', { bubbles: true }));\n success = true;\n } catch (e) {\n success = false;\n }\n }\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'console':\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'console',\n level: data.level,\n args: data.args\n },\n '*'\n );\n break;\n }\n });\n\n let resizeTimeout;\n let previousHeight = 0;\n const notifyResize = () => {\n const container = document.getElementById('pci-container');\n const newHeight = container.scrollHeight + 100;\n if (newHeight !== previousHeight) {\n previousHeight = newHeight;\n clearTimeout(resizeTimeout);\n resizeTimeout = setTimeout(() => {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'resize',\n height: newHeight,\n width: container.scrollWidth\n },\n '*'\n );\n }, 100); // Adjust debounce time as needed\n }\n };\n\n function setupResizeObserver() {\n const container = document.getElementById('pci-container');\n if (!container || !(container instanceof Element)) {\n console.warn('ResizeObserver: document.container is not an Element');\n return;\n }\n\n const resizeObserver = new ResizeObserver(() => {\n notifyResize();\n });\n\n resizeObserver.observe(container);\n }\n\n // Run setup once DOM is ready\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n notifyResize(); // initial resize\n setupResizeObserver();\n });\n } else {\n notifyResize();\n setupResizeObserver();\n }\n\n window.addEventListener('load', () => {\n notifyResize();\n });\n let lastResponseStr = '';\n setInterval(() => {\n if (PCIManager.interactionChangedViaEvent) return;\n if (PCIManager.pciInstance && PCIManager.pciInstance.getResponse) {\n const response = PCIManager.pciInstance.getResponse();\n if (response === undefined) {\n // Don't emit an initial empty on load; only emit a clear if we previously had a value\n if (!PCIManager.hadResponse) return;\n PCIManager.hadResponse = false;\n PCIManager.lastResponseStr = null;\n const state =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.getState === 'function'\n ? PCIManager.pciInstance.getState()\n : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'interactionChanged',\n params: { value: null, state: state }\n },\n '*'\n );\n return;\n }\n\n const responseStr = JSON.stringify(response);\n\n if (responseStr !== PCIManager.lastResponseStr) {\n PCIManager.lastResponseStr = responseStr;\n PCIManager.hadResponse = true;\n const state =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.getState === 'function'\n ? PCIManager.pciInstance.getState()\n : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'interactionChanged',\n params: { value: response, state: state }\n },\n '*'\n );\n }\n }\n }, 500); // Check every 500ms\n <\/script>\n </head>\n <body>\n <div id=\"pci-container\"></div>\n </body>\n </html>")}},{key:"toggleInternalCorrectResponse",value:function t(t){var e;var n=this.responseVariable;this.correctResponse=t?n===null||n===void 0?void 0:n.correctResponse:n.cardinality==="single"?"":[];var i="correct-response-container-".concat(this.responseIdentifier),o=(e=this.parentElement)===null||e===void 0?void 0:e.querySelectorAll("#".concat(i));if(o&&o.forEach(function(t){t.remove()}),t)this.disable();else{this.enable();return}if(!t||!(n===null||n===void 0?void 0:n.correctResponse))return;var a=document.createElement("div");a.id=i,a.className="pci-correct-response-container",a.style.position="relative",a.style.marginTop="20px",a.style.border="2px solid green",a.style.padding="16px",a.style.borderRadius="4px",a.style.backgroundColor="rgba(0, 128, 0, 0.05)";var s=document.createElement("div");s.textContent="Correct Response:",s.style.fontWeight="bold",s.style.marginBottom="10px",s.style.color="green",a.appendChild(s);var l=document.createElement("qti-portable-custom-interaction");Array.from(this.attributes).forEach(function(t){t.name!=="id"&&t.name!=="response-identifier"&&l.setAttribute(t.name,t.value)});var u=this.responseIdentifier;l.responseIdentifier="".concat(u,"-correct"),Array.from(this.children).forEach(function(t){var e=t.cloneNode(!0);l.appendChild(e)});var c=n.correctResponse,d=l.connectedCallback;l.connectedCallback=function(){var t=this;d.call(this);var e=function e(){return t._iframeLoaded?(setTimeout(function(){var e=t.responseVariablesToQtiVariableJSON(c,n.cardinality,n.baseType);t.sendMessageToIframe("setBoundTo",h({},u,e)),t.sendMessageToIframe("setState",{state:"review"})},1e3),!0):!1};if(!e()){var i=setInterval(function(){e()&&clearInterval(i)},100);setTimeout(function(){clearInterval(i)},1e4)}},l.style.pointerEvents="none",a.appendChild(l),this.after(a)}},{key:"disable",value:function t(){if(rn(this,dk,{pointerEvents:this.style.pointerEvents,position:this.style.position}),this.sendMessageToIframe("setState",{state:"disabled"}),!this.querySelector(".pci-interaction-overlay")){var t=document.createElement("div");t.className="pci-interaction-overlay",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.backgroundColor="rgba(200, 200, 200, 0.3)",t.style.zIndex="100",t.style.pointerEvents="all",t.style.cursor="not-allowed",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.appendChild(t)}}},{key:"enable",value:function t(){var t=this.querySelector(".pci-interaction-overlay");t&&t.remove(),rt(this,dk)&&(rt(this,dk).pointerEvents&&(this.style.pointerEvents=rt(this,dk).pointerEvents),rt(this,dk).position&&(this.style.position=rt(this,dk).position),rn(this,dk,null)),this.sendMessageToIframe("setState",{state:"interacting"})}},{key:"render",value:function t(){return iw(e3(),this._errorMessage?iw(e2(),this._errorMessage):"")}}]);return e}(oS);dn=new WeakMap,dr=new WeakMap,di=new WeakMap,da=new WeakSet,ds=function t(){var t=this;if(rt(this,dr)===null&&this.requirePathsJson)try{var e=JSON.parse(this.requirePathsJson);Array.isArray(e)?(rn(this,dr,{}),e.forEach(function(e){e.name&&e.value&&(rt(t,dr)[e.name]=e.value)})):rn(this,dr,e)}catch(t){console.error("Error parsing require paths JSON:",t),this._errorMessage="Error parsing require paths JSON: ".concat(t.message),rn(this,dr,{})}return rt(this,dr)||{}},dl=function t(){if(rt(this,di)===null&&this.requireShimJson)try{rn(this,di,JSON.parse(this.requireShimJson))}catch(t){console.error("Error parsing require shim JSON:",t),this._errorMessage="Error parsing require shim JSON: ".concat(t.message),rn(this,di,{})}return rt(this,di)||{}},du=function t(){return{"taoQtiItem/portableLib/OAT/util/event":"/assets/pci-scripts/portableLib/OAT/util/event","taoQtiItem/portableLib/OAT/util/html":"/assets/pci-scripts/portableLib/OAT/util/html","taoQtiItem/portableLib/OAT/util/EventMgr":"/assets/pci-scripts/portableLib/OAT/util/EventMgr","taoQtiItem/portableLib/OAT/util/math":"/assets/pci-scripts/portableLib/OAT/util/math","taoQtiItem/portableLib/OAT/util/xml":"/assets/pci-scripts/portableLib/OAT/util/xml","taoQtiItem/portableLib/OAT/util/tooltip":"/assets/pci-scripts/portableLib/OAT/util/tooltip","taoQtiItem/portableLib/OAT/util/tpl":"/assets/pci-scripts/portableLib/OAT/util/tpl","taoQtiItem/portableLib/OAT/util/asset":"/assets/pci-scripts/portableLib/OAT/util/asset","taoQtiItem/portableLib/OAT/waitForMedia":"/assets/pci-scripts/portableLib/OAT/waitForMedia","taoQtiItem/portableLib/OAT/mediaPlayer":"/assets/pci-scripts/portableLib/OAT/mediaPlayer","taoQtiItem/portableLib/OAT/scale.raphael":"/assets/pci-scripts/portableLib/OAT/scale.raphael","taoQtiItem/portableLib/OAT/interact-rotate":"/assets/pci-scripts/portableLib/OAT/interact-rotate","taoQtiItem/portableLib/OAT/promise":"/assets/pci-scripts/portableLib/OAT/promise","taoQtiItem/portableLib/OAT/sts/common":"/assets/pci-scripts/portableLib/OAT/sts/common","taoQtiItem/portableLib/OAT/sts/transform-helper":"/assets/pci-scripts/portableLib/OAT/sts/transform-helper","taoQtiItem/portableLib/OAT/sts/stsEventManager":"/assets/pci-scripts/portableLib/OAT/sts/stsEventManager","taoQtiItem/portableLib/async":"/assets/pci-scripts/portableLib/async","taoQtiItem/portableLib/interact":"/assets/pci-scripts/portableLib/interact","taoQtiItem/portableLib/es6-promise":"/assets/pci-scripts/portableLib/es6-promise","taoQtiItem/portableLib/jquery_2_1_1":"/assets/pci-scripts/portableLib/jquery_2_1_1","taoQtiItem/portableLib/jquery.qtip":"/assets/pci-scripts/portableLib/jquery.qtip","taoQtiItem/portableLib/lodash":"/assets/pci-scripts/portableLib/lodash","taoQtiItem/portableLib/handlebars":"/assets/pci-scripts/portableLib/handlebars","taoQtiItem/portableLib/raphael":"/assets/pci-scripts/portableLib/raphael","taoQtiItem/pci-scripts/portableLib/jquery.qtip":"/assets/pci-scripts/portableLib/jquery.qtip","taoQtiItem/pci-scripts/portableLib/lodash":"/assets/pci-scripts/portableLib/lodash","taoQtiItem/pci-scripts/portableLib/raphael":"/assets/pci-scripts/portableLib/raphael","IMSGlobal/jquery_2_1_1":"/assets/pci-scripts/IMSGlobal/jquery_2_1_1","OAT/util/event":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/event","OAT/util/html":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/html","OAT/util/EventMgr":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/EventMgr","OAT/util/math":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/math","OAT/util/xml":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/xml","OAT/util/tooltip":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/tooltip","OAT/lodash":"/assets/pci-scripts/legacyPortableSharedLib/lodash",mathJax:"/assets/pci-scripts/mathjax/mathJax",css:"/assets/pci-scripts/css/css"}},dc=function t(){return{mathJax:{exports:"MathJax",init:function t(){var t=window;if(t.MathJax)return t.MathJax.Hub.Config({showMathMenu:!1,showMathMenuMSIE:!1,menuSettings:{inTabOrder:!1}}),t.MathJax.Hub.Startup.MenuZoom=function(){},t.MathJax.Hub.Startup.onload(),t.MathJax}}}},dd=function t(){var t=rr(this,da,du).call(this),e=rr(this,da,ds).call(this);return this.useDefaultPaths?k({},t,e):e},dh=function t(){var t=rr(this,da,dl).call(this),e=rr(this,da,dc).call(this);return this.useDefaultShims?k({},e,t):t},dp=function t(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n){for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];if(Array.isArray(o))return o.map(String);if(o!=null)return String(o)}}}return null},df=function t(t){var e=k({},t);for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var i=n.replace(/[A-Z]/g,function(t){return"-".concat(t.toLowerCase())});e[i]=t[n]}return e},dv=function t(t){return t&&t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/").replace(/&#x60;/g,"`").replace(/&#x3D;/g,"=")},dm=function t(t){var e={};var n=true,i=false,o=undefined;try{for(var a=Object.entries(t)[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=M(s.value,2),u=l[0],c=l[1];typeof c=="string"?e[u]=rr(this,da,dv).call(this,c):e[u]=c}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e},dg=function t(){var t=this;this._pendingMessages.length&&(this._pendingMessages.forEach(function(e){t.sendMessageToIframe(e.method,e.params)}),this._pendingMessages=[])},db=function t(){var t,e;var n=rr(this,da,df).call(this,rr(this,da,dm).call(this,k({},this.dataset))),i=(e=this.context)===null||e===void 0?void 0:(t=e.state)===null||t===void 0?void 0:t[this.responseIdentifier],o=typeof i=="string"&&i.length>0?i:null,a={module:this.module,customInteractionTypeIdentifier:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl?this.baseUrl.startsWith("http")||this.baseUrl.startsWith("blob")||this.baseUrl.startsWith("base64")?this.baseUrl:nD("".concat(window.location.origin).concat(this.baseUrl)):window.location.origin,responseIdentifier:this.responseIdentifier,properties:n,contextVariables:this.getContextVariables(),templateVariables:this.getTemplateVariables(),dataAttributes:k({},this.dataset),interactionModules:rr(this,da,dy).call(this),boundTo:o?null:this.boundTo,state:o};this.sendMessageToIframe("initialize",a)},dy=function t(){var t=[],e=this.querySelector("qti-interaction-modules");if(e){var n=e.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;t.push({id:u.getAttribute("id"),primaryPath:u.getAttribute("primary-path"),fallbackPath:u.getAttribute("fallback-path")})}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return t},dw=function t(){var t=this.querySelector("qti-interaction-markup");t&&this.sendMessageToIframe("setMarkup",t.innerHTML);var e=Array.from(this.querySelectorAll("qti-stylesheet"));if(e.length){var n=e.map(function(t){return t.outerHTML}).join("\n");this.sendMessageToIframe("setStylesheets",n)}var i=this.querySelector("properties");i&&this.sendMessageToIframe("setProperties",i.innerHTML)},dq=function t(){},dk=new WeakMap,dx.styles=[de,rj(e5())],n7([n({type:String,attribute:"module"})],dx.prototype,"module",2),n7([n({type:String,attribute:"custom-interaction-type-identifier"})],dx.prototype,"customInteractionTypeIdentifier",2),n7([n({type:String,attribute:"data-require-paths"})],dx.prototype,"requirePathsJson",2),n7([n({type:String,attribute:"data-require-shim"})],dx.prototype,"requireShimJson",2),n7([n({type:String,attribute:"data-require-js-url"})],dx.prototype,"requireJsUrl",2),n7([n({type:String,attribute:"data-base-url"})],dx.prototype,"baseUrl",2),n7([n({type:Boolean,attribute:"data-use-default-shims"})],dx.prototype,"useDefaultShims",2),n7([n({type:Boolean,attribute:"data-use-default-paths"})],dx.prototype,"useDefaultPaths",2),n7([i()],dx.prototype,"_errorMessage",2),n7([P({context:i7,subscribe:!0}),i()],dx.prototype,"context",2),n7([P({context:i9,subscribe:!0}),i()],dx.prototype,"qtiContext",2),n7([i()],dx.prototype,"response",2);var d_,dC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,d_,!1);return t}d(e,[{key:"getIFrameContent",value:function t(){return a(function(){var t;return z(this,function(e){t=this;return[2,new Promise(function(e){var n="get-content-".concat(Date.now()),i=function o(o){var a=o.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===t.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="getContentResponse"&&(a===null||a===void 0?void 0:a.messageId)===n&&(window.removeEventListener("message",i),e(a.content))};window.addEventListener("message",i),t.sendMessageToIframe("getContent",{messageId:n}),setTimeout(function(){window.removeEventListener("message",i),e("")},5e3)})]})}).call(this)}},{key:"setTestContext",value:function t(t){var e=this;this.context=t,this.updateComplete.then(function(){var n;e.value=t===null||t===void 0?void 0:(n=t.variables)===null||n===void 0?void 0:n.find(function(t){return t.identifier===e.responseIdentifier}).value})}},{key:"recreateIframe",value:function t(){return a(function(){var t;return z(this,function(e){t=this;rn(this,d_,!0);try{return[2,(this.iframe&&(this._iframeLoaded=!1,this.iframe.remove()),this._pendingMessages=[],this.createIframe(),new Promise(function(e){var n=function i(){t.removeEventListener("qti-portable-custom-interaction-loaded",n),e()};t.addEventListener("qti-portable-custom-interaction-loaded",n),setTimeout(function(){t.removeEventListener("qti-portable-custom-interaction-loaded",n),e()},5e3)}))]}finally{rn(this,d_,!1)}return[2]})}).call(this)}},{key:"disconnectedCallback",value:function t(){rt(this,d_)||p(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"iFrameMouseClick",value:function t(t,e){return a(function(){var n;return z(this,function(i){n=this;return[2,new Promise(function(i){var o="click-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="clickResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i())};window.addEventListener("message",a),n.sendMessageToIframe("simulateClick",{x:t,y:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i()},5e3)})]})}).call(this)}},{key:"iFrameClickOnElement",value:function t(t){return a(function(){var e;return z(this,function(n){e=this;return[2,new Promise(function(n){var i="click-selector-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="clickSelectorResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("clickOnSelector",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"iFrameClickOnElementByText",value:function t(t){return a(function(){var e;return z(this,function(n){e=this;return[2,new Promise(function(n){var i="click-text-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="clickTextResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("clickOnElementByText",{text:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"iFrameSetValueElement",value:function t(t,e){return a(function(){var n;return z(this,function(i){n=this;return[2,new Promise(function(i){var o="set-value-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="setValueResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i(e.success))};window.addEventListener("message",a),n.sendMessageToIframe("setValueElement",{selector:t,value:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i(!1)},5e3)})]})}).call(this)}},{key:"iFrameGetBoundingClientRect",value:function t(t){return a(function(){var e;return z(this,function(n){e=this;return[2,new Promise(function(n){var i="get-bounding-rect-".concat(Date.now()),o=function t(t){var a;var s=t.data;(s===null||s===void 0?void 0:s.source)==="qti-pci-iframe"&&(!(s===null||s===void 0?void 0:s.responseIdentifier)||(s===null||s===void 0?void 0:s.responseIdentifier)===e.responseIdentifier)&&(s===null||s===void 0?void 0:s.method)==="getBoundingRectResponse"&&(s===null||s===void 0?void 0:s.messageId)===i&&(window.removeEventListener("message",o),n((a=s.rect)!==null&&a!==void 0?a:null))};window.addEventListener("message",o),e.sendMessageToIframe("getBoundingRect",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(null)},5e3)})]})}).call(this)}},{key:"iFrameSetValueElementByText",value:function t(t,e){return a(function(){var n;return z(this,function(i){n=this;return[2,new Promise(function(i){var o="set-value-text-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="setValueByTextResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i(e.success))};window.addEventListener("message",a),n.sendMessageToIframe("setValueElementByText",{text:t,value:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i(!1)},5e3)})]})}).call(this)}},{key:"iFrameMousedownOnElement",value:function t(t){return a(function(){var e;return z(this,function(n){e=this;return[2,new Promise(function(n){var i="mousedown-selector-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="mousedownSelectorResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("mousedownOnSelector",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"generateIframeContent",value:function t(){var t=p(f(e.prototype),"generateIframeContent",this).call(this),n="\n // Test helper functions for QtiPortableCustomInteractionTest\n // Base iframe implementation already provides PCIManager.getContent\n \n // Base iframe implementation already provides PCIManager.simulateClick\n \n // Base iframe implementation already provides PCIManager.clickOnSelector\n \n // Base iframe implementation already provides PCIManager.clickOnElementByText\n \n // Base iframe implementation already provides PCIManager.setValueElement\n \n function deepQuerySelector(root, selector) {\n if (!root) return null;\n try {\n const direct = root.querySelector ? root.querySelector(selector) : null;\n if (direct) return direct;\n } catch (e) {\n // ignore invalid selector for this root\n }\n if (!root.querySelectorAll) return null;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n const found = deepQuerySelector(node.shadowRoot, selector);\n if (found) return found;\n }\n }\n return null;\n }\n\n function deepFindElementByExactText(root, text) {\n if (!root || !text) return null;\n if (root.querySelectorAll) {\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if ((node.textContent || '').trim() === text) return node;\n if (node.shadowRoot) {\n const found = deepFindElementByExactText(node.shadowRoot, text);\n if (found) return found;\n }\n }\n }\n return null;\n }\n\n function escapeSelectorId(id) {\n try {\n if (window.CSS && typeof window.CSS.escape === 'function') return window.CSS.escape(id);\n } catch (e) {\n // ignore\n }\n return String(id).replace(/([ #;?%&,.+*~\\':\"!^$[\\]()=>|\\/])/g, '\\\\$1');\n }\n\n PCIManager.setValueElementByText = function(params) {\n const messageId = params && params.messageId;\n try {\n const text = params && params.text;\n const value = params && params.value;\n\n const textEl = text ? deepFindElementByExactText(document, text) : null;\n let target = null;\n\n if (textEl) {\n const tag = (textEl.tagName || '').toUpperCase();\n if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') {\n target = textEl;\n } else if (tag === 'LABEL' && textEl.htmlFor) {\n const id = escapeSelectorId(textEl.htmlFor);\n target = deepQuerySelector(document, '#' + id);\n }\n\n if (!target) {\n let parent = textEl.parentElement;\n while (parent) {\n const candidate = parent.querySelector ? parent.querySelector('input, textarea, select') : null;\n if (candidate) {\n target = candidate;\n break;\n }\n parent = parent.parentElement;\n }\n }\n }\n\n const success = !!target && setValueOnElement(target, value);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueByTextResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n } catch (error) {\n console.error('Error setting value by text:', error);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueByTextResponse',\n messageId: messageId,\n success: false,\n error: error.toString()\n },\n '*'\n );\n }\n };\n \n PCIManager.mousedownOnSelector = function(params) {\n try {\n const element = params && params.selector ? deepQuerySelector(document, params.selector) : null;\n \n let success = false;\n \n if (element) {\n const rect = element.getBoundingClientRect();\n const mousedownEvent = new MouseEvent('mousedown', {\n bubbles: true,\n cancelable: true,\n view: window,\n clientX: rect.left + rect.width / 2,\n clientY: rect.top + rect.height / 2\n });\n element.dispatchEvent(mousedownEvent);\n success = true;\n }\n \n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'mousedownSelectorResponse',\n messageId: params.messageId,\n success\n }, '*');\n } catch (error) {\n console.error('Error performing mousedown on selector:', error);\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'mousedownSelectorResponse',\n messageId: params.messageId,\n success: false,\n error: error.toString()\n }, '*');\n }\n };\n \n // Helper function for setting values on elements\n function setValueOnElement(element, value) {\n if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') {\n element.value = value;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n element.dispatchEvent(new Event('change', { bubbles: true }));\n return true;\n } else if (element.tagName === 'SELECT') {\n element.value = value;\n element.dispatchEvent(new Event('change', { bubbles: true }));\n return true;\n } else if (element.isContentEditable) {\n element.textContent = value;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n return true;\n }\n return false;\n }\n \n // Add test-related message handlers (do not override global handlers)\n let expectedParentOriginTest = null;\n window.addEventListener(\n 'message',\n function(event) {\n const { data } = event;\n\n if (event.source !== window.parent || !data || data.source !== 'qti-portable-custom-interaction') return;\n if (expectedParentOriginTest === null) expectedParentOriginTest = event.origin;\n else if (event.origin !== expectedParentOriginTest) return;\n if (data.responseIdentifier && data.responseIdentifier !== PCIManager.responseIdentifier) return;\n\n switch (data.method) {\n case 'setValueElementByText':\n PCIManager.setValueElementByText(data.params);\n return;\n case 'mousedownOnSelector':\n PCIManager.mousedownOnSelector(data.params);\n return;\n }\n },\n true\n );",i=t.lastIndexOf("<\/script>");return t.substring(0,i)+n+t.substring(i)}}]);return e}(dx);d_=new WeakMap;customElements.define("qti-portable-custom-interaction",dx);customElements.define("qti-portable-custom-interaction-test",dC);var dE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(e4())}}]);return e}(i$);dE.styles=[rj(e6())];var dS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.removeMoveListener=t.removeMoveListener.bind(t),t.dragElementHandler=t.dragElementHandler.bind(t);return t}d(e,[{key:"render",value:function t(){return iw(e8())}},{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;p(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(){document.removeEventListener("mousemove",this.dragElementHandler,!0)}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return e}(i$);dS.styles=[rj(e7())];customElements.define("qti-position-object-interaction",dE);customElements.define("qti-position-object-stage",dS);var dA="important",dR=" !"+dA,dI=oo(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){l(this,e);var n;var i;if(n=s(this,e,[t]),t.type!==oi.ATTRIBUTE||t.name!=="style"||((i=t.strings)===null||i===void 0?void 0:i.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}d(e,[{key:"render",value:function t(t){return Object.keys(t).reduce(function(e,n){var i=t[n];return i==null?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(i,";")},"")}},{key:"update",value:function t(t,e){var n=M(e,1),i=n[0];var o=t.element,a=o.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);var s=true,l=false,u=undefined;try{for(var c=this.ft[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;i[h]==null&&(this.ft.delete(h),h.includes("-")?a.removeProperty(h):a[h]=null)}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}for(var p in i){var f=i[p];if(f!=null){this.ft.add(p);var v=typeof f=="string"&&f.endsWith(dR);p.includes("-")||v?a.setProperty(p,v?f.slice(0,-11):f,v?dA:""):a[p]=f}}return ix}}]);return e}(oa));var dM,dT,dP,dO,dL,dU,dN,dD,dV,dz=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,dD);t.maxChoices=1/0;t.minChoices=0;t.response=null;t._correctAreas=[];t._responseCorrection=[];re(t,dM,null);re(t,dT,1);re(t,dP,1);re(t,dO,0);re(t,dL,0);re(t,dU,function(e){if(t.disabled)return;if(!rt(t,dM)){console.warn("No <img> element found in <qti-select-point-interaction>");return}rr(t,dD,dV).call(t);var n=rt(t,dM).getBoundingClientRect(),i=(e.clientX-n.left)*rt(t,dT),o=(e.clientY-n.top)*rt(t,dP),a="".concat(i.toFixed()," ").concat(o.toFixed());t.maxChoices===1?t.response=[a]:(t.maxChoices===0||(t.response||[]).length<t.maxChoices)&&(t.response=L(t.response||[]).concat([a])),t.saveResponse(t.response)});re(t,dN,function(){rr(t,dD,dV).call(t)});return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",rt(this,dN))}},{key:"responsePoints",get:function t(){return(this.response||[]).filter(function(t){return t}).map(function(t){var e=M(t.split(" ").map(Number),2),n=e[0],i=e[1];return{x:n,y:i}})}},{key:"toggleCandidateCorrection",value:function t(t){var e=this;this._responseCorrection=[],t&&this.responsePoints.forEach(function(t){var n=e.responseVariable.areaMapping.areaMapEntries.some(function(n){return oN.isPointInArea("".concat(t.x," ").concat(t.y),"".concat(n.shape,",").concat(n.coords),e.responseVariable.baseType)});e._responseCorrection.push(n)})}},{key:"toggleCorrectResponse",value:function t(t){var e=this.responseVariable;if(!t||!e){this._correctAreas=[];return}var n=e.areaMapping,i=[];if(!n||n.areaMapEntries.length===0)if(e.correctResponse){var o=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];if(o.length===0||o.find(function(t){return t.split(" ").length<2}))return console.error("No valid correct responses found for the response variable."),null;console.warn("No area mapping found for the response variable. Using the correct responses to display the correct response but it probably won't score correct."),i=o.map(function(t){return{shape:"circle",coords:t.split(" ").join(",").concat(",10"),defaultValue:1,mappedValue:1}})}else{console.error("No area mapping found for the response variable.");return}else i=n.areaMapEntries;this._correctAreas=i.map(function(t){return{coords:t.coords,shape:t.shape}})}},{key:"updated",value:function t(t){p(f(e.prototype),"updated",this).call(this,t);var n=rt(this,dM);n&&t.has("_correctAreas")&&this._correctAreas.length>0&&(rr(this,dD,dV).call(this),this.shadowRoot.querySelectorAll("div").forEach(function(t){var e=t.dataset.coord,i=t.dataset.shape;e&&i&&nV(i,e.split(",").map(function(t){return+t}),n,t)}))}},{key:"render",value:function t(){var t=this;var e;return iw(ne(),cn((this.response||[]).filter(function(t){return t}),function(t){return t},function(e,n){var i=M(e.split(" ").map(Number),2),o=i[0],a=i[1],s=o/(rt(t,dO)||1)*100,l=a/(rt(t,dL)||1)*100,u=16,c=u/(rt(t,dO)||1)*100,d=u/(rt(t,dL)||1)*100,h="";return t._responseCorrection[n]===!0?h=" correct":t._responseCorrection[n]===!1&&(h=" incorrect"),iw(e9(),h,dI({pointerEvents:t.maxChoices===1?"none":"auto",position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(s,"%"),top:"".concat(l,"%"),width:"min(".concat(c,"%, 1rem)"),height:"min(".concat(d,"%, 1rem)"),minWidth:"min(".concat(c,"%, 1rem)"),minHeight:"min(".concat(d,"%, 1rem)"),borderRadius:"50%",background:"red"}),e,t.disabled,function(e){e.stopPropagation(),t.response=(t.response||[]).filter(function(t,e){return e!==n}),t.saveResponse(t.response)})}),cn(((e=this._correctAreas)===null||e===void 0?void 0:e.filter(function(t){return t}))||[],function(t){return t},function(t,e){return iw(nt(),dI({position:"absolute",pointerEvents:"none",backgroundColor:"var(--qti-correct)",opacity:"0.5"}),t.coords,"correct-response-".concat(e+1),t.shape)}))}},{key:"validate",value:function t(){return this.response!==null&&this.response.length>=this.minChoices&&this.response.length<=this.maxChoices}},{key:"firstUpdated",value:function t(){rn(this,dM,this.querySelector("img")),rt(this,dM)?(rr(this,dD,dV).call(this),rt(this,dM).addEventListener("click",rt(this,dU))):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function t(){p(f(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",rt(this,dN)),rt(this,dM)&&rt(this,dM).removeEventListener("click",rt(this,dU))}}]);return e}(oS);dM=new WeakMap,dT=new WeakMap,dP=new WeakMap,dO=new WeakMap,dL=new WeakMap,dU=new WeakMap,dN=new WeakMap,dD=new WeakSet,dV=function t(){rn(this,dO,rt(this,dM).getAttribute("width")?parseFloat(rt(this,dM).getAttribute("width")):rt(this,dM).naturalWidth),rn(this,dL,rt(this,dM).getAttribute("height")?parseFloat(rt(this,dM).getAttribute("height")):rt(this,dM).naturalHeight);var t=rt(this,dM).getBoundingClientRect();rn(this,dT,t.width===0?1:rt(this,dO)/t.width),rn(this,dP,t.height===0?1:rt(this,dL)/t.height)},dz.styles=[rj(nn())],n7([n({type:Number,attribute:"max-choices"})],dz.prototype,"maxChoices",2),n7([n({type:Number,attribute:"min-choices"})],dz.prototype,"minChoices",2),n7([i()],dz.prototype,"response",2),n7([i()],dz.prototype,"_correctAreas",2),n7([i()],dz.prototype,"_responseCorrection",2);customElements.define("qti-select-point-interaction",dz);var d$=rj(nr());var dB,dj,dW,dF,dQ,dH,dG,dX,dJ,dY=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,dW);re(t,dB,0);re(t,dj,null);t.min=0;t.max=100;t.step=1;return t}d(e,[{key:"validate",value:function t(){return!0}},{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),rr(this,dW,dF).call(this,this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"response",get:function t(){return rt(this,dB).toString()},set:function t(t){var e=parseInt(t,10);isNaN(e)||rr(this,dW,dF).call(this,e)}},{key:"toggleCorrectResponse",value:function t(t){var e=this.responseVariable;if(e===null||e===void 0?void 0:e.correctResponse){if(t){this._correctResponse=e.correctResponse.toString();var n=parseFloat(e.correctResponse.toString());if(isNaN(n))rn(this,dj,null);else{rn(this,dj,n);var i=(rt(this,dj)-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage-correct","".concat(i,"%"))}}else rn(this,dj,null);this.requestUpdate()}}},{key:"render",value:function t(){return iw(no(),this.min,this.max,rr(this,dW,dQ),rr(this,dW,dH),this.response,rt(this,dj)!==null?iw(ni(),rt(this,dj)):null)}}]);return e}(oS);dB=new WeakMap,dj=new WeakMap,dW=new WeakSet,dF=function t(t){var e=rt(this,dB);if(rn(this,dB,Math.min(this.max,Math.max(this.min,t))),rt(this,dB)===e)return;var n=(rt(this,dB)-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage","".concat(n,"%")),this._internals.setFormValue(this.value),this.saveResponse(this.response),this.requestUpdate()},dQ=function t(t){var e=this;rr(this,dW,dG).call(this,t.pageX);var n=function t(t){return rr(e,dW,dX).call(e,t.pageX)},i=function t(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",i),rr(e,dW,dJ).call(e)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",i)},dH=function t(t){var e=this;rr(this,dW,dG).call(this,t.touches[0].pageX);var n=function t(t){return rr(e,dW,dX).call(e,t.touches[0].pageX)},i=function t(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",i),rr(e,dW,dJ).call(e)};document.addEventListener("touchmove",n,{passive:!1}),document.addEventListener("touchend",i)},dG=function t(t){rr(this,dW,dX).call(this,t)},dX=function t(t){var e=this._rail.getBoundingClientRect(),n=t-e.left,i=Math.min(1,Math.max(0,n/e.width)),o=this.min+Math.round(i*(this.max-this.min)/this.step)*this.step;rr(this,dW,dF).call(this,o)},dJ=function t(){this.dispatchEvent(new Event("change",{bubbles:!0}))},dY.styles=d$,n7([o("#rail")],dY.prototype,"_rail",2),n7([n({type:Number,attribute:"lower-bound"})],dY.prototype,"min",2),n7([n({type:Number,attribute:"upper-bound"})],dY.prototype,"max",2),n7([n({type:Number,attribute:"step"})],dY.prototype,"step",2);customElements.define("qti-slider-interaction",dY);var dK=function t(){return new dZ},dZ=function t(){"use strict";l(this,t)},d0=new WeakMap,d1=oo(/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(t){return i_}},{key:"update",value:function t(t,e){var n=M(e,1),i=n[0];var o;var a=i!==this.G;return a&&this.G!==void 0&&this.rt(void 0),(a||this.lt!==this.ct)&&(this.G=i,this.ht=(o=t.options)===null||o===void 0?void 0:o.host,this.rt(this.ct=t.element)),i_}},{key:"rt",value:function t(t){if(this.isConnected||(t=void 0),typeof this.G=="function"){var e;var n=(e=this.ht)!==null&&e!==void 0?e:globalThis,i=d0.get(n);i===void 0&&(i=new WeakMap,d0.set(n,i)),i.get(this.G)!==void 0&&this.G.call(this.ht,void 0),i.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}},{key:"lt",get:function t(){var t;var e,n;return typeof this.G=="function"?(e=d0.get((t=this.ht)!==null&&t!==void 0?t:globalThis))===null||e===void 0?void 0:e.get(this.G):(n=this.G)===null||n===void 0?void 0:n.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}(oq));var d2=rj(na());var d3,d5,d4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,d3);t.inputRef=dK();t.response=null;t._handleValueChange=function(){t._internals.setFormValue(t.value),t.validate()};return t}d(e,[{key:"value",get:function t(){return this.response||null},set:function t(t){this.response=t||null}},{key:"correctness",get:function t(){var t=this.responseVariable;if(!t)return null;if(t.value===null)return"incorrect";if(t.mapping){var e=t.mapping.mapEntries.reduce(function(t,e){return Math.max(e.mappedValue,t)},0);var n=true,i=false,o=undefined;try{for(var a=t.mapping.mapEntries[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;var u=l.mapKey,c=t.value;if(l.caseSensitive||(u=u.toLowerCase(),c=c.toLowerCase()),u===c)return l.mappedValue===e?"correct":l.mappedValue<=(t.mapping.defaultValue||0)?"incorrect":"partially-correct"}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}return t.correctResponse===t.value?"correct":"incorrect"}},{key:"isInline",get:function t(){return!0}},{key:"validate",value:function t(){if(!this._input)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),this._input.setCustomValidity(""),this._input.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),this._input.setCustomValidity(this.dataPatternmaskMessage));else{var t=this._input.checkValidity();this._internals.setValidity(t?{}:{customError:!1})}return this.response!==""&&this._input.checkValidity()}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.responseVariable;if(t&&(e===null||e===void 0?void 0:e.correctResponse)){var n=e.correctResponse.toString();this._correctResponse=n}else this._correctResponse=null}},{key:"render",value:function t(){var t=this;return iw(nl(),this.responseIdentifier,function(e){t.reportValidity()},function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",ad(this.placeholderText?this.placeholderText:void 0),this.response,ad(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse?iw(ns(),this._correctResponse):i_)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;rr(this,d3,d5).call(this,e.value),this.response!==e.value&&(this.value=e.value,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.response=""}}]);return e}(oS);d3=new WeakSet,d5=function t(t){this.setAttribute("empty",t===""?"true":"false")},d4.styles=d2,n7([n({type:Number,attribute:"expected-length"})],d4.prototype,"expectedLength",2),n7([n({type:String,attribute:"pattern-mask"})],d4.prototype,"patternMask",2),n7([n({type:String,attribute:"placeholder-text"})],d4.prototype,"placeholderText",2),n7([n({type:String,attribute:"data-patternmask-message"})],d4.prototype,"dataPatternmaskMessage",2),n7([i()],d4.prototype,"response",2),n7([o("input")],d4.prototype,"_input",2),n7([V("response",{waitUntilFirstUpdate:!0})],d4.prototype,"_handleValueChange",2);customElements.define("qti-text-entry-interaction",d4);var d6,d8,d7,d9,ht,he=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,d7);re(t,d6,null);re(t,d8,null);return t}d(e,[{key:"reset",value:function t(){rn(this,d6,null),rn(this,d8,null),this.saveResponse(null)}},{key:"validate",value:function t(){return rt(this,d8)!==null}},{key:"response",get:function t(){return rt(this,d8)},set:function t(t){if(typeof t=="string")rn(this,d8,t),this.saveResponse(t);else if(t===null)this.reset();else throw new Error("Value must be a Base64-encoded string or null")}},{key:"render",value:function t(){return iw(nu(),rr(this,d7,d9),this.disabled,this.readonly)}}],[{key:"properties",get:function t(){return k({},oS.properties)}}]);return e}(oS);d6=new WeakMap,d8=new WeakMap,d7=new WeakSet,d9=function t(t){return a(function(){var e,n,i;return z(this,function(o){switch(o.label){case 0:e=t.target;n=e.files&&e.files.length>0;if(!n)return[3,2];rn(this,d6,e.files[0]);i=[this,d8];return[4,rr(this,d7,ht).call(this,rt(this,d6))];case 1:n=(rn.apply(void 0,i.concat([o.sent()])),this.saveResponse(rt(this,d8)),this.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:rt(this,d8)}})));o.label=2;case 2:n;return[2]}})}).call(this)},ht=function t(t){return new Promise(function(e,n){var i=new FileReader;i.onload=function(){return e(i.result)},i.onerror=function(){return n(i.error)},i.readAsDataURL(t)})},he.styles=[rj(nc())];customElements.define("qti-upload-interaction",he);var hn=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"render",value:function t(){return iw(nd())}}]);return e}(i$);hn.styles=rj(nh());customElements.define("qti-associable-hotspot",hn);var hr=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"render",value:function t(){return iw(np())}}]);return e}(i$);hr.styles=rj(nf()),n7([n({type:Number,reflect:!0})],hr.prototype,"tabindex",2);customElements.define("qti-gap",hr);var hi=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"connectedCallback",value:function t(){this.setAttribute("slot","drags")}}]);return e}(i$);hi.styles=rj(nv()),n7([n({type:Number,reflect:!0})],hi.prototype,"tabindex",2);customElements.define("qti-gap-img",hi);var ho={toAttribute:function t(t){return t?"true":"false"},fromAttribute:function t(t){return t==="true"}};var ha=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","drags")}},{key:"render",value:function t(){return iw(nm())}}]);return e}(nz(i$,"qti-gap-text"));ha.styles=rj(ng()),n7([n({type:Number,reflect:!0})],ha.prototype,"tabindex",2);customElements.define("qti-gap-text",ha);var hs=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(nz(i$,"qti-hotspot-choice"));hs.styles=rj(nb()),n7([n({attribute:"aria-ordervalue",type:Number,reflect:!0})],hs.prototype,"order",2),n7([n({attribute:"aria-ordercorrectvalue",type:Number,reflect:!0})],hs.prototype,"orderCorrect",2);customElements.define("qti-hotspot-choice",hs);var hl=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(ny())}}]);return e}(nz(i$,"qti-hottext"));hl.styles=rj(nw());customElements.define("qti-hottext",hl);var hu=rj(nq()),hc=hu;var hd,hh,hp=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,hd);return t}d(e,[{key:"connectedCallback",value:function t(){p(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("click",rr(this,hd,hh)),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("click",rr(this,hd,hh))}},{key:"render",value:function t(){return iw(nk())}}]);return e}(nz(i$,"qti-inline-choice"));hd=new WeakSet,hh=function t(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))},hp.styles=hc,n7([n({type:String})],hp.prototype,"identifier",2);customElements.define("qti-inline-choice",hp);var hf=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(nx())}},{key:"connectedCallback",value:function t(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return e}(i$);customElements.define("qti-prompt",hf);var hv=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.matchMin=0;t.matchMax=1;t.fixed=!1;return t}d(e,[{key:"connectedCallback",value:function t(){p(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 iw(n_())}}]);return e}(nz(i$,"qti-simple-associable-choice"));hv.styles=rj(nC()),n7([n({type:Number,attribute:"match-min"})],hv.prototype,"matchMin",2),n7([n({type:Number,attribute:"match-max"})],hv.prototype,"matchMax",2),n7([n({type:String,attribute:"fixed",converter:{fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return String(t)}}})],hv.prototype,"fixed",2);customElements.define("qti-simple-associable-choice",hv);var hm=rj(nE());var hg=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.templateIdentifier=null;t.showHide="show";t.fixed=!1;return t}d(e,[{key:"checked",get:function t(){return this.internals.states.has("--checked")}},{key:"render",value:function t(){return iw(nA(),this.marker?iw(nS(),this.marker):i_)}}]);return e}(nz(i$,"qti-simple-choice"));hg.styles=hm,n7([n({type:String,attribute:"template-identifier"})],hg.prototype,"templateIdentifier",2),n7([n({type:String,attribute:"show-hide"})],hg.prototype,"showHide",2),n7([n({type:Boolean,converter:{fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return String(t)}}})],hg.prototype,"fixed",2),n7([n({type:String,attribute:!1})],hg.prototype,"marker",2);customElements.define("qti-simple-choice",hg);var hb=function t(t){return a(function(){var e,n,i,o,a,s;return z(this,function(l){switch(l.label){case 0:e=t.substring(0,t.lastIndexOf("/"));return[4,iX().load("".concat(t)).then(function(t){return t.assessmentTest()})];case 1:n=l.sent();return[4,iJ().load("".concat(e,"/").concat(n.href)).then(function(t){return t.htmlDoc()})];case 2:i=l.sent();return[4,iJ().load("".concat(e,"/").concat(n.href)).then(function(t){return t.items()})];case 3:o=l.sent(),a="".concat(e,"/").concat(n.href),s="".concat(e,"/").concat(n.href.substring(0,n.href.lastIndexOf("/")));return[2,{testHTMLDoc:i,testURI:s,testURL:a,items:o,testIdentifier:n.identifier}]}})})()},hy=function t(t){return a(function(){return z(this,function(e){return[2,iG().load(t).then(function(t){return t.htmlDoc().firstElementChild})]})})()};var hw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(nR())}},{key:"process",value:function t(){throw new Error("Not implemented")}}]);return e}(i$);hw=n7([ij("qti-rule")],hw);var hq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"childExpression",get:function t(){return this.firstElementChild}},{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.context.variables.find(function(e){return e.identifier===t})||null,n;return e.interpolationTable&&(n=e.interpolationTable.get(parseFloat(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:oT(n)}})),n)}}]);return e}(hw);n7([n({type:String})],hq.prototype,"identifier",2),n7([P({context:i7,subscribe:!0}),i()],hq.prototype,"context",2);customElements.define("qti-lookup-outcome-value",hq);var hk=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(nI())}},{key:"process",value:function t(){var t=L(this.children);for(var e=0;e<t.length;e++){var n=t[e];if(n.calculate()){n.process();return}}}}]);return e}(hw);customElements.define("qti-response-condition",hk);var hx,h_,hC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,hx);return t}d(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier");if(!t){console.warn('QtiSetOutcomeValue: Missing "identifier" attribute.');return}var e=this.firstElementChild;if(!e){console.warn("QtiSetOutcomeValue: No expression found.");return}var n=new hE(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:rr(this,hx,h_).call(this,n)}}))}}]);return e}(hw);hx=new WeakSet,h_=function t(t){return Array.isArray(t)?t.map(oT):t!==null?oT(t):null};var hE=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.expression=e}d(t,[{key:"process",value:function t(){var t;var e=(t=this.expression.calculate())!==null&&t!==void 0?t:null;return e===null&&console.warn("QtiSetOutcomeValueRule: Evaluated value is null."),Array.isArray(e)?e.map(function(t){return t.value?t.value:t}):e}}]);return t}();customElements.define("qti-set-outcome-value",hC);var hS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(nM())}},{key:"calculate",value:function t(){return!0}},{key:"getSubRules",value:function t(){return L(this.children)}},{key:"process",value:function t(){var t=this.getSubRules();for(var e=0;e<t.length;e++)t[e].process()}}]);return e}(i$);customElements.define("qti-response-else",hS);var hA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(hS);customElements.define("qti-response-if",hA);var hR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(nT(),p(f(e.prototype),"render",this).call(this))}}]);return e}(hA);customElements.define("qti-response-else-if",hR);var hI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"calculate",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(n$(oI));hI=n7([ij("qti-and")],hI);var hM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.baseType="string";return t}d(e,[{key:"getResult",value:function t(){return this.textContent.trim()}}]);return e}(oR);n7([n({type:String,attribute:"base-type"})],hM.prototype,"baseType",2);customElements.define("qti-base-value",hM);var hT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t;if(((t=this.children)===null||t===void 0?void 0:t.length)!==1)return console.error("qti-container-size must have exactly one child expression"),0;var e=this.getVariables();if(!e||(e===null||e===void 0?void 0:e.length)===0)return 0;var n=e[0];return n.value===null||n.value===void 0?0:n.cardinality!=="multiple"&&n.cardinality!=="ordered"?(console.error("qti-container-size requires multiple or ordered cardinality"),0):Array.isArray(n.value)?n.value.length:(console.error("qti-container-size: expected array value for multiple/ordered cardinality"),0)}}]);return e}(oR);customElements.define("qti-container-size",hT);var hP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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 i=e.value,o=n.value;return i.filter(function(t){return o.includes(t)}).length>0}else if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="single"){var a=e.value;return n.value.includes(a)}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}(oI);customElements.define("qti-contains",hP);var hO=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"interpretation",get:function t(){return this.getAttribute("interpretation")||""}},{key:"getResult",value:function t(){var t=this.getAttribute("identifier")||"",e=this.context.variables.find(function(e){return e.identifier===t})||null;return e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}}]);return e}(oR);customElements.define("qti-correct",hO);var hL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";return t}d(e,[{key:"getResult",value:function t(){var t;if(!this.identifier)return console.error("qti-default requires an identifier attribute"),null;var e=this.identifier.split("."),n=null,i;if(e.length===2)n=e[0],i=e[1];else if(e.length===1)i=e[0];else return console.error("qti-default: invalid identifier format"),null;if(n){var o;var a=this._testContext.items.find(function(t){return t.identifier===n});if(console.debug("itemContext: ".concat(JSON.stringify(a))),!this._testContext||!a)return console.warn('qti-default: item "'.concat(n,'" not found in test context')),null;var s=(o=this._testContext.items.find(function(t){return t.identifier===n}))===null||o===void 0?void 0:o.variables.find(function(t){return t.identifier===i});return s?s.defaultValue||null:(console.warn('qti-default: variable "'.concat(i,'" not found in item "').concat(n,'"')),null)}if(!((t=this.context)===null||t===void 0?void 0:t.variables))return console.warn("qti-default: no variables found in item context"),null;var l=this.context.variables.find(function(t){return t.identifier===i});return l?l.defaultValue||null:(console.warn('qti-default: variable "'.concat(i,'" not found in item context')),null)}}]);return e}(oR);n7([n({type:String})],hL.prototype,"identifier",2),n7([P({context:i7,subscribe:!0}),i()],hL.prototype,"context",2),n7([i(),P({context:or,subscribe:!0})],hL.prototype,"_testContext",2);customElements.define("qti-default",hL);var hU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.roundingMode="significantFigures";return t}d(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 i=parseFloat(e.value),o=parseFloat(n.value);if(!isNaN(i)&&!isNaN(o))return this.roundingMode==="significantFigures"?i.toPrecision(this.figures)===o.toPrecision(this.figures):Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(i,", ").concat(o));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}(oR);n7([n({type:String})],hU.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",hU);var hN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length!==1)return console.error("qti-round must have exactly one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=t[0];if(e.cardinality!=="single")return console.error("qti-round requires single cardinality"),null;if(Array.isArray(e.value))return console.error("qti-round unexpected array value for single cardinality"),null;if(e.value===null||e.value===void 0)return null;if(e.baseType!=="integer"&&e.baseType!=="float")return console.error("qti-round requires numerical base-type (integer or float)"),null;var n=parseFloat(e.value);return isNaN(n)?(console.warn("qti-round: NaN input results in NULL"),null):isFinite(n)?Math.floor(n+.5):n===1/0?1/0:n===-1/0?-1/0:null}}]);return e}(oR);customElements.define("qti-round",hN);var hD,hV,hz,h$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,hD);t.roundingMode="significantFigures";t.figures=3;return t}d(e,[{key:"getResult",value:function t(){if(this.children.length!==1)return console.error("qti-round-to must have exactly one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=t[0];if(e.cardinality!=="single")return console.error("qti-round-to requires single cardinality"),null;if(Array.isArray(e.value))return console.error("qti-round-to unexpected array value for single cardinality"),null;if(e.value===null||e.value===void 0)return null;if(e.baseType!=="integer"&&e.baseType!=="float")return console.error("qti-round-to requires numerical base-type"),null;var n=parseFloat(e.value);return isNaN(n)?null:isFinite(n)?this.figures<0?(console.error("qti-round-to: figures must be non-negative"),null):this.roundingMode==="significantFigures"&&this.figures<1?(console.error("qti-round-to: figures must be at least 1 for significantFigures mode"),null):this.roundingMode==="decimalPlaces"?rr(this,hD,hV).call(this,n,this.figures):rr(this,hD,hz).call(this,n,this.figures):n===1/0?1/0:n===-1/0?-1/0:null}}]);return e}(oR);hD=new WeakSet,hV=function t(t,e){if(t===0)return 0;var n=Math.pow(10,e);return Math.round(t*n)/n},hz=function t(t,e){if(t===0)return 0;var n=Math.floor(Math.log10(Math.abs(t))),i=Math.pow(10,e-n-1);return Math.round(t*i)/i},n7([n({type:String,attribute:"rounding-mode"})],h$.prototype,"roundingMode",2),n7([n({type:Number})],h$.prototype,"figures",2);customElements.define("qti-round-to",h$);var hB=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.toleranceMode="exact";return t}d(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):oN.compareSingleValues(e.value,n.value,e.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return e}(oR);n7([n({type:String})],hB.prototype,"toleranceMode",2);customElements.define("qti-equal",hB);var hj,hW,hF,hQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,hj);return t}d(e,[{key:"getResult",value:function t(){if(this.children.length===0)return console.error("qti-gcd must have at least one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-gcd requires integer base-type"),null;if(l.value===null||l.value===void 0)return null;if(l.cardinality==="single"){if(Array.isArray(l.value))return console.error("qti-gcd unexpected array value for single cardinality"),null;var u=parseInt(l.value,10);if(isNaN(u))return console.error("qti-gcd non-numerical value"),null;e.push(u)}else if(l.cardinality==="multiple"||l.cardinality==="ordered"){if(!Array.isArray(l.value))return console.error("qti-gcd expected array value for multiple/ordered cardinality"),null;var c=true,d=false,h=undefined;try{for(var p=l.value[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;if(v==null)return null;var m=parseInt(v,10);if(isNaN(m))return console.error("qti-gcd non-numerical value"),null;e.push(m)}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}}else return console.error("qti-gcd unsupported cardinality"),null}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e.length===0?null:rr(this,hj,hW).call(this,e)}}]);return e}(oR);hj=new WeakSet,hW=function t(t){if(t.length===0)return 0;if(t.length===1)return Math.abs(t[0]);var e=Math.abs(t[0]);for(var n=1;n<t.length&&(e=rr(this,hj,hF).call(this,e,Math.abs(t[n])),e!==1);n++);return e},hF=function t(t,e){if(t===0&&e===0)return 0;if(t===0)return e;if(e===0)return t;for(;e!==0;){var n=e;e=t%e,t=n}return t};customElements.define("qti-gcd",hQ);var hH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if((e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.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}(oR);customElements.define("qti-gt",hH);var hG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return(e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.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}(oI);customElements.define("qti-gte",hG);var hX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return null}}]);return e}(oR);customElements.define("qti-null",hX);var hJ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(oR);customElements.define("qti-is-null",hJ);var hY=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getAttribute("field-identifier");if(!t)throw new Error("field-identifier attribute is required");if(Array.from(this.children).length!==1)throw new Error("qti-field-value must have exactly one child expression");var e=this.getVariables()[0];if(e.baseType!=="record"||e.value===null)throw new Error("qti-field-value child expression must return a record");var n=e.value[t];if(n===void 0)throw new Error('Field "'.concat(t,'" not found in record'));return n}}]);return e}(oR);customElements.define("qti-field-value",hY);var hK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if((e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.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}(oR);customElements.define("qti-lt",hK);var hZ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return(e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.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}(oI);customElements.define("qti-lte",hZ);var h0=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e||!e.mapping)return console.error("Response ".concat(this.identifier," can not be found")),null;var n=e.mapping,i=Array.isArray(e.value)?e.value:[e.value],o=0;var a=true,s=false,l=undefined;try{var u=function(){var t=d.value;var i=n.mapEntries.filter(function(n){return e.baseType==="string"&&!n.caseSensitive?oN.compareSingleValues(n.mapKey.toLowerCase(),t.toLowerCase(),e.baseType):oN.compareSingleValues(n.mapKey,t,e.baseType)}),a=i.reduce(function(t,e){return t.mappedValue>e.mappedValue?t:e},i.length>0?i[0]:{mapKey:null,mappedValue:null});a===null||a.mappedValue==null?o+=n.defaultValue:o+=a.mappedValue};for(var c=i[Symbol.iterator](),d;!(a=(d=c.next()).done);a=true)u()}catch(t){s=true;l=t}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw l}}}return(n===null||n===void 0?void 0:n.lowerBound)!==null&&(n===null||n===void 0?void 0:n.lowerBound)!==void 0&&(o=Math.max(n.lowerBound,o)),(n===null||n===void 0?void 0:n.upperBound)!==null&&(n===null||n===void 0?void 0:n.upperBound)!==void 0&&(o=Math.min(n.upperBound,o)),o}}]);return e}(oR);n7([n({type:String})],h0.prototype,"identifier",2);customElements.define("qti-map-response",h0);var h1=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e)return console.warn("Response ".concat(this.identifier," cannot be found")),null;var n=e.areaMapping;if(!n)return console.warn("Area mapping not found for response ".concat(this.identifier)),null;var i=Array.isArray(e.value)?e.value:[e.value];if(!i||i.length===0)return console.warn("No candidate responses for response ".concat(this.identifier)),null;var o=0,a=new Set;var s=true,l=false,u=undefined,c=true,d=false,h=undefined;try{for(var p=i[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var v=f.value;try{for(var m=n.areaMapEntries[Symbol.iterator](),g;!(s=(g=m.next()).done);s=true){var b=g.value;var y;if(a.has(b.coords))continue;oN.isPointInArea(v,"".concat(b.shape,",").concat(b.coords),e.baseType)&&(o+=(y=b.mappedValue)!==null&&y!==void 0?y:0,a.add(b.coords))}}catch(t){l=true;u=t}finally{try{if(!s&&m.return!=null){m.return()}}finally{if(l){throw u}}}}}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}return a.size<i.length&&(o+=n.defaultValue),n.lowerBound!=null&&(o=Math.max(n.lowerBound,o)),n.upperBound!=null&&(o=Math.min(n.upperBound,o)),o}}]);return e}(oR);n7([n({type:String})],h1.prototype,"identifier",2);customElements.define("qti-map-response-point",h1);var h2,h3,h5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,h2);t.name="";return t}d(e,[{key:"getResult",value:function t(){if(!this.name)return console.error("qti-math-operator requires a name attribute"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.cardinality!=="single")return console.error("qti-math-operator requires single cardinality"),null;if(Array.isArray(l.value))return console.error("qti-math-operator unexpected array value for single cardinality"),null;if(l.value===null||l.value===void 0)return null;if(l.baseType!=="integer"&&l.baseType!=="float")return console.error("qti-math-operator requires numerical base-type"),null;var u=parseFloat(l.value);if(isNaN(u))return console.error("qti-math-operator non-numerical value"),null;e.push(u)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return rr(this,h2,h3).call(this,this.name,e)}}]);return e}(oR);h2=new WeakSet,h3=function t(t,e){try{switch(t.toLowerCase()){case"sin":return e.length!==1?null:Math.sin(e[0]);case"cos":return e.length!==1?null:Math.cos(e[0]);case"tan":return e.length!==1?null:Math.tan(e[0]);case"asin":return e.length!==1||e[0]<-1||e[0]>1?null:Math.asin(e[0]);case"acos":return e.length!==1||e[0]<-1||e[0]>1?null:Math.acos(e[0]);case"atan":return e.length!==1?null:Math.atan(e[0]);case"sinh":return e.length!==1?null:Math.sinh(e[0]);case"cosh":return e.length!==1?null:Math.cosh(e[0]);case"tanh":return e.length!==1?null:Math.tanh(e[0]);case"log":return e.length!==1||e[0]<=0?null:Math.log(e[0]);case"ln":return e.length!==1||e[0]<=0?null:Math.log(e[0]);case"log10":return e.length!==1||e[0]<=0?null:Math.log10(e[0]);case"exp":return e.length!==1?null:Math.exp(e[0]);case"abs":return e.length!==1?null:Math.abs(e[0]);case"sqrt":return e.length!==1||e[0]<0?null:Math.sqrt(e[0]);case"signum":return e.length!==1?null:Math.sign(e[0]);case"floor":return e.length!==1?null:Math.floor(e[0]);case"ceil":return e.length!==1?null:Math.ceil(e[0]);case"round":return e.length!==1?null:Math.round(e[0]);case"atan2":return e.length!==2?null:Math.atan2(e[0],e[1]);case"pow":{if(e.length!==2)return null;var n=e[0],i=e[1];return n===0&&i<=0||n<0&&!Number.isInteger(i)?null:Math.pow(n,i)}case"log_base":{if(e.length!==2)return null;var o=e[0],a=e[1];return o<=0||a<=0||a===1?null:Math.log(o)/Math.log(a)}case"mod":return e.length!==2||e[1]===0?null:e[0]%e[1];case"max":var s;return e.length<1?null:(s=Math).max.apply(s,L(e));case"min":var l;return e.length<1?null:(l=Math).min.apply(l,L(e));default:return console.error('qti-math-operator: unknown operation "'.concat(t,'"')),null}}catch(e){return console.error('qti-math-operator: error performing operation "'.concat(t,'":'),e),null}},n7([n({type:String})],h5.prototype,"name",2);customElements.define("qti-math-operator",h5);var h4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),n=t[0],i=t[1];return e.match(n,i)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function t(t,e){if(t.value===null)return!1;switch(e.cardinality){case"single":var n;return Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):oN.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 i=0;i<t.value.length;i++)if(!oN.compareSingleValues(e.value[i],t.value[i],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 o=0;var a=true,s=false,l=undefined;try{for(var u=e.value[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;var h=null,p=L(t.value);var f=true,v=false,m=undefined;try{for(var g=p[Symbol.iterator](),b;!(f=(b=g.next()).done);f=true){var y=b.value;if(oN.compareSingleValues(d,y,e.baseType)){h=y;break}}}catch(t){v=true;m=t}finally{try{if(!f&&g.return!=null){g.return()}}finally{if(v){throw m}}}if(h!==null)p.splice(p.indexOf(h),1);else return!1;o++}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return e}(oR);customElements.define("qti-match",h4);var h6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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=M(t,2),n=e[0],i=e[1];if(n.baseType===i.baseType||n.baseType==="integer"&&i.baseType==="float"||n.baseType==="float"&&i.baseType==="integer"||console.warn("Which must both have the same base-type"),i.cardinality==="multiple"||i.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(n.baseType==="float"||i.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(n.baseType==="duration"||i.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),n.value===null||i.value===null)return null;var o=n.value;return i.value.includes(o)}}]);return e}(oR);customElements.define("qti-member",h6);var h8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){console.debug("qti-multiple getResult called",this.innerHTML);var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;if(s.cardinality!=="multiple"&&s.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}return t}}]);return e}(oR);customElements.define("qti-multiple",h8);var h7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return iw(nP(),p(f(e.prototype),"render",this).call(this))}},{key:"getResult",value:function t(){return!this.firstElementChild.calculate()}}]);return e}(oR);customElements.define("qti-not",h7);var h9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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(),i=!1;if(typeof n=="string")if(n==="true")i=!0;else if(n==="false")i=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(i=n);return i}).some(function(t){return typeof t=="boolean"&&t})}}]);return e}(oI);customElements.define("qti-or",h9);var pt=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;if(s.cardinality!=="ordered"&&s.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}return t}}]);return e}(oR);customElements.define("qti-ordered",pt);var pe=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length!==2)return console.error("qti-power must have exactly two child expressions"),null;var t=this.getVariables();if(!t||t.length!==2)return null;var e=M(t,2),n=e[0],i=e[1];if(n.cardinality!=="single"||i.cardinality!=="single")return console.error("qti-power requires single cardinality for both expressions"),null;if(Array.isArray(n.value)||Array.isArray(i.value))return console.error("qti-power unexpected array value for single cardinality"),null;if(n.value===null||n.value===void 0||i.value===null||i.value===void 0)return null;if(n.baseType!=="integer"&&n.baseType!=="float"||i.baseType!=="integer"&&i.baseType!=="float")return console.error("qti-power requires numerical base-types"),null;var o=parseFloat(n.value),a=parseFloat(i.value);if(isNaN(o)||isNaN(a))return console.error("qti-power: non-numerical values encountered"),null;if(o===0&&a<=0||o<0&&!Number.isInteger(a))return null;var s;try{s=Math.pow(o,a)}catch(t){return console.error("qti-power: error calculating power:",t),null}if(isNaN(s))return null;if(s===1/0||s===-1/0)return s;if(!isFinite(s)||Math.abs(s)>Number.MAX_VALUE||s!==0&&Math.abs(s)<Number.MIN_VALUE)return null;if(isFinite(s)&&s!==0){var l=Math.floor(Math.log10(Math.abs(s))),u=Math.max(0,14-l),c=Math.pow(10,u);s=Math.round(s*c)/c}return s}}]);return e}(oR);customElements.define("qti-power",pe);var pn=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(n=this.context)===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 i===null?i_:iw(nO(),JSON.stringify(i,null,2))}},{key:"calculate",value:function t(){var t=this;return this.context.variables.find(function(e){return e.identifier===t.identifier})||null}}]);return e}(i$);n7([n({type:String})],pn.prototype,"identifier",2),n7([P({context:i7,subscribe:!0}),i()],pn.prototype,"context",2);customElements.define("qti-printed-variable",pn);var pr=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return this.getVariables().reduce(function(t,e){if(e.baseType=="float"||e.baseType=="integer")try{return t*parseFloat(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}(oR);customElements.define("qti-product",pr);var pi=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(nB(oR));customElements.define("qti-subtract",pi);var po=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.caseSensitive="true";return t}d(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 i=this.caseSensitive==="true"?e.value:e.value.toLowerCase(),o=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return oN.compareSingleValues(i,o,e.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return e}(oR);n7([n({type:String,attribute:"case-sensitive"})],po.prototype,"caseSensitive",2);customElements.define("qti-string-match",po);var pa,ps=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);re(t,pa);rn(t,pa,new pl(Array.from(t.children)));return t}d(e,[{key:"getResult",value:function t(){return rt(this,pa).calculate()}}]);return e}(oR);pa=new WeakMap;var pl=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.expressions=e}d(t,[{key:"calculate",value:function t(){return this.expressions.filter(function(t){return t.calculate!==void 0}).some(function(t){return t.calculate()===null})?null:this.expressions.map(function(t){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",ps);var pu=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getAttribute("identifier");return this.context.variables.find(function(e){return e.identifier===t}).value}}]);return e}(oR);customElements.define("qti-variable",pu);var pc=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.min=0;t.max=10;t.step=1;return t}d(e,[{key:"getResult",value:function t(){if(this.min>this.max)return console.error("qti-random-integer: min cannot be greater than max"),this.min;if(this.step<=0)return console.error("qti-random-integer: step must be positive"),this.min;var t=[],e=0;for(;;){var n=this.min+this.step*e;if(n>this.max)break;Number.isInteger(n)&&t.push(n),e++}if(t.length===0)return console.warn("qti-random-integer: no valid integer values in range"),Number.isInteger(this.min)?this.min:Math.floor(this.min);var i=Math.floor(Math.random()*t.length);return t[i]}},{key:"getPossibleValues",value:function t(){var t=[];if(this.min>this.max||this.step<=0)return[Number.isInteger(this.min)?this.min:Math.floor(this.min)];var e=0;for(;;){var n=this.min+this.step*e;if(n>this.max)break;Number.isInteger(n)&&t.push(n),e++}return t.length>0?t:[Number.isInteger(this.min)?this.min:Math.floor(this.min)]}}]);return e}(oR);n7([n({type:Number})],pc.prototype,"min",2),n7([n({type:Number})],pc.prototype,"max",2),n7([n({type:Number})],pc.prototype,"step",2);customElements.define("qti-random-integer",pc);var pd=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===1){var e=t[0].value;if(Array.isArray(e)){var n=Math.floor(Math.random()*e.length);return e[n]}return e}return console.error("unexpected number of children in match"),null}}]);return e}(oR);customElements.define("qti-random",pd);var ph=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.cardinality!=="single"||!Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),null):t[0].baseType!==t[1].baseType?(console.error("The baseType of the two variables is different"),null):n.value.filter(function(t){return!e.value.includes(t)})}return null}}]);return e}(oR);customElements.define("qti-delete",ph);var pp,pf,pv=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);re(t,pp);return t}d(e,[{key:"getResult",value:function t(){if(!this.n)return console.error('qti-index: missing required attribute "n"'),null;if(this.children.length!==1)return console.error("qti-index: must have exactly one child container element"),null;var t=this.getVariables()[0];if(!t)return console.error("qti-index: missing container"),null;var e;if(!isNaN(Number(this.n)))e=Number(this.n);else{var n=rr(this,pp,pf).call(this,this.n);if(n===null)return console.error('qti-index: variable "'.concat(this.n,'" is not a valid number')),null;e=Number(n)}if(e<=0||!Number.isInteger(e))return console.error("qti-index: index must be a positive integer"),null;if(t.cardinality==="ordered"){var i=Array.isArray(t.value)?t.value:[t.value];return t.value===null||e>i.length?null:i[e-1]}else return console.error("qti-index: child must have ordered cardinality"),null}}]);return e}(oR);pp=new WeakSet,pf=function t(t){var e;var n=(e=this.context.variables.find(function(e){return e.identifier===t}))===null||e===void 0?void 0:e.value;return n===null||isNaN(Number(n))?null:Number(n)},n7([n({type:String})],pv.prototype,"n",2),pv=n7([ij("qti-index")],pv);return n8(ro)}();