@citolab/qti-components 7.0.4 → 7.0.6-beta.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.
Files changed (143) hide show
  1. package/cdn/chunk-22HAPLRD.js +0 -0
  2. package/cdn/chunk-4DFVJE2A.js +48 -0
  3. package/cdn/chunk-4I75QSIL.js +8 -0
  4. package/cdn/chunk-5WCOPF7O.js +73 -0
  5. package/cdn/chunk-A536ZOJJ.js +43 -0
  6. package/cdn/chunk-BLKKKK6C.js +11 -0
  7. package/cdn/chunk-DC2R556M.js +5 -0
  8. package/cdn/chunk-GALSGMIP.js +5 -0
  9. package/cdn/chunk-IXSX4SJX.js +1 -0
  10. package/cdn/chunk-KYOTSBCX.js +1 -0
  11. package/cdn/chunk-L4TDHAKL.js +24 -0
  12. package/cdn/chunk-LVW3MHTI.js +23 -0
  13. package/cdn/chunk-M6AATWPS.js +59 -0
  14. package/cdn/chunk-MFWSHIPH.js +17 -0
  15. package/cdn/chunk-QGKK4T2J.js +8 -0
  16. package/cdn/chunk-ROXN2HIJ.js +8 -0
  17. package/cdn/chunk-SQDSHH6N.js +3539 -0
  18. package/cdn/chunk-T4A5AZCI.js +939 -0
  19. package/cdn/chunk-VI2WKTN4.js +1 -0
  20. package/cdn/index.global.js +36 -36
  21. package/cdn/index.js +1 -4783
  22. package/cdn/qti-components/index.global.js +226 -0
  23. package/cdn/qti-components/index.js +1 -0
  24. package/cdn/qti-item/core/index.global.js +149 -0
  25. package/cdn/qti-item/core/index.js +1 -0
  26. package/cdn/qti-loader/index.global.js +1 -0
  27. package/cdn/qti-loader/index.js +1 -0
  28. package/cdn/qti-test/components/index.global.js +207 -0
  29. package/cdn/qti-test/components/index.js +1 -0
  30. package/cdn/qti-test/components/styles.global.js +44 -0
  31. package/cdn/qti-test/components/styles.js +1 -0
  32. package/cdn/qti-test/components/test-component.abstract.global.js +170 -0
  33. package/cdn/qti-test/components/test-component.abstract.js +1 -0
  34. package/cdn/qti-test/components/test-item-link.global.js +170 -0
  35. package/cdn/qti-test/components/test-item-link.js +1 -0
  36. package/cdn/qti-test/components/test-next.global.js +170 -0
  37. package/cdn/qti-test/components/test-next.js +1 -0
  38. package/cdn/qti-test/components/test-next.spec.css +1 -0
  39. package/cdn/qti-test/components/test-next.spec.global.js +64 -0
  40. package/cdn/qti-test/components/test-next.spec.js +713 -0
  41. package/cdn/qti-test/components/test-paging-buttons-stamp.global.js +207 -0
  42. package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -0
  43. package/cdn/qti-test/components/test-prev.global.js +170 -0
  44. package/cdn/qti-test/components/test-prev.js +1 -0
  45. package/cdn/qti-test/components/test-view.global.js +170 -0
  46. package/cdn/qti-test/components/test-view.js +1 -0
  47. package/cdn/qti-test/core/index.global.js +205 -0
  48. package/cdn/qti-test/core/index.js +1 -0
  49. package/cdn/qti-transformers/index.global.js +1 -0
  50. package/cdn/qti-transformers/index.js +1 -0
  51. package/dist/chunk-2CHF3TMY.js +3529 -0
  52. package/dist/chunk-2CHF3TMY.js.map +1 -0
  53. package/dist/{transformers/index.js → chunk-2OA7E3E7.js} +2 -1
  54. package/dist/chunk-2OA7E3E7.js.map +1 -0
  55. package/dist/chunk-3TFUBCJW.js +72 -0
  56. package/dist/chunk-3TFUBCJW.js.map +1 -0
  57. package/dist/chunk-44VE5POH.js +55 -0
  58. package/dist/chunk-44VE5POH.js.map +1 -0
  59. package/dist/chunk-4FH7P7YI.js +43 -0
  60. package/dist/chunk-4FH7P7YI.js.map +1 -0
  61. package/dist/chunk-4YG2FPKK.js +31 -0
  62. package/dist/chunk-4YG2FPKK.js.map +1 -0
  63. package/dist/chunk-6SG3NMKU.js +50 -0
  64. package/dist/chunk-6SG3NMKU.js.map +1 -0
  65. package/dist/chunk-ANLIJZBL.js +118 -0
  66. package/dist/chunk-ANLIJZBL.js.map +1 -0
  67. package/dist/chunk-CNQYM52B.js +569 -0
  68. package/dist/chunk-CNQYM52B.js.map +1 -0
  69. package/dist/chunk-F3NTI6TX.js +10 -0
  70. package/dist/chunk-F3NTI6TX.js.map +1 -0
  71. package/dist/chunk-F7HTXGGH.js +78 -0
  72. package/dist/chunk-F7HTXGGH.js.map +1 -0
  73. package/dist/chunk-MAC76UNI.js +1 -0
  74. package/dist/chunk-MAC76UNI.js.map +1 -0
  75. package/dist/chunk-OO6JSYLP.js +50 -0
  76. package/dist/chunk-OO6JSYLP.js.map +1 -0
  77. package/dist/chunk-QYN5S4EM.js +107 -0
  78. package/dist/chunk-QYN5S4EM.js.map +1 -0
  79. package/dist/chunk-UB5K44DB.js +30 -0
  80. package/dist/chunk-UB5K44DB.js.map +1 -0
  81. package/dist/chunk-UBZPSVSE.js +6301 -0
  82. package/dist/chunk-UBZPSVSE.js.map +1 -0
  83. package/dist/index.d.ts +13 -503
  84. package/dist/index.js +132 -13584
  85. package/dist/index.js.map +1 -1
  86. package/dist/item.css +10 -10
  87. package/dist/qti-components/index.d.ts +150 -0
  88. package/dist/qti-components/index.js +188 -0
  89. package/dist/qti-components/index.js.map +1 -0
  90. package/dist/qti-components-jsx.d.ts +147 -201
  91. package/dist/qti-item/core/index.d.ts +61 -0
  92. package/dist/qti-item/core/index.js +13 -0
  93. package/dist/qti-item/core/index.js.map +1 -0
  94. package/dist/{loader → qti-loader}/index.d.ts +1 -1
  95. package/dist/qti-loader/index.js +29 -0
  96. package/dist/qti-loader/index.js.map +1 -0
  97. package/dist/{qti-simple-choice-D0GiMrqD.d.ts → qti-simple-choice-DxWcdKHi.d.ts} +30 -40
  98. package/dist/qti-test/components/index.d.ts +11 -0
  99. package/dist/qti-test/components/index.js +32 -0
  100. package/dist/qti-test/components/index.js.map +1 -0
  101. package/dist/qti-test/components/styles.d.ts +8 -0
  102. package/dist/qti-test/components/styles.js +14 -0
  103. package/dist/qti-test/components/styles.js.map +1 -0
  104. package/dist/qti-test/components/test-component.abstract.d.ts +22 -0
  105. package/dist/qti-test/components/test-component.abstract.js +10 -0
  106. package/dist/qti-test/components/test-component.abstract.js.map +1 -0
  107. package/dist/qti-test/components/test-item-link.d.ts +20 -0
  108. package/dist/qti-test/components/test-item-link.js +12 -0
  109. package/dist/qti-test/components/test-item-link.js.map +1 -0
  110. package/dist/qti-test/components/test-next.d.ts +31 -0
  111. package/dist/qti-test/components/test-next.js +12 -0
  112. package/dist/qti-test/components/test-next.js.map +1 -0
  113. package/dist/qti-test/components/test-next.spec.css +2481 -0
  114. package/dist/qti-test/components/test-next.spec.css.map +1 -0
  115. package/dist/qti-test/components/test-next.spec.d.ts +13 -0
  116. package/dist/qti-test/components/test-next.spec.js +45904 -0
  117. package/dist/qti-test/components/test-next.spec.js.map +1 -0
  118. package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +21 -0
  119. package/dist/qti-test/components/test-paging-buttons-stamp.js +11 -0
  120. package/dist/qti-test/components/test-paging-buttons-stamp.js.map +1 -0
  121. package/dist/qti-test/components/test-prev.d.ts +31 -0
  122. package/dist/qti-test/components/test-prev.js +12 -0
  123. package/dist/qti-test/components/test-prev.js.map +1 -0
  124. package/dist/qti-test/components/test-view.d.ts +26 -0
  125. package/dist/qti-test/components/test-view.js +11 -0
  126. package/dist/qti-test/components/test-view.js.map +1 -0
  127. package/dist/qti-test/core/index.d.ts +121 -0
  128. package/dist/qti-test/core/index.js +27 -0
  129. package/dist/qti-test/core/index.js.map +1 -0
  130. package/dist/qti-transformers/index.js +12 -0
  131. package/dist/qti-transformers/index.js.map +1 -0
  132. package/dist/test.context-DbSTxKk_.d.ts +99 -0
  133. package/dist/vscode.html-custom-data.json +53 -42
  134. package/package.json +100 -111
  135. package/dist/custom-element-eslint-rules.js +0 -329
  136. package/dist/custom-elements.json +0 -27271
  137. package/dist/loader/index.js +0 -310
  138. package/dist/loader/index.js.map +0 -1
  139. package/dist/qti-simple-choice-CfgBEvdI.d.ts +0 -1143
  140. package/dist/qti-simple-choice-UTrFa_RQ.d.ts +0 -1177
  141. package/dist/qti-simple-choice-zEsDq3c0.d.ts +0 -1147
  142. package/dist/transformers/index.js.map +0 -1
  143. /package/dist/{transformers → qti-transformers}/index.d.ts +0 -0
@@ -0,0 +1,939 @@
1
+ import{b as ae,c as W,d as Nt,e as Ht,f as Be,g as le,h as K,i as ce,j as $t}from"./chunk-L4TDHAKL.js";import{a as Dt}from"./chunk-LVW3MHTI.js";import{a as Lt,b as R}from"./chunk-M6AATWPS.js";import{a as f,b as d,c as C,d as ze,e as Vt,f as M}from"./chunk-5WCOPF7O.js";import{a as b,d as h,e as nt,f as ne,g as A,j as v}from"./chunk-4DFVJE2A.js";import{e as o}from"./chunk-VI2WKTN4.js";var It=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],T=Symbol("item");var k=class extends v{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent=null;this._handleDisabledChange=(e,t)=>{this._interactionElements.forEach(r=>r.disabled=t)};this._handleReadonlyChange=(e,t)=>this._interactionElements.forEach(r=>r.readonly=t);this._context={identifier:this.getAttribute("identifier"),variables:It};this._initialContext={...this._context,variables:this._context.variables};this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",e=>{this._context={...this._context,variables:[...this._context.variables,e.detail.variable]},this._initialContext=this._context,e.stopPropagation()}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let t=e.detail;this._feedbackElements.push(t),(Number(this._context.variables.find(i=>i.identifier==="numAttempts")?.value)||0)>0&&t.checkShowFeedback(t.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:t,countAttempt:r}=e.detail;this.validate(),this.updateResponseVariable(t,"true"),this.processResponse(r)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:t,value:r}=e.detail;this.updateOutcomeVariable(t,r),e.stopPropagation()}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>({identifier:e.identifier,value:e.value,type:e.type,...e.type==="outcome"&&e.identifier==="SCORE"?{externalScored:e.externalScored}:{}}))}set variables(e){if(!Array.isArray(e)||e.some(t=>!("identifier"in t))){console.warn("variables property should be an array of VariableDeclaration");return}this._context={...this._context,variables:this._context.variables.map(t=>{let r=e.find(i=>i.identifier===t.identifier);return r?{...t,...r}:t})},this._context.variables.forEach(t=>{if(t.type==="response"){let r=this._interactionElements.find(i=>i.responseIdentifier===t.identifier);r&&(r.value=t.value)}})}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this._emit("qti-assessment-item-connected",this)}set responses(e){if(e)for(let t of e){this.getResponse(t.responseIdentifier)&&this.updateResponseVariable(t.responseIdentifier,t.response);let i=this._interactionElements.find(a=>a.getAttribute("response-identifier")===t.responseIdentifier);i&&(i.value=t.response)}}render(){return h`<slot></slot>`}showCorrectResponse(e){let r=this._context.variables.filter(i=>"correctResponse"in i&&i.correctResponse).map(i=>({responseIdentifier:i.identifier,response:i.correctResponse}));for(let i of r){let a=this._interactionElements.find(p=>p.getAttribute("response-identifier")===i.responseIdentifier);a&&(a.correctResponse=e?i.response:"")}}processResponse(e=!0){this.validate();let t=this.querySelector("qti-response-processing");return!t||!t.process?!1:(t.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+this._context.variables.find(r=>r.identifier==="numAttempts")?.value+1).toString()),this._emit("qti-response-processed"),!0)}resetResponses(){this._context=this._initialContext}getResponse(e){return this.getVariable(e)}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._context.variables.find(t=>t.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:t,response:r}=e.detail;this.updateResponseVariable(t,r)}updateResponseVariable(e,t){this._context={...this._context,variables:this._context.variables.map(r=>r.identifier!==e?r:{...r,value:t})},this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:Array.isArray(t)?[...t]:t}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(e,t){let r=this.getOutcome(e);if(!r){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context={...this._context,variables:this._context.variables.map(i=>i.identifier!==e?i:{...i,value:r.cardinality==="single"?t:[...i.value,t]})},this._feedbackElements.forEach(i=>i.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:this._context.variables.find(i=>i.identifier===e)?.value})}validate(){return this._interactionElements.every(e=>e.validate())?!0:this._interactionElements.some(e=>e.validate())?!1:null}_getCompletionStatus(){let e=this.validate();return e===!0?"completed":e===!1?"incomplete":"not_attempted"}_emit(e,t=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}};o([d({type:String})],k.prototype,"title",2),o([d({type:String})],k.prototype,"identifier",2),o([d({type:String})],k.prototype,"adaptive",2),o([d({type:String})],k.prototype,"timeDependent",2),o([d({type:Boolean})],k.prototype,"disabled",2),o([M("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"_handleDisabledChange",2),o([d({type:Boolean})],k.prototype,"readonly",2),o([M("readonly",{waitUntilFirstUpdate:!0})],k.prototype,"_handleReadonlyChange",2),o([Lt({context:T})],k.prototype,"_context",2),k=o([f("qti-assessment-item")],k);var pe=class extends v{constructor(){super(...arguments);this.identifier="";this.href=""}async connectedCallback(){super.connectedCallback();let e=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0,composed:!0});if(this.dispatchEvent(e)){let i=this.closest("qti-assessment-item").querySelector(`[data-stimulus-idref=${this.identifier}]`);i?await this.updateStimulusRef(i):console.warn(`Stimulus with data-stimulus-idref ${this.identifier} not found`)}}async updateStimulusRef(e){let t=await Dt().load(this.href).then(r=>r.htmlDoc());if(t){let r=t.querySelectorAll("qti-stimulus-body, qti-stylesheet");e.innerHTML="",e.append(...r)}}};o([d({type:String})],pe.prototype,"identifier",2),o([d({type:String})],pe.prototype,"href",2),pe=o([f("qti-assessment-stimulus-ref")],pe);var Ot={toAttribute:l=>l?"true":"false",fromAttribute:l=>l==="true"};function N(l,s){class e extends l{constructor(...i){super(...i);this.identifier="";this.tabIndex=0;this.disabled=!1;this.readonly=!1;this.internals=this.attachInternals()}handleDisabledChange(i,a){this.tabIndex=a?-1:0,a&&this.blur()}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent(`register-${s}`,{bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent(`unregister-${s}`,{bubbles:!0,composed:!0}))}_onKeyUp(i){i.altKey||i.code==="Space"&&(i.preventDefault(),this._activate())}_onClick(){this.disabled||this.readonly||(this.focus(),this._activate())}_activate(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent(`activate-${s}`,{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}render(){return h`<slot></slot>`}}return o([d({type:String})],e.prototype,"identifier",2),o([d({type:Number,reflect:!0,attribute:"tabindex"})],e.prototype,"tabIndex",2),o([d({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:Ot})],e.prototype,"disabled",2),o([d({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:Ot})],e.prototype,"readonly",2),o([M("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e}var Pt=b`
2
+ :host {
3
+ display: block;
4
+ }
5
+ `;var xe=class extends v{render(){return h`<slot name="qti-rubric-block"></slot><slot></slot>`}};xe.styles=Pt,xe=o([f("qti-item-body")],xe);var Ye=class extends v{render(){return h`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};Ye=o([f("qti-prompt")],Ye);var je=class extends v{constructor(){super(...arguments);this.styleElement=null}firstUpdated(e){super.firstUpdated(e);let t=this.getAttribute("href");if(t!==null&&fetch(t).then(r=>r.text()).then(r=>{let i=this.minifyCss(r);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent=`@scope {${i}}`,this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}).catch(r=>{console.error("Failed to load stylesheet:",r)}),this.textContent!==null&&this.textContent.trim()!==""){let r=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent=`@scope {${r}}`,this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}minifyCss(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}disconnectedCallback(){if(this.styleElement)try{this.styleElement.remove()}catch(e){console.error("Could not remove stylesheet:",e)}super.disconnectedCallback()}};je=o([f("qti-stylesheet")],je);var J=class extends v{render(){return h`<slot></slot>`}defaultValues(s){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let t=e.map(r=>r.innerHTML.trim());return t.length>1||s.cardinality==="multiple"||s.cardinality==="ordered"?t:t[0]}};J=o([f("qti-variabledeclaration")],J);var H=class extends J{constructor(){super(...arguments);this.externalScored=null}render(){let e=this.itemContext?.variables.find(t=>t.identifier===this.identifier)?.value;return h`${JSON.stringify(e,null,2)}`}get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let t=new Map;for(let r of e.querySelectorAll("qti-interpolation-table-entry")){!r.getAttribute("source-value")&&r.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let i=parseInt(r.getAttribute("source-value")),a=parseInt(r.getAttribute("target-value"));(isNaN(i)||isNaN(a))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),t.set(i,a)}return t}return null}connectedCallback(){super.connectedCallback();let e={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};H.styles=[b`
6
+ :host {
7
+ display: none;
8
+ }
9
+ `],o([d({type:String,attribute:"base-type"})],H.prototype,"baseType",2),o([d({type:String,attribute:"external-scored"})],H.prototype,"externalScored",2),o([d({type:String})],H.prototype,"identifier",2),o([d({type:String})],H.prototype,"cardinality",2),o([R({context:T,subscribe:!0}),C()],H.prototype,"itemContext",2),H=o([f("qti-outcome-declaration")],H);var z=class extends J{render(){let s=this.itemContext?.variables.find(e=>e.identifier===this.identifier)?.value;return h`${JSON.stringify(s,null,2)}`}connectedCallback(){super.connectedCallback();let s={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};s.value=this.defaultValues(s),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:s}}))}get correctResponse(){let s,e=this.querySelector("qti-correct-response");if(e){let t=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&t.length>0)s=t[0].textContent,t[0].remove();else if(this.cardinality!=="single"){s=[];for(let r=0;r<t.length;r++)s.push(t[r].textContent),t[r].remove()}}return s}get mapping(){return this.querySelector("qti-mapping")}};z.styles=[b`
10
+ :host {
11
+ display: none;
12
+ }
13
+ `],o([d({type:String,attribute:"base-type"})],z.prototype,"baseType",2),o([d({type:String})],z.prototype,"identifier",2),o([d({type:String})],z.prototype,"cardinality",2),o([R({context:T,subscribe:!0}),C()],z.prototype,"itemContext",2),z=o([f("qti-response-declaration")],z);var Xe=class extends v{};Xe=o([f("qti-companion-materials-info")],Xe);var We=class extends v{render(){return h`<slot></slot>`}};We=o([f("qti-content-body")],We);var $=class extends v{handleclassNamesChange(){this.classNames.split(" ").forEach(e=>{switch(e){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return h`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};$.styles=b`
14
+ :host {
15
+ display: block;
16
+ }
17
+ `,o([d({type:String})],$.prototype,"id",2),o([d({type:String})],$.prototype,"use",2),o([d({type:String})],$.prototype,"view",2),o([d({type:String,attribute:"class"})],$.prototype,"classNames",2),o([M("classNames",{waitUntilFirstUpdate:!0})],$.prototype,"handleclassNamesChange",1),$=o([f("qti-rubric-block")],$);var dr=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),Ee=l=>{if(typeof l=="string")return l;let s=dr();return s==="."?l.toLocaleString():l.toString().replace(".","").replace(s,".")};function at(l){return l==null}function Ce(l){return l.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}var S=class extends v{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(s){let e=this._context.variables.find(r=>r.identifier===s)||null;if(this.outcomeIdentifier!==s||!e)return;let t=!1;Array.isArray(e.value)?t=e.value.includes(this.identifier):t=!at(this.identifier)&&!at(e?.value)&&this.identifier===e.value||!1,this.showFeedback(t)}showFeedback(s){this.showStatus=s&&this.showHide==="show"||!s&&this.showHide==="hide"?"on":"off"}};o([d({type:String,attribute:"show-hide"})],S.prototype,"showHide",2),o([d({type:String,attribute:"outcome-identifier"})],S.prototype,"outcomeIdentifier",2),o([d({type:String})],S.prototype,"identifier",2),o([d({type:String,attribute:!1})],S.prototype,"showStatus",2),o([R({context:T,subscribe:!0}),C()],S.prototype,"_context",2);var qe=class extends S{render(){return h` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `}firstUpdated(s){this.checkShowFeedback(this.outcomeIdentifier)}};qe.styles=b`
18
+ :host {
19
+ display: block;
20
+ }
21
+ .on {
22
+ display: block;
23
+ }
24
+ .off {
25
+ display: none;
26
+ }
27
+ `,qe=o([f("qti-feedback-block")],qe);var we=class extends S{constructor(){super(...arguments);this.render=()=>h` <slot part="feedback" class="${this.showStatus}"></slot> `}};we.styles=b`
28
+ .on {
29
+ display: inline-block;
30
+ }
31
+ .off {
32
+ display: none;
33
+ }
34
+ `,we=o([f("qti-feedback-inline")],we);var Te=class extends S{render(){return h`
35
+ <dialog class="qti-dialog" part="feedback" ?open="${this.showStatus==="on"}">
36
+ <slot></slot>
37
+ <div style="margin-top: var(--qti-gap-size); text-align: center;">
38
+ <button class="button close-button" @click="${this.closeFeedback}"></button>
39
+ </div>
40
+ </dialog>
41
+ `}openFeedback(){let s=this.shadowRoot?.querySelector("dialog");s&&!s.open&&s.showModal()}closeFeedback(){let s=this.shadowRoot?.querySelector("dialog");s&&s.open&&(s.close(),this.showStatus="off")}firstUpdated(){this.showStatus==="on"&&this.openFeedback()}updated(s){s.has("showStatus")&&(this.showStatus==="on"?this.openFeedback():this.closeFeedback())}};Te.styles=b`
42
+ .qti-dialog {
43
+ background: var(--qti-bg);
44
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
45
+ border-radius: var(--qti-border-radius);
46
+ padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
47
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
48
+ position: fixed;
49
+ top: 50%;
50
+ left: 50%;
51
+ transform: translate(-50%, -50%);
52
+ z-index: 1000;
53
+ width: auto;
54
+ max-width: 90%;
55
+ }
56
+
57
+ .button {
58
+ border-radius: var(--qti-border-radius);
59
+ padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
60
+ background-color: var(--qti-bg-active);
61
+ border: var(--qti-border-active);
62
+ cursor: pointer;
63
+ position: relative;
64
+ display: inline-block;
65
+ }
66
+
67
+ .button:hover {
68
+ background-color: var(--qti-hover-bg);
69
+ }
70
+
71
+ .button:disabled {
72
+ background-color: var(--qti-disabled-bg);
73
+ color: var(--qti-disabled-color);
74
+ cursor: not-allowed;
75
+ }
76
+
77
+ .button:focus {
78
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
79
+ }
80
+
81
+ /* Text content of the button */
82
+ .button::after {
83
+ content: var(--qti-close-text, 'Close');
84
+ color: inherit;
85
+ font-size: inherit;
86
+ text-align: center;
87
+ display: inline-block;
88
+ line-height: 1.5;
89
+ }
90
+ `,Te=o([f("qti-modal-feedback")],Te);var Z=l=>l??A;var x=class extends v{constructor(){super();this.disabled=!1;this.readonly=!1;this._internals=this.attachInternals()}reportValidity(){return this._internals.reportValidity()}reset(){this.value=""}get correctResponse(){return this._correctResponse}set correctResponse(e){this._correctResponse=e}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier}}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(e)?[...e]:e}}))}};x.formAssociated=!0,o([d({type:String,attribute:"response-identifier"})],x.prototype,"responseIdentifier",2),o([d({reflect:!0,type:Boolean})],x.prototype,"disabled",2),o([d({reflect:!0,type:Boolean})],x.prototype,"readonly",2),o([C()],x.prototype,"_correctResponse",2);var Ft=b`
91
+ /* PK: display host as block, else design will be collapsed */
92
+ :host {
93
+ display: block;
94
+ }
95
+ textarea {
96
+ box-sizing: border-box;
97
+ width: 100%;
98
+ height: 100%;
99
+ border: 0;
100
+ }
101
+ `;var _=class extends x{constructor(){super(...arguments);this._rows=5;this._value=""}handleclassNamesChange(e,t){let r=t.split(" "),i=!1;if(r.forEach(a=>{if(a.startsWith("qti-height-lines-")){let p=a.replace("qti-height-lines-","");this._rows=parseInt(p),i=!0}}),!i&&this.expectedLength){let a=Math.ceil(this.expectedLength/50);this._rows=a}}get value(){return this._value}set value(e){if(typeof e=="string"){this._value=e;let t=new FormData;t.append(this.responseIdentifier,e),this._internals.setFormValue(t),this.validate()}else throw new Error("Value must be a string")}validate(){let e=this.shadowRoot.querySelector("textarea");if(!e)return!1;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),e.setCustomValidity("");let t=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:`^${this.patternMask}$`,r=new RegExp(t);e.checkValidity()&&r.test(e.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),e.setCustomValidity(this.dataPatternmaskMessage))}else{let t=e.checkValidity();this._internals.setValidity(t?{}:{customError:!1})}return this._value!==""&&e.checkValidity()}reportValidity(){let e=this.shadowRoot.querySelector("textarea");if(!e)return!1;let t=this.validate();return t||e.reportValidity(),t}render(){return h`<slot name="prompt"></slot
102
+ ><textarea
103
+ part="textarea"
104
+ name="${this.responseIdentifier}"
105
+ spellcheck="false"
106
+ autocomplete="off"
107
+ maxlength="${5e3}"
108
+ @keydown="${e=>e.stopImmediatePropagation()}"
109
+ @keyup="${this.textChanged}"
110
+ @change="${this.textChanged}"
111
+ @blur="${e=>{this.reportValidity()}}"
112
+ placeholder="${Z(this.placeholderText?this.placeholderText:void 0)}"
113
+ rows="${this._rows}"
114
+ ?disabled="${this.disabled}"
115
+ ?readonly="${this.readonly}"
116
+ .value=${this._value}
117
+ ></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let t=e.target;this.setEmptyAttribute(t.value),this._value!==t.value&&(this.value=t.value,this.saveResponse(t.value))}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};_.styles=Ft,o([C()],_.prototype,"_rows",2),o([d({type:Number,attribute:"expected-length"})],_.prototype,"expectedLength",2),o([d({type:String,attribute:"pattern-mask"})],_.prototype,"patternMask",2),o([d({type:String,attribute:"placeholder-text"})],_.prototype,"placeholderText",2),o([d({type:String,attribute:"data-patternmask-message"})],_.prototype,"dataPatternmaskMessage",2),o([C()],_.prototype,"_value",2),o([d({type:String,attribute:"class"})],_.prototype,"classNames",2),o([M("classNames")],_.prototype,"handleclassNamesChange",1),_=o([f("qti-extended-text-interaction")],_);var Ut=()=>new ct,ct=class{},lt=new WeakMap,Ms=K(class extends $t{render(l){return A}update(l,[s]){let e=s!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=s,this.ht=l.options?.host,this.rt(this.ct=l.element)),A}rt(l){if(this.isConnected||(l=void 0),typeof this.Y=="function"){let s=this.ht??globalThis,e=lt.get(s);e===void 0&&(e=new WeakMap,lt.set(s,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,l),l!==void 0&&this.Y.call(this.ht,l)}else this.Y.value=l}get lt(){return typeof this.Y=="function"?lt.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var zt=b`
118
+ :host {
119
+ display: inline-block;
120
+ }
121
+ [part='correct'] {
122
+ position: absolute;
123
+ width: 100%;
124
+ }
125
+ :host(.qti-input-width-1) [part='input'] {
126
+ width: 1.1rem;
127
+ min-width: 1.1rem;
128
+ }
129
+
130
+ :host(.qti-input-width-2) [part='input'] {
131
+ width: 2.3rem;
132
+ min-width: 2.3rem;
133
+ }
134
+
135
+ :host(.qti-input-width-3) [part='input'] {
136
+ width: 3.3rem;
137
+ min-width: 3.3rem;
138
+ }
139
+
140
+ :host(.qti-input-width-4) [part='input'] {
141
+ width: 4.2rem;
142
+ min-width: 4.2rem;
143
+ }
144
+
145
+ :host(.qti-input-width-6) [part='input'] {
146
+ width: 6.6rem;
147
+ min-width: 6.6rem;
148
+ }
149
+
150
+ :host(.qti-input-width-10) [part='input'] {
151
+ width: 8rem;
152
+ min-width: 8rem;
153
+ }
154
+
155
+ :host(.qti-input-width-15) [part='input'] {
156
+ width: 12rem;
157
+ min-width: 12rem;
158
+ }
159
+
160
+ :host(.qti-input-width-20) [part='input'] {
161
+ width: 17rem;
162
+ min-width: 17rem;
163
+ }
164
+
165
+ :host(.qti-input-width-25) [part='input'] {
166
+ width: 20rem;
167
+ min-width: 20rem;
168
+ }
169
+
170
+ :host(.qti-input-width-30) [part='input'] {
171
+ width: 24rem;
172
+ min-width: 24rem;
173
+ }
174
+
175
+ :host(.qti-input-width-35) [part='input'] {
176
+ width: 28rem;
177
+ min-width: 28rem;
178
+ }
179
+
180
+ :host(.qti-input-width-40) [part='input'] {
181
+ width: 32rem;
182
+ min-width: 32rem;
183
+ }
184
+
185
+ :host(.qti-input-width-45) [part='input'] {
186
+ width: 36rem;
187
+ min-width: 36rem;
188
+ }
189
+
190
+ :host(.qti-input-width-50) [part='input'] {
191
+ width: 40rem;
192
+ min-width: 40rem;
193
+ }
194
+
195
+ :host(.qti-input-width-72) [part='input'] {
196
+ width: 57rem;
197
+ min-width: 57rem;
198
+ }
199
+ `;var I=class extends x{constructor(){super(...arguments);this._value="";this.inputRef=Ut()}get value(){return this._value}set value(e){if(typeof e=="string"){this._value=e;let t=new FormData;t.append(this.responseIdentifier,e),this._internals.setFormValue(t),this.validate()}else throw new Error("Value must be a string")}validate(){let e=this.shadowRoot.querySelector("input");if(!e)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),e.setCustomValidity(""),e.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),e.setCustomValidity(this.dataPatternmaskMessage));else{let t=e.checkValidity();this._internals.setValidity(t?{}:{customError:!1})}return this._value!==""&&e.checkValidity()}render(){return h`
200
+ <input
201
+ part="input"
202
+ name="${this.responseIdentifier}"
203
+ spellcheck="false"
204
+ autocomplete="off"
205
+ @blur="${e=>{this.reportValidity()}}"
206
+ @keydown="${e=>e.stopImmediatePropagation()}"
207
+ @keyup="${this.textChanged}"
208
+ @change="${this.textChanged}"
209
+ type="${this.patternMask=="[0-9]*"?"number":"text"}"
210
+ placeholder="${Z(this.placeholderText?this.placeholderText:void 0)}"
211
+ .value="${this._value}"
212
+ pattern="${Z(this.patternMask?this.patternMask:void 0)}"
213
+ maxlength=${1e3}
214
+ ?disabled="${this.disabled}"
215
+ ?readonly="${this.readonly}"
216
+ />
217
+ <div part="correct">${this._correctResponse}</div>
218
+ `}textChanged(e){if(this.disabled||this.readonly)return;let t=e.target;this.setEmptyAttribute(t.value),this._value!==t.value&&(this.value=t.value,this.saveResponse(t.value))}reportValidity(){let e=this.shadowRoot.querySelector("input");if(!e)return!1;let t=this.validate();return t||e.reportValidity(),t}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};I.styles=zt,o([d({type:Number,attribute:"expected-length"})],I.prototype,"expectedLength",2),o([d({type:String,attribute:"pattern-mask"})],I.prototype,"patternMask",2),o([d({type:String,attribute:"placeholder-text"})],I.prototype,"placeholderText",2),o([d({type:String,attribute:"data-patternmask-message"})],I.prototype,"dataPatternmaskMessage",2),o([C()],I.prototype,"_value",2),I=o([f("qti-text-entry-interaction")],I);var G=(l,s)=>{class e extends l{constructor(){super(...arguments);this._choiceElements=[];this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(i,a)=>{this._choiceElements.forEach(p=>p.disabled=a)};this._handleReadonlyChange=(i,a)=>{this._choiceElements.forEach(p=>p.readonly=a)};this._value=""}_handleMaxChoicesChange(i,a){this._determineInputType()}get value(){return Array.isArray(this._value)?this._value.join(","):this._value}set value(i){if(this.maxChoices>1&&typeof i=="string"?this._value=i.split(","):this._value=i,Array.isArray(this._value)){let a=new FormData;this._value.forEach(p=>{a.append(this.responseIdentifier,p)}),this._internals.setFormValue(a)}else this._internals.setFormValue(this._value);this._updateChoiceSelection()}get correctResponse(){return this._correctResponse}set correctResponse(i){this._correctResponse=i;let a=Array.isArray(i)?i:[i];this._choiceElements.forEach(p=>{p.internals.states.delete("correct-response"),p.internals.states.delete("incorrect-response"),a.length>0&&(a.includes(p.identifier)?p.internals.states.add("correct-response"):p.internals.states.add("incorrect-response"))})}connectedCallback(){super.connectedCallback(),this.addEventListener(`register-${s}`,this._registerChoiceElement),this.addEventListener(`unregister-${s}`,this._unregisterChoiceElement),this.addEventListener(`activate-${s}`,this._choiceElementSelectedHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`register-${s}`,this._registerChoiceElement),this.removeEventListener(`unregister-${s}`,this._unregisterChoiceElement),this.removeEventListener(`activate-${s}`,this._choiceElementSelectedHandler)}validate(){let i=this._choiceElements.filter(c=>this._getChoiceChecked(c)),a=i.length,p=!0,n="";return this.maxChoices!==0&&a>this.maxChoices?(p=!1,n=this.dataset.maxSelectionsMessage||`You can select at most ${this.maxChoices} choices.`):a<this.minChoices&&(p=!1,n=this.dataset.minSelectionsMessage||`You must select at least ${this.minChoices} choices.`),i.length>0&&this._internals.setValidity(p?{}:{customError:!0},n,i[a-1]||this._choiceElements[0]||this),this.reportValidity(),p}reportValidity(){return this._validationMessageElement&&(this._internals.validity.valid?(this._validationMessageElement.textContent="",this._validationMessageElement.style.display="none"):(this._validationMessageElement.textContent=this._internals.validationMessage,this._validationMessageElement.style.display="block")),this._internals.validity.valid}_registerChoiceElement(i){i.stopPropagation();let a=i.target;a.disabled=this.disabled,this._choiceElements.push(a),this._setInputType(a)}_unregisterChoiceElement(i){i.stopPropagation();let a=i.target;this._choiceElements=this._choiceElements.filter(p=>p!==a)}_determineInputType(){this._choiceElements.forEach(i=>{this._setInputType(i)})}_setInputType(i){this._internals.ariaLabel=this.maxChoices===1?"radio-group":"checkbox-group";let a=this.maxChoices===1?"radio":"checkbox";i.internals.role=a,i.internals.states.delete(a==="radio"?"checkbox":"radio"),i.internals.states.add(a)}_choiceElementSelectedHandler(i){this._toggleChoiceChecked(i.target),this.maxChoices===1&&this._choiceElements.forEach(a=>{a.identifier!==i.detail.identifier&&this._setChoiceChecked(a,!1)}),this._handleChoiceSelection()}_setChoiceChecked(i,a){i.internals?.states&&(a?(i.internals.states.add("--checked"),i.internals.ariaChecked="true"):(i.internals.states.delete("--checked"),i.internals.ariaChecked="false"))}_getChoiceChecked(i){return i.internals.states.has("--checked")}_toggleChoiceChecked(i){let a=this._getChoiceChecked(i);this._setChoiceChecked(i,!a)}_handleChoiceSelection(){let a=this._choiceElements.filter(p=>this._getChoiceChecked(p)).map(p=>p.identifier);this.value=this.maxChoices===1?a[0]||"":a,this.validate(),this.saveResponse(this._value)}_updateChoiceSelection(){let i=Array.isArray(this._value)?this._value:[this._value];this._choiceElements.forEach(a=>{let p=i.includes(a.identifier);this._setChoiceChecked(a,p)})}}return o([ze("#validationMessage")],e.prototype,"_validationMessageElement",2),o([d({type:Number,attribute:"min-choices"})],e.prototype,"minChoices",2),o([d({type:Number,attribute:"max-choices"})],e.prototype,"maxChoices",2),o([M("maxChoices",{waitUntilFirstUpdate:!0})],e.prototype,"_handleMaxChoicesChange",1),o([M("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"_handleDisabledChange",2),o([M("readonly",{waitUntilFirstUpdate:!0})],e.prototype,"_handleReadonlyChange",2),e};var Ke=class extends G(x,"qti-hottext"){constructor(){super(...arguments);this.render=()=>h`<slot></slot>`}};Ke=o([f("qti-hottext-interaction")],Ke);var Me=class extends ce{constructor(s){if(super(s),this.it=A,s.type!==le.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(s){if(s===A||s==null)return this._t=void 0,this.it=s;if(s===ne)return s;if(typeof s!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(s===this.it)return this._t;this.it=s;let e=[s];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Me.directiveName="unsafeHTML",Me.resultType=1;var Q=K(Me);var ee=class extends x{constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
219
+ :host {
220
+ display: inline-block;
221
+ }
222
+ slot {
223
+ display: flex;
224
+ flex-direction: column;
225
+ }
226
+ [role='menu'] {
227
+ position: absolute;
228
+ z-index: 1000;
229
+ }
230
+ .anchor {
231
+ /* anchor-name: --infobox; */
232
+ width: fit-content;
233
+ }
234
+
235
+ .positionedElement {
236
+ position: absolute;
237
+ /* position-anchor: --infobox; */
238
+ /* top: anchor(bottom); */
239
+ }
240
+ `]}render(){return h`
241
+ <select part="select" @change="${this.choiceSelected}" ?disabled="${this.disabled}" ?readonly="${this.readonly}">
242
+ ${this.options.map(e=>h`
243
+ <option value="${e.value}" ?selected="${e.selected}">${Q(e.textContent)}</option>
244
+ `)}
245
+ </select>
246
+
247
+ ${Q(this.correctOption)}
248
+ `}connectedCallback(){super.connectedCallback(),this.addEventListener("on-dropdown-selected",this.choiceSelected);let e=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...e.map(t=>({textContent:t.innerHTML,value:t.getAttribute("identifier"),selected:!1}))]}disconnectedCallback(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}validate(){let e=this.options.find(t=>t.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,t)=>({...e,selected:t===0}))}set value(e){this.options=this.options.map(t=>(e===t.value&&(t.selected=!0),t))}get value(){return this.options.find(e=>e.selected).value}set correctResponse(e){if(e===""){this.correctOption="";return}this.correctOption=`<span part="correct-option">${this.options.find(t=>e===t.value).textContent}</span>`}choiceSelected(e){let t=e.target.value;this.options=this.options.map(r=>({...r,selected:r.value===t})),this.saveResponse(t)}};ee.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"],o([C()],ee.prototype,"options",2),o([C()],ee.prototype,"correctOption",2),o([d({attribute:"data-prompt",type:String})],ee.prototype,"dataPrompt",2),ee=o([f("qti-inline-choice-interaction")],ee);var Je=(l,s)=>{class e extends l{constructor(){super(...arguments);this.shuffle="false"}connectedCallback(){super.connectedCallback(),this._applyShuffle()}updated(i){i.has("shuffle")&&this._applyShuffle()}_applyShuffle(){this.shuffle==="true"?this._shuffleChoices():this._resetShuffleChoices()}_shuffleChoices(){let i=Array.from(this.querySelectorAll(s)),a=i.filter(g=>g.hasAttribute("fixed")),p=i.filter(g=>!g.hasAttribute("fixed"));if(p.length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return}let n=[...p],c=!1,u=0;for(;!c&&u<10;){u++;for(let g=p.length-1;g>0;g--){let y=Math.floor(Math.random()*(g+1));[p[g],p[y]]=[p[y],p[g]]}c=!p.every((g,y)=>g===n[y])}c||console.warn("Failed to shuffle the choices after multiple attempts.");let m=1;[...a,...p].forEach(g=>{g.style.setProperty("order",String(m++))})}_resetShuffleChoices(){this.querySelectorAll(s).forEach(i=>{i.style.setProperty("order","initial")})}}return o([d({type:String,reflect:!0})],e.prototype,"shuffle",2),e};var Bt=(l,s)=>{class e extends l{constructor(){super(...arguments);this._classes=[];this._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];this._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"]}set class(i){i&&(this._classes=i.split(" "),this._addLabels())}get class(){return this._classes?.join(" ")||""}updated(i){super.updated(i),i.has("shuffle")&&this._addLabels()}_addLabels(){let i=this._classes.some(p=>this._allLabels.includes(p)||this._allLabelSuffixes.includes(p)),a=p=>!isNaN(+p);if(i){let n=Array.from(this.querySelectorAll("qti-simple-choice")).map(c=>c).map((c,u)=>({el:c,order:a(c.style.order)?+c.style.order:u+1})).sort((c,u)=>c.order-u.order).map(c=>c.el);for(let c=0;c<n.length;c++)n[c].marker=this._getLabel(c+1)}}_getLabel(i){let a=this._classes.filter(c=>this._allLabels.includes(c)).pop(),p=this._classes.filter(c=>this._allLabelSuffixes.includes(c)).pop();!a&&p&&(a="qti-labels-upper-alpha");let n="";switch(a){case"qti-labels-decimal":n=`${i}`;break;case"qti-labels-lower-alpha":n=`${String.fromCharCode(97+i-1)}`;break;case"qti-labels-upper-alpha":n=`${String.fromCharCode(65+i-1)}`;break}return p==="qti-labels-suffix-period"?n+=".":p==="qti-labels-suffix-parenthesis"&&(n+=")"),n}}return o([d({type:String,reflect:!0})],e.prototype,"class",1),e};var Yt=b`
249
+ [part='slot'] {
250
+ display: flex;
251
+ flex-direction: column;
252
+ gap: var(--qti-gap-size);
253
+ flex-wrap: wrap;
254
+ }
255
+
256
+ ::slotted(qti-simple-choice) {
257
+ flex: 0 0
258
+ calc((100% - (var(--qti-gap-size) * var(--choice-interactions-stacking))) / var(--choice-interactions-stacking)) !important;
259
+ box-sizing: border-box !important;
260
+ }
261
+
262
+ :host(.qti-choices-stacking-1) [part='slot'] {
263
+ flex-direction: row;
264
+ --choice-interactions-stacking: 1;
265
+ }
266
+
267
+ :host(.qti-choices-stacking-2) [part='slot'] {
268
+ flex-direction: row;
269
+ --choice-interactions-stacking: 2;
270
+ }
271
+ :host(.qti-choices-stacking-3) [part='slot'] {
272
+ flex-direction: row;
273
+ --choice-interactions-stacking: 3;
274
+ }
275
+ :host(.qti-choices-stacking-4) [part='slot'] {
276
+ flex-direction: row;
277
+ --choice-interactions-stacking: 4;
278
+ }
279
+ :host(.qti-choices-stacking-5) [part='slot'] {
280
+ flex-direction: row;
281
+ --choice-interactions-stacking: 5;
282
+ }
283
+ :host([orientation='horizontal']) [part='slot'] {
284
+ flex-direction: row;
285
+ }
286
+ `;var de=class extends Bt(Je(G(x,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"){constructor(){super(),this._internals.role="group"}render(){return h`
287
+ <slot part="prompt" name="prompt"></slot><slot part="slot"></slot>
288
+ <div part="message" role="alert" id="validationMessage"></div>
289
+ `}};de.styles=Yt,o([d({type:String})],de.prototype,"orientation",2),de=o([f("qti-choice-interaction")],de);var ke=class extends x{constructor(){super(...arguments);this._file=null;this._base64=null}reset(){this._file=null,this._base64=null,this.saveResponse(null)}validate(){return this._base64!==null}get value(){return this._base64}set value(e){if(typeof e=="string")this._base64=e,this.saveResponse(e);else if(e===null)this.reset();else throw new Error("Value must be a Base64-encoded string or null")}static get properties(){return{...x.properties}}render(){return h`
290
+ <div>
291
+ <slot name="prompt"></slot>
292
+ <input type="file" @change="${this._onFileChange}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" />
293
+ </div>
294
+ `}async _onFileChange(e){let t=e.target;t.files&&t.files.length>0&&(this._file=t.files[0],this._base64=await this._convertToBase64(this._file),this.saveResponse(this._base64),this.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:this._base64}})))}_convertToBase64(e){return new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=()=>r(i.error),i.readAsDataURL(e)})}};ke.styles=[b`
295
+ :host {
296
+ display: block;
297
+ margin: 1em 0;
298
+ }
299
+ input[type='file'] {
300
+ display: block;
301
+ margin-top: 0.5em;
302
+ }
303
+ `],ke=o([f("qti-upload-interaction")],ke);var Se=class extends v{render(){return h`<slot></slot>`}process(){let s=new pt,e=[...this.children];s.process(e)}};Se.styles=[b`
304
+ :host {
305
+ display: none;
306
+ }
307
+ `],Se=o([f("qti-outcome-processing")],Se);var pt=class{process(s){for(let e of s)e.process()}};var jt=`<qti-response-processing>
308
+ <qti-response-condition>
309
+ <qti-response-if>
310
+ <qti-match>
311
+ <qti-variable identifier="RESPONSE"></qti-variable>
312
+ <qti-correct identifier="RESPONSE"></qti-correct>
313
+ </qti-match>
314
+ <qti-set-outcome-value identifier="SCORE">
315
+ <qti-base-value base-type="float">1</qti-base-value>
316
+ </qti-set-outcome-value>
317
+ </qti-response-if>
318
+ <qti-response-else>
319
+ <qti-set-outcome-value identifier="SCORE">
320
+ <qti-base-value base-type="float">0</qti-base-value>
321
+ </qti-set-outcome-value>
322
+ </qti-response-else>
323
+ </qti-response-condition>
324
+ </qti-response-processing>`,Xt=`<qti-response-processing>
325
+ <qti-response-condition>
326
+ <qti-response-if>
327
+ <qti-is-null>
328
+ <qti-variable identifier="RESPONSE"></qti-variable>
329
+ </qti-is-null>
330
+ <qti-set-outcome-value identifier="SCORE">
331
+ <qti-base-value base-type="float">0.0</qti-base-value>
332
+ </qti-set-outcome-value>
333
+ </qti-response-if>
334
+ <qti-response-else>
335
+ <qti-set-outcome-value identifier="SCORE">
336
+ <qti-map-response identifier="RESPONSE"> </qti-map-response>
337
+ </qti-set-outcome-value>
338
+ </qti-response-else>
339
+ </qti-response-condition>
340
+ </qti-response-processing>`,Wt=`<qti-response-processing>
341
+ <qti-response-condition>
342
+ <qti-response-if>
343
+ <qti-is-null>
344
+ <qti-variable identifier="RESPONSE"></qti-variable>
345
+ </qti-is-null>
346
+ <qti-set-outcome-value identifier="SCORE">
347
+ <qti-base-value base-type="float">0</qti-base-value>
348
+ </qti-set-outcome-value>
349
+ </qti-response-if>
350
+ <qti-response-else>
351
+ <qti-set-outcome-value identifier="SCORE">
352
+ <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>
353
+ </qti-set-outcome-value>
354
+ </qti-response-else>
355
+ </qti-response-condition>
356
+ </qti-response-processing>`;var se=class extends v{render(){return h`<slot></slot>`}process(){if(!this.closest("qti-assessment-item"))return;let e=[...this.children];for(let t of e)t.process()}firstUpdated(s){if(this.getAttribute("template")){let e=this.getAttribute("template").split("/"),t=e[e.length-1].replace(".xml","");switch(this.innerHTML="",t){case"map_response":{this.appendChild(this.fragmentFromString(Xt).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(Wt).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(jt).firstElementChild.firstElementChild);break}}}fragmentFromString(s){return document.createRange().createContextualFragment(s)}};se.styles=[b`
357
+ :host {
358
+ display: none;
359
+ }
360
+ `],se=o([f("qti-response-processing")],se);var O=class extends v{render(){return h`<slot></slot>`}process(){throw new Error("Not implemented")}};O=o([f("qti-rule")],O);var Ze=class extends O{get childExpression(){return this.firstElementChild}process(){let s=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(s),t;return e.interpolationTable&&(t=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),t==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:Ee(t)}})),t)}};o([d({type:String})],Ze.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Ze);var dt=class extends O{render(){return h`<slot></slot>`}process(){let s=[...this.children];for(let e=0;e<s.length;e++){let t=s[e];if(t.calculate()){t.process();return}}}};customElements.define("qti-response-condition",dt);var ut=class extends O{process(){let s=this.getAttribute("identifier"),e=this.firstElementChild,r=new mt(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:s,value:Array.isArray(r)?r.map(i=>Ee(i)):Ee(r)}}))}},mt=class{constructor(s){this.expression=s}process(){let s=this.expression?this.expression.calculate():null;if(s==null){console.warn("setOutcomeValue: value is null or undefined");return}return s}};customElements.define("qti-set-outcome-value",ut);var _e=class extends v{render(){return h`<slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let s=this.getSubRules();for(let e=0;e<s.length;e++)s[e].process()}};customElements.define("qti-response-else",_e);var Re=class extends _e{calculate(){return this.firstElementChild.calculate()}getSubRules(){let s=[];for(let e=1;e<this.children.length;e++)s.push(this.children[e]);return s}};customElements.define("qti-response-if",Re);var ht=class extends Re{render(){return h`${super.render()}`}};customElements.define("qti-response-else-if",ht);var E=class extends v{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(e=>{switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{let t=e.getAttribute("identifier")||"";return this.context.variables.find(i=>i.identifier===t)||null}case"qti-multiple":{let r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(i=>i.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let t=e.getAttribute("identifier")||"",r=this.context.variables.find(i=>i.identifier===t)||null;return{baseType:r.baseType,value:r.correctResponse,cardinality:r.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch{console.warn("default not sufficient")}return null}}}).filter(e=>e!==null)}render(){return h`<pre>${JSON.stringify(this.result,null,2)}</pre>
361
+ <slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};E.styles=b`
362
+ slot {
363
+ display: none;
364
+ }
365
+ `,o([C()],E.prototype,"result",2),o([R({context:T,subscribe:!0}),C()],E.prototype,"context",2);var L=class extends E{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var Kt=class extends ur(L){calculate(){return this.calculateChildren(Array.from(this.children))}};function ur(l){return class extends l{calculateChildren(e){return e.map(r=>{let i=r;if(!i.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let a=i.calculate(),p=!1;if(typeof a=="string")if(a==="true")p=!0;else if(a==="false")p=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof a=="boolean"&&(p=a);return p}).every(r=>typeof r=="boolean"&&r)}}}var Ge=class extends E{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent.trim()}};o([d({type:String,attribute:"base-type"})],Ge.prototype,"baseType",2);customElements.define("qti-base-value",Ge);var ft=class extends L{getResult(){let s=this.getVariables();if(this.children.length===2){let e=s[0],t=s[1];if(e.baseType==="directedPair"&&t.baseType==="directedPair"&&e.cardinality==="multiple"){let r=e.value,i=t.value;return r.filter(n=>i.includes(n)).length>0}else if(e.baseType==="directedPair"&&t.baseType==="directedPair"&&e.cardinality==="single"){let r=e.value;return t.value.includes(r)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}};customElements.define("qti-contains",ft);var gt=class extends E{get interpretation(){return this.getAttribute("interpretation")||""}getResult(){let s=this.getAttribute("identifier")||"",e=this.context.variables.find(t=>t.identifier===s)||null;return e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",gt);var Qe=class extends E{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let 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}getResult(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];if(this.roundingMode===null)return null;if(t.cardinality!=="single"||r.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(r.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let i=parseFloat(t.value),a=parseFloat(r.value);if(!isNaN(i)&&!isNaN(a))return this.roundingMode==="significantFigures"?i.toPrecision(this.figures)===a.toPrecision(this.figures):Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(a*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${i}, ${a}`);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}};o([d({type:String})],Qe.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",Qe);var V=class{static compareSingleValues(s,e,t){switch(t){case"identifier":case"string":return s===e;case"integer":{let r=parseInt(s,10),i=parseInt(e,10);if(!isNaN(r)&&!isNaN(i))return r===i;console.error(`Cannot convert ${s} and/or ${e} to int.`);break}case"float":{let r=parseFloat(s),i=parseFloat(e);if(!isNaN(r)&&!isNaN(i))return r===i;console.error(`couldn't convert ${s} and/or ${e} to float.`);break}case"pair":case"directedPair":{let r=s.split(" ").sort(),i=e.split(" ").sort();if(r.length===2&&i.length===2)return t==="pair"&&(r.sort(),i.sort()),r.join(" ")===i.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${s} 2: ${e}`);break}}return!1}};var et=class extends E{constructor(){super(...arguments);this.toleranceMode="exact"}getResult(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):t.cardinality!=="single"||r.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(r.value)?(console.error("unexpected cardinality in qti equal"),!1):V.compareSingleValues(t.value,r.value,t.baseType)}return console.error("unexpected number of children in qti-equal"),null}};o([d({type:String})],et.prototype,"toleranceMode",2);customElements.define("qti-equal",et);var bt=class extends E{getResult(){if(this.children.length===2){let s=this.getVariables(),e=s[0],t=s[1];if((e.baseType==="integer"||e.baseType==="float")&&(t.baseType==="integer"||t.baseType==="float"))return+e.value>+t.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",bt);var vt=class extends L{getResult(){if(this.children.length===2){let s=this.getVariables(),e=s[0],t=s[1];return(e.baseType==="integer"||e.baseType==="float")&&(t.baseType==="integer"||t.baseType==="float")?+e.value>=+t.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",vt);var yt=class extends E{getResult(){if(this.children.length===1){let s=this.getVariables();if(!s)return!0;let e=s[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",yt);var xt=class extends E{getResult(){if(this.children.length===2){let s=this.getVariables(),e=s[0],t=s[1];if((e.baseType==="integer"||e.baseType==="float")&&(t.baseType==="integer"||t.baseType==="float"))return+e.value<+t.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",xt);var Et=class extends L{getResult(){if(this.children.length===2){let s=this.getVariables(),e=s[0],t=s[1];return(e.baseType==="integer"||e.baseType==="float")&&(t.baseType==="integer"||t.baseType==="float")?+e.value<=+t.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",Et);var tt=class extends E{getResult(){let s=this.context.variables.find(i=>i.identifier===this.identifier);if(!s)return console.warn(`Response ${this.identifier} can not be found`),null;let e=s.mapping,t=Array.isArray(s.value)?s.value:[s.value],r=0;for(let i of t){let a=e.mapEntries.find(p=>V.compareSingleValues(p.mapKey,i,s.baseType));a==null||a.mappedValue==null?r+=e.defaultValue:r+=a.mappedValue}return e.lowerBound!=null&&(r=Math.max(e.lowerBound,r)),e.upperBound!=null&&(r=Math.min(e.upperBound,r)),r}};o([d({type:String})],tt.prototype,"identifier",2);customElements.define("qti-map-response",tt);var ue=class extends v{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};o([d({attribute:"default-value",type:Number})],ue.prototype,"defaultValue",2),o([d({attribute:"lower-bound",type:Number})],ue.prototype,"lowerBound",2),o([d({attribute:"upper-bound",type:Number})],ue.prototype,"upperBound",2);customElements.define("qti-mapping",ue);var Ct=class l extends E{getResult(){if(this.children.length===2){let s=this.getVariables(),e=s[0],t=s[1];return l.match(e,t)}return console.error("unexpected number of children in match"),null}static match(s,e){switch(e.cardinality){case"single":return s.value===null?!1:Array.isArray(s.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):V.compareSingleValues(s.value?.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(s.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(s.value.length!==e.value.length)return!1;for(let t=0;t<s.value.length;t++)if(!V.compareSingleValues(e.value[t],s.value[t],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(s.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(s.value.length!==e.value.length)return!1;let t=0;for(let r of e.value){let i=null,a=[...s.value];for(let p of a)if(V.compareSingleValues(r,p,e.baseType)){i=p;break}if(i!==null)a.splice(a.indexOf(i),1);else return!1;t++}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}};customElements.define("qti-match",Ct);var qt=class extends E{getResult(){let s=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");let[e,t]=s;if(e.baseType===t.baseType||e.baseType==="integer"&&t.baseType==="float"||e.baseType==="float"&&t.baseType==="integer"||console.warn("Which must both have the same base-type"),t.cardinality==="multiple"||t.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(e.baseType==="float"||t.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||t.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),e.value===null||t.value===null)return null;let r=e.value;return t.value.includes(r)}};customElements.define("qti-member",qt);var wt=class extends E{getResult(){let s=this.getVariables();if(s.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of s)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return s}};customElements.define("qti-multiple",wt);var Tt=class extends E{render(){return h`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",Tt);var Mt=class extends L{getResult(){return Array.from(this.children).map(e=>{let t=e;if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=t.calculate(),i=!1;if(typeof r=="string")if(r==="true")i=!0;else if(r==="false")i=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof r=="boolean"&&(i=r);return i}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",Mt);var kt=class extends E{getResult(){let s=this.getVariables();if(s.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of s)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return s}};customElements.define("qti-ordered",kt);var Ae=class extends v{render(){let s=this.context?.variables.find(e=>e.identifier===this.identifier)?.value;return h`${JSON.stringify(s,null,2)}`}calculate(){return this.context.variables.find(e=>e.identifier===this.identifier)||null}};o([d({type:String})],Ae.prototype,"identifier",2),o([R({context:T,subscribe:!0}),C()],Ae.prototype,"context",2);customElements.define("qti-printed-variable",Ae);var St=class extends E{getResult(){return this.getVariables().reduce((t,r)=>{if(r.baseType=="float"||r.baseType=="integer")try{return t*parseInt(r.value.toString())}catch{console.warn("can not convert to number")}else console.warn(`has another baseType ${r.baseType}`);return t},1)}};customElements.define("qti-product",St);var Jt=class extends mr(E){getResult(){return this.calculateChildren(Array.from(this.children))}};function mr(l){return class extends l{calculateChildren(e){let t=e.map(r=>{if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let i=r.calculate();return Number.isNaN(i)?(console.error("Unexpected value in qti-subtract, expected number"),null):Number(i)});return t.some(r=>r===null)?(console.error("One or more child expressions returned invalid values"),0):t[0]-t[1]}}}var rt=class extends E{constructor(){super(...arguments);this.caseSensitive="true"}getResult(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];if(t.cardinality!=="single"||r.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(r.value))return console.error("unexpected cardinality in qti string-match"),!1;let i=this.caseSensitive==="true"?t.value:t.value.toLowerCase(),a=this.caseSensitive==="true"?r.value:r.value.toLowerCase();return V.compareSingleValues(i,a,t.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};o([d({type:String,attribute:"case-sensitive"})],rt.prototype,"caseSensitive",2);customElements.define("qti-string-match",rt);var _t=class extends E{constructor(){super(),this._expression=new Rt(Array.from(this.children))}getResult(){return this._expression.calculate()}},Rt=class{constructor(s){this.expressions=s}calculate(){return this.expressions.map(e=>{if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let t=e.calculate();return Number.isNaN(t)?(console.error("unexpected value in qti-sum, expected number"),null):Number(t)}).reduce((e,t)=>e+t,0)}};customElements.define("qti-sum",_t);var At=class extends E{getResult(){let s=this.getAttribute("identifier");return this.context.variables.find(t=>t.identifier===s).value}};customElements.define("qti-variable",At);var oe=class extends x{constructor(){super(...arguments);this._errorMessage=null;this.loadConfig=async(e,t)=>{e=this.removeDoubleSlashes(e);try{let r=await fetch(e);if(r.ok){let a=await r.json();for(let p in a.paths)t&&(a.paths[p]=this.getResolvablePath(a.paths[p],t));return a}}catch{}return null};this.getResolvablePathString=(e,t)=>(e=e.replace(/\.js$/,""),e?.toLocaleLowerCase().startsWith("http")||!t?e:this.removeDoubleSlashes(`${t}/${e}`));this.getResolvablePath=(e,t)=>Array.isArray(e)?e.map(r=>this.getResolvablePathString(r,t)):this.getResolvablePathString(e,t)}convertQtiVariableJSON(e){for(let t in e)if(e.hasOwnProperty(t)){let r=e[t];if(r){for(let i in r)if(r.hasOwnProperty(i)){let a=r[i];if(Array.isArray(a))return a.map(String);if(a!=null)return String(a)}}}return null}startChecking(){this.intervalId=setInterval(()=>{let e=this.pci.getResponse(),t=this.pci.getResponse(),r=JSON.stringify(e);if(r!==this.rawResponse){this.rawResponse=r;let i=this.convertQtiVariableJSON(t);this.value=i,this.saveResponse(i)}},200)}stopChecking(){this.intervalId!==void 0&&clearInterval(this.intervalId)}validate(){return!0}set value(e){}get value(){return this.rawResponse}getTAOConfig(e){let t=e.querySelectorAll("properties"),r={},i=p=>{let n={},c=p.getAttribute("key");if(c){let u=Array.from(p.children),m=u.map(y=>y.getAttribute("key"));m.length>0&&!m.find(y=>!Number.isInteger(+y))?n[c]=u.map(y=>a(y)):n[c]=p.textContent}return n},a=p=>{if(p){let n={};for(let c of p.children)n={...n,...i(c)};return n}};for(let p of t)return p.getAttribute("key")||(r={...r,...a(p)}),r;return console.log("Can not find qti-custom-interaction config"),null}register(e){this.pci=e;let t=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",r=t=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");r.classList.add("qti-customInteraction"),t=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let i=t=="IMS"?{properties:this.dataset,onready:()=>{console.log("onready")}}:this.getTAOConfig(this);t=="IMS"?e.getInstance(r,i,void 0):e.initialize(this.customInteractionTypeIdentifier,r.firstElementChild,i),t=="TAO"&&Array.from(this.querySelectorAll("link")).map(p=>p.getAttribute("href")).forEach(p=>{let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.media="screen",n.href=p,r.appendChild(n)}),this.startChecking()}connectedCallback(){super.connectedCallback(),define("qtiCustomInteractionContext",()=>({register:r=>{this.register(r)},notifyReady:()=>{}}));let e=this.buildRequireConfig();requirejs.config(e)(["require"],r=>{r([this.module])})}disconnectedCallback(){super.disconnectedCallback(),requirejs.undef(this.customInteractionTypeIdentifier);let e=requirejs.s.contexts;delete e[this.customInteractionTypeIdentifier],this.stopChecking()}buildRequireConfig(){let e={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;let t=this.getAttribute("data-base-url"),r=this.querySelector("qti-interaction-modules");if(r){let i=r.querySelectorAll("qti-interaction-module");for(let a of i){let p=a.getAttribute("id"),n=a.getAttribute("primary-path"),c=a.getAttribute("fallback-path");if(p&&n){let u=c?this.combineRequireResolvePaths(this.getResolvablePath(n,t),this.getResolvablePath(c,t)):this.getResolvablePath(n,t),m=e.paths[p]||[];e.paths[p]=this.combineRequireResolvePaths(m,u)}}}return e}combineRequireResolvePaths(e,t){let r=Array.isArray(e)?e:[e],i=Array.isArray(t)?t:[t];return r.concat(i)}removeDoubleSlashes(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}render(){return h`<slot></slot>${this._errorMessage&&h`<div style="color:red">
366
+ <h1>Error</h1>
367
+ ${this._errorMessage}
368
+ </div>`}`}};o([d({type:String,attribute:"module"})],oe.prototype,"module",2),o([d({type:String,attribute:"custom-interaction-type-identifier"})],oe.prototype,"customInteractionTypeIdentifier",2),o([C()],oe.prototype,"_errorMessage",2),oe=o([f("qti-portable-custom-interaction")],oe);var Zt=(l,s,e)=>{class t extends l{}return t};function it(l,s){let e;return(t,r)=>{let{connectedCallback:i,disconnectedCallback:a}=t;t.connectedCallback=function(){i.call(this);let p=c=>{let u=Array.from(this.querySelectorAll(l)).concat(Array.from(this.shadowRoot?.querySelectorAll(l)||[]));for(let m of c){let g=Array.from(m.addedNodes).map(q=>q),y=Array.from(m.addedNodes).map(q=>q);m.type==="childList"&&g.find(q=>u.includes(q))&&this[r](g,y)}};e=new MutationObserver(p),e.observe(this,{childList:!0,subtree:!0});let n=Array.from(this.querySelectorAll(l)).concat(Array.from(this.shadowRoot?.querySelectorAll(l)||[]));this[r](Array.from(n),[])},t.disconnectedCallback=function(){a.call(this),e.disconnect()}}}var P=(l,s,e,t,r="default")=>{class i extends Zt(l,e,s){constructor(){super(...arguments);this.observer=null;this.droppableObsever=null;this.resizeObserver=null;this.draggables=[];this.droppables=[];this.dragContainers=[];this.dragClone=null;this.dragSource=null;this.touchStartPoint=null;this.isDraggable=!1;this.cloneOffset={x:0,y:0};this.isDragging=!1;this.rootNode=null;this.allDropzones=[];this.lastTarget=null;this.dropzoneOriginalParent=null;this.currentDropTarget=null;this.MIN_DRAG_DISTANCE=5;this.DRAG_CLONE_OPACITY=1;this.dataTransfer={data:{},setData(n,c){this.data[n]=c},getData(n){return this.data[n]},effectAllowed:"move"};this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.minAssociations=1;this.maxAssociations=1;this.draggablesModified=(n,c)=>{for(let m of c)this.draggables.includes(m)&&(this.draggables=this.draggables.filter(g=>g!==m),m.removeAttribute("tabindex"),m.removeEventListener("touchstart",this.handleTouchStart.bind(this)),m.removeEventListener("mousedown",this.handleTouchStart.bind(this)));for(let m of n)this.draggables.includes(m)||(this.draggables.push(m),m.setAttribute("tabindex","0"),m.hasTouchStartListener||(m.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!1}),m.addEventListener("mousedown",this.handleTouchStart.bind(this),{passive:!1}),m.hasTouchStartListener=!0));let u=0;this.draggables.forEach(m=>{m.style.viewTransitionName=`drag-${u}-${this.getAttribute("identifier")||crypto.randomUUID()}`,m.setAttribute("qti-draggable","true"),m.addEventListener("dragstart",this.handleDragStart),m.addEventListener("dragend",this.handleDragEnd),u++})};this.droppablesModified=(n,c)=>{for(let u of c)this.droppables.includes(u)&&(this.droppables=this.droppables.filter(m=>m!==u),this.allDropzones=this.allDropzones.filter(m=>m!==u));for(let u of n)this.droppables.includes(u)||(this.droppables.push(u),this.allDropzones.push(u));for(let u of this.droppables)this.dataset.choicesContainerWidth&&(u.style.width=`${this.dataset.choicesContainerWidth}px`,u.style.boxSizing="border-box")};this.handleDragStart=n=>{let c=n.currentTarget;n.dataTransfer.setData("text",c.getAttribute("identifier")),this.responseIdentifier&&n.dataTransfer.setData("responseIdentifier",this.responseIdentifier),this._internals.states.add("--dragzone-enabled"),this._internals.states.add("--dragzone-active"),c.setAttribute("dragging",""),this.activateDragLocation(),this.activateDroppables(c)};this.handleDragEnd=async n=>{n.preventDefault();let c=n.currentTarget;this._internals.states.delete("--dragzone-enabled"),this._internals.states.delete("--dragzone-active"),this.deactivateDragLocation(),this.deactivateDroppables(),c.removeAttribute("dragging")}}handleDraggableContainerChange(n,c){this.isMatchTabular()||(n.length>0||c.length>0)&&this.dragContainersModified(n||[],c||[])}dragContainersModified(n,c){for(let u of c)this.dragContainers.includes(u)&&(this.dragContainers=this.dragContainers.filter(m=>m!==u),this.allDropzones=this.allDropzones.filter(m=>m!==u));for(let u of n)this.dragContainers.includes(u)||(this.dragContainers.push(u),this.allDropzones.push(u))}handleDraggablesChange(n,c){this.isMatchTabular()||(n.length>0||c.length>0)&&this.draggablesModified(n||[],c||[])}handleDroppablesChange(n,c){this.isMatchTabular()||(n.length>0||c.length>0)&&this.droppablesModified(n||[],c||[])}firstUpdated(n){super.firstUpdated(n),this.hasAttribute("disabled")||(document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}));let u=Array.from(this.querySelectorAll(s)||[]).concat(Array.from(this.shadowRoot?.querySelectorAll(s)||[])),m=Array.from(this.querySelectorAll(e)||[]).concat(Array.from(this.shadowRoot?.querySelectorAll(e)||[])),g=Array.from(this.querySelectorAll(t)||[]).concat(Array.from(this.shadowRoot?.querySelectorAll(t)||[]));this.dragContainersModified(g,[]),this.droppablesModified(m,[]),this.draggablesModified(u,[]),this.updateMinDimensionsForDropZones(),this.observer=new MutationObserver(()=>this.updateMinDimensionsForDropZones()),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(()=>this.updateMinDimensionsForDropZones()),this.querySelectorAll("qti-gap-text").forEach(q=>this.resizeObserver?.observe(q))}async moveDraggableToDroppable(n,c){(()=>{n.style.transform="translate(0, 0)",c.tagName==="SLOT"?n.setAttribute("slot",c.getAttribute("name")):c.appendChild(n),this.checkAllMaxAssociations(),this.saveResponse()})()}activateDroppable(n){this.dragContainers.includes(n)?(this._internals.states.add("--dragzone-active"),n.setAttribute("active","")):(this._internals.states.delete("--dragzone-active"),n.setAttribute("active",""))}deactivateDroppable(n,c=!0){c&&this._internals.states.add("--dragzone-active"),n.removeAttribute("active")}connectedCallback(){super.connectedCallback()}isMatchTabular(){return this.classList.contains("qti-match-tabular")}updateMinDimensionsForDropZones(){let n=this.querySelectorAll(s),c=Array.from(this.querySelectorAll(e)).map(y=>y),u=0,m=0;n.forEach(y=>{let q=y.getBoundingClientRect();u=Math.max(u,q.height),m=Math.max(m,q.width)});let g=this.querySelector(t)||this.shadowRoot?.querySelector(t);g&&(g.style.minHeight=`${u}px`,g.style.minWidth=`${m}px`);for(let y of c)y.style.minHeight=`${u}px`,y.style.minWidth=`${m}px`}activateDroppables(n){this.dragContainers.forEach(u=>{u.setAttribute("enabled",""),u.hasAttribute("disabled")&&(u.contains(n)||u.shadowRoot&&u.shadowRoot.contains(n))&&u.removeAttribute("disabled")}),this.droppables.forEach(u=>{u.setAttribute("enabled",""),u.hasAttribute("disabled")&&(u.contains(n)||u.shadowRoot&&u.shadowRoot.contains(n))&&u.removeAttribute("disabled")})}activateDragLocation(){this._internals.states.add("--dragzone-enabled")}deactivateDragLocation(){this._internals.states.delete("--dragzone-enabled")}deactivateDroppables(){this.dragContainers.forEach(c=>{c.removeAttribute("enabled")}),this.droppables.forEach(c=>c.removeAttribute("enabled"))}disconnectedCallback(){super.disconnectedCallback(),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("touchmove",this.handleTouchMove),document.removeEventListener("mousemove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("mouseup",this.handleTouchEnd),document.removeEventListener("touchcancel",this.handleTouchCancel)}handleTouchMove(n){if(this.isDraggable&&this.dragClone){let{x:c,y:u}=this.getEventCoordinates(n),m={clientX:c,clientY:u};this.calculateDragDistance(m)>=this.MIN_DRAG_DISTANCE&&(this.isDragging=!0,this.updateDragClonePosition(m));let g=this.findClosestDropzone();this.currentDropTarget=g,g!==this.lastTarget&&(this.lastTarget&&(this.deactivateDroppable(this.lastTarget),this.dispatchCustomEvent(this.lastTarget,"dragleave")),g&&(this.activateDroppable(g),this.dispatchCustomEvent(g,"dragenter")),this.lastTarget=g),this.currentDropTarget&&this.dispatchCustomEvent(this.currentDropTarget,"dragover"),n.preventDefault()}}handleTouchEnd(n){if(this.isDragging){if(this.currentDropTarget){let c=this.dragClone;this.moveDraggableToDroppable(c,this.currentDropTarget)}this.resetDragState()}this._internals.states.delete("--dragzone-active"),this.checkAllMaxAssociations(),n.preventDefault()}handleTouchCancel(n){this.resetDragState()}validate(){if(!this.shadowRoot)return!1;let n=this.getValidAssociations(),c=!0,u="";this.maxAssociations>0&&n>this.maxAssociations?(c=!1,u=this.dataset.maxSelectionsMessage||`You've selected too many associations. Maximum allowed is ${this.maxAssociations}.`):this.minAssociations>0&&n<this.minAssociations&&(c=!1,u=this.dataset.minSelectionsMessage||`You haven't selected enough associations. Minimum required is ${this.minAssociations}.`);let m=this.lastElementChild;return this._internals.setValidity(c?{}:{customError:!0},u,m),this.reportValidity(),c}reportValidity(){let n=this.shadowRoot.querySelector("#validationMessage");return n&&(this._internals.validity.valid?(n.textContent="",n.style.display="none"):(n.textContent=this._internals.validationMessage,n.style.display="block")),this._internals.validity.valid}checkMaxAssociations(n){let c=this.getMatchMaxValue(n),u=n.querySelectorAll('[qti-draggable="true"]').length;return c===0||u>=c}resetDragState(){if(this.dragClone)if(!(this.currentDropTarget!==null)||this.dragContainers.includes(this.currentDropTarget))this.dragSource.style.opacity="1.0",this.dragSource.style.display="block",this.dragSource.style.pointerEvents="auto",this.dragClone.remove();else{let u=window.getComputedStyle(this.dragSource);for(let m=0;m<u.length;m++){let g=u[m];this.dragClone.style.setProperty(g,u.getPropertyValue(g))}this.dragClone.style.opacity="1.0",this.dragClone.style.display="block",this.dragClone.style.pointerEvents="auto"}this.isDragging=!1,this.isDraggable=!1,this.dragSource=null,this.dragClone=null,this.touchStartPoint=null,this.currentDropTarget=null,this.lastTarget=null}checkAllMaxAssociations(){this.droppables.forEach(n=>{this.checkMaxAssociations(n)?this.disableDroppable(n):this.enableDroppable(n)})}getMatchMaxValue(n){let c=n.getAttribute("match-max");return c?parseInt(c,10):1}disableDroppable(n){n.setAttribute("disabled","")}enableDroppable(n){n.removeAttribute("disabled")}get value(){return this.collectResponseData()}set value(n){if(!this.isMatchTabular())if(Array.isArray(n)){n?.forEach(u=>this.placeResponse(u));let c=new FormData;n.forEach(u=>{c.append(this.responseIdentifier,u)}),this._internals.setFormValue(c)}else this._internals.setFormValue(n)}placeResponse(n){let[c,...u]=n.split(" ").reverse(),m=this.findDroppableById(c);u.forEach(g=>this.placeDraggableInDroppable(g,m))}findDroppableById(n){return this.droppables.find(c=>c.getAttribute("identifier")===n)}async placeDraggableInDroppable(n,c){let u=this.querySelector(`[identifier=${n}]`);if(!c||!u){console.error(`Cannot find draggable or droppable with the given identifier: ${n}`);return}let m=()=>{u.style.transform="translate(0, 0)",c.appendChild(u),this.checkAllMaxAssociations()};document.startViewTransition?await document.startViewTransition(m).finished:m()}getValidAssociations(){return this.droppables.filter(n=>n.childElementCount>0).length}saveResponse(){this.validate();let n=this.collectResponseData();this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:n}}))}collectResponseData(){return this.droppables.map(c=>{let u=c.querySelectorAll('[qti-draggable="true"]'),m=Array.from(u).map(y=>y.getAttribute("identifier")),g=c.getAttribute("identifier");return m.map(y=>`${y} ${g}`)}).flat()}reset(n=!0){n&&this.saveResponse()}updateDragClonePosition(n){if(!this.isDragging||!this.dragClone)return;let c=n.clientX-this.cloneOffset.x,u=n.clientY-this.cloneOffset.y,{newLeft:m,newTop:g}=this.applyBoundaries(c,u,this.dragClone);this.dragClone.style.left=`${m}px`,this.dragClone.style.top=`${g}px`}getEventCoordinates(n,c=!1){let u=n.touches?n.touches[0]:n;return{x:c?u.pageX:u.clientX,y:c?u.pageY:u.clientY}}calculateDragDistance(n){let c=Math.abs(n.clientX-this.touchStartPoint.x),u=Math.abs(n.clientY-this.touchStartPoint.y);return c+u}applyBoundaries(n,c,u){let m=new DOMRect(0,0,window.innerWidth,window.innerHeight);this.rootNode instanceof ShadowRoot?m=this.rootNode.host.getBoundingClientRect():this.rootNode instanceof Document&&(m=document.documentElement.getBoundingClientRect());let g=u.getBoundingClientRect(),y=g.width,q=g.height,w=Math.max(m.left,Math.min(n,m.right-y)),U=Math.max(m.top,Math.min(c,m.bottom-q));return{newLeft:w,newTop:U}}findClosestDropzone(){let n=this.allDropzones.filter(g=>!g.hasAttribute("disabled"));if(!this.dragClone||n.length===0)return null;let c=this.dragClone.getBoundingClientRect(),u=null,m=0;for(let g of n){let y=g.getBoundingClientRect(),q=this.calculateOverlapArea(c,y);q>m&&(m=q,u=g)}if(!u){let g=200;for(let y of n){let q=y.getBoundingClientRect(),w=Math.sqrt(Math.pow(c.left-q.left,2)+Math.pow(c.top-q.top,2));w<g&&(g=w,u=y)}}return u}calculateOverlapArea(n,c){let u=Math.max(0,Math.min(n.right,c.right)-Math.max(n.left,c.left)),m=Math.max(0,Math.min(n.bottom,c.bottom)-Math.max(n.top,c.top));return u*m}dispatchCustomEvent(n,c,u=!0){if(!n)return;let m=new CustomEvent(c,{bubbles:u,cancelable:!0});m.dataTransfer=this.dataTransfer,n.dispatchEvent(m)}appendClone(){let n=this.findParentInteractionElement(this.dragSource);r=="default"?n?n.appendChild(this.dragClone):this.rootNode instanceof ShadowRoot?this.rootNode.host.appendChild(this.dragClone):this.rootNode instanceof Document&&document.body.appendChild(this.dragClone):r=="interaction"?n?n.appendChild(this.dragClone):console.error("No interaction found to append the drag clone"):r=="host"?this.rootNode instanceof ShadowRoot?this.rootNode.host.appendChild(this.dragClone):console.error("No host found to append the drag clone"):r=="body"&&document.body.appendChild(this.dragClone)}handleTouchStart(n){let{x:c,y:u}=this.getEventCoordinates(n);this.dropzoneOriginalParent=n.currentTarget.parentElement,this.touchStartPoint={x:c,y:u},this.dragSource=n.currentTarget,this.isDraggable=!0,this.rootNode=this.dragSource.getRootNode();let m=this.findDraggableInDraggableContainer(this.dragSource.getAttribute("identifier")),g=this.dragSource.parentElement;if(this.droppables.includes(g)){this.enableDroppable(g),this.dragClone=this.dragSource,this.dragSource=this.findDraggableInDraggableContainer(this.dragSource.getAttribute("identifier"));let y=this.dragClone.getBoundingClientRect();this.appendClone(),y&&this.setDragCloneStyles(y)}else{let y=m.getBoundingClientRect();this.cloneOffset.x=c-y.left,this.cloneOffset.y=u-y.top,this.dragClone=m.cloneNode(!0);let q=window.getComputedStyle(this.dragSource);for(let D=0;D<q.length;D++){let Ue=q[D];this.dragClone.style.setProperty(Ue,q.getPropertyValue(Ue))}y&&this.setDragCloneStyles(y),this.appendClone();let w=this.getMatchMaxValue(this.dragSource),U=this.draggables.filter(D=>D.getAttribute("identifier")===this.dragSource.getAttribute("identifier"));w!==0&&U.length>=w?(m.style.opacity="0.0",m.style.pointerEvents="none"):m.style.opacity="1.0",n.preventDefault()}}findParentInteractionElement(n){let c=n.parentElement;for(;c&&!c.tagName?.toLowerCase().endsWith("-interaction");)c=c.parentElement;return c}findDraggableInDraggableContainer(n){let c=this.dragContainers.flat();for(let u of c){if(u.getAttribute("identifier")===n)return u;let m;u instanceof HTMLSlotElement?m=Array.from(u.assignedElements()||[]):m=Array.from(u.querySelectorAll(s));let g=m.find(y=>y.getAttribute("identifier")===n);if(g)return g}}setDragCloneStyles(n){this.dragClone.style.position="fixed",this.dragClone.style.top=`${n.top}px`,this.dragClone.style.left=`${n.left}px`,this.dragClone.style.width=`${n.width}px`,this.dragClone.style.height=`${n.height}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 o([d({attribute:!1,type:Object})],i.prototype,"configuration",2),o([d({type:Number,reflect:!0,attribute:"min-associations"})],i.prototype,"minAssociations",2),o([d({type:Number,reflect:!0,attribute:"max-associations"})],i.prototype,"maxAssociations",2),o([it(t)],i.prototype,"handleDraggableContainerChange",1),o([it(s)],i.prototype,"handleDraggablesChange",1),o([it(e)],i.prototype,"handleDroppablesChange",1),i};var Gt=b`
369
+ :host {
370
+ display: block; /* necessary to calculate scaling position */
371
+ }
372
+ slot[name='qti-simple-associable-choice'] {
373
+ display: flex;
374
+ align-items: flex-start;
375
+ flex: 1;
376
+ border: 2px solid transparent;
377
+ padding: 0.3rem;
378
+ border-radius: 0.3rem;
379
+ gap: 0.5rem;
380
+ }
381
+
382
+ :host::part(associables-container) {
383
+ display: flex;
384
+ padding: 0.5rem;
385
+ justify-content: space-between;
386
+ background: linear-gradient(
387
+ 180deg,
388
+ rgb(0 0 0 / 0%) calc(50% - 1px),
389
+ var(--qti-border-color-gray) calc(50%),
390
+ rgb(0 0 0 / 0%) calc(50% + 1px)
391
+ );
392
+ }
393
+ `;var me=class extends P(x,"qti-simple-associable-choice",".dl","slot[name='qti-simple-associable-choice']"){constructor(){super();this._childrenMap=[];this._registerChoiceHandler=this._registerChoice.bind(this),this.addEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}_registerChoice(e){let t=e.target;this._childrenMap.push(t)}render(){return h` <slot name="prompt"></slot>
394
+ <slot name="qti-simple-associable-choice"></slot>
395
+ <div part="drop-container">
396
+ ${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((e,t)=>h`<div part="associables-container">
397
+ <div name="left${t}" part="drop-list" class="dl" identifier="droplist${t}_left"></div>
398
+ <div name="right${t}" part="drop-list" class="dl" identifier="droplist${t}_right"></div>
399
+ </div>`)}
400
+
401
+ <div role="alert" id="validationMessage"></div>
402
+ </div>`}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}};me.styles=Gt,o([C()],me.prototype,"_childrenMap",2),me=o([f("qti-associate-interaction")],me);var B=class extends x{constructor(){super();this._errorMessage=null;this.handlePostMessage=this.handlePostMessage.bind(this)}connectedCallback(){super.connectedCallback();let e=this.data.startsWith("http")?this.data:Ce(this.baseItemUrl+"/"+this.data);fetch(e).then(t=>t.json()).then(t=>{this.manifest=t,this.setupCES()}).catch(t=>{this._errorMessage=t})}setupCES(){let e=this.shadowRoot.querySelector("#pciContainer"),t=e.contentDocument;window.addEventListener("message",this.handlePostMessage),t.open(),t.write(`
403
+ <html>
404
+ <head>
405
+ <link href='${Ce(`${this.baseRefUrl}/${this.manifest.style[0]}`)}' rel="stylesheet" />
406
+ <script src='${Ce(`${this.baseRefUrl}/${this.manifest.script[0]}`)}'></script>
407
+ </head>
408
+ <body></body>
409
+ </html>
410
+ `),t.close()}getIFrames(){let e=this.shadowRoot.querySelectorAll("iframe"),t=this.querySelectorAll("iframe"),r=[...e,...t];for(let i of r){let a=i.src;if(new URL(a,window.location.href).origin===window.location.origin)try{let n=i.contentDocument||i.contentWindow.document;n&&this.getInnerIFrames(n,r)}catch(n){console.error("Error accessing nested iframe:",n)}}return r.forEach((i,a)=>{r.indexOf(i)!==a&&r.splice(a,1)}),r}getInnerIFrames(e,t=[]){return e.querySelectorAll("iframe").forEach(i=>{t.push(i);let a=i.src;if(new URL(a,window.location.href).origin===window.location.origin)try{let n=i.contentDocument||i.contentWindow.document;this.getInnerIFrames(n,t)}catch(n){console.error("Error accessing nested iframe:",n)}else console.warn("Skipped cross-origin iframe:",a)}),t}postToWindowAndIframes(e,t){window.postMessage({type:e,data:t},"*");let r=this.getIFrames();for(let i of r)i.contentWindow&&i.contentWindow.postMessage({type:e,data:t},"*")}handlePostMessage(e){let{type:t,data:r}=e.data;switch(t){case"setResponse":this.rawResponse=r,this.saveResponse(r);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{let i=this.manifest.media.map(a=>a.startsWith("http")?a:Ce(this.baseRefUrl+"/"+a));this.postToWindowAndIframes("mediaData",i);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}validate(){return this.rawResponse!==""}get value(){return this.rawResponse}set value(e){if(typeof e=="string")this.rawResponse=e,this.saveResponse(e);else throw new Error("Value must be a string")}disconnectedCallback(){window.removeEventListener("message",this.handlePostMessage),super.disconnectedCallback()}render(){return h`<iframe
411
+ width=${this.getAttribute("width")}
412
+ height=${this.getAttribute("height")}
413
+ frameborder="0"
414
+ title="pciContainer"
415
+ id="pciContainer"
416
+ >
417
+ </iframe>
418
+ ${this._errorMessage&&h`<div style="color:red">
419
+ <h1>Error</h1>
420
+ ${this._errorMessage}
421
+ </div>`}`}};o([d({type:String,attribute:"data"})],B.prototype,"data",2),o([d({type:String,attribute:"data-base-item"})],B.prototype,"baseItemUrl",2),o([d({type:String,attribute:"data-base-ref"})],B.prototype,"baseRefUrl",2),o([d({type:String,attribute:"id"})],B.prototype,"id",2),o([C()],B.prototype,"_errorMessage",2),B=o([f("qti-custom-interaction")],B);var te=class extends v{constructor(){super(...arguments);this.disabled=!1;this.countAttempt=null;this.title="end attempt"}render(){return h`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`}endAttempt(e){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}};o([d({type:String,attribute:"response-identifier"})],te.prototype,"responseIdentifier",2),o([d({reflect:!0,type:Boolean})],te.prototype,"disabled",2),o([d({type:String,attribute:"count-attempt"})],te.prototype,"countAttempt",2),o([d({type:String})],te.prototype,"title",2),te=o([f("qti-end-attempt-interaction")],te);var Qt=b`
422
+ :host {
423
+ display: flex;
424
+ align-items: flex-start;
425
+ flex-direction: column;
426
+ flex-wrap: wrap;
427
+ gap: 0.5rem;
428
+ }
429
+
430
+ :host(.qti-choices-top) {
431
+ flex-direction: column;
432
+ }
433
+ :host(.qti-choices-bottom) {
434
+ flex-direction: column-reverse;
435
+ }
436
+ :host(.qti-choices-left) {
437
+ flex-direction: row;
438
+ }
439
+ :host(.qti-choices-right) {
440
+ flex-direction: row-reverse;
441
+ }
442
+ /* [part='drops'] , */
443
+ [name='prompt'] {
444
+ width: 100%;
445
+ }
446
+ [name='drags'] {
447
+ display: flex;
448
+ align-items: flex-start;
449
+ flex: 1;
450
+ border: 2px solid transparent;
451
+ padding: 0.3rem;
452
+ border-radius: 0.3rem;
453
+ gap: 0.5rem;
454
+ }
455
+ `;var Le=class extends P(x,"qti-gap-text","qti-gap","slot[part='drags']"){render(){return h`<slot name="prompt"> </slot>
456
+ <slot part="drags" name="drags"></slot>
457
+ <slot part="drops"></slot>
458
+ <div role="alert" id="validationMessage"></div>`}set correctResponse(s){let e=[],t=Array.isArray(s)?s:[s];t&&(e=t.map(i=>{let a=i.split(" ");return{text:a[0],gap:a[1]}})),this.querySelectorAll("qti-gap").forEach(i=>{let a=i.getAttribute("identifier"),p=e.find(c=>c.gap===a)?.text,n=this.querySelector(`qti-gap-text[identifier="${p}"]`)?.textContent.trim();if(p&&n){if(!i.nextElementSibling?.classList.contains("correct-option")){let c=document.createElement("span");c.classList.add("correct-option"),c.textContent=n,i.insertAdjacentElement("afterend",c)}}else i.nextElementSibling?.classList.contains("correct-option")&&i.nextElementSibling.remove()})}};Le.styles=Qt,Le=o([f("qti-gap-match-interaction")],Le);var er=(l,s,e)=>{let t=new Map;for(let r=s;r<=e;r++)t.set(l[r],r);return t},st=K(class extends ce{constructor(l){if(super(l),l.type!==le.CHILD)throw Error("repeat() can only be used in text expressions")}dt(l,s,e){let t;e===void 0?e=s:s!==void 0&&(t=s);let r=[],i=[],a=0;for(let p of l)r[a]=t?t(p,a):a,i[a]=e(p,a),a++;return{values:i,keys:r}}render(l,s,e){return this.dt(l,s,e).values}update(l,[s,e,t]){let r=Ht(l),{values:i,keys:a}=this.dt(s,e,t);if(!Array.isArray(r))return this.ut=a,i;let p=this.ut??(this.ut=[]),n=[],c,u,m=0,g=r.length-1,y=0,q=i.length-1;for(;m<=g&&y<=q;)if(r[m]===null)m++;else if(r[g]===null)g--;else if(p[m]===a[y])n[y]=W(r[m],i[y]),m++,y++;else if(p[g]===a[q])n[q]=W(r[g],i[q]),g--,q--;else if(p[m]===a[q])n[q]=W(r[m],i[q]),ae(l,n[q+1],r[m]),m++,q--;else if(p[g]===a[y])n[y]=W(r[g],i[y]),ae(l,r[m],r[g]),g--,y++;else if(c===void 0&&(c=er(a,y,q),u=er(p,m,g)),c.has(p[m]))if(c.has(p[g])){let w=u.get(a[y]),U=w!==void 0?r[w]:null;if(U===null){let D=ae(l,r[m]);W(D,i[y]),n[y]=D}else n[y]=W(U,i[y]),ae(l,r[m],U),r[w]=null;y++}else Be(r[g]),g--;else Be(r[m]),m++;for(;y<=q;){let w=ae(l,n[q+1]);W(w,i[y]),n[y++]=w}for(;m<=g;){let w=r[m++];w!==null&&Be(w)}return this.ut=a,Nt(l,n),ne}});function he(l,s,e,t){switch(l){case"circle":{let[r,i,a]=s,p=r/e.width*100,n=i/e.height*100,c=a/e.width*100;t.style.left=p-c+"%",t.style.top=n-c+"%",t.style.width=t.style.height=4*c+"px",t.style.borderRadius="9999px"}break;case"rect":{let[r,i,a,p]=s,n=r/e.width*100,c=i/e.height*100,u=a/e.width*100,m=p/e.height*100;t.style.left=n+"%",t.style.top=c+"%",t.style.width=u-n+"%",t.style.height=m-c+"%"}break;case"poly":{let r=s.reduce((w,U,D,Ue)=>{if(D%2===1){let pr=w.pop();w[w.length]={x:pr,y:Ue[D]}}else w.push(U);return w},[]),i=Math.min(...r.map(w=>w.x)),a=Math.max(...r.map(w=>w.x)),p=Math.min(...r.map(w=>w.y)),n=Math.max(...r.map(w=>w.y)),c=i/e.width*100,u=p/e.height*100,m=a/e.width*100,g=n/e.height*100;t.style.left=i/e.width*100+"%",t.style.top=p/e.height*100+"%",t.style.width=m-c+"%",t.style.height=g-u+"%";let q=r.map(w=>({x:(w.x-i)/(a-i)*100,y:(w.y-p)/(n-p)*100})).map(w=>Math.round(w.x)+"% "+Math.round(w.y)+"%").join(",");t.style.clipPath=`polygon(${q})`}break;default:break}}var tr=b`
459
+ slot:not([name='prompt']) {
460
+ // position: relative; /* qti-hotspot-choice relative to the slot */
461
+ display: block;
462
+ width: fit-content; /* hotspots not stretching further if image is at max size */
463
+ }
464
+ ::slotted(img) {
465
+ /* image not selectable anymore */
466
+ pointer-events: none;
467
+ user-select: none;
468
+ }
469
+ ::slotted(qti-associable-hotspot) {
470
+ transform: translate(-50%, -50%);
471
+ }
472
+ line-container {
473
+ display: block;
474
+ position: relative;
475
+ }
476
+ svg {
477
+ position: absolute;
478
+ top: 0px;
479
+ left: 0px;
480
+ }
481
+ `;var Y=class extends x{constructor(){super();this.startPoint=null;this.endPoint=null;this._lines=[];this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}reset(){this._lines=[]}validate(){return this._lines.length>0}set value(e){Array.isArray(e)&&(this._lines=e)}get value(){return this._lines}render(){return h`<slot name="prompt"></slot>
482
+ <line-container>
483
+ <svg
484
+ width=${Z(this.grImage[0]?.width)}
485
+ height=${Z(this.grImage[0]?.height)}
486
+ viewbox="0 0 ${this.grImage[0]?.width} ${this.grImage[0]?.height}"
487
+ >
488
+ ${st(this._lines,e=>e,(e,t)=>nt`
489
+ <line
490
+ part="line"
491
+ x1=${parseInt(this.querySelector("[identifier="+e.split(" ")[0]+"]").style.left)}
492
+ y1=${parseInt(this.querySelector("[identifier="+e.split(" ")[0]+"]").style.top)}
493
+ x2=${parseInt(this.querySelector("[identifier="+e.split(" ")[1]+"]").style.left)}
494
+ y2=${parseInt(this.querySelector("[identifier="+e.split(" ")[1]+"]").style.top)}
495
+ stroke="red"
496
+ stroke-width="3"
497
+ @click=${r=>{r.stopPropagation(),this._lines=this._lines.filter((i,a)=>a!==t),this.saveResponse(this._lines)}}
498
+ />
499
+ `)}
500
+ ${this.startPoint&&nt`<line
501
+ part="point"
502
+ x1=${this.startCoord.x}
503
+ y1=${this.startCoord.y}
504
+ x2=${this.mouseCoord.x}
505
+ y2=${this.mouseCoord.y}
506
+ stroke="red"
507
+ stroke-width="3"
508
+ />`}
509
+ </svg>
510
+ <slot></slot>
511
+ </line-container>
512
+ <div role="alert" id="validationMessage"></div>`}positionHotspotOnRegister(e){let t=this.querySelector("img"),r=e.target,i=r.getAttribute("coords"),a=r.getAttribute("shape"),p=i.split(",").map(n=>parseInt(n));he(a,p,t,r)}firstUpdated(e){super.firstUpdated(e),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",t=>{this.mouseCoord={x:t.clientX-this.grImage[0].getBoundingClientRect().left,y:t.clientY-this.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(t=>{t.style.left=t.getAttribute("coords").split(",")[0]+"px",t.style.top=t.getAttribute("coords").split(",")[1]+"px",t.addEventListener("click",r=>{this.startPoint?this.endPoint||(this.endPoint=r.target,this._lines=[...this._lines,this.startPoint.getAttribute("identifier")+" "+this.endPoint.getAttribute("identifier")],this.saveResponse(this._lines),this.startPoint=null,this.endPoint=null):(this.startPoint=r.target,this.startCoord={x:this.startPoint.getAttribute("coords").split(",")[0],y:this.startPoint.getAttribute("coords").split(",")[1]})})})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};Y.styles=tr,o([C()],Y.prototype,"_lines",2),o([C()],Y.prototype,"startCoord",2),o([C()],Y.prototype,"mouseCoord",2),o([Vt({selector:"img"})],Y.prototype,"grImage",2),Y=o([f("qti-graphic-associate-interaction")],Y);var rr=b`
513
+ :host {
514
+ display: flex;
515
+ align-items: flex-start;
516
+ flex-direction: column;
517
+ flex-wrap: wrap;
518
+ gap: 0.5rem;
519
+ }
520
+
521
+ :host(.qti-choices-top) {
522
+ flex-direction: column-reverse;
523
+ }
524
+ :host(.qti-choices-bottom) {
525
+ flex-direction: column;
526
+ }
527
+ :host(.qti-choices-left) {
528
+ flex-direction: row-reverse;
529
+ & [name='drags'] {
530
+ width: 25%;
531
+ }
532
+ & [part='image'] {
533
+ width: 75%;
534
+ }
535
+ }
536
+ :host(.qti-choices-right) {
537
+ flex-direction: row;
538
+ & [name='drags'] {
539
+ width: 25%;
540
+ }
541
+ & [part='image'] {
542
+ width: 75%;
543
+ }
544
+ }
545
+ [part='image'] {
546
+ display: block;
547
+ position: relative;
548
+ }
549
+ /* [part='drops'] , */
550
+
551
+ [name='drags'] {
552
+ display: flex;
553
+ align-items: flex-start;
554
+ flex-wrap: wrap;
555
+ flex: 1;
556
+ border: 2px solid transparent;
557
+ padding: 0.3rem;
558
+ border-radius: 0.3rem;
559
+ gap: 0.5rem;
560
+ }
561
+ ::slotted(img) {
562
+ display: inline-block;
563
+ user-select: none;
564
+ pointer-events: none;
565
+ }
566
+ `;var Ve=class extends P(x,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part='drags']"){render(){return h` <slot name="prompt"></slot>
567
+ <slot part="image"></slot>
568
+ <slot part="drags" name="drags" class="hover-border"></slot>
569
+ <div role="alert" id="validationMessage"></div>`}positionHotspotOnRegister(s){let e=s.target,t=e.getAttribute("coords"),r=e.getAttribute("shape"),i=t.split(",").map(a=>parseInt(a));switch(r){case"circle":{let[a,p,n]=i;e.style.left=a-n+"px",e.style.top=p-n+"px",e.style.width=e.style.height=2*n+"px"}break;case"rect":{let[a,p,n,c]=i;e.style.left=a+"px",e.style.top=p+"px",e.style.width=n-a+"px",e.style.height=c-p+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};Ve.styles=rr,Ve=o([f("qti-graphic-gap-match-interaction")],Ve);var ir=b`
570
+ slot:not([name='prompt']) {
571
+ position: relative; /* qti-hotspot-choice relative to the slot */
572
+ display: block;
573
+ width: fit-content; /* hotspots not stretching further if image is at max size */
574
+ }
575
+ ::slotted(img) {
576
+ /* image not selectable anymore */
577
+ pointer-events: none;
578
+ user-select: none;
579
+ }
580
+ `;var De=class extends G(x,"qti-hotspot-choice"){constructor(){super(...arguments);this._choiceElements=[]}render(){return h`
581
+ <slot name="prompt"></slot>
582
+ <slot></slot>
583
+ <div role="alert" id="validationMessage"></div>
584
+ `}setHotspotOrder(e){let{identifier:t}=e.detail,r=this._choiceElements.find(a=>a.getAttribute("identifier")===t),i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(a=>a.order>0).length>=i){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(a=>!!a.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(a=>(a.order>a.order&&a.order--,a)),r.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(e){let t=this.querySelector("img"),r=e.target,i=r.getAttribute("coords"),a=r.getAttribute("shape"),p=i.split(",").map(n=>parseInt(n));he(a,p,t,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}};De.styles=ir,De=o([f("qti-graphic-order-interaction")],De);var sr=b`
585
+ slot:not([name='prompt']) {
586
+ position: relative; /* qti-hotspot-choice relative to the slot */
587
+ display: block;
588
+ width: fit-content; /* hotspots not stretching further if image is at max size */
589
+ }
590
+ ::slotted(img) {
591
+ /* image not selectable anymore */
592
+ pointer-events: none;
593
+ user-select: none;
594
+ /* width:100%; */
595
+ }
596
+ `;var Ne=class extends G(x,"qti-hotspot-choice"){render(){return h`
597
+ <slot name="prompt"></slot>
598
+ <slot></slot>
599
+ `}positionHotspotOnRegister(s){let e=this.querySelector("img"),t=s.target,r=t.getAttribute("coords"),i=t.getAttribute("shape"),a=r.split(",").map(p=>parseInt(p));he(i,a,e,t)}connectedCallback(){super.connectedCallback(),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("unregister-qti-hotspot-choice",this.positionHotspotOnRegister)}};Ne.styles=sr,Ne=o([f("qti-hotspot-interaction")],Ne);var re=class extends N(v,"qti-simple-associable-choice"){constructor(){super(...arguments);this.matchMin=0;this.matchMax=1;this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return h`
600
+ <slot part="slot"></slot>
601
+ <slot part="dropslot" name="qti-simple-associable-choice"></slot>
602
+ `}};re.styles=b`
603
+ :host {
604
+ display: flex;
605
+ user-select: none;
606
+ }
607
+ slot {
608
+ width: 100%;
609
+ display: block;
610
+ }
611
+ slot[name='qti-simple-associable-choice'] {
612
+ width: 100%;
613
+ }
614
+ `,o([d({type:Number,attribute:"match-min"})],re.prototype,"matchMin",2),o([d({type:Number,attribute:"match-max"})],re.prototype,"matchMax",2),o([d({type:Boolean,attribute:"fixed"})],re.prototype,"fixed",2),re=o([f("qti-simple-associable-choice")],re);var or=b`
615
+ slot:not([hidden]) {
616
+ /* slot where the */
617
+ display: flex;
618
+ flex-direction: column;
619
+ gap: 0.5rem;
620
+ align-items: flex-start; /* prevents the drag and drop container slots having the same height */
621
+ }
622
+ :host(.qti-choices-top) slot {
623
+ flex-direction: column;
624
+ }
625
+ :host(.qti-choices-bottom) slot {
626
+ flex-direction: column-reverse;
627
+ }
628
+ :host(.qti-choices-left) slot {
629
+ flex-direction: row;
630
+ }
631
+ :host(.qti-choices-right) slot {
632
+ flex-direction: row-reverse;
633
+ }
634
+ slot[name='prompt'] {
635
+ display: block;
636
+ }
637
+ ::slotted(qti-simple-match-set) {
638
+ /* Make sure the drag and drop container slots have the same width */
639
+ flex: 1;
640
+ }
641
+ `;var j=class extends P(x,"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","body"){constructor(){super(...arguments);this.lastCheckedRadio=null;this.class="";this._response=[];this.responseIdentifier="";this.correctOptions=[];this.handleRadioClick=e=>{let t=e.target;this.lastCheckedRadio===t?(t.checked=!1,this.lastCheckedRadio=null,this.handleRadioChange(e)):this.lastCheckedRadio=t};this.handleRadioChange=e=>{let t=e.target,r=t.value,i=t.name,a=t.type;t.checked?(this.value?this.value.indexOf(r)===-1&&(a==="radio"&&(this.value=this.value.filter(p=>p.indexOf(i)===-1)),this.value=[...this.value,r]):this.value=[r],this.lastCheckedRadio=t):(this.value=this.value.filter(p=>p!==r),this.lastCheckedRadio=null),this.requestUpdate(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(this.value)?[...this.value]:this.value}}))}}get value(){return this.classList.contains("qti-match-tabular")?this._response:super.value}set value(e){this.classList.contains("qti-match-tabular")?this._response=e:super.value=e}async connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.value=[]}set correctResponse(e){if(e===""){this.correctOptions=[];return}else Array.isArray(e)&&(this.correctOptions=e)}render(){let e=this.class.split(" ").includes("qti-match-tabular");return h`
642
+ <slot name="prompt"></slot>
643
+ <slot ?hidden=${e}></slot>
644
+
645
+ ${e?h`
646
+ <table>
647
+ <tr>
648
+ <td></td>
649
+ ${this.cols.map(t=>h`<th part="r-header">${Q(t.innerHTML)}</th>`)}
650
+ </tr>
651
+
652
+ ${this.rows.map(t=>h`<tr>
653
+ <td part="c-header">${Q(t.innerHTML)}</td>
654
+ ${this.cols.map(r=>{let i=t.getAttribute("identifier"),a=r.getAttribute("identifier"),p=`${i} ${a}`,n=this.value.filter(g=>g.split(" ")[0]===i).length||0,c=this.value.includes(p),u=`rb ${c?"rb-checked":""} ${this.correctOptions.includes(p)?"rb-correct":""}`,m=this.correctOptions.length>0?!0:t.matchMax===1?!1:n>=t.matchMax&&!c;return h`<td>
655
+ <input
656
+ type=${t.matchMax===1?"radio":"checkbox"}
657
+ part=${u}
658
+ name=${i}
659
+ value=${p}
660
+ .disabled=${m}
661
+ @change=${g=>this.handleRadioChange(g)}
662
+ @click=${g=>t.matchMax===1?this.handleRadioClick(g):null}
663
+ />
664
+ </td>`})}
665
+ </tr>`)}
666
+ </table>
667
+ `:A}
668
+
669
+ <div role="alert" id="validationMessage"></div>
670
+ `}};j.styles=or,o([d({type:String})],j.prototype,"class",2),o([C()],j.prototype,"_response",2),o([d({type:String,attribute:"response-identifier"})],j.prototype,"responseIdentifier",2),o([C()],j.prototype,"correctOptions",2),j=o([f("qti-match-interaction")],j);var He=class extends x{constructor(){super();this._value=0}reset(){}validate(){return!0}get value(){return this._value.toString()}set value(e){if(!isNaN(parseInt(e.toString())))this._value=parseInt(e.toString());else throw new Error("Value must be a number")}static get properties(){return{...x.properties,step:{type:Number,attribute:"step",default:10}}}render(){return h` <slot name="prompt"></slot>
671
+ <slot></slot>`}connectedCallback(){super.connectedCallback();let e=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");e&&e.addEventListener("ended",()=>{this._value++,this.saveResponse(this.value)})}};He.styles=[b``],He=o([f("qti-media-interaction")],He);var nr=b`
672
+ [part='drags'] {
673
+ display: flex;
674
+ align-items: flex-start;
675
+ flex: 1;
676
+ border: 2px solid transparent;
677
+ }
678
+
679
+ [part='drops'] {
680
+ flex: 1;
681
+ display: grid;
682
+ grid-auto-flow: column;
683
+ grid-auto-columns: 1fr;
684
+ }
685
+
686
+ :host([orientation='horizontal']) [part='drags'] {
687
+ flex-direction: row;
688
+ }
689
+ :host([orientation='horizontal']) [part='drops'] {
690
+ grid-auto-flow: column;
691
+ }
692
+ :host([orientation='vertical']) [part='drags'] {
693
+ flex-direction: column;
694
+ }
695
+ :host([orientation='vertical']) [part='drops'] {
696
+ grid-auto-flow: row;
697
+ }
698
+
699
+ [part='drop-list'] {
700
+ display: block;
701
+ flex: 1;
702
+ }
703
+
704
+ [part='container'] {
705
+ display: flex;
706
+ gap: 0.5rem;
707
+ }
708
+ :host(.qti-choices-top) [part='container'] {
709
+ flex-direction: column;
710
+ }
711
+ :host(.qti-choices-bottom) [part='container'] {
712
+ flex-direction: column-reverse;
713
+ }
714
+ :host(.qti-choices-left) [part='container'] {
715
+ flex-direction: row;
716
+ }
717
+ :host(.qti-choices-right) [part='container'] {
718
+ flex-direction: row-reverse;
719
+ }
720
+ `;var X=class extends Je(P(x,"qti-simple-choice","drop-list","slot[part='drags']"),"qti-simple-choice"){constructor(){super(...arguments);this.nrChoices=0;this.correctResponses=[];this.showCorrectResponses=!1}render(){let e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),h` <slot name="prompt"> </slot>
721
+ <div part="container">
722
+ <slot part="drags"> </slot>
723
+ <div part="drops">
724
+ ${Array.from(Array(this.nrChoices)).map((t,r)=>h`<drop-list part="drop-list" identifier="droplist${r}"></drop-list>${this.showCorrectResponses&&this.correctResponses.length>r?Q(`<span part='correct-response'>${this.correctResponses[r]}</span>`):""}`)}
725
+ </div>
726
+ </div>`}set correctResponse(e){if(e===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(e)?e:[e]).forEach(r=>{let i=this.querySelector(`qti-simple-choice[identifier="${r}"]`);i||(i=this.shadowRoot.querySelector(`qti-simple-choice[identifier="${r}"]`));let a=i?.textContent.trim();this.correctResponses=[...this.correctResponses,a]}),this.showCorrectResponses=!0}getResponse(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(r=>{let i=r.querySelectorAll('[qti-draggable="true"]');return[...Array.from(i).map(p=>p.getAttribute("identifier"))].join(" ")})}async firstUpdated(e){super.firstUpdated(e),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(t=>t.setAttribute("part","qti-simple-choice"))}};X.styles=nr,o([C()],X.prototype,"nrChoices",2),o([C()],X.prototype,"correctResponses",2),o([C()],X.prototype,"showCorrectResponses",2),o([d({type:String})],X.prototype,"orientation",2),X=o([f("qti-order-interaction")],X);var ot=class extends v{render(){return h`<slot></slot>`}};ot.styles=[b`
727
+ :host {
728
+ display: block;
729
+ }
730
+ ::slotted(img) {
731
+ position: absolute;
732
+ cursor: move;
733
+ user-select: none;
734
+ left: 50%;
735
+ transform: translateX(-50%);
736
+ }
737
+ `];customElements.define("qti-position-object-interaction",ot);var $e=class extends v{render(){return h`<slot></slot>`}constructor(){super(),this.removeMoveListener=this.removeMoveListener.bind(this),this.dragElementHandler=this.dragElementHandler.bind(this)}dragElementHandler(s){s.preventDefault();let e=s.clientX-this.startX,t=s.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+t+"px",this.startX=s.clientX,this.startY=s.clientY}firstUpdated(s){super.firstUpdated(s),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",e=>{this.startX=e.clientX,this.startY=e.clientY,document.addEventListener("mousemove",this.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}removeMoveListener(){document.removeEventListener("mousemove",this.dragElementHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}};$e.styles=[b`
738
+ :host {
739
+ display: inline-block;
740
+ position: relative;
741
+ }
742
+ `],$e=o([f("qti-position-object-stage")],$e);var ar="important",hr=" !"+ar,lr=K(class extends ce{constructor(l){if(super(l),l.type!==le.ATTRIBUTE||l.name!=="style"||l.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(l){return Object.keys(l).reduce((s,e)=>{let t=l[e];return t==null?s:s+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(l,[s]){let{style:e}=l.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(s)),this.render(s);for(let t of this.ft)s[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in s){let r=s[t];if(r!=null){this.ft.add(t);let i=typeof r=="string"&&r.endsWith(hr);t.includes("-")||i?e.setProperty(t,i?r.slice(0,-11):r,i?ar:""):e[t]=r}}return ne}});var ie=class extends x{constructor(){super(...arguments);this.maxChoices=1/0;this.minChoices=0;this._points=[];this._imgElement=null;this._onImageClick=e=>{if(this._points.length<this.maxChoices){let t=e.offsetX,r=e.offsetY;this._points=[...this._points,`${t} ${r}`],this.saveResponse(this._points)}}}render(){return h` <slot name="prompt"></slot>
743
+ <point-container>
744
+ ${st(this._points,e=>e,(e,t)=>h`
745
+ <button
746
+ part="point"
747
+ style=${lr({position:"absolute",transform:"translate(-50%, -50%)",left:`${e.split(" ")[0]}px`,top:`${e.split(" ")[1]}px`})}
748
+ aria-label="Remove point at ${e}"
749
+ @click=${r=>{r.stopPropagation(),this._points=this._points.filter((i,a)=>a!==t),this.saveResponse(this._points)}}
750
+ ></button>
751
+ `)}
752
+ <slot></slot>
753
+ </point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set value(e){this._points=Array.isArray(e)?e:[e]}get value(){return this._points}firstUpdated(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}disconnectedCallback(){super.disconnectedCallback(),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}};ie.styles=[b`
754
+ :host {
755
+ display: block;
756
+ }
757
+ point-container {
758
+ display: block;
759
+ position: relative;
760
+ }
761
+ `],o([d({type:Number,attribute:"max-choices"})],ie.prototype,"maxChoices",2),o([d({type:Number,attribute:"min-choices"})],ie.prototype,"minChoices",2),o([C()],ie.prototype,"_points",2),ie=o([f("qti-select-point-interaction")],ie);var cr=b`
762
+ :host {
763
+ display: block;
764
+ --show-bounds: true;
765
+ --show-ticks: true;
766
+ --show-value: true;
767
+ }
768
+
769
+ [part='slider'] {
770
+ margin-left: 2rem; /* mx-8 */
771
+ margin-right: 2rem;
772
+ padding-bottom: 1rem; /* pb-4 */
773
+ padding-top: 1.25rem; /* pt-5 */
774
+ }
775
+
776
+ [part='bounds'] {
777
+ display: flex;
778
+ width: 100%;
779
+ justify-content: space-between;
780
+ margin-bottom: 0.5rem; /* mb-2 */
781
+ }
782
+
783
+ [part='ticks'] {
784
+ margin-left: 0.125rem; /* mx-0.5 */
785
+ margin-right: 0.125rem;
786
+ margin-bottom: 0.25rem; /* mb-1 */
787
+ height: 0.5rem; /* h-2 */
788
+ background: linear-gradient(to right, var(--qti-border-color) var(--qti-border-thickness), transparent 1px) repeat-x
789
+ 0 center / calc(calc(100% - var(--qti-border-thickness)) / ((var(--max) - var(--min)) / var(--step))) 100%;
790
+ }
791
+
792
+ [part='rail'] {
793
+ display: flex;
794
+ align-items: center;
795
+ box-sizing: border-box;
796
+ height: 0.375rem; /* h-1.5 */
797
+ width: 100%;
798
+ cursor: pointer;
799
+ border-radius: 9999px; /* rounded-full */
800
+ border: 1px solid #d1d5db; /* border-gray-300 */
801
+ background-color: #e5e7eb; /* bg-gray-200 */
802
+ }
803
+
804
+ [part='knob'] {
805
+ background-color: var(--qti-bg-active);
806
+ border: 2px solid var(--qti-border-active);
807
+ position: relative;
808
+ height: 1rem; /* h-4 */
809
+ width: 1rem; /* w-4 */
810
+ transform-origin: center;
811
+ transform: translateX(-50%);
812
+ cursor: pointer;
813
+ border-radius: 9999px; /* rounded-full */
814
+ left: var(--value-percentage);
815
+ }
816
+
817
+ [part='value'] {
818
+ position: absolute;
819
+ bottom: 2rem; /* bottom-8 */
820
+ left: 0.5rem; /* left-2 */
821
+ transform: translateX(-50%);
822
+ cursor: pointer;
823
+ border-radius: 0.25rem; /* rounded */
824
+ background-color: #f3f4f6; /* bg-gray-100 */
825
+ padding: 0.25rem 0.5rem; /* px-2 py-1 */
826
+ text-align: center;
827
+ color: #6b7280; /* text-gray-500 */
828
+ }
829
+ `;var F=class extends v{constructor(){super();this._value=0;this.min=0;this.max=100;this.step=1;this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this._updateValue(this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}get value(){return this._value.toString()}set value(e){let t=parseInt(e,10);isNaN(t)||this._updateValue(t)}_updateValue(e){this._value=Math.min(this.max,Math.max(this.min,e));let t=(this._value-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage",`${t}%`),this._internals.setFormValue(this.value),this.requestUpdate()}render(){return h`
830
+ <slot name="prompt"></slot>
831
+ <div id="slider" part="slider">
832
+ <div id="bounds" part="bounds">
833
+ <div>${this.min}</div>
834
+ <div>${this.max}</div>
835
+ </div>
836
+
837
+ <div id="ticks" part="ticks"></div>
838
+
839
+ <div id="rail" part="rail" @mousedown=${this._onMouseDown} @touchstart=${this._onTouchStart}>
840
+ <div id="knob" part="knob"><div id="value" part="value">${this.value}</div></div>
841
+ </div>
842
+ </div>
843
+ `}_onMouseDown(e){this._startDrag(e.pageX);let t=i=>this._onDrag(i.pageX),r=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r),this._onDragEnd()};document.addEventListener("mousemove",t),document.addEventListener("mouseup",r)}_onTouchStart(e){this._startDrag(e.touches[0].pageX);let t=i=>this._onDrag(i.touches[0].pageX),r=()=>{document.removeEventListener("touchmove",t),document.removeEventListener("touchend",r),this._onDragEnd()};document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",r)}_startDrag(e){this._onDrag(e)}_onDrag(e){let t=this._rail.getBoundingClientRect(),r=e-t.left,i=Math.min(1,Math.max(0,r/t.width)),a=this.min+Math.round(i*(this.max-this.min)/this.step)*this.step;this._updateValue(a)}_onDragEnd(){this.dispatchEvent(new Event("change",{bubbles:!0}))}};F.formAssociated=!0,F.styles=cr,o([ze("#rail")],F.prototype,"_rail",2),o([d({type:Number,attribute:"lower-bound"})],F.prototype,"min",2),o([d({type:Number,attribute:"upper-bound"})],F.prototype,"max",2),o([d({type:Number,attribute:"step"})],F.prototype,"step",2),F=o([f("qti-slider-interaction")],F);var Ie=class extends v{render(){return h`<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(){let s=Array.from(this.firstElementChild?.childNodes??[]).find(e=>e.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","fn","item",s?.textContent??"")}catch(e){console.error("custom-operator contains invalid javascript code",e)}}calculate(){let s={variable:t=>this._context?.variables.find(r=>r.identifier===t)?.value??"",correct:t=>this._context?.variables.find(r=>r.identifier===t)?.correctResponse??""},e={getVariable:t=>this._context?.variables.find(r=>r.identifier===t),updateOutcomeVariable:(t,r)=>{this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:r}}))},updateResponseVariable:(t,r)=>{this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t,response:r}}))}};return this.operatorFunction(this._context,s,e)}};o([R({context:T,subscribe:!0}),C()],Ie.prototype,"_context",2),Ie=o([f("qti-custom-operator")],Ie);var Oe=class extends v{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}render(){return h` <slot name="drags"></slot> `}};Oe.styles=b`
844
+ :host {
845
+ display: flex;
846
+ user-select: none;
847
+ position: absolute;
848
+ }
849
+ `,Oe=o([f("qti-associable-hotspot")],Oe);var fe=class extends v{constructor(){super(...arguments);this.tabindex=0}render(){return h` <slot name="drags"></slot>`}};fe.styles=b`
850
+ :host {
851
+ display: flex;
852
+ user-select: none;
853
+ }
854
+ `,o([d({type:Number,reflect:!0})],fe.prototype,"tabindex",2),fe=o([f("qti-gap")],fe);var ge=class extends v{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","drags")}};ge.styles=b`
855
+ :host {
856
+ display: flex;
857
+ user-select: none;
858
+ }
859
+ `,o([d({type:Number,reflect:!0})],ge.prototype,"tabindex",2),ge=o([f("qti-gap-img")],ge);var be=class extends N(v,"qti-gap-text"){constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","drags")}render(){return h`<slot></slot>`}};be.styles=b`
860
+ :host {
861
+ display: inline-flex;
862
+ user-select: none;
863
+ }
864
+ `,o([d({type:Number,reflect:!0})],be.prototype,"tabindex",2),be=o([f("qti-gap-text")],be);var ve=class extends N(v,"qti-hotspot-choice"){};ve.styles=b`
865
+ :host {
866
+ display: flex;
867
+ user-select: none;
868
+ position: absolute;
869
+ }
870
+ `,o([d({attribute:"aria-ordervalue",type:Number,reflect:!0})],ve.prototype,"order",2),ve=o([f("qti-hotspot-choice")],ve);var Pe=class extends N(v,"qti-hottext"){render(){return h`<div part="ch"><div part="cha"></div></div>
871
+ <slot></slot> `}};Pe.styles=b`
872
+ :host {
873
+ display: flex;
874
+ user-select: none;
875
+ }
876
+ `,Pe=o([f("qti-hottext")],Pe);var Fe=class extends v{static get styles(){return[b`
877
+ :host {
878
+ display: block;
879
+ cursor: pointer;
880
+ }
881
+ `]}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}disconnectedCallback(){this.removeEventListener("click",this._onSelectInlineChoice)}render(){return h` <slot></slot> `}_onSelectInlineChoice(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}};o([d({type:String})],Fe.prototype,"identifier",2),Fe=o([f("qti-inline-choice")],Fe);var ye=class extends N(v,"qti-simple-choice"){get checked(){return this.internals.states.has("--checked")}render(){return h`<div part="ch">
882
+ <div part="cha"></div>
883
+ </div>
884
+ ${this.marker?h`<div id="label">${this.marker}</div>`:A}
885
+ <slot part="slot"></slot> `}};ye.styles=b`
886
+ :host {
887
+ display: flex;
888
+ align-items: center;
889
+ user-select: none;
890
+ }
891
+ slot {
892
+ width: 100%;
893
+ display: flex;
894
+ align-items: center;
895
+ }
896
+ [part='ch'] {
897
+ display: flex;
898
+ flex-shrink: 0;
899
+ align-items: center;
900
+ justify-content: center;
901
+ }
902
+ `,o([d({type:String,attribute:!1})],ye.prototype,"marker",2),ye=o([f("qti-simple-choice")],ye);export{It as a,T as b,k as c,pe as d,N as e,xe as f,Ye as g,je as h,H as i,z as j,Xe as k,We as l,$ as m,qe as n,we as o,Te as p,x as q,_ as r,I as s,Ke as t,ee as u,de as v,ke as w,Se as x,pt as y,se as z,O as A,Ze as B,dt as C,ut as D,mt as E,_e as F,Re as G,ht as H,E as I,L as J,Kt as K,ur as L,Ge as M,ft as N,gt as O,Qe as P,et as Q,bt as R,vt as S,yt as T,xt as U,Et as V,tt as W,ue as X,Ct as Y,qt as Z,wt as _,Tt as $,Mt as aa,kt as ba,Ae as ca,St as da,Jt as ea,mr as fa,rt as ga,_t as ha,Rt as ia,At as ja,oe as ka,me as la,B as ma,te as na,Le as oa,Y as pa,Ve as qa,De as ra,Ne as sa,re as ta,j as ua,He as va,X as wa,ot as xa,$e as ya,ie as za,F as Aa,Ie as Ba,Oe as Ca,fe as Da,ge as Ea,be as Fa,ve as Ga,Pe as Ha,Fe as Ia,ye as Ja};
903
+ /*! Bundled license information:
904
+
905
+ lit-html/node/directives/if-defined.js:
906
+ (**
907
+ * @license
908
+ * Copyright 2018 Google LLC
909
+ * SPDX-License-Identifier: BSD-3-Clause
910
+ *)
911
+
912
+ lit-html/node/directives/ref.js:
913
+ (**
914
+ * @license
915
+ * Copyright 2020 Google LLC
916
+ * SPDX-License-Identifier: BSD-3-Clause
917
+ *)
918
+
919
+ lit-html/node/directives/unsafe-html.js:
920
+ (**
921
+ * @license
922
+ * Copyright 2017 Google LLC
923
+ * SPDX-License-Identifier: BSD-3-Clause
924
+ *)
925
+
926
+ lit-html/node/directives/repeat.js:
927
+ (**
928
+ * @license
929
+ * Copyright 2017 Google LLC
930
+ * SPDX-License-Identifier: BSD-3-Clause
931
+ *)
932
+
933
+ lit-html/node/directives/style-map.js:
934
+ (**
935
+ * @license
936
+ * Copyright 2018 Google LLC
937
+ * SPDX-License-Identifier: BSD-3-Clause
938
+ *)
939
+ */