@citolab/qti-components 6.4.4 → 6.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +400 -400
- package/dist/index.bundled.css +2002 -2
- package/dist/index.cjs +24 -24
- package/dist/index.js +22 -22
- package/dist/qti-components/index.cjs +10 -10
- package/dist/qti-components/index.js +35 -35
- package/package.json +3 -2
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
5
|
-
`;var O=class extends _lit.LitElement{render(){return _lit.html`<slot name="qti-rubric-block"></slot><slot></slot>`}};O.styles=Lt,O=_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-item-body")],O);var Pe=class extends _lit.LitElement{render(){return _lit.html`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};customElements.define("qti-prompt",Pe);var _statichtmljs = require('lit/static-html.js');var
|
|
5
|
+
`;var O=class extends _lit.LitElement{render(){return _lit.html`<slot name="qti-rubric-block"></slot><slot></slot>`}};O.styles=Lt,O=_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-item-body")],O);var Pe=class extends _lit.LitElement{render(){return _lit.html`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};customElements.define("qti-prompt",Pe);var _statichtmljs = require('lit/static-html.js');var vr={SPACE:32},x= exports.QtiChoice =class extends _lit.LitElement{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,t){t?(this.tabindex=void 0,this.blur()):this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-register-choice",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-loose-choice",{bubbles:!0,cancelable:!1,composed:!0}))}reset(){this.checked=!1,this.disabled=!1}_onKeyUp(e){if(!e.altKey)switch(e.keyCode){case vr.SPACE:e.preventDefault(),this._toggleChecked();break;default:}}_onClick(){this._toggleChecked()}_toggleChecked(){this.disabled||this.readonly||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("qti-choice-element-selected",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier,checked:this.checked}})))}validateAllProps(){return!!this.getAttribute("identifier")}render(){return this.validateAllProps()||console.warn(`Invalid props for ${this.outerHTML}`,"missing identifier"),_statichtmljs.html` <slot></slot> `}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],x.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number,reflect:!0})],x.prototype,"tabindex",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:a=>a}})],x.prototype,"disabled",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:a=>a}})],x.prototype,"readonly",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:a=>a}})],x.prototype,"checked",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "disabled",{waitUntilFirstUpdate:!0})],x.prototype,"handleDisabledChange",1);var H=class extends _lit.LitElement{render(){return _lit.html`<slot></slot>`}defaultValues(i){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let t=e.map(r=>r.innerHTML);return t.length>1||i.cardinality==="multiple"||i.cardinality==="ordered"?t:t[0]}};customElements.define("qti-variabledeclaration",H);var P=class extends H{connectedCallback(){super.connectedCallback();let e={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}get correctResponse(){let e,t=this.querySelector("qti-correct-response");if(t){let r=t.querySelectorAll("qti-value");if(this.cardinality==="single"&&r.length>0)e=r[0].textContent,r[0].remove();else if(this.cardinality!=="single"){e=[];for(let o=0;o<r.length;o++)e.push(r[o].textContent),r[o].remove()}}return e}get mapping(){return this.querySelector("qti-mapping")}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"base-type"})],P.prototype,"baseType",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],P.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],P.prototype,"cardinality",2);customElements.define("qti-response-declaration",P);var I=class extends H{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 o=parseInt(r.getAttribute("source-value")),n=parseInt(r.getAttribute("target-value"));(isNaN(o)||isNaN(n))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),t.set(o,n)}}return null}connectedCallback(){super.connectedCallback();let e={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"base-type"})],I.prototype,"baseType",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],I.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],I.prototype,"cardinality",2);customElements.define("qti-outcome-declaration",I);var le=class extends _lit.LitElement{};le= exports.QtiCompanionMaterialsInfo =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-companion-materials-info")],le);var S=class extends _lit.LitElement{handleclassNamesChange(e,t){this.classNames.split(" ").forEach(o=>{switch(o){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return _lit.html`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};S.styles=_lit.css`
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
8
|
}
|
|
9
|
-
`,_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],S.prototype,"id",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],S.prototype,"use",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],S.prototype,"view",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"class"})],S.prototype,"classNames",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "classNames",{waitUntilFirstUpdate:!0})],S.prototype,"handleclassNamesChange",1),S= exports.qtiRubricBlock =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-rubric-block")],S);var pe=class extends _lit.LitElement{render(){return _lit.html`<slot></slot>`}};pe= exports.qtiContentBody =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-content-body")],pe);var
|
|
9
|
+
`,_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],S.prototype,"id",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],S.prototype,"use",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],S.prototype,"view",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"class"})],S.prototype,"classNames",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "classNames",{waitUntilFirstUpdate:!0})],S.prototype,"handleclassNamesChange",1),S= exports.qtiRubricBlock =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-rubric-block")],S);var pe=class extends _lit.LitElement{render(){return _lit.html`<slot></slot>`}};pe= exports.qtiContentBody =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-content-body")],pe);var Tr=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),Fe=a=>{if(typeof a=="string")return a;let i=Tr();return i==="."?a.toLocaleString():a.toString().replace(".","").replace(i,".")};function Xe(a){return a==null}var _=class extends _lit.LitElement{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(e){let t=this.closest("qti-assessment-item").getOutcome(e);if(this.outcomeIdentifier!==e||!t)return;let r=!1;Array.isArray(t.value)?r=t.value.includes(this.identifier):r=!Xe(this.identifier)&&!Xe(t==null?void 0:t.value)&&this.identifier===t.value||!1,this.showFeedback(r)}showFeedback(e){this.showStatus=e&&this.showHide==="show"||!e&&this.showHide==="hide"?"on":"off"}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"show-hide"})],_.prototype,"showHide",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"outcome-identifier"})],_.prototype,"outcomeIdentifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],_.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:!1})],_.prototype,"showStatus",2);var ue=class extends _{constructor(){super(...arguments);this.render=()=>_lit.html` <slot part="feedback" class="${this.showStatus}"></slot> `}};ue.styles=_lit.css`
|
|
10
10
|
.on {
|
|
11
11
|
display: inline-block;
|
|
12
12
|
}
|
|
@@ -82,18 +82,18 @@
|
|
|
82
82
|
`]}render(){return _lit.html`
|
|
83
83
|
<select part="select" @change="${this.choiceSelected}" ?disabled="${this.disabled}" ?readonly="${this.readonly}">
|
|
84
84
|
${this.options.map(e=>_lit.html`
|
|
85
|
-
<option value="${e.value}" ?selected="${e.selected}">${e.textContent}</option>
|
|
85
|
+
<option value="${e.value}" ?selected="${e.selected}">${_unsafehtmljs.unsafeHTML.call(void 0, e.textContent)}</option>
|
|
86
86
|
`)}
|
|
87
87
|
</select>
|
|
88
88
|
|
|
89
89
|
${_unsafehtmljs.unsafeHTML.call(void 0, this.correctOption)}
|
|
90
|
-
`}firstUpdated(e){super.firstUpdated(e),this.addEventListener(Tt.ON_DROPDOWN_SELECTED,this.choiceSelected);let t=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...t.map(r=>({textContent:r.innerHTML,value:r.getAttribute("identifier"),selected:!1}))]}validate(){let e=this.options.find(t=>t.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,t)=>_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},e),{selected:t===0}))}set response(e){this.options=this.options.map(t=>(e===t.value&&(t.selected=!0),t))}set correctResponse(e){if(e===""){this.correctOption="";return}console.log("correctResponse",e),this.correctOption=this.options.find(t=>e===t.value).textContent}choiceSelected(e){let t=e.target.value;this.options=this.options.map(r=>_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},r),{selected:r.value===t})),this.saveResponse(t)}};D.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"],_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],D.prototype,"options",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],D.prototype,"correctOption",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {attribute:"data-prompt",type:String})],D.prototype,"dataPrompt",2);customElements.define("qti-inline-choice-interaction",D);var
|
|
90
|
+
`}firstUpdated(e){super.firstUpdated(e),this.addEventListener(Tt.ON_DROPDOWN_SELECTED,this.choiceSelected);let t=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...t.map(r=>({textContent:r.innerHTML,value:r.getAttribute("identifier"),selected:!1}))]}validate(){let e=this.options.find(t=>t.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,t)=>_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},e),{selected:t===0}))}set response(e){this.options=this.options.map(t=>(e===t.value&&(t.selected=!0),t))}set correctResponse(e){if(e===""){this.correctOption="";return}console.log("correctResponse",e),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=>_chunkHYQC3D4Zcjs.b.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},r),{selected:r.value===t})),this.saveResponse(t)}};D.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"],_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],D.prototype,"options",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],D.prototype,"correctOption",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {attribute:"data-prompt",type:String})],D.prototype,"dataPrompt",2);customElements.define("qti-inline-choice-interaction",D);var Ot=_lit.css`
|
|
91
91
|
:host {
|
|
92
92
|
display: flex;
|
|
93
93
|
flex-direction: column;
|
|
94
94
|
// align-items: flex-start;
|
|
95
95
|
}
|
|
96
|
-
`;var U=class extends y{render(){return _lit.html` <slot name="prompt"></slot><slot part="slot"></slot>`}};U.styles
|
|
96
|
+
`;var U=class extends y{render(){return _lit.html` <slot name="prompt"></slot><slot part="slot"></slot>`}};U.styles=Ot,_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],U.prototype,"orientation",2),U= exports.QtiChoiceInteraction =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-choice-interaction")],U);var Pt=`<qti-response-processing>
|
|
97
97
|
<qti-response-condition>
|
|
98
98
|
<qti-response-if>
|
|
99
99
|
<qti-match>
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
</qti-set-outcome-value>
|
|
111
111
|
</qti-response-else>
|
|
112
112
|
</qti-response-condition>
|
|
113
|
-
</qti-response-processing>`,
|
|
113
|
+
</qti-response-processing>`,It=`<qti-response-processing>
|
|
114
114
|
<qti-response-condition>
|
|
115
115
|
<qti-response-if>
|
|
116
116
|
<qti-is-null>
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
</qti-set-outcome-value>
|
|
127
127
|
</qti-response-else>
|
|
128
128
|
</qti-response-condition>
|
|
129
|
-
</qti-response-processing>`,
|
|
129
|
+
</qti-response-processing>`,Ut=`<qti-response-processing>
|
|
130
130
|
<qti-response-condition>
|
|
131
131
|
<qti-response-if>
|
|
132
132
|
<qti-is-null>
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
</qti-set-outcome-value>
|
|
143
143
|
</qti-response-else>
|
|
144
144
|
</qti-response-condition>
|
|
145
|
-
</qti-response-processing>`;var F=class extends _lit.LitElement{render(){return _lit.html`<slot></slot>`}static get observedAttributes(){return["identifier"]}process(){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(
|
|
145
|
+
</qti-response-processing>`;var F=class extends _lit.LitElement{render(){return _lit.html`<slot></slot>`}static get observedAttributes(){return["identifier"]}process(){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(It));break}case"map_response_point":{this.appendChild(this.fragmentFromString(Ut));break}case"match_correct":this.appendChild(this.fragmentFromString(Pt));break}}let i=[...this.children];for(let e of i)e.process()}fragmentFromString(i){return document.createRange().createContextualFragment(i)}};F= exports.QtiResponseProcessing =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-response-processing")],F);var V=class extends _lit.LitElement{render(){return _lit.html`<slot></slot>`}process(){throw new Error("Not implemented")}};V= exports.QtiRule =_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-rule")],V);var ze=class extends V{render(){return _lit.html`<slot></slot>`}process(){let i=[...this.children];for(let e=0;e<i.length;e++){let t=i[e];if(t.calculate()){t.process();return}}}};customElements.define("qti-response-condition",ze);var Ke=class extends V{process(){let i=this.getAttribute("identifier"),e=this.firstElementChild,t=e?e.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:i,value:Array.isArray(t)?t.map(r=>Fe(r)):Fe(t)}}))}};customElements.define("qti-set-outcome-value",Ke);var J=class extends _lit.LitElement{static get properties(){return{debugCalculateResult:{type:Object}}}render(){return _lit.html` <slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let i=this.getSubRules();for(let e=0;e<i.length;e++)i[e].process()}};customElements.define("qti-response-else",J);var Z=class extends J{render(){return _lit.html`${super.render()}`}calculate(){return this.firstElementChild.calculate()}getSubRules(){let i=[];for(let e=1;e<this.children.length;e++)i.push(this.children[e]);return i}};customElements.define("qti-response-if",Z);var We=class extends Z{render(){return _lit.html`${super.render()}`}};customElements.define("qti-response-else-if",We);var u=class extends _lit.LitElement{constructor(){super(...arguments);this._error=[];this._debug=!1;this.getVariables=()=>Array.from(this.children).map(e=>{switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent,cardinality:"single"};case"qti-variable":{let t=e.getAttribute("identifier")||"";return this.assessmentItem.getVariable(t)}case"qti-multiple":{let r=e.calculate();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(o=>o.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let t=e.getAttribute("identifier")||"",r=this.assessmentItem.getResponse(t);return{baseType:r.baseType,value:r.correctResponse,cardinality:r.cardinality}}default:{try{return{baseType:"integer",value:e.calculate().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(e=>e!==null)}set error(e){let t=this._error;this._error.push(e),this.requestUpdate("error",t)}render(){return _lit.html`${this._debug?_lit.html`${this._error.map(e=>_lit.html`<div role="alert">${e}</div>`)}`:_lit.nothing}
|
|
146
146
|
${this._debug?_lit.html`${JSON.stringify(this._result)}`:_lit.nothing} ${this._debug?_lit.html`<slot></slot>`:_lit.nothing}`}calculate(){throw new Error("Not implemented")}get assessmentItem(){return this.closest("qti-assessment-item")}};u.styles=_lit.css`
|
|
147
147
|
:host {
|
|
148
148
|
display: inline;
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
`,_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],u.prototype,"_result",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],u.prototype,"error",1);var k=class extends u{calculate(){throw new Error("Not implemented")}};var Je=class extends k{calculate(){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();if(typeof r=="string")if(r==="true")r=!0;else if(r==="false")r=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return r}).every(e=>typeof e=="boolean"&&e)}};customElements.define("qti-and",Je);var ge=class extends u{constructor(){super(...arguments);this.baseType="string"}calculate(){return this.textContent}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"base-type"})],ge.prototype,"baseType",2);customElements.define("qti-base-value",ge);var Ze=class extends k{calculate(){let i=this.getVariables();if(this.children.length===2){let e=i[0],t=i[1];if(e.baseType==="directedPair"&&t.baseType==="directedPair"&&e.cardinality==="multiple"){let r=e.value,o=t.value;return r.filter(c=>o.includes(c)).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",Ze);var Qe=class extends u{get interpretation(){return this.getAttribute("interpretation")||""}calculate(){let i=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(i);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",Qe);var R=class{static compareSingleValues(i,e,t){switch(t){case"identifier":case"string":return i===e;case"integer":{let r=parseInt(i,10),o=parseInt(e,10);if(!isNaN(r)&&!isNaN(o))return r===o;console.error(`Cannot convert ${i} and/or ${e} to int.`);break}case"float":{let r=parseFloat(i),o=parseFloat(e);if(!isNaN(r)&&!isNaN(o))return r===o;console.error(`couldn't convert ${i} and/or ${e} to float.`);break}case"pair":case"directedPair":{let r=i.split(" ").sort(),o=e.split(" ").sort();if(r.length===2&&o.length===2)return t==="pair"&&(r.sort(),o.sort()),r.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${i} 2: ${e}`);break}}return!1}};var ve=class extends u{constructor(){super(...arguments);this.toleranceMode="exact"}calculate(){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):R.compareSingleValues(t.value,r.value,t.baseType)}return console.error("unexpected number of children in qti-equal"),null}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],ve.prototype,"toleranceMode",2);customElements.define("qti-equal",ve);var ye=class extends u{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}calculate(){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 o=parseFloat(t.value),n=parseFloat(r.value);if(!isNaN(o)&&!isNaN(n))return this.roundingMode==="significantFigures"?o.toPrecision(this.figures)===n.toPrecision(this.figures):Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${o}, ${n}`);break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],ye.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",ye);var et=class extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];if(e.baseType===t.baseType&&(e.baseType==="integer"||e.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",et);var tt=class extends k{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return e.baseType===t.baseType&&(e.baseType==="integer"||e.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",tt);var rt=class extends u{calculate(){if(this.children.length===1){let i=this.getVariables();if(!i)return!0;let e=i[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",rt);var it=class extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];if(e.baseType===t.baseType&&(e.baseType==="integer"||e.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",it);var st=class extends k{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return e.baseType===t.baseType&&(e.baseType==="integer"||e.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",st);var X=class extends _lit.LitElement{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")}))}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {attribute:"default-value",type:Number})],X.prototype,"defaultValue",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {attribute:"lower-bound",type:Number})],X.prototype,"lowerBound",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {attribute:"upper-bound",type:Number})],X.prototype,"upperBound",2);customElements.define("qti-mapping",X);var xe=class extends u{calculate(){let e=this.assessmentItem.getResponse(this.identifier);if(!e)return console.warn(`Response ${this.identifier} can not be found`),null;let t=e.mapping,r=Array.isArray(e.value)?e.value:[e.value],o=0;for(let n of r){let l=t.mapEntries.find(c=>R.compareSingleValues(c.mapKey,n,e.baseType));l==null||l.mappedValue==null?o+=t.defaultValue:o+=l.mappedValue}return t.lowerBound!=null&&(o=Math.max(t.lowerBound,o)),t.upperBound!=null&&(o=Math.min(t.upperBound,o)),o}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],xe.prototype,"identifier",2);customElements.define("qti-map-response",xe);var ee=class a extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return this._result=a.match(e,t),this._result}return console.error("unexpected number of children in match"),null}static match(i,e){var t;if(e.cardinality==="single")return i.value===null?!1:Array.isArray(i.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):R.compareSingleValues((t=i.value)==null?void 0:t.toString(),e.value.toString(),e.baseType);{if(!Array.isArray(i.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(i.value.length!==e.value.length)return!1;let r=0;for(let o of e.value){if(e.cardinality==="ordered"){let n=i[r];if(!R.compareSingleValues(o,n,e.baseType))return!1}else{let n=null;for(let l of i.value)if(R.compareSingleValues(o,l,e.baseType)){n=l;break}if(n!==null)i.value.splice(i.value.indexOf(n),1);else return!1}r++}return!0}}};customElements.define("qti-match",ee);var nt=class extends u{calculate(){let i=this.getVariables();this.children.length!==2&&(this.error="The member operator takes two sub-expressions");let[e,t]=i;if(e.baseType!==t.baseType&&(this.error="Which must both have the same base-type"),t.cardinality==="multiple"||t.cardinality==="ordered"||(this.error="and the second must be a multiple or ordered container"),(e.baseType==="float"||t.baseType==="float")&&(this.error="The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||t.baseType==="duration")&&(this.error="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",nt);var at=class extends u{calculate(){let i=this.getVariables();if(i.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of i)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return i}};customElements.define("qti-multiple",at);var lt=class extends u{render(){return _lit.html`${super.render()}`}calculate(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",lt);var ct=class extends k{render(){return _lit.html``}calculate(){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();if(typeof r=="string")if(r==="true")r=!0;else if(r==="false")r=!1;else return console.error("unexpected value in qti-or, expected boolean"),null;return r}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",ct);var pt=class extends u{calculate(){let i=this.getVariables();if(i.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of i)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return i}};customElements.define("qti-ordered",pt);var te=class extends _lit.LitElement{constructor(){super();this.value="";this.closest("qti-assessment-item").addEventListener("qti-response-processed",()=>{this.value=this.calculate()})}render(){return _lit.html`${Array.isArray(this.value)?this.value.map(e=>_lit.html`${e}`):this.value}`}calculate(){let e=this.closest("qti-assessment-item"),t=this.identifier;return e.getVariable(t).value}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],te.prototype,"identifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],te.prototype,"value",2);customElements.define("qti-printed-variable",te);var dt=class extends u{calculate(){return this.getVariables().reduce((t,r)=>{if(r.baseType=="float"||r.baseType=="integer")try{return t*parseInt(r.value.toString())}catch(o){console.warn("can not convert to number")}else console.warn(`has another baseType ${r.baseType}`);return t},1)}};customElements.define("qti-product",dt);var ut=class extends u{calculate(){let i=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(i).value}};customElements.define("qti-variable",ut);var Ee=class extends u{constructor(){super(...arguments);this.caseSensitive="true"}calculate(){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 o=this.caseSensitive==="true"?t.value:t.value.toLowerCase(),n=this.caseSensitive==="true"?r.value:r.value.toLowerCase();return R.compareSingleValues(o,n,t.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"case-sensitive"})],Ee.prototype,"caseSensitive",2);customElements.define("qti-string-match",Ee);var mt=class extends u{calculate(){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();return Number.isNaN(r)?(console.error("unexpected value in qti-sum, expected number"),null):Number(r)}).reduce((e,t)=>e+t,0)}};customElements.define("qti-sum",mt);var ht=class extends _lit.LitElement{constructor(){super(...arguments);this._errorMessage=null}static get properties(){return{responseIdentifier:{type:String,attribute:"response-identifier"},module:{type:String,attribute:"module"},customInteractionTypeIdentifier:{type:String,attribute:"custom-interaction-type-identifier"},baseUrl:{type:String,attribute:"base-url"},_errorMessage:{type:String,state:!0}}}getTAOConfig(e){let t=e.querySelectorAll("properties"),r={},o=l=>{let c={},p=l.getAttribute("key");if(p){let d=Array.from(l.children),h=d.map(v=>v.getAttribute("key"));h.length>0&&!h.find(v=>!Number.isInteger(+v))?c[p]=d.map(v=>n(v)):c[p]=l.textContent}return c},n=l=>{if(l){let c={};for(let p of l.children)c=_chunkHYQC3D4Zcjs.a.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},c),o(p));return c}};for(let l of t)return l.getAttribute("key")||(r=_chunkHYQC3D4Zcjs.a.call(void 0, _chunkHYQC3D4Zcjs.a.call(void 0, {},r),n(l))),r;console.log("Can not find qti-custom-interaction config")}register(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 o=t=="IMS"?{properties:this.dataset}:this.getTAOConfig(this);t=="IMS"?e.getInstance(r,o,void 0):e.initialize(this.customInteractionTypeIdentifier,r.firstElementChild,o),t=="TAO"&&Array.from(this.querySelectorAll("link")).map(l=>l.getAttribute("href")).forEach(l=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=l,r.appendChild(c)})}connectedCallback(){super.connectedCallback();let e={context:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl,catchError:!0};if(window.requirePaths&&window.requireShim&&(e.paths=window.requirePaths,e.shim=window.requireShim),!globalThis.require){this._errorMessage="requirejs not found, load with cdn: https://cdnjs.com/libraries/require.js";return}requirejs.config(e)(["require"],r=>{!r.defined("qtiCustomInteractionContext")&&define("qtiCustomInteractionContext",()=>({register:n=>{this.register(n)},notifyReady:()=>{}}));let o=r.defined(this.module);r([this.module],n=>{o&&this.register(n)},n=>{this._errorMessage=n})},r=>{this._errorMessage=r})}render(){return _lit.html`<slot></slot>${this._errorMessage&&_lit.html`<div style="color:red">
|
|
160
160
|
<h1>Error</h1>
|
|
161
161
|
${this._errorMessage}
|
|
162
|
-
</div>`}`}};customElements.define("qti-portable-custom-interaction",ht);var Ce=class a{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(i,e){this.data[i]=e},getData:function(i){return this.data[i]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(i,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let t=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let r of t)this._dragCopy.style[r]=t.getPropertyValue(r);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let t=this;requestAnimationFrame(function(){t._touchEndCalled||t._dragCopy===null||(t._dragCopy.style.top=e.clientY-t._copyOffset.y+"px",t._dragCopy.style.left=e.clientX-t._copyOffset.x+"px")});let r=this._findDroppable(i);r!=this._lastTarget&&(this._dispatchEvent(r,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=r),this._currentDropContainer=r,this._currentDropContainer&&this._dispatchEvent(r,"dragover")}};return a._instance?a._instance:(a._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(i){i.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(i){this._touchBegin=Date.now();let{x:e,y:t}=this._getPoint(i);if(this._touchDown={x:e,y:t},this._dragSrc=i.currentTarget,this._canDrag=!0,this.dragOnClick){let r={clientX:e,clientY:t};this._dragRunning=!0,this._createDragCopy(i,r)}i.preventDefault()}_touchMove(i){if(this._canDrag&&this._dragSrc){let{x:e,y:t}=this._getPoint(i),r={clientX:e,clientY:t};this._getDelta(r)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(i,r),i.preventDefault()}}_touchEnd(i){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let t=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});t.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(t)}this._reset()}_touchCancel(i){this._reset()}_findDroppable(i){let e=this._getPoint(i);return this.elementFromPoint(e.x,e.y)}elementFromPoint(i,e){let t=document.elementFromPoint(i,e);if(t){for(;t.shadowRoot;){let r=t.shadowRoot.elementFromPoint(i,e);if(r===null||r===t)break;t=r}return t}return null}_getPoint(i,e){return i&&i.touches&&(i=i.touches[0]),{x:e?i.pageX:i.clientX,y:e?i.pageY:i.clientY}}_calculateDragCopyPosition(i){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=i.clientX-e.left,this._copyOffset.y=i.clientY-e.top}_getDelta(i){let e=Math.abs(i.clientX-this._touchDown.x),t=Math.abs(i.clientY-this._touchDown.y);return e+t}_dispatchEvent(i,e,t=!0){if(!i)return!1;let r=new CustomEvent(e,{bubbles:t,cancelable:!0});return r.dataTransfer=this._dataTransfer,i.dispatchEvent(r),r.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(i,e){this.data[i]=e},getData:function(i){return this.data[i]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};var Yt=(a,i,e)=>{class t extends a{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(n);let l=Array.from(i?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),l.forEach(c=>{c.setAttribute("dropzone","move"),c.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(c)});for(let c of l)this.observer=new MutationObserver(p=>{p.forEach(d=>{if(d.type==="attributes")switch(d.attributeName){case"disabled":{c.hasAttribute("disabled")?this.removeHandler(c):this.attachHandler(c);break}}})}),this.observer.observe(c,{attributes:!0})}attachHandler(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeHandler(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var n;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(n=this.observer)==null||n.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){return n.preventDefault(),n.currentTarget.setAttribute("active",""),n.dataTransfer.dropEffect="move",!1}dropHandler(n){n.preventDefault();let l=n.currentTarget,c=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),p=c||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return l?p.parentElement.getAttribute("identifier")!==l.getAttribute("identifier")&&l.appendChild(p):console.error(`cannot find droppable, target: ${n.target?JSON.stringify(n.target):"null"}`),l.removeAttribute("active"),!1}dragleaveHandler(n){return n.preventDefault(),n.currentTarget.removeAttribute("active"),n.dataTransfer.dropEffect="none",!1}}return _chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean,reflect:!0})],t.prototype,"disabled",2),t};var Bt=(a,i,e)=>{class t extends a{}return t};var L=(a,i,e,t)=>{class r extends Bt(Yt(a,e,t),t,i){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1}reInitDragAndDrop(l,c){if(this.classList.contains("qti-match-tabular"))return;l.filter(d=>!this.draggables||!this.draggables.get(d)).length>0&&(this.dragDropApi.addDraggables(l),l.forEach(d=>{this.draggables.set(d,{parent:d.parentElement,index:Array.from(d.parentNode.children).indexOf(d)}),d.setAttribute("qti-draggable","true"),d.addEventListener("dragstart",h=>{h.dataTransfer.setData("text",h.currentTarget.getAttribute("identifier")),d.setAttribute("dragging","")}),d.addEventListener("dragend",h=>{if(h.preventDefault(),d.removeAttribute("over"),d.removeAttribute("dragging"),(h.dataTransfer.dropEffect==="none"||h.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack){let A=h.currentTarget,v=this.draggables.get(A),De=v.index<v.parent.children.length?v.index:v.parent.children.length-1,b=v.parent,$e=v.parent.children[De];b.insertBefore(A,$e),this.saveResponse(),this.checkMaxMatchAssociations()}h.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())})}))}handleDragOptionsChanged(l,c){this.dragDropApi.copyStylesDragClone=c.copyStylesDragClone,this.dragDropApi.dragOnClick=c.dragOnClick}handleDisabledChange(l,c){this.draggables.forEach((p,d)=>{c?d.setAttribute("disabled",""):d.removeAttribute("disabled"),c?d.removeAttribute("qti-draggable"):d.setAttribute("qti-draggable","true")})}handleReadonlyChange(l,c){this.draggables.forEach((p,d)=>{c?d.setAttribute("readonly",""):d.removeAttribute("readonly"),c?d.removeAttribute("qti-draggable"):d.setAttribute("qti-draggable","true")})}firstUpdated(l){super.firstUpdated(l),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(t):this.querySelectorAll(t))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new Ce,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}reset(l=!0){this.draggables.forEach((c,p)=>{let d=c.parent.children,h=c.index<d.length?c.index:d.length;c.parent.insertBefore(p,d[h])}),l&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(l=>{let p=+(l.getAttribute("match-max")||1)<=(l.children.length||0);p?l.setAttribute("disabled",""):l.removeAttribute("disabled"),p?l.removeAttribute("dropzone"):l.setAttribute("dropzone","move")})}set response(l){this.classList.contains("qti-match-tabular")||(this.reset(!1),l!==null&&Array.isArray(l)&&l.forEach(c=>{let[p,...d]=c.split(" ").reverse();if(p){let h=this.droppables.find(A=>A.getAttribute("identifier")===p);d.forEach(A=>{let v=this.querySelector(`[identifier=${A}]`);h?v?(h.appendChild(v),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${A}`):console.error(`cannot find droppable with identifier: ${p}`)})}}))}validate(){let c=(e?Array.from(this.shadowRoot.querySelectorAll(t)):Array.from(this.querySelectorAll(t))).filter(p=>p.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=c}saveResponse(){let l=this.droppables.map(c=>{var d;let p="";return((d=c.children)==null?void 0:d.length)>0&&(p+=Array.from(c.children).map(h=>h.getAttribute("identifier")).join(" ")+" "),p+=c.getAttribute("identifier"),p});this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:l}}))}}return _chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.a.call(void 0, i)],r.prototype,"reInitDragAndDrop",1),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"response-identifier"})],r.prototype,"responseIdentifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {attribute:!1,type:Object})],r.prototype,"configuration",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "configuration")],r.prototype,"handleDragOptionsChanged",1),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean,reflect:!0})],r.prototype,"disabled",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "disabled",{waitUntilFirstUpdate:!0})],r.prototype,"handleDisabledChange",1),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean,reflect:!0})],r.prototype,"readonly",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "readonly",{waitUntilFirstUpdate:!0})],r.prototype,"handleReadonlyChange",1),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number,reflect:!0,attribute:"min-associations"})],r.prototype,"minAssociations",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number,reflect:!0,attribute:"max-associations"})],r.prototype,"maxAssociations",2),r};var re=class extends L(_lit.LitElement,"qti-simple-associable-choice",!0,".dl"){render(){return _lit.html` <slot name="prompt"></slot>
|
|
162
|
+
</div>`}`}};customElements.define("qti-portable-custom-interaction",ht);var Ce=class a{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(i,e){this.data[i]=e},getData:function(i){return this.data[i]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(i,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let t=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let r of t)this._dragCopy.style[r]=t.getPropertyValue(r);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let t=this;requestAnimationFrame(function(){t._touchEndCalled||t._dragCopy===null||(t._dragCopy.style.top=e.clientY-t._copyOffset.y+"px",t._dragCopy.style.left=e.clientX-t._copyOffset.x+"px")});let r=this._findDroppable(i);r!=this._lastTarget&&(this._dispatchEvent(r,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=r),this._currentDropContainer=r,this._currentDropContainer&&this._dispatchEvent(r,"dragover")}};return a._instance?a._instance:(a._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(i){i.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(i){this._touchBegin=Date.now();let{x:e,y:t}=this._getPoint(i);if(this._touchDown={x:e,y:t},this._dragSrc=i.currentTarget,this._canDrag=!0,this.dragOnClick){let r={clientX:e,clientY:t};this._dragRunning=!0,this._createDragCopy(i,r)}i.preventDefault()}_touchMove(i){if(this._canDrag&&this._dragSrc){let{x:e,y:t}=this._getPoint(i),r={clientX:e,clientY:t};this._getDelta(r)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(i,r),i.preventDefault()}}_touchEnd(i){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let t=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});t.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(t)}this._reset()}_touchCancel(i){this._reset()}_findDroppable(i){let e=this._getPoint(i);return this.elementFromPoint(e.x,e.y)}elementFromPoint(i,e){let t=document.elementFromPoint(i,e);if(t){for(;t.shadowRoot;){let r=t.shadowRoot.elementFromPoint(i,e);if(r===null||r===t)break;t=r}return t}return null}_getPoint(i,e){return i&&i.touches&&(i=i.touches[0]),{x:e?i.pageX:i.clientX,y:e?i.pageY:i.clientY}}_calculateDragCopyPosition(i){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=i.clientX-e.left,this._copyOffset.y=i.clientY-e.top}_getDelta(i){let e=Math.abs(i.clientX-this._touchDown.x),t=Math.abs(i.clientY-this._touchDown.y);return e+t}_dispatchEvent(i,e,t=!0){if(!i)return!1;let r=new CustomEvent(e,{bubbles:t,cancelable:!0});return r.dataTransfer=this._dataTransfer,i.dispatchEvent(r),r.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(i,e){this.data[i]=e},getData:function(i){return this.data[i]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};var Bt=(a,i,e)=>{class t extends a{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(n);let l=Array.from(i?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),l.forEach(c=>{c.setAttribute("dropzone","move"),c.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(c)});for(let c of l)this.observer=new MutationObserver(p=>{p.forEach(d=>{if(d.type==="attributes")switch(d.attributeName){case"disabled":{c.hasAttribute("disabled")?this.removeHandler(c):this.attachHandler(c);break}}})}),this.observer.observe(c,{attributes:!0})}attachHandler(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeHandler(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var n;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(n=this.observer)==null||n.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){return n.preventDefault(),n.currentTarget.setAttribute("active",""),n.dataTransfer.dropEffect="move",!1}dropHandler(n){n.preventDefault();let l=n.currentTarget,c=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),p=c||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return l?p.parentElement.getAttribute("identifier")!==l.getAttribute("identifier")&&l.appendChild(p):console.error(`cannot find droppable, target: ${n.target?JSON.stringify(n.target):"null"}`),l.removeAttribute("active"),!1}dragleaveHandler(n){return n.preventDefault(),n.currentTarget.removeAttribute("active"),n.dataTransfer.dropEffect="none",!1}}return _chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean,reflect:!0})],t.prototype,"disabled",2),t};var jt=(a,i,e)=>{class t extends a{}return t};var L=(a,i,e,t)=>{class r extends jt(Bt(a,e,t),t,i){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1}reInitDragAndDrop(l,c){if(this.classList.contains("qti-match-tabular"))return;l.filter(d=>!this.draggables||!this.draggables.get(d)).length>0&&(this.dragDropApi.addDraggables(l),l.forEach(d=>{this.draggables.set(d,{parent:d.parentElement,index:Array.from(d.parentNode.children).indexOf(d)}),d.setAttribute("qti-draggable","true"),d.addEventListener("dragstart",h=>{h.dataTransfer.setData("text",h.currentTarget.getAttribute("identifier")),d.setAttribute("dragging","")}),d.addEventListener("dragend",h=>{if(h.preventDefault(),d.removeAttribute("over"),d.removeAttribute("dragging"),(h.dataTransfer.dropEffect==="none"||h.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack){let A=h.currentTarget,v=this.draggables.get(A),De=v.index<v.parent.children.length?v.index:v.parent.children.length-1,b=v.parent,$e=v.parent.children[De];b.insertBefore(A,$e),this.saveResponse(),this.checkMaxMatchAssociations()}h.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())})}))}handleDragOptionsChanged(l,c){this.dragDropApi.copyStylesDragClone=c.copyStylesDragClone,this.dragDropApi.dragOnClick=c.dragOnClick}handleDisabledChange(l,c){this.draggables.forEach((p,d)=>{c?d.setAttribute("disabled",""):d.removeAttribute("disabled"),c?d.removeAttribute("qti-draggable"):d.setAttribute("qti-draggable","true")})}handleReadonlyChange(l,c){this.draggables.forEach((p,d)=>{c?d.setAttribute("readonly",""):d.removeAttribute("readonly"),c?d.removeAttribute("qti-draggable"):d.setAttribute("qti-draggable","true")})}firstUpdated(l){super.firstUpdated(l),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(t):this.querySelectorAll(t))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new Ce,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}reset(l=!0){this.draggables.forEach((c,p)=>{let d=c.parent.children,h=c.index<d.length?c.index:d.length;c.parent.insertBefore(p,d[h])}),l&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(l=>{let p=+(l.getAttribute("match-max")||1)<=(l.children.length||0);p?l.setAttribute("disabled",""):l.removeAttribute("disabled"),p?l.removeAttribute("dropzone"):l.setAttribute("dropzone","move")})}set response(l){this.classList.contains("qti-match-tabular")||(this.reset(!1),l!==null&&Array.isArray(l)&&l.forEach(c=>{let[p,...d]=c.split(" ").reverse();if(p){let h=this.droppables.find(A=>A.getAttribute("identifier")===p);d.forEach(A=>{let v=this.querySelector(`[identifier=${A}]`);h?v?(h.appendChild(v),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${A}`):console.error(`cannot find droppable with identifier: ${p}`)})}}))}validate(){let c=(e?Array.from(this.shadowRoot.querySelectorAll(t)):Array.from(this.querySelectorAll(t))).filter(p=>p.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=c}saveResponse(){let l=this.droppables.map(c=>{var d;let p="";return((d=c.children)==null?void 0:d.length)>0&&(p+=Array.from(c.children).map(h=>h.getAttribute("identifier")).join(" ")+" "),p+=c.getAttribute("identifier"),p});this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:l}}))}}return _chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.a.call(void 0, i)],r.prototype,"reInitDragAndDrop",1),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"response-identifier"})],r.prototype,"responseIdentifier",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {attribute:!1,type:Object})],r.prototype,"configuration",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "configuration")],r.prototype,"handleDragOptionsChanged",1),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean,reflect:!0})],r.prototype,"disabled",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "disabled",{waitUntilFirstUpdate:!0})],r.prototype,"handleDisabledChange",1),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean,reflect:!0})],r.prototype,"readonly",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_chunkSLKHOXHJcjs.b.call(void 0, "readonly",{waitUntilFirstUpdate:!0})],r.prototype,"handleReadonlyChange",1),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number,reflect:!0,attribute:"min-associations"})],r.prototype,"minAssociations",2),_chunkHYQC3D4Zcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Number,reflect:!0,attribute:"max-associations"})],r.prototype,"maxAssociations",2),r};var re=class extends L(_lit.LitElement,"qti-simple-associable-choice",!0,".dl"){render(){return _lit.html` <slot name="prompt"></slot>
|
|
163
163
|
<slot name="qti-simple-associable-choice"></slot>
|
|
164
164
|
${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((e,t)=>_lit.html`<div part="associables-container">
|
|
165
165
|
<div name="left${t}" part="drop-list" class="dl" identifier="droplist${t}_left"></div>
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
align-items: flex-start;
|
|
198
198
|
flex: 1;
|
|
199
199
|
}
|
|
200
|
-
`];customElements.define("qti-gap-match-interaction",qe);function B(a,i,e,t){switch(a){case"circle":{let[r,o,n]=i,l=r/e.width*100,c=o/e.height*100,p=n/e.width*100;t.style.left=l-p+"%",t.style.top=c-p+"%",t.style.width=t.style.height=4*p+"px",t.style.borderRadius="9999px"}break;case"rect":{let[r,o,n,l]=i,c=r/e.width*100,p=o/e.height*100,d=n/e.width*100,h=l/e.height*100;t.style.left=c+"%",t.style.top=p+"%",t.style.width=d-c+"%",t.style.height=h-p+"%"}break;case"poly":{let r=i.reduce((b,$e,yt,
|
|
200
|
+
`];customElements.define("qti-gap-match-interaction",qe);function B(a,i,e,t){switch(a){case"circle":{let[r,o,n]=i,l=r/e.width*100,c=o/e.height*100,p=n/e.width*100;t.style.left=l-p+"%",t.style.top=c-p+"%",t.style.width=t.style.height=4*p+"px",t.style.borderRadius="9999px"}break;case"rect":{let[r,o,n,l]=i,c=r/e.width*100,p=o/e.height*100,d=n/e.width*100,h=l/e.height*100;t.style.left=c+"%",t.style.top=p+"%",t.style.width=d-c+"%",t.style.height=h-p+"%"}break;case"poly":{let r=i.reduce((b,$e,yt,rr)=>{if(yt%2===1){let ir=b.pop();b[b.length]={x:ir,y:rr[yt]}}else b.push($e);return b},[]),o=Math.min(...r.map(b=>b.x)),n=Math.max(...r.map(b=>b.x)),l=Math.min(...r.map(b=>b.y)),c=Math.max(...r.map(b=>b.y)),p=o/e.width*100,d=l/e.height*100,h=n/e.width*100,A=c/e.height*100;t.style.left=o/e.width*100+"%",t.style.top=l/e.height*100+"%",t.style.width=h-p+"%",t.style.height=A-d+"%";let De=r.map(b=>({x:(b.x-o)/(n-o)*100,y:(b.y-l)/(c-l)*100})).map(b=>Math.round(b.x)+"% "+Math.round(b.y)+"%").join(",");t.style.clipPath=`polygon(${De})`}break;default:break}}var _repeatjs = require('lit/directives/repeat.js');var M=class extends m{constructor(){super();this.startPoint=null;this.endPoint=null;this._lines=[];this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}reset(){this._lines=[]}validate(){return this._lines.length>0}set response(e){Array.isArray(e)&&(this._lines=e)}render(){var e,t,r,o;return _lit.html`<slot name="prompt"></slot>
|
|
201
201
|
<line-container>
|
|
202
202
|
<svg
|
|
203
203
|
width=${_ifdefinedjs.ifDefined.call(void 0, (e=this.grImage[0])==null?void 0:e.width)}
|