cognikit 0.2.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
  var HTMLElement = globalThis.HTMLElement ?? class {}; var customElements = globalThis.customElements ?? { get() { return undefined; }, define() {} };
2
- function et(){let e=globalThis;if(typeof e.HTMLElement>"u"&&(e.HTMLElement=class{}),typeof e.customElements>"u"){let n=new Map;e.customElements={define(t,r){n.has(t)||n.set(t,r)},get(t){return n.get(t)},getName(t){for(let[r,i]of n.entries())if(i===t)return r;return null},upgrade(){},whenDefined(){return Promise.resolve(class{})}}}}et();function zt(e){return typeof e>"u"||e===null}function fi(e){return typeof e=="object"&&e!==null}function bi(e){return Array.isArray(e)?e:zt(e)?[]:[e]}function vi(e,n){var t,r,i,o;if(n)for(o=Object.keys(n),t=0,r=o.length;t<r;t+=1)i=o[t],e[i]=n[i];return e}function xi(e,n){var t="",r;for(r=0;r<n;r+=1)t+=e;return t}function wi(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var yi=zt,Ei=fi,Ci=bi,ki=xi,Si=wi,Ti=vi,k={isNothing:yi,isObject:Ei,toArray:Ci,repeat:ki,isNegativeZero:Si,extend:Ti};function Ht(e,n){var t="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(t+='in "'+e.mark.name+'" '),t+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(t+=`
2
+ function et(){let e=globalThis;if(typeof e.HTMLElement>"u"&&(e.HTMLElement=class{}),typeof e.customElements>"u"){let n=new Map;e.customElements={define(t,r){n.has(t)||n.set(t,r)},get(t){return n.get(t)},getName(t){for(let[r,i]of n.entries())if(i===t)return r;return null},upgrade(){},whenDefined(){return Promise.resolve(class{})}}}}et();function zt(e){return typeof e>"u"||e===null}function fi(e){return typeof e=="object"&&e!==null}function bi(e){return Array.isArray(e)?e:zt(e)?[]:[e]}function vi(e,n){var t,r,i,o;if(n)for(o=Object.keys(n),t=0,r=o.length;t<r;t+=1)i=o[t],e[i]=n[i];return e}function xi(e,n){var t="",r;for(r=0;r<n;r+=1)t+=e;return t}function wi(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var yi=zt,Ci=fi,Ei=bi,ki=xi,Si=wi,Ti=vi,k={isNothing:yi,isObject:Ci,toArray:Ei,repeat:ki,isNegativeZero:Si,extend:Ti};function Ht(e,n){var t="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(t+='in "'+e.mark.name+'" '),t+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(t+=`
3
3
 
4
4
  `+e.mark.snippet),r+" "+t):r}function he(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Ht(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}he.prototype=Object.create(Error.prototype);he.prototype.constructor=he;he.prototype.toString=function(n){return this.name+": "+Ht(this,n)};var _=he;function tt(e,n,t,r,i){var o="",a="",s=Math.floor(i/2)-1;return r-n>s&&(o=" ... ",n=r-s+o.length),t-r>s&&(a=" ...",t=r+s-a.length),{str:o+e.slice(n,t).replace(/\t/g,"\u2192")+a,pos:r-n+o.length}}function rt(e,n){return k.repeat(" ",n-e.length)+e}function $i(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],o,a=-1;o=t.exec(e.buffer);)i.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var s="",l,c,d=Math.min(e.line+n.linesAfter,i.length).toString().length,u=n.maxLength-(n.indent+d+3);for(l=1;l<=n.linesBefore&&!(a-l<0);l++)c=tt(e.buffer,r[a-l],i[a-l],e.position-(r[a]-r[a-l]),u),s=k.repeat(" ",n.indent)+rt((e.line-l+1).toString(),d)+" | "+c.str+`
5
5
  `+s;for(c=tt(e.buffer,r[a],i[a],e.position,u),s+=k.repeat(" ",n.indent)+rt((e.line+1).toString(),d)+" | "+c.str+`
6
6
  `,s+=k.repeat("-",n.indent+d+3+c.pos)+`^
7
7
  `,l=1;l<=n.linesAfter&&!(a+l>=i.length);l++)c=tt(e.buffer,r[a+l],i[a+l],e.position-(r[a]-r[a+l]),u),s+=k.repeat(" ",n.indent)+rt((e.line+l+1).toString(),d)+" | "+c.str+`
8
- `;return s.replace(/\n$/,"")}var Ai=$i,_i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ii=["scalar","sequence","mapping"];function Mi(e){var n={};return e!==null&&Object.keys(e).forEach(function(t){e[t].forEach(function(r){n[String(r)]=t})}),n}function Li(e,n){if(n=n||{},Object.keys(n).forEach(function(t){if(_i.indexOf(t)===-1)throw new _('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(t){return t},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Mi(n.styleAliases||null),Ii.indexOf(this.kind)===-1)throw new _('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var $=Li;function Ct(e,n){var t=[];return e[n].forEach(function(r){var i=t.length;t.forEach(function(o,a){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=a)}),t[i]=r}),t}function Di(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,t;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(n=0,t=arguments.length;n<t;n+=1)arguments[n].forEach(r);return e}function nt(e){return this.extend(e)}nt.prototype.extend=function(n){var t=[],r=[];if(n instanceof $)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(t=t.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new _("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof $))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new _("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new _("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof $))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(nt.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Ct(i,"implicit"),i.compiledExplicit=Ct(i,"explicit"),i.compiledTypeMap=Di(i.compiledImplicit,i.compiledExplicit),i};var Nt=nt,Gt=new $("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Vt=new $("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ot=new $("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ft=new Nt({explicit:[Gt,Vt,Ot]});function Ri(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function Pi(){return null}function Bi(e){return e===null}var jt=new $("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ri,construct:Pi,predicate:Bi,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function qi(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function zi(e){return e==="true"||e==="True"||e==="TRUE"}function Hi(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Ut=new $("tag:yaml.org,2002:bool",{kind:"scalar",resolve:qi,construct:zi,predicate:Hi,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Ni(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Gi(e){return 48<=e&&e<=55}function Vi(e){return 48<=e&&e<=57}function Oi(e){if(e===null)return!1;var n=e.length,t=0,r=!1,i;if(!n)return!1;if(i=e[t],(i==="-"||i==="+")&&(i=e[++t]),i==="0"){if(t+1===n)return!0;if(i=e[++t],i==="b"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(!Ni(e.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(!Gi(e.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<n;t++)if(i=e[t],i!=="_"){if(!Vi(e.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}function Fi(e){var n=e,t=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(t=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return t*parseInt(n.slice(2),2);if(n[1]==="x")return t*parseInt(n.slice(2),16);if(n[1]==="o")return t*parseInt(n.slice(2),8)}return t*parseInt(n,10)}function ji(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!k.isNegativeZero(e)}var Yt=new $("tag:yaml.org,2002:int",{kind:"scalar",resolve:Oi,construct:Fi,predicate:ji,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ui=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Yi(e){return!(e===null||!Ui.test(e)||e[e.length-1]==="_")}function Ki(e){var n,t;return n=e.replace(/_/g,"").toLowerCase(),t=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:t*parseFloat(n,10)}var Wi=/^[-+]?[0-9]+e/;function Qi(e,n){var t;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(k.isNegativeZero(e))return"-0.0";return t=e.toString(10),Wi.test(t)?t.replace("e",".e"):t}function Zi(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||k.isNegativeZero(e))}var Kt=new $("tag:yaml.org,2002:float",{kind:"scalar",resolve:Yi,construct:Ki,predicate:Zi,represent:Qi,defaultStyle:"lowercase"}),Wt=Ft.extend({implicit:[jt,Ut,Yt,Kt]}),Qt=Wt,Zt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Xt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Xi(e){return e===null?!1:Zt.exec(e)!==null||Xt.exec(e)!==null}function Ji(e){var n,t,r,i,o,a,s,l=0,c=null,d,u,p;if(n=Zt.exec(e),n===null&&(n=Xt.exec(e)),n===null)throw new Error("Date resolve error");if(t=+n[1],r=+n[2]-1,i=+n[3],!n[4])return new Date(Date.UTC(t,r,i));if(o=+n[4],a=+n[5],s=+n[6],n[7]){for(l=n[7].slice(0,3);l.length<3;)l+="0";l=+l}return n[9]&&(d=+n[10],u=+(n[11]||0),c=(d*60+u)*6e4,n[9]==="-"&&(c=-c)),p=new Date(Date.UTC(t,r,i,o,a,s,l)),c&&p.setTime(p.getTime()-c),p}function en(e){return e.toISOString()}var Jt=new $("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Xi,construct:Ji,instanceOf:Date,represent:en});function tn(e){return e==="<<"||e===null}var er=new $("tag:yaml.org,2002:merge",{kind:"scalar",resolve:tn}),ct=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
- \r`;function rn(e){if(e===null)return!1;var n,t,r=0,i=e.length,o=ct;for(t=0;t<i;t++)if(n=o.indexOf(e.charAt(t)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function nn(e){var n,t,r=e.replace(/[\r\n=]/g,""),i=r.length,o=ct,a=0,s=[];for(n=0;n<i;n++)n%4===0&&n&&(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|o.indexOf(r.charAt(n));return t=i%4*6,t===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):t===18?(s.push(a>>10&255),s.push(a>>2&255)):t===12&&s.push(a>>4&255),new Uint8Array(s)}function on(e){var n="",t=0,r,i,o=e.length,a=ct;for(r=0;r<o;r++)r%3===0&&r&&(n+=a[t>>18&63],n+=a[t>>12&63],n+=a[t>>6&63],n+=a[t&63]),t=(t<<8)+e[r];return i=o%3,i===0?(n+=a[t>>18&63],n+=a[t>>12&63],n+=a[t>>6&63],n+=a[t&63]):i===2?(n+=a[t>>10&63],n+=a[t>>4&63],n+=a[t<<2&63],n+=a[64]):i===1&&(n+=a[t>>2&63],n+=a[t<<4&63],n+=a[64],n+=a[64]),n}function an(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var tr=new $("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rn,construct:nn,predicate:an,represent:on}),sn=Object.prototype.hasOwnProperty,ln=Object.prototype.toString;function cn(e){if(e===null)return!0;var n=[],t,r,i,o,a,s=e;for(t=0,r=s.length;t<r;t+=1){if(i=s[t],a=!1,ln.call(i)!=="[object Object]")return!1;for(o in i)if(sn.call(i,o))if(!a)a=!0;else return!1;if(!a)return!1;if(n.indexOf(o)===-1)n.push(o);else return!1}return!0}function dn(e){return e!==null?e:[]}var rr=new $("tag:yaml.org,2002:omap",{kind:"sequence",resolve:cn,construct:dn}),un=Object.prototype.toString;function pn(e){if(e===null)return!0;var n,t,r,i,o,a=e;for(o=new Array(a.length),n=0,t=a.length;n<t;n+=1){if(r=a[n],un.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[n]=[i[0],r[i[0]]]}return!0}function hn(e){if(e===null)return[];var n,t,r,i,o,a=e;for(o=new Array(a.length),n=0,t=a.length;n<t;n+=1)r=a[n],i=Object.keys(r),o[n]=[i[0],r[i[0]]];return o}var ir=new $("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pn,construct:hn}),gn=Object.prototype.hasOwnProperty;function mn(e){if(e===null)return!0;var n,t=e;for(n in t)if(gn.call(t,n)&&t[n]!==null)return!1;return!0}function fn(e){return e!==null?e:{}}var nr=new $("tag:yaml.org,2002:set",{kind:"mapping",resolve:mn,construct:fn}),dt=Qt.extend({implicit:[Jt,er],explicit:[tr,rr,ir,nr]}),N=Object.prototype.hasOwnProperty,qe=1,or=2,ar=3,ze=4,it=1,bn=2,kt=3,vn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,xn=/[\x85\u2028\u2029]/,wn=/[,\[\]\{\}]/,sr=/^(?:!|!!|![a-z\-]+!)$/i,lr=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function St(e){return Object.prototype.toString.call(e)}function R(e){return e===10||e===13}function O(e){return e===9||e===32}function I(e){return e===9||e===32||e===10||e===13}function Q(e){return e===44||e===91||e===93||e===123||e===125}function yn(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function En(e){return e===120?2:e===117?4:e===85?8:0}function Cn(e){return 48<=e&&e<=57?e-48:-1}function Tt(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
10
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function kn(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function cr(e,n,t){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:t}):e[n]=t}var dr=new Array(256),ur=new Array(256);for(V=0;V<256;V++)dr[V]=Tt(V)?1:0,ur[V]=Tt(V);var V;function Sn(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||dt,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function pr(e,n){var t={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return t.snippet=Ai(t),new _(n,t)}function f(e,n){throw pr(e,n)}function He(e,n){e.onWarning&&e.onWarning.call(null,pr(e,n))}var $t={YAML:function(n,t,r){var i,o,a;n.version!==null&&f(n,"duplication of %YAML directive"),r.length!==1&&f(n,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&f(n,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),a=parseInt(i[2],10),o!==1&&f(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=a<2,a!==1&&a!==2&&He(n,"unsupported YAML version of the document")},TAG:function(n,t,r){var i,o;r.length!==2&&f(n,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],sr.test(i)||f(n,"ill-formed tag handle (first argument) of the TAG directive"),N.call(n.tagMap,i)&&f(n,'there is a previously declared suffix for "'+i+'" tag handle'),lr.test(o)||f(n,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{f(n,"tag prefix is malformed: "+o)}n.tagMap[i]=o}};function H(e,n,t,r){var i,o,a,s;if(n<t){if(s=e.input.slice(n,t),r)for(i=0,o=s.length;i<o;i+=1)a=s.charCodeAt(i),a===9||32<=a&&a<=1114111||f(e,"expected valid JSON character");else vn.test(s)&&f(e,"the stream contains non-printable characters");e.result+=s}}function At(e,n,t,r){var i,o,a,s;for(k.isObject(t)||f(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),a=0,s=i.length;a<s;a+=1)o=i[a],N.call(n,o)||(cr(n,o,t[o]),r[o]=!0)}function Z(e,n,t,r,i,o,a,s,l){var c,d;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,d=i.length;c<d;c+=1)Array.isArray(i[c])&&f(e,"nested arrays are not supported inside keys"),typeof i=="object"&&St(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&St(i)==="[object Object]"&&(i="[object Object]"),i=String(i),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,d=o.length;c<d;c+=1)At(e,n,o[c],t);else At(e,n,o,t);else!e.json&&!N.call(t,i)&&N.call(n,i)&&(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,f(e,"duplicated mapping key")),cr(n,i,o),delete t[i];return n}function ut(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):f(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function E(e,n,t){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;O(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(n&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(R(i))for(ut(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return t!==-1&&r!==0&&e.lineIndent<t&&He(e,"deficient indentation"),r}function Ve(e){var n=e.position,t;return t=e.input.charCodeAt(n),!!((t===45||t===46)&&t===e.input.charCodeAt(n+1)&&t===e.input.charCodeAt(n+2)&&(n+=3,t=e.input.charCodeAt(n),t===0||I(t)))}function pt(e,n){n===1?e.result+=" ":n>1&&(e.result+=k.repeat(`
11
- `,n-1))}function Tn(e,n,t){var r,i,o,a,s,l,c,d,u=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),I(h)||Q(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(i=e.input.charCodeAt(e.position+1),I(i)||t&&Q(i)))return!1;for(e.kind="scalar",e.result="",o=a=e.position,s=!1;h!==0;){if(h===58){if(i=e.input.charCodeAt(e.position+1),I(i)||t&&Q(i))break}else if(h===35){if(r=e.input.charCodeAt(e.position-1),I(r))break}else{if(e.position===e.lineStart&&Ve(e)||t&&Q(h))break;if(R(h))if(l=e.line,c=e.lineStart,d=e.lineIndent,E(e,!1,-1),e.lineIndent>=n){s=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=d;break}}s&&(H(e,o,a,!1),pt(e,e.line-l),o=a=e.position,s=!1),O(h)||(a=e.position+1),h=e.input.charCodeAt(++e.position)}return H(e,o,a,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function $n(e,n){var t,r,i;if(t=e.input.charCodeAt(e.position),t!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(t=e.input.charCodeAt(e.position))!==0;)if(t===39)if(H(e,r,e.position,!0),t=e.input.charCodeAt(++e.position),t===39)r=e.position,e.position++,i=e.position;else return!0;else R(t)?(H(e,r,i,!0),pt(e,E(e,!1,n)),r=i=e.position):e.position===e.lineStart&&Ve(e)?f(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);f(e,"unexpected end of the stream within a single quoted scalar")}function An(e,n){var t,r,i,o,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,t=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return H(e,t,e.position,!0),e.position++,!0;if(s===92){if(H(e,t,e.position,!0),s=e.input.charCodeAt(++e.position),R(s))E(e,!1,n);else if(s<256&&dr[s])e.result+=ur[s],e.position++;else if((a=En(s))>0){for(i=a,o=0;i>0;i--)s=e.input.charCodeAt(++e.position),(a=yn(s))>=0?o=(o<<4)+a:f(e,"expected hexadecimal character");e.result+=kn(o),e.position++}else f(e,"unknown escape sequence");t=r=e.position}else R(s)?(H(e,t,r,!0),pt(e,E(e,!1,n)),t=r=e.position):e.position===e.lineStart&&Ve(e)?f(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}f(e,"unexpected end of the stream within a double quoted scalar")}function _n(e,n){var t=!0,r,i,o,a=e.tag,s,l=e.anchor,c,d,u,p,h,g=Object.create(null),m,b,w,v;if(v=e.input.charCodeAt(e.position),v===91)d=93,h=!1,s=[];else if(v===123)d=125,h=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(E(e,!0,n),v=e.input.charCodeAt(e.position),v===d)return e.position++,e.tag=a,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=s,!0;t?v===44&&f(e,"expected the node content, but found ','"):f(e,"missed comma between flow collection entries"),b=m=w=null,u=p=!1,v===63&&(c=e.input.charCodeAt(e.position+1),I(c)&&(u=p=!0,e.position++,E(e,!0,n))),r=e.line,i=e.lineStart,o=e.position,X(e,n,qe,!1,!0),b=e.tag,m=e.result,E(e,!0,n),v=e.input.charCodeAt(e.position),(p||e.line===r)&&v===58&&(u=!0,v=e.input.charCodeAt(++e.position),E(e,!0,n),X(e,n,qe,!1,!0),w=e.result),h?Z(e,s,g,b,m,w,r,i,o):u?s.push(Z(e,null,g,b,m,w,r,i,o)):s.push(m),E(e,!0,n),v=e.input.charCodeAt(e.position),v===44?(t=!0,v=e.input.charCodeAt(++e.position)):t=!1}f(e,"unexpected end of the stream within a flow collection")}function In(e,n){var t,r,i=it,o=!1,a=!1,s=n,l=0,c=!1,d,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)it===i?i=u===43?kt:bn:f(e,"repeat of a chomping mode identifier");else if((d=Cn(u))>=0)d===0?f(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?f(e,"repeat of an indentation width identifier"):(s=n+d-1,a=!0);else break;if(O(u)){do u=e.input.charCodeAt(++e.position);while(O(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!R(u)&&u!==0)}for(;u!==0;){for(ut(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!a||e.lineIndent<s)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>s&&(s=e.lineIndent),R(u)){l++;continue}if(e.lineIndent<s){i===kt?e.result+=k.repeat(`
8
+ `;return s.replace(/\n$/,"")}var Ai=$i,_i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ii=["scalar","sequence","mapping"];function Mi(e){var n={};return e!==null&&Object.keys(e).forEach(function(t){e[t].forEach(function(r){n[String(r)]=t})}),n}function Li(e,n){if(n=n||{},Object.keys(n).forEach(function(t){if(_i.indexOf(t)===-1)throw new _('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(t){return t},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Mi(n.styleAliases||null),Ii.indexOf(this.kind)===-1)throw new _('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var $=Li;function Et(e,n){var t=[];return e[n].forEach(function(r){var i=t.length;t.forEach(function(o,a){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=a)}),t[i]=r}),t}function Di(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,t;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(n=0,t=arguments.length;n<t;n+=1)arguments[n].forEach(r);return e}function nt(e){return this.extend(e)}nt.prototype.extend=function(n){var t=[],r=[];if(n instanceof $)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(t=t.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new _("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof $))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new _("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new _("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof $))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(nt.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Et(i,"implicit"),i.compiledExplicit=Et(i,"explicit"),i.compiledTypeMap=Di(i.compiledImplicit,i.compiledExplicit),i};var Nt=nt,Gt=new $("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ot=new $("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Vt=new $("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ft=new Nt({explicit:[Gt,Ot,Vt]});function Ri(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function Pi(){return null}function Bi(e){return e===null}var jt=new $("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ri,construct:Pi,predicate:Bi,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function qi(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function zi(e){return e==="true"||e==="True"||e==="TRUE"}function Hi(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Ut=new $("tag:yaml.org,2002:bool",{kind:"scalar",resolve:qi,construct:zi,predicate:Hi,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Ni(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Gi(e){return 48<=e&&e<=55}function Oi(e){return 48<=e&&e<=57}function Vi(e){if(e===null)return!1;var n=e.length,t=0,r=!1,i;if(!n)return!1;if(i=e[t],(i==="-"||i==="+")&&(i=e[++t]),i==="0"){if(t+1===n)return!0;if(i=e[++t],i==="b"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(!Ni(e.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(!Gi(e.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<n;t++)if(i=e[t],i!=="_"){if(!Oi(e.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}function Fi(e){var n=e,t=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(t=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return t*parseInt(n.slice(2),2);if(n[1]==="x")return t*parseInt(n.slice(2),16);if(n[1]==="o")return t*parseInt(n.slice(2),8)}return t*parseInt(n,10)}function ji(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!k.isNegativeZero(e)}var Yt=new $("tag:yaml.org,2002:int",{kind:"scalar",resolve:Vi,construct:Fi,predicate:ji,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ui=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Yi(e){return!(e===null||!Ui.test(e)||e[e.length-1]==="_")}function Ki(e){var n,t;return n=e.replace(/_/g,"").toLowerCase(),t=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:t*parseFloat(n,10)}var Wi=/^[-+]?[0-9]+e/;function Qi(e,n){var t;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(k.isNegativeZero(e))return"-0.0";return t=e.toString(10),Wi.test(t)?t.replace("e",".e"):t}function Zi(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||k.isNegativeZero(e))}var Kt=new $("tag:yaml.org,2002:float",{kind:"scalar",resolve:Yi,construct:Ki,predicate:Zi,represent:Qi,defaultStyle:"lowercase"}),Wt=Ft.extend({implicit:[jt,Ut,Yt,Kt]}),Qt=Wt,Zt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Xt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Xi(e){return e===null?!1:Zt.exec(e)!==null||Xt.exec(e)!==null}function Ji(e){var n,t,r,i,o,a,s,l=0,c=null,d,u,p;if(n=Zt.exec(e),n===null&&(n=Xt.exec(e)),n===null)throw new Error("Date resolve error");if(t=+n[1],r=+n[2]-1,i=+n[3],!n[4])return new Date(Date.UTC(t,r,i));if(o=+n[4],a=+n[5],s=+n[6],n[7]){for(l=n[7].slice(0,3);l.length<3;)l+="0";l=+l}return n[9]&&(d=+n[10],u=+(n[11]||0),c=(d*60+u)*6e4,n[9]==="-"&&(c=-c)),p=new Date(Date.UTC(t,r,i,o,a,s,l)),c&&p.setTime(p.getTime()-c),p}function en(e){return e.toISOString()}var Jt=new $("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Xi,construct:Ji,instanceOf:Date,represent:en});function tn(e){return e==="<<"||e===null}var er=new $("tag:yaml.org,2002:merge",{kind:"scalar",resolve:tn}),ct=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
+ \r`;function rn(e){if(e===null)return!1;var n,t,r=0,i=e.length,o=ct;for(t=0;t<i;t++)if(n=o.indexOf(e.charAt(t)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function nn(e){var n,t,r=e.replace(/[\r\n=]/g,""),i=r.length,o=ct,a=0,s=[];for(n=0;n<i;n++)n%4===0&&n&&(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|o.indexOf(r.charAt(n));return t=i%4*6,t===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):t===18?(s.push(a>>10&255),s.push(a>>2&255)):t===12&&s.push(a>>4&255),new Uint8Array(s)}function on(e){var n="",t=0,r,i,o=e.length,a=ct;for(r=0;r<o;r++)r%3===0&&r&&(n+=a[t>>18&63],n+=a[t>>12&63],n+=a[t>>6&63],n+=a[t&63]),t=(t<<8)+e[r];return i=o%3,i===0?(n+=a[t>>18&63],n+=a[t>>12&63],n+=a[t>>6&63],n+=a[t&63]):i===2?(n+=a[t>>10&63],n+=a[t>>4&63],n+=a[t<<2&63],n+=a[64]):i===1&&(n+=a[t>>2&63],n+=a[t<<4&63],n+=a[64],n+=a[64]),n}function an(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var tr=new $("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rn,construct:nn,predicate:an,represent:on}),sn=Object.prototype.hasOwnProperty,ln=Object.prototype.toString;function cn(e){if(e===null)return!0;var n=[],t,r,i,o,a,s=e;for(t=0,r=s.length;t<r;t+=1){if(i=s[t],a=!1,ln.call(i)!=="[object Object]")return!1;for(o in i)if(sn.call(i,o))if(!a)a=!0;else return!1;if(!a)return!1;if(n.indexOf(o)===-1)n.push(o);else return!1}return!0}function dn(e){return e!==null?e:[]}var rr=new $("tag:yaml.org,2002:omap",{kind:"sequence",resolve:cn,construct:dn}),un=Object.prototype.toString;function pn(e){if(e===null)return!0;var n,t,r,i,o,a=e;for(o=new Array(a.length),n=0,t=a.length;n<t;n+=1){if(r=a[n],un.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[n]=[i[0],r[i[0]]]}return!0}function hn(e){if(e===null)return[];var n,t,r,i,o,a=e;for(o=new Array(a.length),n=0,t=a.length;n<t;n+=1)r=a[n],i=Object.keys(r),o[n]=[i[0],r[i[0]]];return o}var ir=new $("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pn,construct:hn}),gn=Object.prototype.hasOwnProperty;function mn(e){if(e===null)return!0;var n,t=e;for(n in t)if(gn.call(t,n)&&t[n]!==null)return!1;return!0}function fn(e){return e!==null?e:{}}var nr=new $("tag:yaml.org,2002:set",{kind:"mapping",resolve:mn,construct:fn}),dt=Qt.extend({implicit:[Jt,er],explicit:[tr,rr,ir,nr]}),N=Object.prototype.hasOwnProperty,qe=1,or=2,ar=3,ze=4,it=1,bn=2,kt=3,vn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,xn=/[\x85\u2028\u2029]/,wn=/[,\[\]\{\}]/,sr=/^(?:!|!!|![a-z\-]+!)$/i,lr=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function St(e){return Object.prototype.toString.call(e)}function R(e){return e===10||e===13}function V(e){return e===9||e===32}function I(e){return e===9||e===32||e===10||e===13}function Q(e){return e===44||e===91||e===93||e===123||e===125}function yn(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function Cn(e){return e===120?2:e===117?4:e===85?8:0}function En(e){return 48<=e&&e<=57?e-48:-1}function Tt(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
10
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function kn(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function cr(e,n,t){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:t}):e[n]=t}var dr=new Array(256),ur=new Array(256);for(O=0;O<256;O++)dr[O]=Tt(O)?1:0,ur[O]=Tt(O);var O;function Sn(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||dt,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function pr(e,n){var t={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return t.snippet=Ai(t),new _(n,t)}function f(e,n){throw pr(e,n)}function He(e,n){e.onWarning&&e.onWarning.call(null,pr(e,n))}var $t={YAML:function(n,t,r){var i,o,a;n.version!==null&&f(n,"duplication of %YAML directive"),r.length!==1&&f(n,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&f(n,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),a=parseInt(i[2],10),o!==1&&f(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=a<2,a!==1&&a!==2&&He(n,"unsupported YAML version of the document")},TAG:function(n,t,r){var i,o;r.length!==2&&f(n,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],sr.test(i)||f(n,"ill-formed tag handle (first argument) of the TAG directive"),N.call(n.tagMap,i)&&f(n,'there is a previously declared suffix for "'+i+'" tag handle'),lr.test(o)||f(n,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{f(n,"tag prefix is malformed: "+o)}n.tagMap[i]=o}};function H(e,n,t,r){var i,o,a,s;if(n<t){if(s=e.input.slice(n,t),r)for(i=0,o=s.length;i<o;i+=1)a=s.charCodeAt(i),a===9||32<=a&&a<=1114111||f(e,"expected valid JSON character");else vn.test(s)&&f(e,"the stream contains non-printable characters");e.result+=s}}function At(e,n,t,r){var i,o,a,s;for(k.isObject(t)||f(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),a=0,s=i.length;a<s;a+=1)o=i[a],N.call(n,o)||(cr(n,o,t[o]),r[o]=!0)}function Z(e,n,t,r,i,o,a,s,l){var c,d;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,d=i.length;c<d;c+=1)Array.isArray(i[c])&&f(e,"nested arrays are not supported inside keys"),typeof i=="object"&&St(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&St(i)==="[object Object]"&&(i="[object Object]"),i=String(i),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,d=o.length;c<d;c+=1)At(e,n,o[c],t);else At(e,n,o,t);else!e.json&&!N.call(t,i)&&N.call(n,i)&&(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,f(e,"duplicated mapping key")),cr(n,i,o),delete t[i];return n}function ut(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):f(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function C(e,n,t){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;V(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(n&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(R(i))for(ut(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return t!==-1&&r!==0&&e.lineIndent<t&&He(e,"deficient indentation"),r}function Oe(e){var n=e.position,t;return t=e.input.charCodeAt(n),!!((t===45||t===46)&&t===e.input.charCodeAt(n+1)&&t===e.input.charCodeAt(n+2)&&(n+=3,t=e.input.charCodeAt(n),t===0||I(t)))}function pt(e,n){n===1?e.result+=" ":n>1&&(e.result+=k.repeat(`
11
+ `,n-1))}function Tn(e,n,t){var r,i,o,a,s,l,c,d,u=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),I(h)||Q(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(i=e.input.charCodeAt(e.position+1),I(i)||t&&Q(i)))return!1;for(e.kind="scalar",e.result="",o=a=e.position,s=!1;h!==0;){if(h===58){if(i=e.input.charCodeAt(e.position+1),I(i)||t&&Q(i))break}else if(h===35){if(r=e.input.charCodeAt(e.position-1),I(r))break}else{if(e.position===e.lineStart&&Oe(e)||t&&Q(h))break;if(R(h))if(l=e.line,c=e.lineStart,d=e.lineIndent,C(e,!1,-1),e.lineIndent>=n){s=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=d;break}}s&&(H(e,o,a,!1),pt(e,e.line-l),o=a=e.position,s=!1),V(h)||(a=e.position+1),h=e.input.charCodeAt(++e.position)}return H(e,o,a,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function $n(e,n){var t,r,i;if(t=e.input.charCodeAt(e.position),t!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(t=e.input.charCodeAt(e.position))!==0;)if(t===39)if(H(e,r,e.position,!0),t=e.input.charCodeAt(++e.position),t===39)r=e.position,e.position++,i=e.position;else return!0;else R(t)?(H(e,r,i,!0),pt(e,C(e,!1,n)),r=i=e.position):e.position===e.lineStart&&Oe(e)?f(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);f(e,"unexpected end of the stream within a single quoted scalar")}function An(e,n){var t,r,i,o,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,t=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return H(e,t,e.position,!0),e.position++,!0;if(s===92){if(H(e,t,e.position,!0),s=e.input.charCodeAt(++e.position),R(s))C(e,!1,n);else if(s<256&&dr[s])e.result+=ur[s],e.position++;else if((a=Cn(s))>0){for(i=a,o=0;i>0;i--)s=e.input.charCodeAt(++e.position),(a=yn(s))>=0?o=(o<<4)+a:f(e,"expected hexadecimal character");e.result+=kn(o),e.position++}else f(e,"unknown escape sequence");t=r=e.position}else R(s)?(H(e,t,r,!0),pt(e,C(e,!1,n)),t=r=e.position):e.position===e.lineStart&&Oe(e)?f(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}f(e,"unexpected end of the stream within a double quoted scalar")}function _n(e,n){var t=!0,r,i,o,a=e.tag,s,l=e.anchor,c,d,u,p,h,g=Object.create(null),m,b,w,v;if(v=e.input.charCodeAt(e.position),v===91)d=93,h=!1,s=[];else if(v===123)d=125,h=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(C(e,!0,n),v=e.input.charCodeAt(e.position),v===d)return e.position++,e.tag=a,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=s,!0;t?v===44&&f(e,"expected the node content, but found ','"):f(e,"missed comma between flow collection entries"),b=m=w=null,u=p=!1,v===63&&(c=e.input.charCodeAt(e.position+1),I(c)&&(u=p=!0,e.position++,C(e,!0,n))),r=e.line,i=e.lineStart,o=e.position,X(e,n,qe,!1,!0),b=e.tag,m=e.result,C(e,!0,n),v=e.input.charCodeAt(e.position),(p||e.line===r)&&v===58&&(u=!0,v=e.input.charCodeAt(++e.position),C(e,!0,n),X(e,n,qe,!1,!0),w=e.result),h?Z(e,s,g,b,m,w,r,i,o):u?s.push(Z(e,null,g,b,m,w,r,i,o)):s.push(m),C(e,!0,n),v=e.input.charCodeAt(e.position),v===44?(t=!0,v=e.input.charCodeAt(++e.position)):t=!1}f(e,"unexpected end of the stream within a flow collection")}function In(e,n){var t,r,i=it,o=!1,a=!1,s=n,l=0,c=!1,d,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)it===i?i=u===43?kt:bn:f(e,"repeat of a chomping mode identifier");else if((d=En(u))>=0)d===0?f(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?f(e,"repeat of an indentation width identifier"):(s=n+d-1,a=!0);else break;if(V(u)){do u=e.input.charCodeAt(++e.position);while(V(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!R(u)&&u!==0)}for(;u!==0;){for(ut(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!a||e.lineIndent<s)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>s&&(s=e.lineIndent),R(u)){l++;continue}if(e.lineIndent<s){i===kt?e.result+=k.repeat(`
12
12
  `,o?1+l:l):i===it&&o&&(e.result+=`
13
- `);break}for(r?O(u)?(c=!0,e.result+=k.repeat(`
13
+ `);break}for(r?V(u)?(c=!0,e.result+=k.repeat(`
14
14
  `,o?1+l:l)):c?(c=!1,e.result+=k.repeat(`
15
15
  `,l+1)):l===0?o&&(e.result+=" "):e.result+=k.repeat(`
16
16
  `,l):e.result+=k.repeat(`
17
- `,o?1+l:l),o=!0,a=!0,l=0,t=e.position;!R(u)&&u!==0;)u=e.input.charCodeAt(++e.position);H(e,t,e.position,!1)}return!0}function _t(e,n){var t,r=e.tag,i=e.anchor,o=[],a,s=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,f(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!I(a))));){if(s=!0,e.position++,E(e,!0,-1)&&e.lineIndent<=n){o.push(null),l=e.input.charCodeAt(e.position);continue}if(t=e.line,X(e,n,ar,!1,!0),o.push(e.result),E(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===t||e.lineIndent>n)&&l!==0)f(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function Mn(e,n,t){var r,i,o,a,s,l,c=e.tag,d=e.anchor,u={},p=Object.create(null),h=null,g=null,m=null,b=!1,w=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),v=e.input.charCodeAt(e.position);v!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,f(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(v===63||v===58)&&I(r))v===63?(b&&(Z(e,u,p,h,g,null,a,s,l),h=g=m=null),w=!0,b=!0,i=!0):b?(b=!1,i=!0):f(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=r;else{if(a=e.line,s=e.lineStart,l=e.position,!X(e,t,or,!1,!0))break;if(e.line===o){for(v=e.input.charCodeAt(e.position);O(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),I(v)||f(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Z(e,u,p,h,g,null,a,s,l),h=g=m=null),w=!0,b=!1,i=!1,h=e.tag,g=e.result;else if(w)f(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=d,!0}else if(w)f(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=d,!0}if((e.line===o||e.lineIndent>n)&&(b&&(a=e.line,s=e.lineStart,l=e.position),X(e,n,ze,!0,i)&&(b?g=e.result:m=e.result),b||(Z(e,u,p,h,g,m,a,s,l),h=g=m=null),E(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>n)&&v!==0)f(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return b&&Z(e,u,p,h,g,null,a,s,l),w&&(e.tag=c,e.anchor=d,e.kind="mapping",e.result=u),w}function Ln(e){var n,t=!1,r=!1,i,o,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&f(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(t=!0,a=e.input.charCodeAt(++e.position)):a===33?(r=!0,i="!!",a=e.input.charCodeAt(++e.position)):i="!",n=e.position,t){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(o=e.input.slice(n,e.position),a=e.input.charCodeAt(++e.position)):f(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!I(a);)a===33&&(r?f(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(n-1,e.position+1),sr.test(i)||f(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),a=e.input.charCodeAt(++e.position);o=e.input.slice(n,e.position),wn.test(o)&&f(e,"tag suffix cannot contain flow indicator characters")}o&&!lr.test(o)&&f(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{f(e,"tag name is malformed: "+o)}return t?e.tag=o:N.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:f(e,'undeclared tag handle "'+i+'"'),!0}function Dn(e){var n,t;if(t=e.input.charCodeAt(e.position),t!==38)return!1;for(e.anchor!==null&&f(e,"duplication of an anchor property"),t=e.input.charCodeAt(++e.position),n=e.position;t!==0&&!I(t)&&!Q(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&f(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Rn(e){var n,t,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!I(r)&&!Q(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&f(e,"name of an alias node must contain at least one character"),t=e.input.slice(n,e.position),N.call(e.anchorMap,t)||f(e,'unidentified alias "'+t+'"'),e.result=e.anchorMap[t],E(e,!0,-1),!0}function X(e,n,t,r,i){var o,a,s,l=1,c=!1,d=!1,u,p,h,g,m,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=ze===t||ar===t,r&&E(e,!0,-1)&&(c=!0,e.lineIndent>n?l=1:e.lineIndent===n?l=0:e.lineIndent<n&&(l=-1)),l===1)for(;Ln(e)||Dn(e);)E(e,!0,-1)?(c=!0,s=o,e.lineIndent>n?l=1:e.lineIndent===n?l=0:e.lineIndent<n&&(l=-1)):s=!1;if(s&&(s=c||i),(l===1||ze===t)&&(qe===t||or===t?m=n:m=n+1,b=e.position-e.lineStart,l===1?s&&(_t(e,b)||Mn(e,b,m))||_n(e,m)?d=!0:(a&&In(e,m)||$n(e,m)||An(e,m)?d=!0:Rn(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&f(e,"alias node should not have any properties")):Tn(e,m,qe===t)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=s&&_t(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&f(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(N.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,h=e.typeMap.multi[e.kind||"fallback"],u=0,p=h.length;u<p;u+=1)if(e.tag.slice(0,h[u].tag.length)===h[u].tag){g=h[u];break}g||f(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&f(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):f(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function Pn(e){var n=e.position,t,r,i,o=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(E(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(o=!0,a=e.input.charCodeAt(++e.position),t=e.position;a!==0&&!I(a);)a=e.input.charCodeAt(++e.position);for(r=e.input.slice(t,e.position),i=[],r.length<1&&f(e,"directive name must not be less than one character in length");a!==0;){for(;O(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!R(a));break}if(R(a))break;for(t=e.position;a!==0&&!I(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}a!==0&&ut(e),N.call($t,r)?$t[r](e,r,i):He(e,'unknown document directive "'+r+'"')}if(E(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,E(e,!0,-1)):o&&f(e,"directives end mark is expected"),X(e,e.lineIndent-1,ze,!1,!0),E(e,!0,-1),e.checkLineBreaks&&xn.test(e.input.slice(n,e.position))&&He(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ve(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,E(e,!0,-1));return}if(e.position<e.length-1)f(e,"end of the stream or a document separator is expected");else return}function hr(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
18
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var t=new Sn(e,n),r=e.indexOf("\0");for(r!==-1&&(t.position=r,f(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)Pn(t);return t.documents}function Bn(e,n,t){n!==null&&typeof n=="object"&&typeof t>"u"&&(t=n,n=null);var r=hr(e,t);if(typeof n!="function")return r;for(var i=0,o=r.length;i<o;i+=1)n(r[i])}function qn(e,n){var t=hr(e,n);if(t.length!==0){if(t.length===1)return t[0];throw new _("expected a single document in the stream, but found more")}}var zn=Bn,Hn=qn,gr={loadAll:zn,load:Hn},mr=Object.prototype.toString,fr=Object.prototype.hasOwnProperty,ht=65279,Nn=9,ge=10,Gn=13,Vn=32,On=33,Fn=34,ot=35,jn=37,Un=38,Yn=39,Kn=42,br=44,Wn=45,Ne=58,Qn=61,Zn=62,Xn=63,Jn=64,vr=91,xr=93,eo=96,wr=123,to=124,yr=125,A={};A[0]="\\0";A[7]="\\a";A[8]="\\b";A[9]="\\t";A[10]="\\n";A[11]="\\v";A[12]="\\f";A[13]="\\r";A[27]="\\e";A[34]='\\"';A[92]="\\\\";A[133]="\\N";A[160]="\\_";A[8232]="\\L";A[8233]="\\P";var ro=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],io=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function no(e,n){var t,r,i,o,a,s,l;if(n===null)return{};for(t={},r=Object.keys(n),i=0,o=r.length;i<o;i+=1)a=r[i],s=String(n[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&fr.call(l.styleAliases,s)&&(s=l.styleAliases[s]),t[a]=s;return t}function oo(e){var n,t,r;if(n=e.toString(16).toUpperCase(),e<=255)t="x",r=2;else if(e<=65535)t="u",r=4;else if(e<=4294967295)t="U",r=8;else throw new _("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+k.repeat("0",r-n.length)+n}var ao=1,me=2;function so(e){this.schema=e.schema||dt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=k.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=no(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?me:ao,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function It(e,n){for(var t=k.repeat(" ",n),r=0,i=-1,o="",a,s=e.length;r<s;)i=e.indexOf(`
17
+ `,o?1+l:l),o=!0,a=!0,l=0,t=e.position;!R(u)&&u!==0;)u=e.input.charCodeAt(++e.position);H(e,t,e.position,!1)}return!0}function _t(e,n){var t,r=e.tag,i=e.anchor,o=[],a,s=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,f(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!I(a))));){if(s=!0,e.position++,C(e,!0,-1)&&e.lineIndent<=n){o.push(null),l=e.input.charCodeAt(e.position);continue}if(t=e.line,X(e,n,ar,!1,!0),o.push(e.result),C(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===t||e.lineIndent>n)&&l!==0)f(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function Mn(e,n,t){var r,i,o,a,s,l,c=e.tag,d=e.anchor,u={},p=Object.create(null),h=null,g=null,m=null,b=!1,w=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),v=e.input.charCodeAt(e.position);v!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,f(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(v===63||v===58)&&I(r))v===63?(b&&(Z(e,u,p,h,g,null,a,s,l),h=g=m=null),w=!0,b=!0,i=!0):b?(b=!1,i=!0):f(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=r;else{if(a=e.line,s=e.lineStart,l=e.position,!X(e,t,or,!1,!0))break;if(e.line===o){for(v=e.input.charCodeAt(e.position);V(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),I(v)||f(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Z(e,u,p,h,g,null,a,s,l),h=g=m=null),w=!0,b=!1,i=!1,h=e.tag,g=e.result;else if(w)f(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=d,!0}else if(w)f(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=d,!0}if((e.line===o||e.lineIndent>n)&&(b&&(a=e.line,s=e.lineStart,l=e.position),X(e,n,ze,!0,i)&&(b?g=e.result:m=e.result),b||(Z(e,u,p,h,g,m,a,s,l),h=g=m=null),C(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>n)&&v!==0)f(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return b&&Z(e,u,p,h,g,null,a,s,l),w&&(e.tag=c,e.anchor=d,e.kind="mapping",e.result=u),w}function Ln(e){var n,t=!1,r=!1,i,o,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&f(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(t=!0,a=e.input.charCodeAt(++e.position)):a===33?(r=!0,i="!!",a=e.input.charCodeAt(++e.position)):i="!",n=e.position,t){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(o=e.input.slice(n,e.position),a=e.input.charCodeAt(++e.position)):f(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!I(a);)a===33&&(r?f(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(n-1,e.position+1),sr.test(i)||f(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),a=e.input.charCodeAt(++e.position);o=e.input.slice(n,e.position),wn.test(o)&&f(e,"tag suffix cannot contain flow indicator characters")}o&&!lr.test(o)&&f(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{f(e,"tag name is malformed: "+o)}return t?e.tag=o:N.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:f(e,'undeclared tag handle "'+i+'"'),!0}function Dn(e){var n,t;if(t=e.input.charCodeAt(e.position),t!==38)return!1;for(e.anchor!==null&&f(e,"duplication of an anchor property"),t=e.input.charCodeAt(++e.position),n=e.position;t!==0&&!I(t)&&!Q(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&f(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Rn(e){var n,t,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!I(r)&&!Q(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&f(e,"name of an alias node must contain at least one character"),t=e.input.slice(n,e.position),N.call(e.anchorMap,t)||f(e,'unidentified alias "'+t+'"'),e.result=e.anchorMap[t],C(e,!0,-1),!0}function X(e,n,t,r,i){var o,a,s,l=1,c=!1,d=!1,u,p,h,g,m,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=ze===t||ar===t,r&&C(e,!0,-1)&&(c=!0,e.lineIndent>n?l=1:e.lineIndent===n?l=0:e.lineIndent<n&&(l=-1)),l===1)for(;Ln(e)||Dn(e);)C(e,!0,-1)?(c=!0,s=o,e.lineIndent>n?l=1:e.lineIndent===n?l=0:e.lineIndent<n&&(l=-1)):s=!1;if(s&&(s=c||i),(l===1||ze===t)&&(qe===t||or===t?m=n:m=n+1,b=e.position-e.lineStart,l===1?s&&(_t(e,b)||Mn(e,b,m))||_n(e,m)?d=!0:(a&&In(e,m)||$n(e,m)||An(e,m)?d=!0:Rn(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&f(e,"alias node should not have any properties")):Tn(e,m,qe===t)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=s&&_t(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&f(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(N.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,h=e.typeMap.multi[e.kind||"fallback"],u=0,p=h.length;u<p;u+=1)if(e.tag.slice(0,h[u].tag.length)===h[u].tag){g=h[u];break}g||f(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&f(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):f(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function Pn(e){var n=e.position,t,r,i,o=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(C(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(o=!0,a=e.input.charCodeAt(++e.position),t=e.position;a!==0&&!I(a);)a=e.input.charCodeAt(++e.position);for(r=e.input.slice(t,e.position),i=[],r.length<1&&f(e,"directive name must not be less than one character in length");a!==0;){for(;V(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!R(a));break}if(R(a))break;for(t=e.position;a!==0&&!I(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}a!==0&&ut(e),N.call($t,r)?$t[r](e,r,i):He(e,'unknown document directive "'+r+'"')}if(C(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,C(e,!0,-1)):o&&f(e,"directives end mark is expected"),X(e,e.lineIndent-1,ze,!1,!0),C(e,!0,-1),e.checkLineBreaks&&xn.test(e.input.slice(n,e.position))&&He(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Oe(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,C(e,!0,-1));return}if(e.position<e.length-1)f(e,"end of the stream or a document separator is expected");else return}function hr(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
18
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var t=new Sn(e,n),r=e.indexOf("\0");for(r!==-1&&(t.position=r,f(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)Pn(t);return t.documents}function Bn(e,n,t){n!==null&&typeof n=="object"&&typeof t>"u"&&(t=n,n=null);var r=hr(e,t);if(typeof n!="function")return r;for(var i=0,o=r.length;i<o;i+=1)n(r[i])}function qn(e,n){var t=hr(e,n);if(t.length!==0){if(t.length===1)return t[0];throw new _("expected a single document in the stream, but found more")}}var zn=Bn,Hn=qn,gr={loadAll:zn,load:Hn},mr=Object.prototype.toString,fr=Object.prototype.hasOwnProperty,ht=65279,Nn=9,ge=10,Gn=13,On=32,Vn=33,Fn=34,ot=35,jn=37,Un=38,Yn=39,Kn=42,br=44,Wn=45,Ne=58,Qn=61,Zn=62,Xn=63,Jn=64,vr=91,xr=93,eo=96,wr=123,to=124,yr=125,A={};A[0]="\\0";A[7]="\\a";A[8]="\\b";A[9]="\\t";A[10]="\\n";A[11]="\\v";A[12]="\\f";A[13]="\\r";A[27]="\\e";A[34]='\\"';A[92]="\\\\";A[133]="\\N";A[160]="\\_";A[8232]="\\L";A[8233]="\\P";var ro=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],io=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function no(e,n){var t,r,i,o,a,s,l;if(n===null)return{};for(t={},r=Object.keys(n),i=0,o=r.length;i<o;i+=1)a=r[i],s=String(n[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&fr.call(l.styleAliases,s)&&(s=l.styleAliases[s]),t[a]=s;return t}function oo(e){var n,t,r;if(n=e.toString(16).toUpperCase(),e<=255)t="x",r=2;else if(e<=65535)t="u",r=4;else if(e<=4294967295)t="U",r=8;else throw new _("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+k.repeat("0",r-n.length)+n}var ao=1,me=2;function so(e){this.schema=e.schema||dt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=k.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=no(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?me:ao,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function It(e,n){for(var t=k.repeat(" ",n),r=0,i=-1,o="",a,s=e.length;r<s;)i=e.indexOf(`
19
19
  `,r),i===-1?(a=e.slice(r),r=s):(a=e.slice(r,i+1),r=i+1),a.length&&a!==`
20
20
  `&&(o+=t),o+=a;return o}function at(e,n){return`
21
- `+k.repeat(" ",e.indent*n)}function lo(e,n){var t,r,i;for(t=0,r=e.implicitTypes.length;t<r;t+=1)if(i=e.implicitTypes[t],i.resolve(n))return!0;return!1}function Ge(e){return e===Vn||e===Nn}function fe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ht||65536<=e&&e<=1114111}function Mt(e){return fe(e)&&e!==ht&&e!==Gn&&e!==ge}function Lt(e,n,t){var r=Mt(e),i=r&&!Ge(e);return(t?r:r&&e!==br&&e!==vr&&e!==xr&&e!==wr&&e!==yr)&&e!==ot&&!(n===Ne&&!i)||Mt(n)&&!Ge(n)&&e===ot||n===Ne&&i}function co(e){return fe(e)&&e!==ht&&!Ge(e)&&e!==Wn&&e!==Xn&&e!==Ne&&e!==br&&e!==vr&&e!==xr&&e!==wr&&e!==yr&&e!==ot&&e!==Un&&e!==Kn&&e!==On&&e!==to&&e!==Qn&&e!==Zn&&e!==Yn&&e!==Fn&&e!==jn&&e!==Jn&&e!==eo}function uo(e){return!Ge(e)&&e!==Ne}function pe(e,n){var t=e.charCodeAt(n),r;return t>=55296&&t<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}function Er(e){var n=/^\n* /;return n.test(e)}var Cr=1,st=2,kr=3,Sr=4,W=5;function po(e,n,t,r,i,o,a,s){var l,c=0,d=null,u=!1,p=!1,h=r!==-1,g=-1,m=co(pe(e,0))&&uo(pe(e,e.length-1));if(n||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=pe(e,l),!fe(c))return W;m=m&&Lt(c,d,s),d=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=pe(e,l),c===ge)u=!0,h&&(p=p||l-g-1>r&&e[g+1]!==" ",g=l);else if(!fe(c))return W;m=m&&Lt(c,d,s),d=c}p=p||h&&l-g-1>r&&e[g+1]!==" "}return!u&&!p?m&&!a&&!i(e)?Cr:o===me?W:st:t>9&&Er(e)?W:a?o===me?W:st:p?Sr:kr}function ho(e,n,t,r,i){e.dump=function(){if(n.length===0)return e.quotingType===me?'""':"''";if(!e.noCompatMode&&(ro.indexOf(n)!==-1||io.test(n)))return e.quotingType===me?'"'+n+'"':"'"+n+"'";var o=e.indent*Math.max(1,t),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),s=r||e.flowLevel>-1&&t>=e.flowLevel;function l(c){return lo(e,c)}switch(po(n,s,e.indent,a,l,e.quotingType,e.forceQuotes&&!r,i)){case Cr:return n;case st:return"'"+n.replace(/'/g,"''")+"'";case kr:return"|"+Dt(n,e.indent)+Rt(It(n,o));case Sr:return">"+Dt(n,e.indent)+Rt(It(go(n,a),o));case W:return'"'+mo(n)+'"';default:throw new _("impossible error: invalid scalar style")}}()}function Dt(e,n){var t=Er(e)?String(n):"",r=e[e.length-1]===`
21
+ `+k.repeat(" ",e.indent*n)}function lo(e,n){var t,r,i;for(t=0,r=e.implicitTypes.length;t<r;t+=1)if(i=e.implicitTypes[t],i.resolve(n))return!0;return!1}function Ge(e){return e===On||e===Nn}function fe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ht||65536<=e&&e<=1114111}function Mt(e){return fe(e)&&e!==ht&&e!==Gn&&e!==ge}function Lt(e,n,t){var r=Mt(e),i=r&&!Ge(e);return(t?r:r&&e!==br&&e!==vr&&e!==xr&&e!==wr&&e!==yr)&&e!==ot&&!(n===Ne&&!i)||Mt(n)&&!Ge(n)&&e===ot||n===Ne&&i}function co(e){return fe(e)&&e!==ht&&!Ge(e)&&e!==Wn&&e!==Xn&&e!==Ne&&e!==br&&e!==vr&&e!==xr&&e!==wr&&e!==yr&&e!==ot&&e!==Un&&e!==Kn&&e!==Vn&&e!==to&&e!==Qn&&e!==Zn&&e!==Yn&&e!==Fn&&e!==jn&&e!==Jn&&e!==eo}function uo(e){return!Ge(e)&&e!==Ne}function pe(e,n){var t=e.charCodeAt(n),r;return t>=55296&&t<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}function Cr(e){var n=/^\n* /;return n.test(e)}var Er=1,st=2,kr=3,Sr=4,W=5;function po(e,n,t,r,i,o,a,s){var l,c=0,d=null,u=!1,p=!1,h=r!==-1,g=-1,m=co(pe(e,0))&&uo(pe(e,e.length-1));if(n||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=pe(e,l),!fe(c))return W;m=m&&Lt(c,d,s),d=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=pe(e,l),c===ge)u=!0,h&&(p=p||l-g-1>r&&e[g+1]!==" ",g=l);else if(!fe(c))return W;m=m&&Lt(c,d,s),d=c}p=p||h&&l-g-1>r&&e[g+1]!==" "}return!u&&!p?m&&!a&&!i(e)?Er:o===me?W:st:t>9&&Cr(e)?W:a?o===me?W:st:p?Sr:kr}function ho(e,n,t,r,i){e.dump=function(){if(n.length===0)return e.quotingType===me?'""':"''";if(!e.noCompatMode&&(ro.indexOf(n)!==-1||io.test(n)))return e.quotingType===me?'"'+n+'"':"'"+n+"'";var o=e.indent*Math.max(1,t),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),s=r||e.flowLevel>-1&&t>=e.flowLevel;function l(c){return lo(e,c)}switch(po(n,s,e.indent,a,l,e.quotingType,e.forceQuotes&&!r,i)){case Er:return n;case st:return"'"+n.replace(/'/g,"''")+"'";case kr:return"|"+Dt(n,e.indent)+Rt(It(n,o));case Sr:return">"+Dt(n,e.indent)+Rt(It(go(n,a),o));case W:return'"'+mo(n)+'"';default:throw new _("impossible error: invalid scalar style")}}()}function Dt(e,n){var t=Cr(e)?String(n):"",r=e[e.length-1]===`
22
22
  `,i=r&&(e[e.length-2]===`
23
23
  `||e===`
24
24
  `),o=i?"+":r?"":"-";return t+o+`
@@ -30,9 +30,9 @@ function et(){let e=globalThis;if(typeof e.HTMLElement>"u"&&(e.HTMLElement=class
30
30
  `+e.slice(i,o),i=o+1),a=s;return l+=`
31
31
  `,e.length-i>n&&a>i?l+=e.slice(i,a)+`
32
32
  `+e.slice(a+1):l+=e.slice(i),l.slice(1)}function mo(e){for(var n="",t=0,r,i=0;i<e.length;t>=65536?i+=2:i++)t=pe(e,i),r=A[t],!r&&fe(t)?(n+=e[i],t>=65536&&(n+=e[i+1])):n+=r||oo(t);return n}function fo(e,n,t){var r="",i=e.tag,o,a,s;for(o=0,a=t.length;o<a;o+=1)s=t[o],e.replacer&&(s=e.replacer.call(t,String(o),s)),(z(e,n,s,!1,!1)||typeof s>"u"&&z(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Bt(e,n,t,r){var i="",o=e.tag,a,s,l;for(a=0,s=t.length;a<s;a+=1)l=t[a],e.replacer&&(l=e.replacer.call(t,String(a),l)),(z(e,n+1,l,!0,!0,!1,!0)||typeof l>"u"&&z(e,n+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=at(e,n)),e.dump&&ge===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function bo(e,n,t){var r="",i=e.tag,o=Object.keys(t),a,s,l,c,d;for(a=0,s=o.length;a<s;a+=1)d="",r!==""&&(d+=", "),e.condenseFlow&&(d+='"'),l=o[a],c=t[l],e.replacer&&(c=e.replacer.call(t,l,c)),z(e,n,l,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),z(e,n,c,!1,!1)&&(d+=e.dump,r+=d));e.tag=i,e.dump="{"+r+"}"}function vo(e,n,t,r){var i="",o=e.tag,a=Object.keys(t),s,l,c,d,u,p;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new _("sortKeys must be a boolean or a function");for(s=0,l=a.length;s<l;s+=1)p="",(!r||i!=="")&&(p+=at(e,n)),c=a[s],d=t[c],e.replacer&&(d=e.replacer.call(t,c,d)),z(e,n+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&ge===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=at(e,n)),z(e,n+1,d,!0,u)&&(e.dump&&ge===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=o,e.dump=i||"{}"}function qt(e,n,t){var r,i,o,a,s,l;for(i=t?e.explicitTypes:e.implicitTypes,o=0,a=i.length;o<a;o+=1)if(s=i[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof n=="object"&&n instanceof s.instanceOf)&&(!s.predicate||s.predicate(n))){if(t?s.multi&&s.representName?e.tag=s.representName(n):e.tag=s.tag:e.tag="?",s.represent){if(l=e.styleMap[s.tag]||s.defaultStyle,mr.call(s.represent)==="[object Function]")r=s.represent(n,l);else if(fr.call(s.represent,l))r=s.represent[l](n,l);else throw new _("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function z(e,n,t,r,i,o,a){e.tag=null,e.dump=t,qt(e,t,!1)||qt(e,t,!0);var s=mr.call(e.dump),l=r,c;r&&(r=e.flowLevel<0||e.flowLevel>n);var d=s==="[object Object]"||s==="[object Array]",u,p;if(d&&(u=e.duplicates.indexOf(t),p=u!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&n>0)&&(i=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(d&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(vo(e,n,e.dump,i),p&&(e.dump="&ref_"+u+e.dump)):(bo(e,n,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!a&&n>0?Bt(e,n-1,e.dump,i):Bt(e,n,e.dump,i),p&&(e.dump="&ref_"+u+e.dump)):(fo(e,n,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&ho(e,e.dump,n,o,l);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function xo(e,n){var t=[],r=[],i,o;for(lt(e,t,r),i=0,o=r.length;i<o;i+=1)n.duplicates.push(t[r[i]]);n.usedDuplicates=new Array(o)}function lt(e,n,t){var r,i,o;if(e!==null&&typeof e=="object")if(i=n.indexOf(e),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(n.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)lt(e[i],n,t);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)lt(e[r[i]],n,t)}function wo(e,n){n=n||{};var t=new so(n);t.noRefs||xo(e,t);var r=e;return t.replacer&&(r=t.replacer.call({"":r},"",r)),z(t,0,r,!0,!0)?t.dump+`
33
- `:""}var yo=wo,Eo={dump:yo};function gt(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var Co=$,ko=Nt,So=Ft,To=Wt,$o=Qt,Ao=dt,_o=gr.load,Io=gr.loadAll,Mo=Eo.dump,Lo=_,Do={binary:tr,float:Kt,map:Ot,null:jt,pairs:ir,set:nr,timestamp:Jt,bool:Ut,int:Yt,merge:er,omap:rr,seq:Vt,str:Gt},Ro=gt("safeLoad","load"),Po=gt("safeLoadAll","loadAll"),Bo=gt("safeDump","dump"),Tr={Type:Co,Schema:ko,FAILSAFE_SCHEMA:So,JSON_SCHEMA:To,CORE_SCHEMA:$o,DEFAULT_SCHEMA:Ao,load:_o,loadAll:Io,dump:Mo,YAMLException:Lo,types:Do,safeLoad:Ro,safeLoadAll:Po,safeDump:Bo};var F=["#10b981","#f59e0b","#06b6d4","#ec4899","#8b5cf6","#3b82f6","#f43f5e","#84cc16","#a855f7","#6366f1"];function S(e){let n=e.length,t;for(;n!==0;)t=Math.floor(Math.random()*n),n--,[e[n],e[t]]=[e[t],e[n]];return e}var P=(e,n=0)=>{let t=3735928559^n,r=1103547991^n;for(let i=0,o;i<e.length;i++)o=e.charCodeAt(i),t=Math.imul(t^o,265443561),r=Math.imul(r^o,159334677);return t=Math.imul(t^r>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2009751&r)+(t>>>0)).toString()};function C(e){return e.replace(/[&<>"']/g,n=>n==="&"?"&amp;":n==="<"?"&lt;":n===">"?"&gt;":n==='"'?"&quot;":"&#39;")}function qo(e){try{return Tr.load(e)}catch(n){throw new Error(`Invalid YAML assets:
34
- ${n instanceof Error?n.message:String(n)}`)}}function M(e){return typeof e=="string"}function mt(e){return typeof e=="number"}function ft(e){return/^(\d{1,2}:)?\d{1,2}:\d{2}$/.test(e)}function $r(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Oe(e){return typeof e=="object"&&e!==null&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function j(e){return e.split("|").map(n=>n.trim()).filter(Boolean)}var J=e=>[...new Set(e)];var be=class extends Error{constructor(n){super(`Asset validation failed:n- ${n.join(`
35
- - `)}`),this.name="AssetValidationError",this.issues=n}};function zo(e){let n=[];if(!Oe(e))throw new be(["Top-level assets must be an object/map like { mango: {...}, trend: {...} }"]);let t=e,r={};for(let[o,a]of Object.entries(t)){if(!o||typeof o!="string"){n.push(`Asset key must be a non-empty string (got: ${String(o)})`);continue}if(/^[a-zA-Z0-9._-]+$/.test(o)||n.push(`Asset id "${o}" has invalid chars; use letters/numbers/._-`),!Oe(a)){n.push(`Asset "${o}" must be an object (got: ${$r(a)})`);continue}let s=a,l=s.type,c=!!s.dialog;if(!M(l)){n.push(`Asset "${o}" missing string field "type"`);continue}if(!Ho(l)){n.push(`Asset "${o}" has unsupported type "${l}" (use image|video|audio|html)`);continue}switch(l){case"image":{let d=s.url;M(d)||n.push(`Asset "${o}" (image) missing "url"`);let u=s.size;u!==void 0&&!M(u)&&n.push(`Asset "${o}" (image) field "size" must be a string`),M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...M(u)?{size:u}:{}});break}case"video":{let d=s.url;M(d)||n.push(`Asset "${o}" (video) missing "url"`);let u=s.span,p;if(u!==void 0)if(!Oe(u))n.push(`Asset "${o}" (video) field "span" must be an object`);else{let h=u.from,g=u.to;!M(h)||!M(g)?n.push(`Asset "${o}" (video) span requires string "from" and "to"`):((!ft(h)||!ft(g))&&n.push(`Asset "${o}" (video) span times should look like "02:15" or "01:02:45"`),p={from:h,to:g})}M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...p?{span:p}:{}});break}case"audio":{let d=s.url;M(d)||n.push(`Asset "${o}" (audio) missing "url"`);let u=s.volume;u!==void 0&&(!mt(u)||!Number.isFinite(u)?n.push(`Asset "${o}" (audio) field "volume" must be a number`):(u<0||u>100)&&n.push(`Asset "${o}" (audio) field "volume" must be between 0 and 100`)),M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...mt(u)?{volume:u}:{}});break}case"html":{let d=s.content;if(!M(d)){n.push(`Asset "${o}" (html) missing string field "content"`);break}r[o]={id:o,type:l,dialog:c,content:d};break}case"tts":{let d=s.content;if(!M(d)){n.push(`Asset "${o}" (tts) missing string field "content"`);break}r[o]={id:o,type:l,dialog:c,content:d};break}}}if(n.length)throw new be(n);let i=Object.keys(r).sort((o,a)=>o.localeCompare(a)).map(o=>r[o]);return{assetsById:r,assetsList:i}}function Ho(e){return e==="image"||e==="video"||e==="audio"||e==="html"}var Fe={"default-light":{"--edu-bg":"247 249 252","--edu-card":"255 255 255","--edu-ink":"31 41 55","--edu-second-ink":"71 85 105","--edu-third-ink":"100 116 139","--edu-inverted-ink":"248 250 252","--edu-success":"22 163 74","--edu-error":"220 38 38","--edu-warning":"255 222 33","--edu-neutral":"14 165 233","--edu-first-accent":"49 120 198","--edu-second-accent":"245 158 11","--edu-third-accent":"236 72 153","--edu-border":"229 231 235","--edu-muted":"243 244 246","--edu-radius":"0.375rem","--edu-shadow-color":"0 0 0","--edu-pad":"1rem","--edu-mar":"0"},"default-dark":{"--edu-bg":"15 23 42","--edu-card":"30 41 59","--edu-ink":"241 245 249","--edu-second-ink":"203 213 225","--edu-third-ink":"148 163 184","--edu-inverted-ink":"15 23 42","--edu-success":"74 222 128","--edu-error":"248 113 113","--edu-warning":"250 204 21","--edu-neutral":"56 189 248","--edu-first-accent":"96 165 250","--edu-second-accent":"251 191 36","--edu-third-accent":"244 114 182","--edu-border":"71 85 105","--edu-muted":"51 65 85","--edu-radius":"0.375rem","--edu-shadow-color":"2 6 23","--edu-pad":"1rem","--edu-mar":"0"},"ocean-light":{"--edu-bg":"239 246 255","--edu-card":"255 255 255","--edu-ink":"8 47 73","--edu-second-ink":"14 116 144","--edu-third-ink":"8 145 178","--edu-inverted-ink":"239 246 255","--edu-success":"5 150 105","--edu-error":"225 29 72","--edu-warning":"245 158 11","--edu-neutral":"2 132 199","--edu-first-accent":"6 182 212","--edu-second-accent":"59 130 246","--edu-third-accent":"14 165 233","--edu-border":"186 230 253","--edu-muted":"224 242 254","--edu-radius":"0.5rem","--edu-shadow-color":"8 47 73","--edu-pad":"1rem","--edu-mar":"0"},"ocean-dark":{"--edu-bg":"8 47 73","--edu-card":"12 74 110","--edu-ink":"236 254 255","--edu-second-ink":"165 243 252","--edu-third-ink":"103 232 249","--edu-inverted-ink":"8 47 73","--edu-success":"52 211 153","--edu-error":"251 113 133","--edu-warning":"251 191 36","--edu-neutral":"34 211 238","--edu-first-accent":"103 232 249","--edu-second-accent":"56 189 248","--edu-third-accent":"45 212 191","--edu-border":"14 116 144","--edu-muted":"14 116 144","--edu-radius":"0.5rem","--edu-shadow-color":"8 47 73","--edu-pad":"1rem","--edu-mar":"0"},"forest-light":{"--edu-bg":"240 253 244","--edu-card":"255 255 255","--edu-ink":"20 83 45","--edu-second-ink":"22 101 52","--edu-third-ink":"74 124 89","--edu-inverted-ink":"240 253 244","--edu-success":"22 163 74","--edu-error":"220 38 38","--edu-warning":"234 179 8","--edu-neutral":"34 197 94","--edu-first-accent":"34 197 94","--edu-second-accent":"132 204 22","--edu-third-accent":"16 185 129","--edu-border":"187 247 208","--edu-muted":"220 252 231","--edu-radius":"0.5rem","--edu-shadow-color":"20 83 45","--edu-pad":"1rem","--edu-mar":"0"},"forest-dark":{"--edu-bg":"20 83 45","--edu-card":"22 101 52","--edu-ink":"240 253 244","--edu-second-ink":"187 247 208","--edu-third-ink":"134 239 172","--edu-inverted-ink":"20 83 45","--edu-success":"74 222 128","--edu-error":"248 113 113","--edu-warning":"250 204 21","--edu-neutral":"74 222 128","--edu-first-accent":"134 239 172","--edu-second-accent":"190 242 100","--edu-third-accent":"52 211 153","--edu-border":"34 197 94","--edu-muted":"21 128 61","--edu-radius":"0.5rem","--edu-shadow-color":"20 83 45","--edu-pad":"1rem","--edu-mar":"0"}},bt=Fe["default-light"],y={audioBaseUrl:null,soundFiles:{},injectThemeVariables:!0,theme:null,themeVariables:{}},Ar="cognikit-theme-variables";function No(e){e.audioBaseUrl!==void 0&&(y.audioBaseUrl=e.audioBaseUrl),e.soundFiles&&(y.soundFiles={...y.soundFiles,...e.soundFiles}),e.injectThemeVariables!==void 0&&(y.injectThemeVariables=e.injectThemeVariables),e.theme!==void 0&&(y.theme=e.theme),e.themeVariables===null&&(y.themeVariables={}),e.themeVariables&&(y.themeVariables={...y.themeVariables,...e.themeVariables}),je()}function Go(){return y}function Vo(){return Fe}function Mr(e=y.theme,n=y.themeVariables){return{...e?Fe[e]:bt,...n}}function Oo(e,n){y.theme=e,n!==void 0&&(y.themeVariables={...n}),je()}function Fo(){y.theme=null,y.themeVariables={},je()}function je(){if(typeof document>"u")return;let e=document.getElementById(Ar);if(e||(e=document.createElement("style"),e.id=Ar,document.head.appendChild(e)),!y.injectThemeVariables){e.textContent="";return}let n=document.documentElement,t=window.getComputedStyle(n),r=Mr();if(y.theme!==null||Object.keys(y.themeVariables).length>0){e.textContent=Ir(r);return}let o=Object.entries(bt).filter(([a])=>t.getPropertyValue(a).trim()==="");e.textContent=o.length===0?"":Ir(Object.fromEntries(o))}function Lr(e,n){let t=y.soundFiles[e];return t?_r(t,y.audioBaseUrl):y.audioBaseUrl?_r(n,y.audioBaseUrl):null}function _r(e,n){return Uo(e)||e.startsWith("data:")?e:n?new URL(e,jo(n)).href:e}function jo(e){return typeof window>"u"?e:new URL(e,document.baseURI||window.location.href).href}function Uo(e){return/^https?:\/\//.test(e)}function Ir(e){return`:root {
33
+ `:""}var yo=wo,Co={dump:yo};function gt(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var Eo=$,ko=Nt,So=Ft,To=Wt,$o=Qt,Ao=dt,_o=gr.load,Io=gr.loadAll,Mo=Co.dump,Lo=_,Do={binary:tr,float:Kt,map:Vt,null:jt,pairs:ir,set:nr,timestamp:Jt,bool:Ut,int:Yt,merge:er,omap:rr,seq:Ot,str:Gt},Ro=gt("safeLoad","load"),Po=gt("safeLoadAll","loadAll"),Bo=gt("safeDump","dump"),Tr={Type:Eo,Schema:ko,FAILSAFE_SCHEMA:So,JSON_SCHEMA:To,CORE_SCHEMA:$o,DEFAULT_SCHEMA:Ao,load:_o,loadAll:Io,dump:Mo,YAMLException:Lo,types:Do,safeLoad:Ro,safeLoadAll:Po,safeDump:Bo};var F=["#10b981","#f59e0b","#06b6d4","#ec4899","#8b5cf6","#3b82f6","#f43f5e","#84cc16","#a855f7","#6366f1"];function S(e){let n=e.length,t;for(;n!==0;)t=Math.floor(Math.random()*n),n--,[e[n],e[t]]=[e[t],e[n]];return e}var P=(e,n=0)=>{let t=3735928559^n,r=1103547991^n;for(let i=0,o;i<e.length;i++)o=e.charCodeAt(i),t=Math.imul(t^o,265443561),r=Math.imul(r^o,159334677);return t=Math.imul(t^r>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2009751&r)+(t>>>0)).toString()};function E(e){return e.replace(/[&<>"']/g,n=>n==="&"?"&amp;":n==="<"?"&lt;":n===">"?"&gt;":n==='"'?"&quot;":"&#39;")}function qo(e){try{return Tr.load(e)}catch(n){throw new Error(`Invalid YAML assets:
34
+ ${n instanceof Error?n.message:String(n)}`)}}function M(e){return typeof e=="string"}function mt(e){return typeof e=="number"}function ft(e){return/^(\d{1,2}:)?\d{1,2}:\d{2}$/.test(e)}function $r(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Ve(e){return typeof e=="object"&&e!==null&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function j(e){return e.split("|").map(n=>n.trim()).filter(Boolean)}var J=e=>[...new Set(e)];var be=class extends Error{constructor(n){super(`Asset validation failed:n- ${n.join(`
35
+ - `)}`),this.name="AssetValidationError",this.issues=n}};function zo(e){let n=[];if(!Ve(e))throw new be(["Top-level assets must be an object/map like { mango: {...}, trend: {...} }"]);let t=e,r={};for(let[o,a]of Object.entries(t)){if(!o||typeof o!="string"){n.push(`Asset key must be a non-empty string (got: ${String(o)})`);continue}if(/^[a-zA-Z0-9._-]+$/.test(o)||n.push(`Asset id "${o}" has invalid chars; use letters/numbers/._-`),!Ve(a)){n.push(`Asset "${o}" must be an object (got: ${$r(a)})`);continue}let s=a,l=s.type,c=!!s.dialog;if(!M(l)){n.push(`Asset "${o}" missing string field "type"`);continue}if(!Ho(l)){n.push(`Asset "${o}" has unsupported type "${l}" (use image|video|audio|html)`);continue}switch(l){case"image":{let d=s.url;M(d)||n.push(`Asset "${o}" (image) missing "url"`);let u=s.size;u!==void 0&&!M(u)&&n.push(`Asset "${o}" (image) field "size" must be a string`),M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...M(u)?{size:u}:{}});break}case"video":{let d=s.url;M(d)||n.push(`Asset "${o}" (video) missing "url"`);let u=s.span,p;if(u!==void 0)if(!Ve(u))n.push(`Asset "${o}" (video) field "span" must be an object`);else{let h=u.from,g=u.to;!M(h)||!M(g)?n.push(`Asset "${o}" (video) span requires string "from" and "to"`):((!ft(h)||!ft(g))&&n.push(`Asset "${o}" (video) span times should look like "02:15" or "01:02:45"`),p={from:h,to:g})}M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...p?{span:p}:{}});break}case"audio":{let d=s.url;M(d)||n.push(`Asset "${o}" (audio) missing "url"`);let u=s.volume;u!==void 0&&(!mt(u)||!Number.isFinite(u)?n.push(`Asset "${o}" (audio) field "volume" must be a number`):(u<0||u>100)&&n.push(`Asset "${o}" (audio) field "volume" must be between 0 and 100`)),M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...mt(u)?{volume:u}:{}});break}case"html":{let d=s.content;if(!M(d)){n.push(`Asset "${o}" (html) missing string field "content"`);break}r[o]={id:o,type:l,dialog:c,content:d};break}case"tts":{let d=s.content;if(!M(d)){n.push(`Asset "${o}" (tts) missing string field "content"`);break}r[o]={id:o,type:l,dialog:c,content:d};break}}}if(n.length)throw new be(n);let i=Object.keys(r).sort((o,a)=>o.localeCompare(a)).map(o=>r[o]);return{assetsById:r,assetsList:i}}function Ho(e){return e==="image"||e==="video"||e==="audio"||e==="html"}var Fe={"default-light":{"--edu-bg":"247 249 252","--edu-card":"255 255 255","--edu-ink":"31 41 55","--edu-second-ink":"71 85 105","--edu-third-ink":"100 116 139","--edu-inverted-ink":"248 250 252","--edu-success":"22 163 74","--edu-error":"220 38 38","--edu-warning":"255 222 33","--edu-neutral":"14 165 233","--edu-first-accent":"49 120 198","--edu-second-accent":"245 158 11","--edu-third-accent":"236 72 153","--edu-border":"229 231 235","--edu-muted":"243 244 246","--edu-radius":"0.375rem","--edu-shadow-color":"0 0 0","--edu-pad":"1rem","--edu-mar":"0"},"default-dark":{"--edu-bg":"15 23 42","--edu-card":"30 41 59","--edu-ink":"241 245 249","--edu-second-ink":"203 213 225","--edu-third-ink":"148 163 184","--edu-inverted-ink":"15 23 42","--edu-success":"74 222 128","--edu-error":"248 113 113","--edu-warning":"250 204 21","--edu-neutral":"56 189 248","--edu-first-accent":"96 165 250","--edu-second-accent":"251 191 36","--edu-third-accent":"244 114 182","--edu-border":"71 85 105","--edu-muted":"51 65 85","--edu-radius":"0.375rem","--edu-shadow-color":"2 6 23","--edu-pad":"1rem","--edu-mar":"0"},"ocean-light":{"--edu-bg":"239 246 255","--edu-card":"255 255 255","--edu-ink":"8 47 73","--edu-second-ink":"14 116 144","--edu-third-ink":"8 145 178","--edu-inverted-ink":"239 246 255","--edu-success":"5 150 105","--edu-error":"225 29 72","--edu-warning":"245 158 11","--edu-neutral":"2 132 199","--edu-first-accent":"6 182 212","--edu-second-accent":"59 130 246","--edu-third-accent":"14 165 233","--edu-border":"186 230 253","--edu-muted":"224 242 254","--edu-radius":"0.5rem","--edu-shadow-color":"8 47 73","--edu-pad":"1rem","--edu-mar":"0"},"ocean-dark":{"--edu-bg":"8 47 73","--edu-card":"12 74 110","--edu-ink":"236 254 255","--edu-second-ink":"165 243 252","--edu-third-ink":"103 232 249","--edu-inverted-ink":"8 47 73","--edu-success":"52 211 153","--edu-error":"251 113 133","--edu-warning":"251 191 36","--edu-neutral":"34 211 238","--edu-first-accent":"103 232 249","--edu-second-accent":"56 189 248","--edu-third-accent":"45 212 191","--edu-border":"14 116 144","--edu-muted":"14 116 144","--edu-radius":"0.5rem","--edu-shadow-color":"8 47 73","--edu-pad":"1rem","--edu-mar":"0"},"forest-light":{"--edu-bg":"240 253 244","--edu-card":"255 255 255","--edu-ink":"20 83 45","--edu-second-ink":"22 101 52","--edu-third-ink":"74 124 89","--edu-inverted-ink":"240 253 244","--edu-success":"22 163 74","--edu-error":"220 38 38","--edu-warning":"234 179 8","--edu-neutral":"34 197 94","--edu-first-accent":"34 197 94","--edu-second-accent":"132 204 22","--edu-third-accent":"16 185 129","--edu-border":"187 247 208","--edu-muted":"220 252 231","--edu-radius":"0.5rem","--edu-shadow-color":"20 83 45","--edu-pad":"1rem","--edu-mar":"0"},"forest-dark":{"--edu-bg":"20 83 45","--edu-card":"22 101 52","--edu-ink":"240 253 244","--edu-second-ink":"187 247 208","--edu-third-ink":"134 239 172","--edu-inverted-ink":"20 83 45","--edu-success":"74 222 128","--edu-error":"248 113 113","--edu-warning":"250 204 21","--edu-neutral":"74 222 128","--edu-first-accent":"134 239 172","--edu-second-accent":"190 242 100","--edu-third-accent":"52 211 153","--edu-border":"34 197 94","--edu-muted":"21 128 61","--edu-radius":"0.5rem","--edu-shadow-color":"20 83 45","--edu-pad":"1rem","--edu-mar":"0"}},bt=Fe["default-light"],y={audioBaseUrl:null,soundFiles:{},injectThemeVariables:!0,theme:null,themeVariables:{}},Ar="cognikit-theme-variables";function No(e){e.audioBaseUrl!==void 0&&(y.audioBaseUrl=e.audioBaseUrl),e.soundFiles&&(y.soundFiles={...y.soundFiles,...e.soundFiles}),e.injectThemeVariables!==void 0&&(y.injectThemeVariables=e.injectThemeVariables),e.theme!==void 0&&(y.theme=e.theme),e.themeVariables===null&&(y.themeVariables={}),e.themeVariables&&(y.themeVariables={...y.themeVariables,...e.themeVariables}),je()}function Go(){return y}function Oo(){return Fe}function Mr(e=y.theme,n=y.themeVariables){return{...e?Fe[e]:bt,...n}}function Vo(e,n){y.theme=e,n!==void 0&&(y.themeVariables={...n}),je()}function Fo(){y.theme=null,y.themeVariables={},je()}function je(){if(typeof document>"u")return;let e=document.getElementById(Ar);if(e||(e=document.createElement("style"),e.id=Ar,document.head.appendChild(e)),!y.injectThemeVariables){e.textContent="";return}let n=document.documentElement,t=window.getComputedStyle(n),r=Mr();if(y.theme!==null||Object.keys(y.themeVariables).length>0){e.textContent=Ir(r);return}let o=Object.entries(bt).filter(([a])=>t.getPropertyValue(a).trim()==="");e.textContent=o.length===0?"":Ir(Object.fromEntries(o))}function Lr(e,n){let t=y.soundFiles[e];return t?_r(t,y.audioBaseUrl):y.audioBaseUrl?_r(n,y.audioBaseUrl):null}function _r(e,n){return Uo(e)||e.startsWith("data:")?e:n?new URL(e,jo(n)).href:e}function jo(e){return typeof window>"u"?e:new URL(e,document.baseURI||window.location.href).href}function Uo(e){return/^https?:\/\//.test(e)}function Ir(e){return`:root {
36
36
  ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
37
37
  `)}
38
38
  }`}var U=new Map,T=e=>{let n=U.get(e.id);if(n){if(n.ctor===e.ctor)return;throw new Error(`Duplicate interaction id: "${e.id}"`)}U.set(e.id,e)},Ia=e=>U.delete(e),Ma=()=>{U.clear()},La=()=>U,Da=()=>Array.from(U.values()),Yo=e=>U.get(e)??null,Ra=(e,...n)=>{let t=Yo(e);if(!t)throw new Error(`Unknown interaction "${e}"`);return new t.ctor(...n)};var Ue=class{constructor(){this._current=0;this._total=0}initialize(n){if(n<0)throw new Error("Total must be non-negative");this._total=n,this._current=0}setCurrent(n){n<0?this._current=0:n>this._total?this._current=this._total:this._current=n}increment(){this._current<this._total&&this._current++}decrement(){this._current>0&&this._current--}reset(){this._current=0}getPercentage(){return this._total===0?0:Math.round(this._current/this._total*100)}isComplete(){return this._current===this._total&&this._total>0}get current(){return this._current}get total(){return this._total}get remaining(){return Math.max(0,this._total-this._current)}};var Ko=`
@@ -161,6 +161,7 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
161
161
 
162
162
  :host {
163
163
  display: inline-block;
164
+ container-type: size;
164
165
  --chip-color: rgb(var(--edu-first-accent));
165
166
  --chip-colored-color: #d1d1d1;
166
167
  }
@@ -168,20 +169,36 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
168
169
  :host([colored]) {
169
170
  & .chip-container { position: relative; }
170
171
 
172
+ & .content-zone {
173
+ border-color: color-mix(in srgb, var(--chip-colored-color) 55%, rgb(var(--edu-border)));
174
+ background:
175
+ linear-gradient(
176
+ 180deg,
177
+ color-mix(in srgb, var(--chip-colored-color) 18%, rgb(var(--edu-card))) 0%,
178
+ rgb(var(--edu-card)) 44%
179
+ );
180
+ box-shadow:
181
+ inset 0 4px 0 color-mix(in srgb, var(--chip-colored-color) 85%, white 15%),
182
+ 0 0 0 1px color-mix(in srgb, var(--chip-colored-color) 22%, transparent);
183
+ }
184
+
171
185
  & .chip-container::after {
172
186
  content: '';
173
187
  position: absolute;
174
- top: -2px;
175
- left: -2px;
176
- right: -2px;
177
- bottom: -2px;
188
+ top: 0.25rem;
189
+ left: 0.25rem;
190
+ right: 0.25rem;
191
+ height: 0.4rem;
178
192
  border-radius: 10px;
179
- background: var(--chip-colored-color);
180
- opacity: 0.18;
181
- mix-blend-mode: multiply;
193
+ background: color-mix(in srgb, var(--chip-colored-color) 90%, white 10%);
194
+ opacity: 0.95;
182
195
  z-index: 2;
183
196
  pointer-events: none;
184
197
  }
198
+
199
+ & .prefix {
200
+ color: color-mix(in srgb, var(--chip-colored-color) 82%, rgb(var(--edu-ink)));
201
+ }
185
202
  }
186
203
 
187
204
  :host([aria-disabled]) {
@@ -194,7 +211,8 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
194
211
  flex-direction: column;
195
212
  align-items: center;
196
213
  position: relative;
197
- width: 100%;height: 100%;
214
+ width: 100%;
215
+ height: 100%;
198
216
  }
199
217
 
200
218
  ::slotted(img.chip-image) {
@@ -228,8 +246,9 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
228
246
  border: 1px solid rgb(var(--edu-border));
229
247
  padding: 0.5rem 1rem;
230
248
  cursor: pointer;
231
- font-size: 1rem;
249
+ font-size: clamp(0.95rem, min(12cqi, 24cqb), 2.35rem);
232
250
  font-weight: 500;
251
+ line-height: 1.2;
233
252
  text-align: center;
234
253
  transition: all 0.2s ease;
235
254
  user-select: none;
@@ -267,6 +286,7 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
267
286
  align-items: center;
268
287
  justify-content: center;
269
288
  min-width: 0;
289
+ overflow-wrap: anywhere;
270
290
  }
271
291
 
272
292
  /* ==================== MODALITY ACTION BUTTON ==================== */
@@ -454,38 +474,45 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
454
474
  /* ==================== VARIANT: PLAYFUL ==================== */
455
475
 
456
476
  :host([variant="playful"]) .content-zone {
457
- background: var(--chip-color);
458
- color: rgb(var(--edu-inverted-ink));
459
- border-radius: 12px;
460
- border: none;
461
- box-shadow: 0 4px 12px rgb(var(--chip-color) / 0.3);
477
+ background:
478
+ linear-gradient(135deg, rgb(var(--edu-card)), rgb(var(--edu-muted) / 0.9));
479
+ color: rgb(var(--edu-ink));
480
+ border-radius: 14px;
481
+ border: 2px solid rgb(var(--edu-border));
482
+ box-shadow: 0 6px 14px rgb(var(--edu-shadow-color) / 0.12);
462
483
  font-weight: 600;
463
484
  }
464
485
 
465
486
  :host([variant="playful"]) .content-zone:hover:not([aria-disabled="true"]) {
466
- box-shadow: 0 6px 16px rgba(var(--chip-color), 0.4);
487
+ transform: translateY(-2px) rotate(-1deg);
488
+ border-color: rgb(var(--edu-first-accent) / 0.5);
489
+ box-shadow: 0 10px 22px rgb(var(--edu-shadow-color) / 0.18);
467
490
  }
468
491
 
469
492
  :host([variant="playful"]) .content-zone:active:not([aria-disabled="true"]) {
493
+ transform: translateY(0) rotate(0deg);
470
494
  }
471
495
 
472
496
  :host([variant="playful"]) .prefix {
473
- color: rgb(var(--edu-inverted-ink));
474
- opacity: 0.9;
497
+ color: var(--chip-color);
498
+ opacity: 1;
475
499
  }
476
500
 
477
501
  :host([variant="playful"]) .modality-action {
478
- background: rgb(var(--edu-card));
479
- color: var(--chip-color);
502
+ background: var(--chip-color);
503
+ color: rgb(var(--edu-inverted-ink));
480
504
  }
481
505
 
482
506
  :host([variant="playful"][selected]) .content-zone {
483
- box-shadow: 0 0 0 3px rgb(var(--edu-first-accent) / 0.4), 0 6px 16px rgb(var(--edu-first-accent) / 0.4);
507
+ background:
508
+ linear-gradient(135deg, rgb(var(--edu-card)), rgb(var(--edu-muted)));
509
+ border-color: var(--chip-color);
510
+ box-shadow: 0 0 0 3px rgb(var(--chip-color) / 0.22), 0 10px 22px rgb(var(--edu-shadow-color) / 0.16);
484
511
  }
485
512
 
486
513
  :host([variant="playful"]) ::slotted(img.chip-image) {
487
- border: 4px solid rgb(var(--edu-border) / 0.6);
488
- border-radius: 4px;
514
+ border: 3px solid rgb(var(--edu-border) / 0.6);
515
+ border-radius: 8px;
489
516
  }
490
517
 
491
518
 
@@ -550,7 +577,6 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
550
577
  border-radius: 2px;
551
578
  background: rgb(var(--edu-card));
552
579
  color: rgb(var(--edu-ink));
553
- font-size: 0.95rem;
554
580
  letter-spacing: 0.5px;
555
581
  }
556
582
 
@@ -578,82 +604,88 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
578
604
  /* ==================== VARIANT: MINIMAL ==================== */
579
605
 
580
606
  :host([variant="minimal"]) .content-zone {
581
- background: rgb(var(--edu-card));
607
+ background: transparent;
582
608
  border: 1px solid rgb(var(--edu-border));
583
- border-radius: 6px;
584
- color: rgb(var(--edu-ink));
585
- padding: 0.4rem 0.75rem;
586
- font-size: 0.9rem;
609
+ border-radius: 10px;
610
+ color: rgb(var(--edu-second-ink));
611
+ padding: 0.45rem 0.85rem;
587
612
  }
588
613
 
589
614
  :host([variant="minimal"]) .content-zone:hover:not([aria-disabled="true"]) {
590
- border-color: rgba(var(--chip-color), 0.5);
591
- box-shadow: 0 1px 4px rgba(var(--edu-shadow-color), 0.1);
615
+ background: rgb(var(--edu-card) / 0.8);
616
+ color: rgb(var(--edu-ink));
617
+ border-color: rgb(var(--edu-first-accent) / 0.35);
618
+ box-shadow: 0 4px 12px rgba(var(--edu-shadow-color), 0.08);
592
619
  }
593
620
 
594
621
  :host([variant="minimal"][selected]) .content-zone {
595
622
  border-color: var(--chip-color);
596
623
  background: rgba(var(--chip-color), 0.08);
624
+ color: rgb(var(--edu-ink));
597
625
  }
598
626
 
599
627
  /* ==================== VARIANT: GLASS ==================== */
600
628
 
601
629
  :host([variant="glass"]) .content-zone {
602
- background: rgb(var(--edu-card));
603
- border: 2px solid rgb(var(--edu-border));
604
- border-radius: 0;
630
+ background: rgb(var(--edu-card) / 0.65);
631
+ backdrop-filter: blur(10px);
632
+ border: 1px solid rgb(var(--edu-border) / 0.6);
633
+ border-radius: 14px;
605
634
  color: rgb(var(--edu-ink));
606
- padding: 0.5rem 1.2rem;
607
- font-weight: 700;
608
- letter-spacing: 1.5px;
609
- font-size: 0.9rem;
635
+ padding: 0.5rem 1rem;
636
+ font-weight: 600;
637
+ letter-spacing: 0.03em;
638
+ box-shadow: inset 0 1px 0 rgb(var(--edu-card) / 0.8), 0 8px 20px rgb(var(--edu-shadow-color) / 0.12);
610
639
  }
611
640
 
612
641
  :host([variant="glass"]) .content-zone:hover:not([aria-disabled="true"]) {
613
- background: var(--chip-color);
614
- color: rgb(var(--edu-inverted-ink));
615
- border-color: var(--chip-color);
642
+ background: rgb(var(--edu-card) / 0.78);
643
+ border-color: rgb(var(--edu-first-accent) / 0.45);
644
+ box-shadow: inset 0 1px 0 rgb(var(--edu-card) / 0.9), 0 12px 24px rgb(var(--edu-shadow-color) / 0.16);
616
645
  }
617
646
 
618
647
  :host([variant="glass"]) .content-zone:active:not([aria-disabled="true"]) {
619
- background: rgba(var(--chip-color), 0.9);
648
+ background: rgb(var(--edu-card) / 0.88);
620
649
  }
621
650
 
622
651
  :host([variant="glass"]) .prefix {
623
- font-weight: 800;
652
+ font-weight: 700;
653
+ color: rgb(var(--edu-first-accent));
624
654
  }
625
655
 
626
656
  :host([variant="glass"][selected]) .content-zone {
627
657
  background: rgba(var(--chip-color), 0.15);
628
658
  border-color: var(--chip-color);
629
- box-shadow: 0 0 0 2px rgba(var(--chip-color), 0.3);
659
+ box-shadow: 0 0 0 2px rgba(var(--chip-color), 0.24), inset 0 1px 0 rgb(var(--edu-card) / 0.85);
630
660
  }
631
661
 
632
662
  /* ==================== VARIANT: CARD ==================== */
633
663
 
634
664
  :host([variant="card"]) .content-zone {
635
- background: transparent;
636
- border: 2px solid rgb(var(--edu-border));
637
- border-radius: 4px;
665
+ background: rgb(var(--edu-card));
666
+ border: 1px solid rgb(var(--edu-border));
667
+ border-radius: 12px;
638
668
  color: rgb(var(--edu-ink));
669
+ box-shadow: 0 8px 18px rgb(var(--edu-shadow-color) / 0.1);
639
670
  }
640
671
 
641
672
  :host([variant="card"]) .content-zone:hover:not([aria-disabled="true"]) {
642
- background: rgb(var(--edu-muted));
643
- border-color: var(--chip-color);
673
+ background: linear-gradient(180deg, rgb(var(--edu-card)), rgb(var(--edu-muted) / 0.8));
674
+ border-color: rgb(var(--edu-first-accent) / 0.35);
675
+ box-shadow: 0 12px 24px rgb(var(--edu-shadow-color) / 0.14);
644
676
  }
645
677
 
646
678
  :host([variant="card"]) .content-zone:active:not([aria-disabled="true"]) {
647
- background: rgb(var(--edu-border));
679
+ transform: translateY(1px);
648
680
  }
649
681
 
650
682
  :host([variant="card"]) .prefix {
651
- color: var(--chip-color);
683
+ color: rgb(var(--edu-third-ink));
652
684
  }
653
685
 
654
686
  :host([variant="card"][selected]) .content-zone {
655
687
  border-color: var(--chip-color);
656
- box-shadow: 0 0 0 3px rgba(var(--chip-color), 0.2);
688
+ box-shadow: 0 0 0 3px rgba(var(--chip-color), 0.18), 0 12px 24px rgb(var(--edu-shadow-color) / 0.12);
657
689
  }
658
690
 
659
691
  /* ==================== VARIANT: SIGN ==================== */
@@ -663,9 +695,8 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
663
695
  border-radius: 0;
664
696
  color: rgb(var(--edu-ink));
665
697
  padding: 0.5rem 1.2rem;
666
- font-size: 0.9rem;
667
698
  font-weight: bold;
668
- transform: skewX(-10deg);
699
+ transform: skewX(-3deg);
669
700
  text-transform: uppercase;
670
701
  letter-spacing: 0.2rem;
671
702
  }
@@ -924,16 +955,17 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
924
955
  }
925
956
 
926
957
  .block[variant="playful"] {
927
- background: var(--accent-color);
928
- border: none;
929
- color: rgb(var(--edu-inverted-ink));
958
+ background: linear-gradient(135deg, rgb(var(--edu-card)), rgb(var(--edu-muted) / 0.92));
959
+ border: 2px solid rgb(var(--edu-border));
960
+ color: rgb(var(--edu-ink));
930
961
  border-radius: 16px;
931
- box-shadow: 2px 2px 0px rgba(var(--edu-shadow-color) / 0.2);
962
+ box-shadow: 0 6px 14px rgb(var(--edu-shadow-color) / 0.12);
932
963
  }
933
964
 
934
965
  .block[variant="playful"]:hover {
935
- transform: translateY(-2px) rotate(-2deg);
936
- box-shadow: 0 6px 16px rgba(var(--edu-first-accent), 0.4);
966
+ transform: translateY(-2px) rotate(-1deg);
967
+ border-color: color-mix(in srgb, var(--accent-color) 38%, rgb(var(--edu-border)));
968
+ box-shadow: 0 10px 22px rgb(var(--edu-shadow-color) / 0.18);
937
969
  }
938
970
 
939
971
  .block[variant="outline"] {
@@ -964,40 +996,45 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
964
996
  }
965
997
 
966
998
  .block[variant="minimal"] {
967
- background: rgb(var(--edu-card));
968
- color: rgb(var(--edu-ink));
999
+ background: transparent;
1000
+ color: rgb(var(--edu-second-ink));
969
1001
  border: 1px solid rgb(var(--edu-border));
970
- border-radius: 6px;
1002
+ border-radius: 10px;
971
1003
  padding: 0.75rem;
972
1004
  }
973
1005
 
974
1006
  .block[variant="minimal"]:hover {
975
- border-color: rgb(var(--edu-first-accent) / 0.5);
976
- box-shadow: 0 1px 4px rgba(var(--edu-shadow-color), 0.1);
1007
+ background: rgb(var(--edu-card) / 0.8);
1008
+ color: rgb(var(--edu-ink));
1009
+ border-color: rgb(var(--edu-first-accent) / 0.35);
1010
+ box-shadow: 0 4px 12px rgba(var(--edu-shadow-color), 0.08);
977
1011
  }
978
1012
 
979
1013
  .block[variant="glass"] {
980
1014
  background: rgba(var(--edu-card), 0.7);
981
1015
  backdrop-filter: blur(10px);
982
- border: 2px solid rgba(var(--edu-border), 0.35);
983
- border-radius: 12px;
1016
+ border: 1px solid rgba(var(--edu-border), 0.45);
1017
+ border-radius: 14px;
1018
+ box-shadow: inset 0 1px 0 rgb(var(--edu-card) / 0.85), 0 8px 20px rgba(var(--edu-shadow-color), 0.12);
984
1019
  }
985
1020
 
986
1021
  .block[variant="glass"]:hover {
987
- background: rgba(var(--edu-card), 0.85);
988
- border-color: rgba(var(--edu-first-accent), 0.5);
1022
+ background: rgba(var(--edu-card), 0.82);
1023
+ border-color: rgba(var(--edu-first-accent), 0.4);
1024
+ box-shadow: inset 0 1px 0 rgb(var(--edu-card) / 0.95), 0 12px 24px rgba(var(--edu-shadow-color), 0.16);
989
1025
  }
990
1026
 
991
1027
  .block[variant="card"] {
992
1028
  background: rgb(var(--edu-card));
993
- border: 2px solid rgb(var(--edu-border));
994
- border-radius: 8px;
995
- box-shadow: 0 2px 8px rgba(var(--edu-shadow-color), 0.08);
1029
+ border: 1px solid rgb(var(--edu-border));
1030
+ border-radius: 12px;
1031
+ box-shadow: 0 8px 18px rgba(var(--edu-shadow-color), 0.1);
996
1032
  }
997
1033
 
998
1034
  .block[variant="card"]:hover {
999
- border-color: rgb(var(--edu-first-accent));
1000
- box-shadow: 0 4px 12px rgba(var(--edu-shadow-color), 0.12);
1035
+ background: linear-gradient(180deg, rgb(var(--edu-card)), rgb(var(--edu-muted) / 0.8));
1036
+ border-color: rgb(var(--edu-first-accent) / 0.35);
1037
+ box-shadow: 0 12px 24px rgba(var(--edu-shadow-color), 0.14);
1001
1038
  }
1002
1039
 
1003
1040
  .block[variant="sign"] {
@@ -1013,7 +1050,7 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
1013
1050
 
1014
1051
  .block[variant="sign"]:hover {
1015
1052
  border-color: var(--accent-color);
1016
- background: var(accent-color);
1053
+ background: rgb(var(--edu-muted));
1017
1054
  }
1018
1055
 
1019
1056
  .block[variant="empty"] {
@@ -1033,10 +1070,10 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
1033
1070
  <div class="block" part="block">
1034
1071
  <slot></slot>
1035
1072
  </div>
1036
- `,Y=class extends HTMLElement{static get observedAttributes(){return["variant"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=Xo,this.$blockEl=this.shadowRoot.querySelector(".block"),L.injectKeyframes(this.shadowRoot)}connectedCallback(){this.hasAttribute("variant")||(this.variant="outline"),this.sync()}attributeChangedCallback(){this.sync()}sync(){this.$blockEl&&this.$blockEl.setAttribute("variant",this.variant)}getBlock(){return this.$blockEl}get variant(){return this.getAttribute("variant")??"outline"}set variant(n){this.setAttribute("variant",n)}setAccentColor(n){this.shadowRoot.host.style.setProperty("--accent-color",n)}removeSelf(){this.remove()}};customElements.get("edu-block")||customElements.define("edu-block",Y);function xe(e,n,t){let r=0,i=0;return e.forEach(a=>{a.items.forEach(s=>{i++;let l=n.get(s),c=t.querySelector(`[data-label="${s}"]`);l===a.label?(r++,c.chipState="correct"):c.chipState="wrong"})}),{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}var we=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="static";this.categories=["none"];this.allItems=[];this.categoryColors=["#94a3b8","#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1"];this.currentColor=this.categoryColors[0];this.data.categories.forEach(({label:o,items:a})=>{this.categories.push(o),this.allItems.push(...a)}),this.currentCategory=this.categories[0],this.data.distractors&&this.allItems.push(...this.data.distractors),this.allItems=S(this.allItems),this.categorized=new Map,this.initializeProgress(this.allItems.length)}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)})}render(){this.innerHTML=`
1073
+ `,Y=class extends HTMLElement{static get observedAttributes(){return["variant"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=Xo,this.$blockEl=this.shadowRoot.querySelector(".block"),L.injectKeyframes(this.shadowRoot)}connectedCallback(){this.hasAttribute("variant")||(this.variant="outline"),this.sync()}attributeChangedCallback(){this.sync()}sync(){this.$blockEl&&this.$blockEl.setAttribute("variant",this.variant)}getBlock(){return this.$blockEl}get variant(){return this.getAttribute("variant")??"outline"}set variant(n){this.setAttribute("variant",n)}setAccentColor(n){this.shadowRoot.host.style.setProperty("--accent-color",n)}removeSelf(){this.remove()}};customElements.get("edu-block")||customElements.define("edu-block",Y);function xe(e,n,t,r){let i=0,o=0;return e.forEach(s=>{s.items.forEach(l=>{o++;let c=n.get(l),d=t.querySelector(`[data-label="${l}"]`);c===s.label?(i++,d.chipState="correct"):d.chipState="wrong"})}),r&&r.forEach(s=>{o++;let l=n.get(s),c=t.querySelector(`[data-label="${s}"]`);l==="Invalid"?(i++,c.chipState="correct"):c.chipState="wrong"}),{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}var we=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="static";this.categories=[];this.allItems=[];this.categoryColors=["#6366f1","#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#94a3b8"];this.currentColor=this.categoryColors[0];this.data.categories.forEach(({label:o,items:a})=>{this.categories.push(o),this.allItems.push(...a)}),this.currentCategory=this.categories[0],this.data.distractors&&(this.allItems.push(...this.data.distractors),this.categories.push("Invalid")),this.allItems=S(this.allItems),this.categorized=new Map,this.initializeProgress(this.allItems.length)}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)})}render(){this.innerHTML=`
1037
1074
  <style>
1038
1075
  open-classification {
1039
- --current-color: #94a3b8;
1076
+ --current-color: #aa94b8;
1040
1077
  display: flex;
1041
1078
  width: 100%;
1042
1079
  height: 100%;
@@ -1081,7 +1118,7 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
1081
1118
  .items-container {
1082
1119
  display: grid;
1083
1120
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
1084
- grid-auto-rows: minmax(44px, 1fr);
1121
+ grid-auto-rows: minmax(clamp(56px, 12cqh, 88px), 1fr);
1085
1122
  gap: clamp(0.5rem, min(1.6cqw, 1.6cqh), 1rem);
1086
1123
  padding: clamp(0.5rem, min(1.6cqw, 1.6cqh), 1.25rem);
1087
1124
  background: rgb(var(--edu-muted));
@@ -1193,7 +1230,7 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
1193
1230
  </div>
1194
1231
  `,this.style.setProperty("--current-color",this.currentColor),this.$categoriesBar=this.querySelector("#categories-bar"),this.setCategories(this.$categoriesBar);let t=this.querySelector(".items-container");this.setItems(t)}setItems(t){this.allItems.forEach((r,i)=>{let o=document.createElement("edu-chip");o.variant=this.config.variant,o.dataset.label=r,D(r,o,this.assets?.assetsById),o.addEventListener("click",a=>{let s=a.currentTarget,l=s.dataset.label;if(this.categorized.get(l)===this.currentCategory){this.categorized.delete(l),s.colored=!1,this.decrementProgress(),this.emitStateChange();return}this.categorized.has(l)||this.incrementProgress(),this.categorized.set(l,this.currentCategory),s.color=this.currentColor,s.colored=!0,this.emitStateChange()}),t.append(o)})}setCategories(t){this.categories.forEach((r,i)=>{let o=new Y;o.variant=this.config.variant;let a=this.categoryColors[i%this.categoryColors.length];o.dataset.category=r,o.dataset.color=a,o.style.setProperty("--category-color",a),o.innerHTML=`
1195
1232
  <div class="category-label">${r}</div>
1196
- `,o.addEventListener("click",s=>{let l=s.currentTarget;this.currentCategory=l.dataset.category,this.currentColor=l.dataset.color,this.style.setProperty("--current-color",this.currentColor),t.querySelectorAll("edu-block").forEach(c=>c.classList.remove("active")),o.classList.add("active")}),r===this.currentCategory&&o.classList.add("active"),t.append(o)})}getCurrentState(){return{categorized:Object.fromEntries(this.categorized),progress:this.progressTracker.current}}isInteractionComplete(){if(this.categorized.size!==this.allItems.length)return!1;for(let t of this.categorized.values())if(t==null)return!1;return!0}onHint(){let t=this.allItems.filter(i=>!this.categorized.has(i));if(t.length===0){alert('All items are categorized! Click "Check" to submit.'),this.emitHintShown("All items categorized");return}let r=t[0];alert(`Hint: You haven't categorized "${r}" yet. Which category does it belong to?`),this.emitHintShown(`Uncategorized item: ${r}`)}submit(){super.submit();let t=xe(this.data.categories,this.categorized,this);console.log(`Classification Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.categorized.clear(),this.querySelectorAll("edu-chip").forEach(t=>{t.classList.remove("colorized"),t.style.setProperty("--current-color","")})}};customElements.get("open-classification")||customElements.define("open-classification",we);var ye=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="automatic-sequencing";this.categories=[];this.allItems=[];this.categorized=new Map;this.zones=[];this.chips=[];this.activeChip=null;this.currentZone=null;this.isDragging=!1;this.startX=0;this.startY=0;this.offsetX=0;this.offsetY=0;this.data.categories.forEach(({label:o,items:a})=>{this.categories.push(o),this.allItems.push(...a)}),this.data.distractors&&console.warn("Found a distractor in a Sequential Classification interaction, those are not useful and will be ignored"),this.allItems=this.config.shuffle?S(this.allItems):this.allItems,this.initializeProgress(this.allItems.length),this.boundPointerMove=this.handlePointerMove.bind(this),this.boundPointerUp=this.handlePointerUp.bind(this),this.variant=this.config.variant}initialize(){window.addEventListener("pointermove",this.boundPointerMove),window.addEventListener("pointerup",this.boundPointerUp)}cleanup(){window.removeEventListener("pointermove",this.boundPointerMove),window.removeEventListener("pointerup",this.boundPointerUp)}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}render(){let t=Math.min(this.categories.length,4);this.innerHTML=`
1233
+ `,o.addEventListener("click",s=>{let l=s.currentTarget;this.currentCategory=l.dataset.category,this.currentColor=l.dataset.color,this.style.setProperty("--current-color",this.currentColor),t.querySelectorAll("edu-block").forEach(c=>c.classList.remove("active")),o.classList.add("active")}),r===this.currentCategory&&o.classList.add("active"),t.append(o)})}getCurrentState(){return{categorized:Object.fromEntries(this.categorized),progress:this.progressTracker.current}}isInteractionComplete(){if(this.categorized.size!==this.allItems.length)return!1;for(let t of this.categorized.values())if(t==null)return!1;return!0}onHint(){let t=this.allItems.filter(i=>!this.categorized.has(i));if(t.length===0){alert('All items are categorized! Click "Check" to submit.'),this.emitHintShown("All items categorized");return}let r=t[0];alert(`Hint: You haven't categorized "${r}" yet. Which category does it belong to?`),this.emitHintShown(`Uncategorized item: ${r}`)}submit(){super.submit();let t=xe(this.data.categories,this.categorized,this,this.data.distractors);console.log(`Classification Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this.categorized.clear(),this.querySelectorAll("edu-chip").forEach(t=>{t.classList.remove("colorized"),t.style.setProperty("--current-color","")})}};customElements.get("open-classification")||customElements.define("open-classification",we);var ye=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="automatic-sequencing";this.categories=[];this.allItems=[];this.categorized=new Map;this.zones=[];this.chips=[];this.activeChip=null;this.currentZone=null;this.isDragging=!1;this.startX=0;this.startY=0;this.offsetX=0;this.offsetY=0;this.data.categories.forEach(({label:o,items:a})=>{this.categories.push(o),this.allItems.push(...a)}),this.data.distractors&&console.warn("Found a distractor in a Sequential Classification interaction, those are not useful and will be ignored"),this.allItems=this.config.shuffle?S(this.allItems):this.allItems,this.initializeProgress(this.allItems.length),this.boundPointerMove=this.handlePointerMove.bind(this),this.boundPointerUp=this.handlePointerUp.bind(this),this.variant=this.config.variant}initialize(){window.addEventListener("pointermove",this.boundPointerMove),window.addEventListener("pointerup",this.boundPointerUp)}cleanup(){window.removeEventListener("pointermove",this.boundPointerMove),window.removeEventListener("pointerup",this.boundPointerUp)}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}render(){let t=Math.min(this.categories.length,4);this.innerHTML=`
1197
1234
  <style>
1198
1235
  sequential-classification {
1199
1236
  display: flex;
@@ -1275,6 +1312,7 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
1275
1312
  gap: clamp(0.5rem, min(1.5cqw, 1.5cqh), 1rem);
1276
1313
  overflow-y: auto;
1277
1314
  overflow-x: hidden;
1315
+ scrollbar-gutter: stable;
1278
1316
  align-content: stretch;
1279
1317
  padding: clamp(0.25rem, min(1cqw, 1cqh), 0.5rem);
1280
1318
  min-height: 0;
@@ -1318,11 +1356,17 @@ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
1318
1356
 
1319
1357
  edu-chip {
1320
1358
  position: absolute;
1359
+ width: clamp(160px, 20cqw, 280px);
1360
+ max-width: calc(100% - 0.5rem);
1321
1361
  user-select: none;
1322
1362
  touch-action: none;
1323
1363
  transition: transform 0.2s ease;
1324
1364
  }
1325
1365
 
1366
+ edu-chip::part(content-zone) {
1367
+ min-height: clamp(56px, 10cqh, 88px);
1368
+ }
1369
+
1326
1370
  edu-chip:hover {
1327
1371
  transform: scale(1.05);
1328
1372
  }
@@ -1575,7 +1619,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1575
1619
  }
1576
1620
  </style>
1577
1621
  <div class="media-html">${this.mediaData}</div>
1578
- `}parseTime(t){let r=t.split(":").map(i=>parseInt(i,10));return r.length===2?r[0]*60+r[1]:r.length===3?r[0]*3600+r[1]*60+r[2]:null}};customElements.get("edu-media")||customElements.define("edu-media",xt);function zr(e,n){let t=0,r=e.data.length;e.data.forEach(a=>{let s=new Set(a.correctOptions),l=new Set(n[a.question]||[]),c=0,d=0,u=0;l.forEach(m=>{s.has(m)?c++:d++}),s.forEach(m=>{l.has(m)||u++});let p=s.size,h=c-d-u,g=Math.max(0,h/p*100);t+=g});let i=Math.round(t/r),o=0;return e.data.forEach(a=>{let s=new Set(a.correctOptions),l=new Set(n[a.question]||[]);s.size===l.size&&[...s].every(c=>l.has(c))&&o++}),{score:i,correct:o,total:r}}var ee=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="sequential";this.currentQuestionIndex=0;this.userAnswers={};this.shuffledOptions=new Map;this.isGraded=!1;this.data.data.forEach(o=>{this.userAnswers[o.question]=[],this.config.shuffle?this.shuffledOptions.set(o.question,S([...o.options])):this.shuffledOptions.set(o.question,[...o.options])}),this.variant=this.config.variant,this.initializeProgress(this.data.data.length)}get slidesCount(){return this.data.data.length}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}setSteps(t){let r=t-1;r>=0&&r<this.data.data.length&&(this.currentQuestionIndex=r,this.renderCurrentQuestion())}render(){this.innerHTML=`
1622
+ `}parseTime(t){let r=t.split(":").map(i=>parseInt(i,10));return r.length===2?r[0]*60+r[1]:r.length===3?r[0]*3600+r[1]*60+r[2]:null}};customElements.get("edu-media")||customElements.define("edu-media",xt);function zr(e,n){let t=0,r=e.data.length;e.data.forEach(a=>{let s=new Set(a.correctOptions),l=new Set(n[a.question]||[]),c=0,d=0,u=0;l.forEach(m=>{s.has(m)?c++:d++}),s.forEach(m=>{l.has(m)||u++});let p=s.size,h=c-d-u,g=Math.max(0,h/p*100);t+=g});let i=Math.round(t/r),o=0;return e.data.forEach(a=>{let s=new Set(a.correctOptions),l=new Set(n[a.question]||[]);s.size===l.size&&[...s].every(c=>l.has(c))&&o++}),{score:i,correct:o,total:r}}var ee=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="sequential";this.currentQuestionIndex=0;this.userAnswers={};this.shuffledOptions=new Map;this.isGraded=!1;this.data.data.forEach(o=>{this.userAnswers[o.question]=[],this.config.shuffle?this.shuffledOptions.set(o.question,S([...o.options,...o.correctOptions])):this.shuffledOptions.set(o.question,[...o.options,...o.correctOptions])}),this.variant=this.config.variant,this.initializeProgress(this.data.data.length)}get slidesCount(){return this.data.data.length}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}setSteps(t){let r=t-1;r>=0&&r<this.data.data.length&&(this.currentQuestionIndex=r,this.renderCurrentQuestion())}render(){this.innerHTML=`
1579
1623
  <style>
1580
1624
  mcq-interaction {
1581
1625
  display: flex;
@@ -1612,17 +1656,17 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1612
1656
  flex-shrink: 0;
1613
1657
  display: flex;
1614
1658
  flex-direction: column;
1615
- min-height: clamp(64px, 10cqh, 120px);
1616
- max-height: clamp(120px, 30cqh, 260px);
1659
+ min-height: clamp(88px, 16cqh, 160px);
1660
+ max-height: clamp(132px, 32cqh, 280px);
1617
1661
  overflow: hidden;
1618
1662
  }
1619
1663
 
1620
1664
  .question-text {
1621
1665
  padding: 0;
1622
- font-size: clamp(0.95rem, 2.4cqh, 1.2rem);
1666
+ font-size: clamp(1.05rem, 2.6cqh, 1.45rem);
1623
1667
  font-weight: 600;
1624
1668
  color: rgb(var(--edu-ink));
1625
- line-height: 1.4;
1669
+ line-height: 1.35;
1626
1670
  }
1627
1671
 
1628
1672
  .divider {
@@ -1686,7 +1730,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1686
1730
  border: none;
1687
1731
  padding: clamp(0.5rem, min(1.6cqw, 1.6cqh), 1rem);
1688
1732
  height: 100%;
1689
- max-height: clamp(120px, 30cqh, 260px);
1733
+ max-height: clamp(132px, 32cqh, 280px);
1690
1734
  overflow: auto;
1691
1735
  align-items: center;
1692
1736
  justify-content: flex-start;
@@ -1728,7 +1772,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1728
1772
  </div>
1729
1773
  </div>
1730
1774
  `,this.$modeLabel=this.querySelector(".mode-label"),this.$optionsContainer=this.querySelector(".options-container");let t=this.querySelector("#question-block");this.$questionBlock=document.createElement("edu-block"),this.$questionBlock.variant=this.config.variant,this.$questionBlock.innerHTML='<div class="question-text"></div>',t.appendChild(this.$questionBlock),this.$questionText=this.$questionBlock.querySelector(".question-text"),this.renderCurrentQuestion()}renderCurrentQuestion(){let t=this.data.data[this.currentQuestionIndex];if(!t)return;let r=t.correctOptions.length===1;this.$modeLabel.textContent=r?"Multiple Choice":"Multiple Response",Br(t.question,this.$questionText,this.assets?.assetsById);let i=this.shuffledOptions.get(t.question)||t.options;this.$optionsContainer.innerHTML="",i.forEach((o,a)=>{let s=document.createElement("edu-chip");s.variant=this.variant,s.prefix=`${a+1}:`,s.dataset.option=o,D(o,s,this.assets?.assetsById);let l=this.userAnswers[t.question]?.includes(o);if(l&&(s.selected=!0,s.classList.add("selected")),this.isGraded){let c=t.correctOptions.includes(o);l&&c?s.chipState="correct":l&&!c?s.chipState="wrong":!l&&c&&(s.chipState="missed")}this.isGraded||s.addEventListener("click",()=>{this.handleOptionClick(o,s,r)}),this.$optionsContainer.appendChild(s)})}handleOptionClick(t,r,i){let o=this.data.data[this.currentQuestionIndex],a=this.userAnswers[o.question];if(i){let s=a.includes(t);this.$optionsContainer.querySelectorAll("edu-chip").forEach(l=>{l.selected=!1,l.classList.remove("selected")}),this.userAnswers[o.question]=[],s||(r.selected=!0,r.classList.add("selected"),this.userAnswers[o.question]=[t])}else{let s=a.indexOf(t);s>-1?(a.splice(s,1),r.selected=!1,r.classList.remove("selected")):(a.push(t),r.selected=!0,r.classList.add("selected"))}this.updateProgress(),this.emitStateChange()}updateProgress(){let t=0;this.data.data.forEach(r=>{this.userAnswers[r.question]?.length>0&&t++}),this.setProgress(t)}getCurrentState(){return{...this.userAnswers}}isInteractionComplete(){return this.data.data.every(t=>this.userAnswers[t.question]?.length>0)}onHint(){let t=this.data.data[this.currentQuestionIndex];this.userAnswers[t.question]?.length>0?(alert("Hint: You've selected an answer. Review your choice and make sure it's correct before submitting."),this.emitHintShown(`Answer exists for question ${this.currentQuestionIndex+1}`)):(alert("Hint: This question requires at least one selection. Read the question carefully and choose the best answer(s)."),this.emitHintShown(`No answer selected for question ${this.currentQuestionIndex+1}`))}submit(){super.submit();let t=zr(this.data,this.userAnswers);console.log(`Recognition Score: ${t.score}% (${t.correct}/${t.total} questions fully correct)`),this.isGraded=!0,this.renderCurrentQuestion(),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.data.data.forEach(t=>{this.userAnswers[t.question]=[]}),this.isGraded=!1,this.currentQuestionIndex=0,this.renderCurrentQuestion()}};customElements.get("mcq-interaction")||customElements.define("mcq-interaction",ee);function Hs(e){let n=[],t={},r=e.split(`
1731
- `).map(s=>s.trim()).filter(Boolean),i=null,o=0;for(let s=0;s<r.length;s++){let l=r[s];if(l.startsWith("#")){i=l.substring(1).trim(),o++;continue}if(l.endsWith(";")){if(!i){t[`parse.noQuestion.line${s+1}`]=`Line ${s+1}: Found options without a preceding question (# question).`;continue}let c=l.slice(0,-1).trim(),d=c.match(/\[([^\]]+)\]/),u=[],p=c;d&&(u=d[1].split("|").map(w=>w.trim()).filter(Boolean),p=c.replace(/\[([^\]]+)\]/,"").trim());let h=p.split("|").map(b=>b.trim()).filter(Boolean),g=[...u,...h],m=new Set;for(let b of g){if(m.has(b)){t[`parse.duplicate.q${o}`]=`Question ${o}: Duplicate option "${b}" found.`;break}m.add(b)}n.push({question:i,correctOptions:u,options:g}),i=null}else t[`parse.missingSemicolon.line${s+1}`]=`Line ${s+1}: Options line must end with ';'.`}i&&(t["parse.danglingQuestion"]=`Question "${i}" has no options defined.`);let a={type:"recognition",data:n};return Object.keys(t).length>0?{data:a,errors:t}:{data:a}}function Gs(e){let n={};return!e.data||e.data.length===0?(n["validation.noQuestions"]="No questions found. Expected at least one question with format: # question\\n[correct] | incorrect;",{ok:!1,errors:n}):(e.data.forEach((t,r)=>{let i=r+1;if((!t.question||t.question.trim()==="")&&(n[`validation.emptyQuestion.q${i}`]=`Question ${i}: Question text cannot be empty.`),(!t.correctOptions||t.correctOptions.length===0)&&(n[`validation.noCorrectOptions.q${i}`]=`Question ${i}: Must have at least one correct answer. Use [correct] syntax.`),(!t.options||t.options.length<2)&&(n[`validation.insufficientOptions.q${i}`]=`Question ${i}: Must have at least 2 options (correct and incorrect).`),t.options&&t.options.forEach((o,a)=>{(!o||o.trim()==="")&&(n[`validation.emptyOption.q${i}.opt${a+1}`]=`Question ${i}, Option ${a+1}: Option text cannot be empty.`)}),t.correctOptions&&t.options&&t.correctOptions.forEach(o=>{t.options.includes(o)||(n[`validation.missingCorrectOption.q${i}`]=`Question ${i}: Correct option "${o}" not found in options array.`)}),t.options){let o=new Set;t.options.forEach(a=>{o.has(a)&&(n[`validation.duplicateOption.q${i}`]=`Question ${i}: Duplicate option "${a}" found.`),o.add(a)})}}),Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0})}function Hr(e,n,t){let r=0;for(let[a,s]of n.entries()){let l=t.querySelector(`[data-val="${a}"]`),c=e.find(d=>d.left===a);c&&c.right===s?(l.chipState="correct",r++):l.chipState="wrong"}let i=e.length,o=i>0?r/i*100:0;return console.log(`Association Score: ${o.toFixed(1)}% (${r}/${i} correct)`),{score:o,correct:r,total:i,answerKey:e,userResponse:n}}var Ee=class extends x{constructor(t,r,i,o){super(t,r,i);this.interactionMechanic="static";this.leftItems=[];this.rightItems=[];this.matched=new Map;this.matchColors=new Map;this.data.pairs.forEach(({left:a,right:s})=>{this.leftItems.push(a),this.rightItems.push(s)}),this.data.distractors&&this.rightItems.push(...this.data.distractors),this.config.shuffle&&(this.leftItems=S(this.leftItems),this.rightItems=S(this.rightItems)),this.initializeProgress(this.leftItems.length),this.currentColor=F[0]}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip").forEach(r=>{r.variant!==void 0&&(r.variant=t)})}render(){this.innerHTML=`
1775
+ `).map(s=>s.trim()).filter(Boolean),i=null,o=0;for(let s=0;s<r.length;s++){let l=r[s];if(l.startsWith("#")){i=l.substring(1).trim(),o++;continue}if(l.endsWith(";")){if(!i){t[`parse.noQuestion.line${s+1}`]=`Line ${s+1}: Found options without a preceding question (# question).`;continue}let c=l.slice(0,-1).trim(),d=c.match(/\[([^\]]+)\]/),u=[],p=c;d&&(u=d[1].split("|").map(w=>w.trim()).filter(Boolean),p=c.replace(/\[([^\]]+)\]/,"").trim());let h=p.split("|").map(b=>b.trim()).filter(Boolean),g=[...u,...h],m=new Set;for(let b of g){if(m.has(b)){t[`parse.duplicate.q${o}`]=`Question ${o}: Duplicate option "${b}" found.`;break}m.add(b)}n.push({question:i,correctOptions:u,options:g}),i=null}else t[`parse.missingSemicolon.line${s+1}`]=`Line ${s+1}: Options line must end with ';'.`}i&&(t["parse.danglingQuestion"]=`Question "${i}" has no options defined.`);let a={type:"recognition",data:n};return Object.keys(t).length>0?{data:a,errors:t}:{data:a}}function Gs(e){let n={};return!e.data||e.data.length===0?(n["validation.noQuestions"]="No questions found. Expected at least one question with format: # question\\n[correct] | incorrect;",{ok:!1,errors:n}):(e.data.forEach((t,r)=>{let i=r+1;if((!t.question||t.question.trim()==="")&&(n[`validation.emptyQuestion.q${i}`]=`Question ${i}: Question text cannot be empty.`),(!t.correctOptions||t.correctOptions.length===0)&&(n[`validation.noCorrectOptions.q${i}`]=`Question ${i}: Must have at least one correct answer. Use [correct] syntax.`),(!t.options||t.options.length<2)&&(n[`validation.insufficientOptions.q${i}`]=`Question ${i}: Must have at least 2 options (correct and incorrect).`),t.options&&t.options.forEach((o,a)=>{(!o||o.trim()==="")&&(n[`validation.emptyOption.q${i}.opt${a+1}`]=`Question ${i}, Option ${a+1}: Option text cannot be empty.`)}),t.correctOptions&&t.options&&t.correctOptions.forEach(o=>{t.options.includes(o)||(n[`validation.missingCorrectOption.q${i}`]=`Question ${i}: Correct option "${o}" not found in options array.`)}),t.options){let o=new Set;t.options.forEach(a=>{o.has(a)&&(n[`validation.duplicateOption.q${i}`]=`Question ${i}: Duplicate option "${a}" found.`),o.add(a)})}}),Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0})}function Hr(e,n,t){let r=0;for(let[a,s]of n.entries()){let l=t.querySelector(`[data-val="${a}"]`),c=e.find(d=>d.left===a);c&&c.right===s?(l.chipState="correct",r++):l.chipState="wrong"}let i=e.length,o=i>0?r/i*100:0;return console.log(`Association Score: ${o.toFixed(1)}% (${r}/${i} correct)`),{score:o,correct:r,total:i,answerKey:e,userResponse:n}}var Ce=class extends x{constructor(t,r,i,o){super(t,r,i);this.interactionMechanic="static";this.leftItems=[];this.rightItems=[];this.matched=new Map;this.matchColors=new Map;this.data.pairs.forEach(({left:a,right:s})=>{this.leftItems.push(a),this.rightItems.push(s)}),this.data.distractors&&this.rightItems.push(...this.data.distractors),this.config.shuffle&&(this.leftItems=S(this.leftItems),this.rightItems=S(this.rightItems)),this.initializeProgress(this.leftItems.length),this.currentColor=F[0]}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip").forEach(r=>{r.variant!==void 0&&(r.variant=t)})}render(){this.innerHTML=`
1732
1776
  <style>
1733
1777
  simultaneous-association {
1734
1778
  --current-color: #3b82f6;
@@ -1771,7 +1815,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1771
1815
  .items-list {
1772
1816
  display: grid;
1773
1817
  grid-template-columns: 1fr;
1774
- grid-auto-rows: minmax(44px, 1fr);
1818
+ grid-auto-rows: minmax(clamp(56px, 12cqh, 88px), 1fr);
1775
1819
  gap: clamp(0.35rem, min(1.2cqw, 1.2cqh), 0.75rem);
1776
1820
  min-height: 0;
1777
1821
  height: 100%;
@@ -1823,7 +1867,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1823
1867
  <div class="items-list" id="right-col" data-compact="${this.rightItems.length>=7}"></div>
1824
1868
  </div>
1825
1869
  </div>
1826
- `,this.$leftCol=this.querySelector("#left-col"),this.$rightCol=this.querySelector("#right-col"),this.renderItems()}renderItems(){this.leftItems.forEach((t,r)=>{let i=document.createElement("edu-chip");i.variant=this.config.variant,D(t,i,this.assets?.assetsById),i.dataset.val=t,i.addEventListener("click",o=>{let a=o.currentTarget,s=a.dataset.val;if(this.currentSelected===s){a.selected=!1,this.currentSelected="",this.currentEl=null;return}if(this.matched.get(s)){let l=this.matched.get(s),c=this.querySelector(`[data-val="${l}"]`);a.color="",a.colored=!1,c.colored=!1,c.color="",this.matched.delete(s),this.matchColors.delete(s),this.decrementProgress(),this.emitStateChange();return}this.currentSelected&&(this.currentEl.selected=!1),this.currentSelected=s,this.currentEl=a,a.selected=!0}),this.$leftCol.append(i)}),this.rightItems.forEach((t,r)=>{let i=document.createElement("edu-chip");i.variant=this.config.variant,D(t,i,this.assets?.assetsById),i.dataset.val=t,i.dataset.colorIndex=`${r+1}`,i.addEventListener("click",o=>{let a=o.currentTarget,s=a.dataset.val;if(this.currentSelected===s){this.currentSelected="",this.currentEl=null,a.selected=!1;return}if(![...this.matched.values()].includes(s)){if(this.currentSelected)if(this.leftItems.includes(this.currentSelected)&&this.rightItems.includes(s)){let c=Number(a.dataset.colorIndex)%F.length,d=F[c];this.matched.set(this.currentSelected,s),this.matchColors.set(this.currentSelected,d),a.selected=!1,this.currentEl.selected=!1,a.color=d,a.colored=!0,this.currentEl.color=d,this.currentEl.colored=!0,this.incrementProgress(),this.emitStateChange(),this.currentSelected="",this.currentEl=null;return}else this.currentEl.selected=!1;this.currentSelected=s,this.currentEl=a,a.selected=!0}}),this.$rightCol.append(i)})}getCurrentState(){return{matched:Object.fromEntries(this.matched),progress:this.progressTracker.current}}isInteractionComplete(){return this.matched.size===this.leftItems.length}onHint(){let t=this.leftItems.filter(i=>!this.matched.has(i));if(t.length===0){alert('All items are matched! Click "Check" to submit.'),this.emitHintShown("All items matched");return}let r=t[0];alert(`Hint: You haven't matched "${r}" yet. Select it from the left, then select its match from the right.`),this.emitHintShown(`Unmatched: ${r}`)}submit(){super.submit();let t=Hr(this.data.pairs,this.matched,this);this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this.matched.clear(),this.matchColors.clear(),this.currentSelected="",this.currentEl=null,this.querySelectorAll("edu-chip").forEach(t=>{t.classList.remove("colorized","selected"),t.style.setProperty("--current-color","")})}};customElements.get("simultaneous-association")||customElements.define("simultaneous-association",Ee);var te=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._recalledItems=new Set;this.initializeProgress(t.items.length)}initialize(){}cleanup(){}onVariantChange(t){this._$textInput&&(this._$textInput.variant=t),this._$addButton&&(this._$addButton.variant=t),this._$chipsContainer?.querySelectorAll("edu-chip").forEach(r=>{r.variant=t})}render(){this.innerHTML=`
1870
+ `,this.$leftCol=this.querySelector("#left-col"),this.$rightCol=this.querySelector("#right-col"),this.renderItems()}renderItems(){this.leftItems.forEach((t,r)=>{let i=document.createElement("edu-chip");i.variant=this.config.variant,D(t,i,this.assets?.assetsById),i.dataset.val=t,i.addEventListener("click",o=>{let a=o.currentTarget,s=a.dataset.val;if(this.currentSelected===s){a.selected=!1,this.currentSelected="",this.currentEl=null;return}if(this.matched.get(s)){let l=this.matched.get(s),c=this.querySelector(`[data-val="${l}"]`);a.color="",a.colored=!1,c.colored=!1,c.color="",this.matched.delete(s),this.matchColors.delete(s),this.decrementProgress(),this.emitStateChange();return}this.currentSelected&&(this.currentEl.selected=!1),this.currentSelected=s,this.currentEl=a,a.selected=!0}),this.$leftCol.append(i)}),this.rightItems.forEach((t,r)=>{let i=document.createElement("edu-chip");i.variant=this.config.variant,D(t,i,this.assets?.assetsById),i.dataset.val=t,i.dataset.colorIndex=`${r+1}`,i.addEventListener("click",o=>{let a=o.currentTarget,s=a.dataset.val;if(this.currentSelected===s){this.currentSelected="",this.currentEl=null,a.selected=!1;return}if(![...this.matched.values()].includes(s)){if(this.currentSelected)if(this.leftItems.includes(this.currentSelected)&&this.rightItems.includes(s)){let c=Number(a.dataset.colorIndex)%F.length,d=F[c];this.matched.set(this.currentSelected,s),this.matchColors.set(this.currentSelected,d),a.selected=!1,this.currentEl.selected=!1,a.color=d,a.colored=!0,this.currentEl.color=d,this.currentEl.colored=!0,this.incrementProgress(),this.emitStateChange(),this.currentSelected="",this.currentEl=null;return}else this.currentEl.selected=!1;this.currentSelected=s,this.currentEl=a,a.selected=!0}}),this.$rightCol.append(i)})}getCurrentState(){return{matched:Object.fromEntries(this.matched),progress:this.progressTracker.current}}isInteractionComplete(){return this.matched.size===this.leftItems.length}onHint(){let t=this.leftItems.filter(i=>!this.matched.has(i));if(t.length===0){alert('All items are matched! Click "Check" to submit.'),this.emitHintShown("All items matched");return}let r=t[0];alert(`Hint: You haven't matched "${r}" yet. Select it from the left, then select its match from the right.`),this.emitHintShown(`Unmatched: ${r}`)}submit(){super.submit();let t=Hr(this.data.pairs,this.matched,this);this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this.matched.clear(),this.matchColors.clear(),this.currentSelected="",this.currentEl=null,this.querySelectorAll("edu-chip").forEach(t=>{t.classList.remove("colorized","selected"),t.style.setProperty("--current-color","")})}};customElements.get("simultaneous-association")||customElements.define("simultaneous-association",Ce);var te=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._recalledItems=new Set;this.initializeProgress(t.items.length)}initialize(){}cleanup(){}onVariantChange(t){this._$textInput&&(this._$textInput.variant=t),this._$addButton&&(this._$addButton.variant=t),this._$chipsContainer?.querySelectorAll("edu-chip").forEach(r=>{r.variant=t})}render(){this.innerHTML=`
1827
1871
  <style>
1828
1872
  list-recall {
1829
1873
  display: flex;
@@ -1839,8 +1883,8 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1839
1883
  .chips-container {
1840
1884
  flex: 1;
1841
1885
  display: grid;
1842
- grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
1843
- grid-auto-rows: minmax(44px, auto);
1886
+ grid-template-columns: 1fr 1fr;
1887
+ grid-auto-rows: minmax(56px, auto);
1844
1888
  gap: clamp(0.4rem, min(1.4cqw, 1.4cqh), 0.75rem);
1845
1889
  padding: clamp(0.5rem, min(1.6cqw, 1.6cqh), 1rem);
1846
1890
  border: 2px dashed rgb(var(--edu-border));
@@ -1903,7 +1947,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1903
1947
  <edu-input type="text" placeholder="Enter an item..."></edu-input>
1904
1948
  <edu-input as="button">Add</edu-input>
1905
1949
  </div>
1906
- `,this._$chipsContainer=this.querySelector(".chips-container"),this._$textInput=this.querySelector('edu-input[type="text"]'),this._$addButton=this.querySelector('edu-input[as="button"]'),this._$textInput.variant=this.config.variant,this._$addButton.variant=this.config.variant,this._$addButton.addEventListener("click",()=>this.handleAddItem()),this._$textInput.addEventListener("keydown",t=>{t.key==="Enter"&&(t.preventDefault(),this.handleAddItem())})}handleAddItem(){let t=this._$textInput.value.trim();if(!t)return;let r=t.toLowerCase();if(this._recalledItems.has(r)){alert("You have already added this item."),this._$textInput.value="";return}if(this._recalledItems.size>=this.data.items.length){alert(`You can only add up to ${this.data.items.length} items.`),this._$textInput.value="";return}this._recalledItems.add(r),this.addChip(t),this._$textInput.value="",this.setProgress(this._recalledItems.size),this.emitStateChange()}addChip(t){let r=document.createElement("edu-chip");r.textContent=t,r.variant=this.config.variant,r.value=t.toLowerCase(),r.addEventListener("click",()=>{let i=r.value;this._recalledItems.delete(i),r.remove(),this.setProgress(this._recalledItems.size),this.emitStateChange()}),this._$chipsContainer.appendChild(r)}getCurrentState(){return Array.from(this._recalledItems)}isInteractionComplete(){return this._recalledItems.size===this.data.items.length}onHint(){let t=this._recalledItems.size,r=this.data.items.length;t===0?(alert(`Hint: Try to recall all ${r} items from memory.`),this.emitHintShown("No items recalled yet")):t<r?(alert(`Hint: You've recalled ${t} out of ${r} items. Keep going!`),this.emitHintShown(`${t}/${r} items recalled`)):(alert(`Great! You've recalled all items. Click "Check" to submit.`),this.emitHintShown("All items recalled"))}submit(){super.submit();let t=this.gradeRecall();console.log(`List Recall Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.applyGradingFeedback(t),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}gradeRecall(){let t=this.data.items.map(s=>s.toLowerCase()),r=Array.from(this._recalledItems),i=0;for(let s of r)t.includes(s)&&i++;let o=this.data.items.length;return{score:o>0?Math.round(i/o*100):0,correct:i,total:o,answerKey:this.data.items,userResponse:r}}applyGradingFeedback(t){let r=this.data.items.map(o=>o.toLowerCase());this._$chipsContainer.querySelectorAll("edu-chip").forEach(o=>{let a=o.value;r.includes(a)?o.chipState="correct":o.chipState="wrong"})}reset(){super.reset(),this._recalledItems.clear(),this._$chipsContainer.innerHTML="";let t=this._$textInput.querySelector(".control");t&&(t.value=""),this.setProgress(0)}};customElements.get("list-recall")||customElements.define("list-recall",te);function sl(e){let n=[],t=[],r=new Map,i={},o=/^\s*(?<category>[A-Z_](?:[A-Z0-9_]* ?[A-Z0-9_]+)*)\s*=\s*(?<items>[^;]+?)\s*;\s*$/gm,a=[...e.matchAll(o)];a.length===0&&(i["parse.noMatches"]="No valid category entries found. Expected lines like: CATEGORY = item1 | item2;");let s=new Set;for(let c of a){let d=c.groups?.category??"",u=c.groups?.items??"",p=d.trim().toLowerCase();if(r.has(p)){i[`parse.duplicateCategory.${p}`]=`Duplicate category "${p}" was defined more than once. Merge them into a single entry.`;continue}let h=u.split("|").map(g=>g.replace(/\s+/g," ").trim()).filter(Boolean);if(h.length===0){i[`parse.emptyCategory.${p}`]=`Category "${p}" has no items. Expected at least one item before ';'.`,t.push(p),r.set(p,[]);continue}t.push(p);for(let g of h)s.has(g)||(s.add(g),n.push(g));r.set(p,h)}let l={rows:n,cols:t,answerKey:r};return Object.keys(i).length>0?{data:l,errors:i}:{data:l}}function ll(e){let n={},t=[],r=new Map,i=/^\s*(?<category>[a-z_](?:[a-z0-9_]* ?[a-z0-9_]+)*)\s*=\s*(?<values>[^;]+?)\s*;/gim,o=[...e.matchAll(i)];if(o.length===0)return n["parse.noMatches"]="No valid category entries found. Expected lines like: category = val1 | val2;",{data:{rows:[],cols:[],answerKey:{}},errors:n};let a=new Set;for(let d of o){let u=d.groups?.category??"",p=d.groups?.values??"",h=u.trim().toLowerCase();if(a.has(h)){n[`parse.duplicateCategory.${h}`]=`Duplicate category "${h}" was defined more than once.`;continue}a.add(h);let g=p.split("|").map(m=>m.trim()).filter(Boolean);t.push(h),r.set(h,g)}let s=t.length;for(let d of t){let u=r.get(d)??[],p=s-1;u.length!==p&&(n[`parse.valueCount.${d}`]=`Category "${d}" has ${u.length} values, but expected ${p} (n-1 where n=${s}).`)}let l={};for(let d=0;d<t.length;d++){let u=t[d],p=r.get(u)??[];l[u]={};let h=0;for(let g=0;g<t.length;g++){if(d===g)continue;let m=t[g],b=p[h],w=null;if(b!==void 0&&b!==""){let v=Number(b);w=isNaN(v)?b:v}l[u][m]=w,h++}}let c={rows:t,cols:t,answerKey:l};return Object.keys(n).length>0?{data:c,errors:n}:{data:c}}function cl(e){let n={},t=[],r=[],i={},o=/^\s*=\s*(?<cols>[^;]+?)\s*;/m,a=e.match(o);if(!a)return n["parse.noHeader"]="Missing header line. Expected first line like: = col1 | col2 | col3;",{data:{rows:[],cols:[],answerKey:{}},errors:n};if(t=(a.groups?.cols??"").split("|").map(p=>p.trim()).filter(Boolean),t.length===0)return n["parse.emptyHeader"]='Header line has no columns. Expected at least one column after "=".',{data:{rows:[],cols:[],answerKey:{}},errors:n};let l=/^\s*(?<row>[^=]+?)\s*=\s*(?<values>[^;]+?)\s*;/gm,c=[...e.matchAll(l)],d=new Set;for(let p of c){let h=p.groups?.row??"",g=p.groups?.values??"";if(h.trim()==="")continue;let m=h.trim();if(d.has(m)){n[`parse.duplicateRow.${m}`]=`Duplicate row "${m}" was defined more than once.`;continue}d.add(m);let b=g.split("|").map(w=>w.trim()).filter(w=>w!=="");if(b.length!==t.length){n[`parse.valueCount.${m}`]=`Row "${m}" has ${b.length} values, but expected ${t.length} (matching column count).`;continue}r.push(m),i[m]={};for(let w=0;w<t.length;w++){let v=t[w],q=b[w];if(q==="-"){i[m][v]=null;continue}let K=null;if(q!==void 0&&q!==""){let Et=Number(q);K=isNaN(Et)?q:Et}i[m][v]=K}}r.length===0&&(n["parse.noRows"]="No data rows found. Expected at least one line like: row = val1 | val2;");let u={rows:r,cols:t,answerKey:i};return Object.keys(n).length>0?{data:u,errors:n}:{data:u}}function ul(e,n="classification"){let t={},r=e.answerKey;e.cols.length===0&&(t["cols.empty"]="No categories were found. Expected at least one CATEGORY = ... ; entry."),e.rows.length===0&&(t["rows.empty"]="No row items were found. Expected at least one item in any category.");for(let i of e.cols)e.rows.includes(i)&&(t[`cols.rowConflict.${i}`]=`Category "${i}" is also present as an item. Category labels cannot be used as row items.`);for(let i of e.cols){let o=r.get(i);if(!o){t[`answerKey.missing.${i}`]=`Category "${i}" has no entry in answerKey. This usually indicates a parser issue.`;continue}o.length===0&&(t[`answerKey.emptyCategory.${i}`]=`Category "${i}" has no items. Each category must include at least one item.`)}for(let[i,o]of r.entries()){let a=new Set;for(let s of o){if(a.has(s)){t[`answerKey.duplicateItem.${i}`]=`Category "${i}" includes duplicate item "${s}". Remove duplicates.`;break}a.add(s)}}if(n==="n-ary"){let i=new Map;for(let[o,a]of r.entries())for(let s of a){let l=i.get(s);l?l.push(o):i.set(s,[o])}for(let o of e.rows){let a=i.get(o)??[];if(a.length===0){t[`nary.unassigned.${o}`]=`Item "${o}" is not assigned to any category. In n-ary tables, every item must belong to exactly one category.`;continue}a.length>1&&(t[`nary.multiCategory.${o}`]=`Item "${o}" appears in multiple categories (${a.join(", ")}). In n-ary tables, items must belong to exactly one category.`)}}return Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0}}function pl(e){let n={};if(e.rows.length===0&&(n["rows.empty"]="No rows found. Expected at least one category."),e.cols.length===0&&(n["cols.empty"]="No columns found. Expected at least one category."),e.rows.length!==e.cols.length)n["symmetry.lengthMismatch"]=`Rows (${e.rows.length}) and columns (${e.cols.length}) must have the same length for adjacency tables.`;else{let t=new Set(e.rows),r=new Set(e.cols);for(let i of e.rows)r.has(i)||(n[`symmetry.rowNotInCols.${i}`]=`Row "${i}" does not appear in columns. Adjacency tables must be symmetric.`);for(let i of e.cols)t.has(i)||(n[`symmetry.colNotInRows.${i}`]=`Column "${i}" does not appear in rows. Adjacency tables must be symmetric.`)}for(let t of e.rows){if(!e.answerKey[t]){n[`answerKey.missingRow.${t}`]=`Row "${t}" has no entry in answer key.`;continue}for(let r of e.cols)if(t===r){let i=e.answerKey[t][r];i!=null&&(n[`answerKey.diagonalValue.${t}`]=`Diagonal cell (${t}, ${t}) should be empty, but has value "${i}".`)}else e.answerKey[t][r]===void 0&&(n[`answerKey.missingCell.${t}.${r}`]=`Missing value at cell (${t}, ${r}). All non-diagonal cells must have values.`)}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0}}function hl(e){let n={};e.cols.length===0&&(n["cols.empty"]="No columns found. Expected at least one column in header line."),e.rows.length===0&&(n["rows.empty"]="No rows found. Expected at least one data row.");let t=new Set(e.cols);for(let r of e.rows)t.has(r)&&(n[`naming.rowColConflict.${r}`]=`Row name "${r}" is also a column name. This creates ambiguity and should be avoided.`);for(let r of e.rows){if(!e.answerKey[r]){n[`answerKey.missingRow.${r}`]=`Row "${r}" has no entry in answer key.`;continue}for(let i of e.cols)e.answerKey[r][i]===void 0&&(n[`answerKey.missingCell.${r}.${i}`]=`Missing value at cell (${r}, ${i}). Cells must have values or be marked as disabled with '-'.`)}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0}}function Ce(e){let n=[];for(let t of Object.values(e))for(let r of Object.values(t))r!==null&&n.push(r);return n}function Ke(e){let n=Ce(e);return Array.from(new Set(n))}function We(e){let n=new Set(e.filter(t=>t!==null));return e.every(t=>t===null||typeof t=="number")?"number":n.size>0&&n.size<=10?"select":"text"}function ke(e,n){return e===null||n===null?!1:typeof e=="number"&&typeof n=="number"?Math.abs(e-n)<1e-4:String(e).trim()===String(n).trim()}function Nr(e,n,t){let r=0,i=t.length;for(let a of t){let s=n[a]?.selectedCols??[],l=null;for(let[c,d]of e.entries())if(d.includes(a)){l=c;break}s.length===1&&s[0]===l&&r++}return{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}function Gr(e,n,t,r){let i=0,o=0;for(let s of t)for(let l of r){let c=e[s]?.[l];if(c===null)continue;let d=n[s]?.values[l];o++,ke(c,d)&&i++}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function Vr(e,n,t,r){let i=0,o=0;for(let s of t){let l=new Set(n[s]?.selectedCols??[]),c=new Set;for(let[d,u]of e.entries())u.includes(s)&&c.add(d);for(let d of r){let u=c.has(d),p=l.has(d);u===p&&i++,o++}}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function Or(e,n,t){let r=0,i=0;for(let a of t)for(let s of t){if(a===s)continue;let l=e[a]?.[s],c=n[a]?.values[s];i++,ke(l,c)&&r++}return{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}function Fr(e,n,t){let r={};for(let i of t){r[i]={};for(let o of t){if(i===o)continue;let a=e[i]?.[o],s=n[i]?.values[o];s==null||s===""?r[i][o]="missed":ke(a,s)?r[i][o]="correct":r[i][o]="wrong"}}return r}function jr(e,n,t,r){let i={};for(let o of t){i[o]={};for(let a of r){let s=e[o]?.[a];if(s===null)continue;let l=n[o]?.values[a];l==null||l===""?i[o][a]="missed":ke(s,l)?i[o][a]="correct":i[o][a]="wrong"}}return i}function Ur(e,n,t,r){let i={};for(let o of t){i[o]={};let a=new Set(n[o]?.selectedCols??[]),s=new Set;for(let[l,c]of e.entries())c.includes(o)&&s.add(l);for(let l of r){let c=s.has(l),d=a.has(l);c===d?i[o][l]="correct":!d&&c?i[o][l]="missed":i[o][l]="wrong"}}return i}function Yr(e,n,t){let r={};for(let i of t){r[i]={};let o=n[i]?.selectedCols??[],a=null;for(let[s,l]of e.entries())if(l.includes(i)){a=s;break}if(o.length===1){let s=o[0];s===a?r[i][s]="correct":r[i][s]="wrong"}else o.length===0&&a&&(r[i][a]="missed")}return r}var Kr=`/* ===========================================
1950
+ `,this._$chipsContainer=this.querySelector(".chips-container"),this._$textInput=this.querySelector('edu-input[type="text"]'),this._$addButton=this.querySelector('edu-input[as="button"]'),this._$textInput.variant=this.config.variant,this._$addButton.variant=this.config.variant,this._$addButton.addEventListener("click",()=>this.handleAddItem()),this._$textInput.addEventListener("keydown",t=>{t.key==="Enter"&&(t.preventDefault(),this.handleAddItem())})}handleAddItem(){let t=this._$textInput.value.trim();if(!t)return;let r=t.toLowerCase();if(this._recalledItems.has(r)){alert("You have already added this item."),this._$textInput.value="";return}if(this._recalledItems.size>=this.data.items.length){alert(`You can only add up to ${this.data.items.length} items.`),this._$textInput.value="";return}this._recalledItems.add(r),this.addChip(t),this._$textInput.value="",this.setProgress(this._recalledItems.size),this.emitStateChange()}addChip(t){let r=document.createElement("edu-chip");r.textContent=t,r.variant=this.config.variant,r.value=t.toLowerCase(),r.addEventListener("click",()=>{let i=r.value;this._recalledItems.delete(i),r.remove(),this.setProgress(this._recalledItems.size),this.emitStateChange()}),this._$chipsContainer.appendChild(r)}getCurrentState(){return Array.from(this._recalledItems)}isInteractionComplete(){return this._recalledItems.size===this.data.items.length}onHint(){let t=this._recalledItems.size,r=this.data.items.length;t===0?(alert(`Hint: Try to recall all ${r} items from memory.`),this.emitHintShown("No items recalled yet")):t<r?(alert(`Hint: You've recalled ${t} out of ${r} items. Keep going!`),this.emitHintShown(`${t}/${r} items recalled`)):(alert(`Great! You've recalled all items. Click "Check" to submit.`),this.emitHintShown("All items recalled"))}submit(){super.submit();let t=this.gradeRecall();console.log(`List Recall Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.applyGradingFeedback(t),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}gradeRecall(){let t=this.data.items.map(s=>s.toLowerCase()),r=Array.from(this._recalledItems),i=0;for(let s of r)t.includes(s)&&i++;let o=this.data.items.length;return{score:o>0?Math.round(i/o*100):0,correct:i,total:o,answerKey:this.data.items,userResponse:r}}applyGradingFeedback(t){let r=this.data.items.map(o=>o.toLowerCase());this._$chipsContainer.querySelectorAll("edu-chip").forEach(o=>{let a=o.value;r.includes(a)?o.chipState="correct":o.chipState="wrong"})}reset(){super.reset(),this._recalledItems.clear(),this._$chipsContainer.innerHTML="";let t=this._$textInput.querySelector(".control");t&&(t.value=""),this.setProgress(0)}};customElements.get("list-recall")||customElements.define("list-recall",te);function sl(e){let n=[],t=[],r=new Map,i={},o=/^\s*(?<category>[A-Z_](?:[A-Z0-9_]* ?[A-Z0-9_]+)*)\s*=\s*(?<items>[^;]+?)\s*;\s*$/gm,a=[...e.matchAll(o)];a.length===0&&(i["parse.noMatches"]="No valid category entries found. Expected lines like: CATEGORY = item1 | item2;");let s=new Set;for(let c of a){let d=c.groups?.category??"",u=c.groups?.items??"",p=d.trim().toLowerCase();if(r.has(p)){i[`parse.duplicateCategory.${p}`]=`Duplicate category "${p}" was defined more than once. Merge them into a single entry.`;continue}let h=u.split("|").map(g=>g.replace(/\s+/g," ").trim()).filter(Boolean);if(h.length===0){i[`parse.emptyCategory.${p}`]=`Category "${p}" has no items. Expected at least one item before ';'.`,t.push(p),r.set(p,[]);continue}t.push(p);for(let g of h)s.has(g)||(s.add(g),n.push(g));r.set(p,h)}let l={rows:n,cols:t,answerKey:r};return Object.keys(i).length>0?{data:l,errors:i}:{data:l}}function ll(e){let n={},t=[],r=new Map,i=/^\s*(?<category>[a-z_](?:[a-z0-9_]* ?[a-z0-9_]+)*)\s*=\s*(?<values>[^;]+?)\s*;/gim,o=[...e.matchAll(i)];if(o.length===0)return n["parse.noMatches"]="No valid category entries found. Expected lines like: category = val1 | val2;",{data:{rows:[],cols:[],answerKey:{}},errors:n};let a=new Set;for(let d of o){let u=d.groups?.category??"",p=d.groups?.values??"",h=u.trim().toLowerCase();if(a.has(h)){n[`parse.duplicateCategory.${h}`]=`Duplicate category "${h}" was defined more than once.`;continue}a.add(h);let g=p.split("|").map(m=>m.trim()).filter(Boolean);t.push(h),r.set(h,g)}let s=t.length;for(let d of t){let u=r.get(d)??[],p=s-1;u.length!==p&&(n[`parse.valueCount.${d}`]=`Category "${d}" has ${u.length} values, but expected ${p} (n-1 where n=${s}).`)}let l={};for(let d=0;d<t.length;d++){let u=t[d],p=r.get(u)??[];l[u]={};let h=0;for(let g=0;g<t.length;g++){if(d===g)continue;let m=t[g],b=p[h],w=null;if(b!==void 0&&b!==""){let v=Number(b);w=isNaN(v)?b:v}l[u][m]=w,h++}}let c={rows:t,cols:t,answerKey:l};return Object.keys(n).length>0?{data:c,errors:n}:{data:c}}function cl(e){let n={},t=[],r=[],i={},o=/^\s*=\s*(?<cols>[^;]+?)\s*;/m,a=e.match(o);if(!a)return n["parse.noHeader"]="Missing header line. Expected first line like: = col1 | col2 | col3;",{data:{rows:[],cols:[],answerKey:{}},errors:n};if(t=(a.groups?.cols??"").split("|").map(p=>p.trim()).filter(Boolean),t.length===0)return n["parse.emptyHeader"]='Header line has no columns. Expected at least one column after "=".',{data:{rows:[],cols:[],answerKey:{}},errors:n};let l=/^\s*(?<row>[^=]+?)\s*=\s*(?<values>[^;]+?)\s*;/gm,c=[...e.matchAll(l)],d=new Set;for(let p of c){let h=p.groups?.row??"",g=p.groups?.values??"";if(h.trim()==="")continue;let m=h.trim();if(d.has(m)){n[`parse.duplicateRow.${m}`]=`Duplicate row "${m}" was defined more than once.`;continue}d.add(m);let b=g.split("|").map(w=>w.trim()).filter(w=>w!=="");if(b.length!==t.length){n[`parse.valueCount.${m}`]=`Row "${m}" has ${b.length} values, but expected ${t.length} (matching column count).`;continue}r.push(m),i[m]={};for(let w=0;w<t.length;w++){let v=t[w],q=b[w];if(q==="-"){i[m][v]=null;continue}let K=null;if(q!==void 0&&q!==""){let Ct=Number(q);K=isNaN(Ct)?q:Ct}i[m][v]=K}}r.length===0&&(n["parse.noRows"]="No data rows found. Expected at least one line like: row = val1 | val2;");let u={rows:r,cols:t,answerKey:i};return Object.keys(n).length>0?{data:u,errors:n}:{data:u}}function ul(e,n="classification"){let t={},r=e.answerKey;e.cols.length===0&&(t["cols.empty"]="No categories were found. Expected at least one CATEGORY = ... ; entry."),e.rows.length===0&&(t["rows.empty"]="No row items were found. Expected at least one item in any category.");for(let i of e.cols)e.rows.includes(i)&&(t[`cols.rowConflict.${i}`]=`Category "${i}" is also present as an item. Category labels cannot be used as row items.`);for(let i of e.cols){let o=r.get(i);if(!o){t[`answerKey.missing.${i}`]=`Category "${i}" has no entry in answerKey. This usually indicates a parser issue.`;continue}o.length===0&&(t[`answerKey.emptyCategory.${i}`]=`Category "${i}" has no items. Each category must include at least one item.`)}for(let[i,o]of r.entries()){let a=new Set;for(let s of o){if(a.has(s)){t[`answerKey.duplicateItem.${i}`]=`Category "${i}" includes duplicate item "${s}". Remove duplicates.`;break}a.add(s)}}if(n==="n-ary"){let i=new Map;for(let[o,a]of r.entries())for(let s of a){let l=i.get(s);l?l.push(o):i.set(s,[o])}for(let o of e.rows){let a=i.get(o)??[];if(a.length===0){t[`nary.unassigned.${o}`]=`Item "${o}" is not assigned to any category. In n-ary tables, every item must belong to exactly one category.`;continue}a.length>1&&(t[`nary.multiCategory.${o}`]=`Item "${o}" appears in multiple categories (${a.join(", ")}). In n-ary tables, items must belong to exactly one category.`)}}return Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0}}function pl(e){let n={};if(e.rows.length===0&&(n["rows.empty"]="No rows found. Expected at least one category."),e.cols.length===0&&(n["cols.empty"]="No columns found. Expected at least one category."),e.rows.length!==e.cols.length)n["symmetry.lengthMismatch"]=`Rows (${e.rows.length}) and columns (${e.cols.length}) must have the same length for adjacency tables.`;else{let t=new Set(e.rows),r=new Set(e.cols);for(let i of e.rows)r.has(i)||(n[`symmetry.rowNotInCols.${i}`]=`Row "${i}" does not appear in columns. Adjacency tables must be symmetric.`);for(let i of e.cols)t.has(i)||(n[`symmetry.colNotInRows.${i}`]=`Column "${i}" does not appear in rows. Adjacency tables must be symmetric.`)}for(let t of e.rows){if(!e.answerKey[t]){n[`answerKey.missingRow.${t}`]=`Row "${t}" has no entry in answer key.`;continue}for(let r of e.cols)if(t===r){let i=e.answerKey[t][r];i!=null&&(n[`answerKey.diagonalValue.${t}`]=`Diagonal cell (${t}, ${t}) should be empty, but has value "${i}".`)}else e.answerKey[t][r]===void 0&&(n[`answerKey.missingCell.${t}.${r}`]=`Missing value at cell (${t}, ${r}). All non-diagonal cells must have values.`)}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0}}function hl(e){let n={};e.cols.length===0&&(n["cols.empty"]="No columns found. Expected at least one column in header line."),e.rows.length===0&&(n["rows.empty"]="No rows found. Expected at least one data row.");let t=new Set(e.cols);for(let r of e.rows)t.has(r)&&(n[`naming.rowColConflict.${r}`]=`Row name "${r}" is also a column name. This creates ambiguity and should be avoided.`);for(let r of e.rows){if(!e.answerKey[r]){n[`answerKey.missingRow.${r}`]=`Row "${r}" has no entry in answer key.`;continue}for(let i of e.cols)e.answerKey[r][i]===void 0&&(n[`answerKey.missingCell.${r}.${i}`]=`Missing value at cell (${r}, ${i}). Cells must have values or be marked as disabled with '-'.`)}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0}}function Ee(e){let n=[];for(let t of Object.values(e))for(let r of Object.values(t))r!==null&&n.push(r);return n}function Ke(e){let n=Ee(e);return Array.from(new Set(n))}function We(e){let n=new Set(e.filter(t=>t!==null));return e.every(t=>t===null||typeof t=="number")?"number":n.size>0&&n.size<=10?"select":"text"}function ke(e,n){return e===null||n===null?!1:typeof e=="number"&&typeof n=="number"?Math.abs(e-n)<1e-4:String(e).trim()===String(n).trim()}function Nr(e,n,t){let r=0,i=t.length;for(let a of t){let s=n[a]?.selectedCols??[],l=null;for(let[c,d]of e.entries())if(d.includes(a)){l=c;break}s.length===1&&s[0]===l&&r++}return{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}function Gr(e,n,t,r){let i=0,o=0;for(let s of t)for(let l of r){let c=e[s]?.[l];if(c===null)continue;let d=n[s]?.values[l];o++,ke(c,d)&&i++}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function Or(e,n,t,r){let i=0,o=0;for(let s of t){let l=new Set(n[s]?.selectedCols??[]),c=new Set;for(let[d,u]of e.entries())u.includes(s)&&c.add(d);for(let d of r){let u=c.has(d),p=l.has(d);u===p&&i++,o++}}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function Vr(e,n,t){let r=0,i=0;for(let a of t)for(let s of t){if(a===s)continue;let l=e[a]?.[s],c=n[a]?.values[s];i++,ke(l,c)&&r++}return{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}function Fr(e,n,t){let r={};for(let i of t){r[i]={};for(let o of t){if(i===o)continue;let a=e[i]?.[o],s=n[i]?.values[o];s==null||s===""?r[i][o]="missed":ke(a,s)?r[i][o]="correct":r[i][o]="wrong"}}return r}function jr(e,n,t,r){let i={};for(let o of t){i[o]={};for(let a of r){let s=e[o]?.[a];if(s===null)continue;let l=n[o]?.values[a];l==null||l===""?i[o][a]="missed":ke(s,l)?i[o][a]="correct":i[o][a]="wrong"}}return i}function Ur(e,n,t,r){let i={};for(let o of t){i[o]={};let a=new Set(n[o]?.selectedCols??[]),s=new Set;for(let[l,c]of e.entries())c.includes(o)&&s.add(l);for(let l of r){let c=s.has(l),d=a.has(l);c===d?i[o][l]="correct":!d&&c?i[o][l]="missed":i[o][l]="wrong"}}return i}function Yr(e,n,t){let r={};for(let i of t){r[i]={};let o=n[i]?.selectedCols??[],a=null;for(let[s,l]of e.entries())if(l.includes(i)){a=s;break}if(o.length===1){let s=o[0];s===a?r[i][s]="correct":r[i][s]="wrong"}else o.length===0&&a&&(r[i][a]="missed")}return r}var Kr=`/* ===========================================
1907
1951
  BASE TABLE STYLES
1908
1952
  =========================================== */
1909
1953
 
@@ -2446,19 +2490,19 @@ input[type="radio"] {
2446
2490
  min-width: clamp(48px, 10cqw, 60px);
2447
2491
  }
2448
2492
  }
2449
- `;function re(e){return C(e)}var Qe=class extends HTMLElement{constructor(){super();this._state={};this._mounted=!1;this.onChange=t=>{let r=t.target,i=r.getAttribute?.("data-r"),o=r.getAttribute?.("data-c");if(!i||!o||!this._config)return;let a=this._config.cellKind,s=null;r instanceof HTMLInputElement&&(a==="checkbox"||a==="radio"?s=r.checked:a==="text"?s=r.value:a==="number"&&(s=r.value===""?null:Number(r.value))),r instanceof HTMLSelectElement&&(s=r.value===""?null:r.value),this.applyCellValue(i,o,s),this.emitChange(i,o,s)};this.onInput=t=>{};this.attachShadow({mode:"open"});let t=document.createElement("section");t.className="wrap",this.shadowRoot.append(t),this.$wrapEl=t}static get observedAttributes(){return["variant"]}connectedCallback(){this._mounted=!0,this.shadowRoot?.addEventListener("change",this.onChange),this.shadowRoot?.addEventListener("input",this.onInput),this.render()}disconnectedCallback(){this._mounted=!1}set config(t){this._config=t,this._state=this.initState(t),t.variant&&this.setAttribute("variant",t.variant),this.render()}get config(){if(!this._config)throw new Error("<edu-table>: spec not set");return this._config}get value(){return this._state}set value(t){this._state=t,this.render()}getValue(){return this._state}setValue(t){this._state=t,this.render()}getState(){let t=this._config;if(!t)return{};let r={};for(let i of t.rows){let o=this._state[i]??{},a=[];for(let s of t.cols){let l=o[s]??null;(t.cellKind==="checkbox"||t.cellKind==="radio")&&l===!0&&a.push(s)}r[i]={selectedCols:a,values:{...o}}}return r}attributeChangedCallback(t,r,i){r!==i&&t==="variant"&&(this.setAttribute("variant",i),this.$wrapEl.querySelectorAll("edu-input").forEach(o=>{o.setAttribute("variant",i)}))}initState(t){let r={};for(let i of t.rows){r[i]={};for(let o of t.cols)switch(t.cellKind){case"checkbox":case"radio":r[i][o]=!1;break;case"select":case"text":case"number":r[i][o]=null;break}}return r}render(){if(!this._mounted||!this.shadowRoot)return;if(!this._config){this.$wrapEl.innerHTML="<style>:host{display:block}</style><div></div>";return}let t=this._config,r=t.shuffle?S(t.cols):t.cols,i=`
2493
+ `;function re(e){return E(e)}var Qe=class extends HTMLElement{constructor(){super();this._state={};this._mounted=!1;this.onChange=t=>{let r=t.target,i=r.getAttribute?.("data-r"),o=r.getAttribute?.("data-c");if(!i||!o||!this._config)return;let a=this._config.cellKind,s=null;r instanceof HTMLInputElement&&(a==="checkbox"||a==="radio"?s=r.checked:a==="text"?s=r.value:a==="number"&&(s=r.value===""?null:Number(r.value))),r instanceof HTMLSelectElement&&(s=r.value===""?null:r.value),this.applyCellValue(i,o,s),this.emitChange(i,o,s)};this.onInput=t=>{};this.attachShadow({mode:"open"});let t=document.createElement("section");t.className="wrap",this.shadowRoot.append(t),this.$wrapEl=t}static get observedAttributes(){return["variant"]}connectedCallback(){this._mounted=!0,this.shadowRoot?.addEventListener("change",this.onChange),this.shadowRoot?.addEventListener("input",this.onInput),this.render()}disconnectedCallback(){this._mounted=!1}set config(t){this._config=t,this._state=this.initState(t),t.variant&&this.setAttribute("variant",t.variant),this.render()}get config(){if(!this._config)throw new Error("<edu-table>: spec not set");return this._config}get value(){return this._state}set value(t){this._state=t,this.render()}getValue(){return this._state}setValue(t){this._state=t,this.render()}getState(){let t=this._config;if(!t)return{};let r={};for(let i of t.rows){let o=this._state[i]??{},a=[];for(let s of t.cols){let l=o[s]??null;(t.cellKind==="checkbox"||t.cellKind==="radio")&&l===!0&&a.push(s)}r[i]={selectedCols:a,values:{...o}}}return r}attributeChangedCallback(t,r,i){r!==i&&t==="variant"&&(this.setAttribute("variant",i),this.$wrapEl.querySelectorAll("edu-input").forEach(o=>{o.setAttribute("variant",i)}))}initState(t){let r={};for(let i of t.rows){r[i]={};for(let o of t.cols)switch(t.cellKind){case"checkbox":case"radio":r[i][o]=!1;break;case"select":case"text":case"number":r[i][o]=null;break}}return r}render(){if(!this._mounted||!this.shadowRoot)return;if(!this._config){this.$wrapEl.innerHTML="<style>:host{display:block}</style><div></div>";return}let t=this._config,r=t.shuffle?S(t.cols):t.cols,i=`
2450
2494
  <tr>
2451
2495
  <th></th>
2452
- ${r.map(s=>`<th scope="col">${C(s)}</th>`).join("")}
2496
+ ${r.map(s=>`<th scope="col">${E(s)}</th>`).join("")}
2453
2497
  </tr>
2454
- `,a=(t.shuffle?S(t.rows):t.rows).map(s=>{let l=r.map(c=>this.renderCell(t,s,c)).join("");return`<tr><th scope="row">${C(s)}</th>${l}</tr>`}).join("");this.$wrapEl.innerHTML=`
2498
+ `,a=(t.shuffle?S(t.rows):t.rows).map(s=>{let l=r.map(c=>this.renderCell(t,s,c)).join("");return`<tr><th scope="row">${E(s)}</th>${l}</tr>`}).join("");this.$wrapEl.innerHTML=`
2455
2499
  <style>${Kr}</style>
2456
2500
  <table part="table">
2457
2501
  <thead>${i}</thead>
2458
2502
  <tbody>${a}</tbody>
2459
2503
  </table>
2460
2504
  `}renderCell(t,r,i){if(t.disabled?.(r,i)??!1)return'<td aria-disabled="true" class="disabled-cell"></td>';let a=`cell-${P(r)}-${P(i)}`,s=this._state[r]?.[i]??null,l=t.gradingState?.[r]?.[i],c=l?`cell-${l}`:"",d=p=>`<td class="${c}">${p}</td>`,u=`id="${a}" data-r="${re(r)}" data-c="${re(i)}"
2461
- aria-label="${re(`${r} / ${i}`)}" variant="${this.getAttribute("variant")}" `;switch(t.cellKind){case"checkbox":return d(`<input ${u} type="checkbox" ${s===!0?"checked":""}/>`);case"radio":{let p=s===!0?"checked":"";return d(`<input ${u} type="radio" name="row-${P(r)}" ${p}/>`)}case"text":{let p=s==null?"":String(s);return d(`<edu-input ${u} type="text" value="${re(p)}"/>`)}case"number":{let p=s==null?"":String(s);return d(`<edu-input ${u} type="number" value="${re(p)}"/>`)}case"select":{let p=t.allowed?.(r,i)??[],h=s==null?"":String(s),g=['<option value=""></option>',...p.map(m=>{let b=String(m),w=b===h?"selected":"";return`<option value="${re(b)}" ${w}>${C(b)}</option>`})].join("");return d(`<edu-input as="select" ${u}>${g}</select>`)}}}reset(){this._config&&(this._state=this.initState(this._config),this.render(),this.dispatchEvent(new CustomEvent("reset",{bubbles:!0,composed:!0})))}setGradingState(t){this._config&&(this._config.gradingState=t,this.render())}clearGradingState(){this._config&&(this._config.gradingState=void 0,this.render())}applyCellValue(t,r,i){let o=this._config;if(o&&!o.disabled?.(t,r)){if(o.cellKind==="select"){let a=o.allowed?.(t,r);if(a&&i!==null&&!a.some(s=>String(s)===String(i)))return}if(this._state[t]??={},this._config.cellKind==="radio"&&i===!0){for(let a of this._config.cols)this._state[t][a]=!1;this._state[t][r]=!0;return}this._state[t][r]=i}}emitChange(t,r,i){let o={row:t,col:r,value:i,state:this.getValue(),selection:this.getState()};this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,composed:!0}))}};customElements.get("edu-table")||customElements.define("edu-table",Qe);var Se=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";let i=Ce(t.answerKey),o=We(i);this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:o,preset:"lookup",disabled:(s,l)=>t.answerKey[s]?.[l]===null,allowed:o==="select"?()=>Ke(t.answerKey):void 0,variant:r.variant??"outline",shuffle:r.shuffle??!1};let a=0;for(let s of t.rows)for(let l of t.cols)t.answerKey[s]?.[l]!==null&&a++;this.initializeProgress(a)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2505
+ aria-label="${re(`${r} / ${i}`)}" variant="${this.getAttribute("variant")}" `;switch(t.cellKind){case"checkbox":return d(`<input ${u} type="checkbox" ${s===!0?"checked":""}/>`);case"radio":{let p=s===!0?"checked":"";return d(`<input ${u} type="radio" name="row-${P(r)}" ${p}/>`)}case"text":{let p=s==null?"":String(s);return d(`<edu-input ${u} type="text" value="${re(p)}"/>`)}case"number":{let p=s==null?"":String(s);return d(`<edu-input ${u} type="number" value="${re(p)}"/>`)}case"select":{let p=t.allowed?.(r,i)??[],h=s==null?"":String(s),g=['<option value=""></option>',...p.map(m=>{let b=String(m),w=b===h?"selected":"";return`<option value="${re(b)}" ${w}>${E(b)}</option>`})].join("");return d(`<edu-input as="select" ${u}>${g}</select>`)}}}reset(){this._config&&(this._state=this.initState(this._config),this.render(),this.dispatchEvent(new CustomEvent("reset",{bubbles:!0,composed:!0})))}setGradingState(t){this._config&&(this._config.gradingState=t,this.render())}clearGradingState(){this._config&&(this._config.gradingState=void 0,this.render())}applyCellValue(t,r,i){let o=this._config;if(o&&!o.disabled?.(t,r)){if(o.cellKind==="select"){let a=o.allowed?.(t,r);if(a&&i!==null&&!a.some(s=>String(s)===String(i)))return}if(this._state[t]??={},this._config.cellKind==="radio"&&i===!0){for(let a of this._config.cols)this._state[t][a]=!1;this._state[t][r]=!0;return}this._state[t][r]=i}}emitChange(t,r,i){let o={row:t,col:r,value:i,state:this.getValue(),selection:this.getState()};this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,composed:!0}))}};customElements.get("edu-table")||customElements.define("edu-table",Qe);var Se=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";let i=Ee(t.answerKey),o=We(i);this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:o,preset:"lookup",disabled:(s,l)=>t.answerKey[s]?.[l]===null,allowed:o==="select"?()=>Ke(t.answerKey):void 0,variant:r.variant??"outline",shuffle:r.shuffle??!1};let a=0;for(let s of t.rows)for(let l of t.cols)t.answerKey[s]?.[l]!==null&&a++;this.initializeProgress(a)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2462
2506
  <style>
2463
2507
  :host {
2464
2508
  display: flex;
@@ -2487,7 +2531,7 @@ input[type="radio"] {
2487
2531
  <div class="table-container">
2488
2532
  <div class="table-wrapper"></div>
2489
2533
  </div>
2490
- `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)for(let o of this.data.cols){if(this.data.answerKey[i]?.[o]===null)continue;let a=t[i]?.values[o];a!=null&&a!==""&&r++}this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(this.data.answerKey[r]?.[i]===null)continue;let o=t[r]?.values[i];if(o==null||o==="")return!1}return!0}onHint(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(this.data.answerKey[r]?.[i]===null)continue;let o=t[r]?.values[i];if(o==null||o===""){alert(`Hint: You haven't filled the cell for "${r}" / "${i}" yet.`),this.emitHintShown(`Empty cell: ${r} / ${i}`);return}}alert('All cells are complete! Click "Check" to submit.'),this.emitHintShown("All cells complete")}submit(){super.submit();let t=this.getCurrentState(),r=Gr(this.data.answerKey,t,this.data.rows,this.data.cols),i=jr(this.data.answerKey,t,this.data.rows,this.data.cols);this._$table.setGradingState(i),console.log(`Lookup Table Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("lookup-table")||customElements.define("lookup-table",Se);var Te=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:"checkbox",preset:"classification",variant:r.variant??"outline",shuffle:r.shuffle},this.initializeProgress(t.rows.length)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML="",this.appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)t[i]?.selectedCols.length>0&&r++;this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();return this.data.rows.every(r=>t[r]?.selectedCols.length>0)}onHint(){let t=this._$table.getState(),r=this.data.rows.filter(o=>!t[o]||t[o].selectedCols.length===0);if(r.length===0){alert('All rows are complete! Click "Check" to submit.'),this.emitHintShown("All rows complete");return}let i=r[0];alert(`Hint: You haven't classified "${i}" yet. Which categories does it belong to?`),this.emitHintShown(`Incomplete row: ${i}`)}submit(){super.submit();let t=this.getCurrentState(),r=Vr(this.data.answerKey,t,this.data.rows,this.data.cols),i=Ur(this.data.answerKey,t,this.data.rows,this.data.cols);this._$table.setGradingState(i),console.log(`Classification Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("classification-matrix")||customElements.define("classification-matrix",Te);var $e=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:"radio",preset:"n-ary",variant:r.variant??"outline",shuffle:!0},this.initializeProgress(t.rows.length)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2534
+ `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)for(let o of this.data.cols){if(this.data.answerKey[i]?.[o]===null)continue;let a=t[i]?.values[o];a!=null&&a!==""&&r++}this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(this.data.answerKey[r]?.[i]===null)continue;let o=t[r]?.values[i];if(o==null||o==="")return!1}return!0}onHint(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(this.data.answerKey[r]?.[i]===null)continue;let o=t[r]?.values[i];if(o==null||o===""){alert(`Hint: You haven't filled the cell for "${r}" / "${i}" yet.`),this.emitHintShown(`Empty cell: ${r} / ${i}`);return}}alert('All cells are complete! Click "Check" to submit.'),this.emitHintShown("All cells complete")}submit(){super.submit();let t=this.getCurrentState(),r=Gr(this.data.answerKey,t,this.data.rows,this.data.cols),i=jr(this.data.answerKey,t,this.data.rows,this.data.cols);this._$table.setGradingState(i),console.log(`Lookup Table Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("lookup-table")||customElements.define("lookup-table",Se);var Te=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:"checkbox",preset:"classification",variant:r.variant??"outline",shuffle:r.shuffle},this.initializeProgress(t.rows.length)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML="",this.appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)t[i]?.selectedCols.length>0&&r++;this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();return this.data.rows.every(r=>t[r]?.selectedCols.length>0)}onHint(){let t=this._$table.getState(),r=this.data.rows.filter(o=>!t[o]||t[o].selectedCols.length===0);if(r.length===0){alert('All rows are complete! Click "Check" to submit.'),this.emitHintShown("All rows complete");return}let i=r[0];alert(`Hint: You haven't classified "${i}" yet. Which categories does it belong to?`),this.emitHintShown(`Incomplete row: ${i}`)}submit(){super.submit();let t=this.getCurrentState(),r=Or(this.data.answerKey,t,this.data.rows,this.data.cols),i=Ur(this.data.answerKey,t,this.data.rows,this.data.cols);this._$table.setGradingState(i),console.log(`Classification Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("classification-matrix")||customElements.define("classification-matrix",Te);var $e=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:"radio",preset:"n-ary",variant:r.variant??"outline",shuffle:!0},this.initializeProgress(t.rows.length)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2491
2535
  <style>
2492
2536
  nary-choice-table {
2493
2537
  display: flex;
@@ -2516,7 +2560,7 @@ input[type="radio"] {
2516
2560
  <div class="table-container">
2517
2561
  <div class="table-wrapper"></div>
2518
2562
  </div>
2519
- `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)t[i]?.selectedCols.length===1&&r++;this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();return this.data.rows.every(r=>t[r]?.selectedCols.length===1)}onHint(){let t=this._$table.getState(),r=this.data.rows.filter(o=>!t[o]||t[o].selectedCols.length!==1);if(r.length===0){alert('All rows are complete! Click "Check" to submit.'),this.emitHintShown("All rows complete");return}let i=r[0];alert(`Hint: You haven't selected a category for "${i}" yet. Which one does it belong to?`),this.emitHintShown(`Incomplete row: ${i}`)}submit(){super.submit();let t=this.getCurrentState(),r=Nr(this.data.answerKey,t,this.data.rows),i=Yr(this.data.answerKey,t,this.data.rows);this._$table.setGradingState(i),console.log(`N-ary Choice Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("nary-choice-table")||customElements.define("nary-choice-table",$e);var Ae=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";let i=Ce(t.answerKey),o=We(i);this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:o,preset:"adjacency",disabled:(s,l)=>s===l,allowed:o==="select"?()=>Ke(t.answerKey):void 0,variant:r.variant??"outline",shuffle:r.shuffle??!1};let a=t.rows.length*(t.rows.length-1);this.initializeProgress(a)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2563
+ `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)t[i]?.selectedCols.length===1&&r++;this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();return this.data.rows.every(r=>t[r]?.selectedCols.length===1)}onHint(){let t=this._$table.getState(),r=this.data.rows.filter(o=>!t[o]||t[o].selectedCols.length!==1);if(r.length===0){alert('All rows are complete! Click "Check" to submit.'),this.emitHintShown("All rows complete");return}let i=r[0];alert(`Hint: You haven't selected a category for "${i}" yet. Which one does it belong to?`),this.emitHintShown(`Incomplete row: ${i}`)}submit(){super.submit();let t=this.getCurrentState(),r=Nr(this.data.answerKey,t,this.data.rows),i=Yr(this.data.answerKey,t,this.data.rows);this._$table.setGradingState(i),console.log(`N-ary Choice Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("nary-choice-table")||customElements.define("nary-choice-table",$e);var Ae=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";let i=Ee(t.answerKey),o=We(i);this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:o,preset:"adjacency",disabled:(s,l)=>s===l,allowed:o==="select"?()=>Ke(t.answerKey):void 0,variant:r.variant??"outline",shuffle:r.shuffle??!1};let a=t.rows.length*(t.rows.length-1);this.initializeProgress(a)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2520
2564
  <style>
2521
2565
  :host {
2522
2566
  display: flex;
@@ -2545,7 +2589,7 @@ input[type="radio"] {
2545
2589
  <div class="table-container">
2546
2590
  <div class="table-wrapper"></div>
2547
2591
  </div>
2548
- `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)for(let o of this.data.cols){if(i===o)continue;let a=t[i]?.values[o];a!=null&&a!==""&&r++}this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(r===i)continue;let o=t[r]?.values[i];if(o==null||o==="")return!1}return!0}onHint(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(r===i)continue;let o=t[r]?.values[i];if(o==null||o===""){alert(`Hint: You haven't filled the cell for "${r}" \u2192 "${i}" yet.`),this.emitHintShown(`Empty cell: ${r} \u2192 ${i}`);return}}alert('All cells are complete! Click "Check" to submit.'),this.emitHintShown("All cells complete")}submit(){super.submit();let t=this.getCurrentState(),r=Or(this.data.answerKey,t,this.data.rows),i=Fr(this.data.answerKey,t,this.data.rows);this._$table.setGradingState(i),console.log(`Adjacency Table Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("adjacency-table")||customElements.define("adjacency-table",Ae);var ia=/\[([^\]]+)\]/g,na=/^\s*(-?\d+)\s*(\.\.)\s*(-?\d+)\s*$/,oa=/^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])$/,aa=/^([01]\d|2[0-3]):[0-5]\d$/,Wr=e=>{let n=j(e);if(n.length===0||n.some(o=>!o))return{ok:!1,data:null,errors:{"@tx":"provide at least one non-empty answer."}};let t=J(n),r=`text-${P(e)}`,i=`<edu-input type="text" id="${r}" variant="outline" autocomplete="off"></edu-input>`;return{ok:!0,data:{type:"text",id:r,value:t,html:i},errors:null}},Qr=e=>{let t=[...e.matchAll(ia)].flatMap(c=>j(c[1])),r=e.replace(/\[|\]/g,""),i=[" ",...S(J(j(r)))];if(i.length===0)return{ok:!1,data:null,errors:{"@sl":"provide at least one option for the select."}};if(t.length===0)return{ok:!1,data:null,errors:{"@sl":"Mark at least one correct option inside of square brackets."}};let o=[...i],a=`select-${P(e)}-${Math.random().toString(36).slice(2)}`,s=o.map(c=>`<option>${c}</option>`).join(""),l=`<edu-input as="select" id="${a}" variant="outline">${s}</edu-input>`;return{ok:!0,data:{type:"select",id:a,correctOptions:t,options:i,html:l},errors:null}},Zr=e=>{let n=j(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@nm":"provide at least one non-empty option."}};let t=[],r=[];for(let a of n){let s=a.match(na);if(s){let l=parseInt(s[1],10),c=parseInt(s[3],10);if(Number.isNaN(l)||Number.isNaN(c)||l>c)return{ok:!1,data:null,errors:{"@nm":"Invalid range ${t}"}};r.push({from:l,to:c})}else{let l=Number(a.trim());if(!Number.isInteger(l))return{ok:!1,data:null,errors:{"@nm":"${t} is not an integer."}};t.push(l)}}let i=`number-${P(e)}-${Math.random().toString(36).slice(2)}`,o=`<edu-input type="number" variant="outline" id="${i}"></edu-input>`;return{ok:!0,data:{type:"number",id:i,targets:J(t),ranges:r,html:o},errors:null}},Xr=e=>{let n=j(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@dt":"provide at least one non-empty date option."}};let t=[];for(let a of n){let s=a.trim();if(!oa.test(s))return{ok:!1,data:null,errors:{"@dt":`"${s}" is not a valid date. Expected format: YYYY/MM/DD`}};t.push(s)}let r=J(t),i=`date-${P(e)}`,o=`<edu-input type="date" id="${i}" variant="outline"></edu-input>`;return{ok:!0,data:{type:"date",id:i,value:r[0],html:o},errors:null}},Jr=e=>{let n=j(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@tm":"provide at least one non-empty time option."}};let t=[];for(let a of n){let s=a.trim();if(!aa.test(s))return{ok:!1,data:null,errors:{"@tm":`"${s}" is not a valid time. Expected format: HH:MM (24-hour)`}};t.push(s)}let r=J(t),i=`time-${P(e)}`,o=`<edu-input type="time" id="${i}" variant="outline"></edu-input>`;return{ok:!0,data:{type:"time",id:i,value:r[0],html:o},errors:null}};function ei(e){return e.trim().split(";;")}var ti=["tx","nm","sl","dt","tm"],sa={tx:Wr,nm:Zr,sl:Qr,dt:Xr,tm:Jr},ri=e=>{let n=[],t=[],r={},i,o=/^\s*=\s*\[([^\]]+)\]\s*;/m,a=e.match(o);a&&(i=a[1].split("|").map(h=>h.trim().replace(/^["']|["']$/g,"")).filter(Boolean),e=e.replace(o,""));let s="",l=!1,c=null,d=0;for(;d<e.length;){let p=e[d];if(d+1<e.length&&p==="["&&e[d+1]==="["){s+="[",d+=2;continue}if(p==="["){s.trim().length>0&&(n.push(s.trim()),s=""),l=!0,c={words:[],startPos:n.length,endPos:n.length},d++;continue}if(p==="]"){if(!l){r[`at:${d}`]="Unexpected closing bracket ']' without matching opening bracket.",d++;continue}if(s.trim().length>0){let h=s.trim();c.words.push(h),n.push(h),s=""}c.words.length===0?r[`at:${d}`]="Empty brackets [] are not allowed as targets.":(c.endPos=n.length-1,t.push(c)),c=null,l=!1,d++;continue}if(p===" "||p===`
2592
+ `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)for(let o of this.data.cols){if(i===o)continue;let a=t[i]?.values[o];a!=null&&a!==""&&r++}this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(r===i)continue;let o=t[r]?.values[i];if(o==null||o==="")return!1}return!0}onHint(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(r===i)continue;let o=t[r]?.values[i];if(o==null||o===""){alert(`Hint: You haven't filled the cell for "${r}" \u2192 "${i}" yet.`),this.emitHintShown(`Empty cell: ${r} \u2192 ${i}`);return}}alert('All cells are complete! Click "Check" to submit.'),this.emitHintShown("All cells complete")}submit(){super.submit();let t=this.getCurrentState(),r=Vr(this.data.answerKey,t,this.data.rows),i=Fr(this.data.answerKey,t,this.data.rows);this._$table.setGradingState(i),console.log(`Adjacency Table Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("adjacency-table")||customElements.define("adjacency-table",Ae);var ia=/\[([^\]]+)\]/g,na=/^\s*(-?\d+)\s*(\.\.)\s*(-?\d+)\s*$/,oa=/^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])$/,aa=/^([01]\d|2[0-3]):[0-5]\d$/,Wr=e=>{let n=j(e);if(n.length===0||n.some(o=>!o))return{ok:!1,data:null,errors:{"@tx":"provide at least one non-empty answer."}};let t=J(n),r=`text-${P(e)}`,i=`<edu-input type="text" id="${r}" variant="outline" autocomplete="off"></edu-input>`;return{ok:!0,data:{type:"text",id:r,value:t,html:i},errors:null}},Qr=e=>{let t=[...e.matchAll(ia)].flatMap(c=>j(c[1])),r=e.replace(/\[|\]/g,""),i=[" ",...S(J(j(r)))];if(i.length===0)return{ok:!1,data:null,errors:{"@sl":"provide at least one option for the select."}};if(t.length===0)return{ok:!1,data:null,errors:{"@sl":"Mark at least one correct option inside of square brackets."}};let o=[...i],a=`select-${P(e)}-${Math.random().toString(36).slice(2)}`,s=o.map(c=>`<option>${c}</option>`).join(""),l=`<edu-input as="select" id="${a}" variant="outline">${s}</edu-input>`;return{ok:!0,data:{type:"select",id:a,correctOptions:t,options:i,html:l},errors:null}},Zr=e=>{let n=j(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@nm":"provide at least one non-empty option."}};let t=[],r=[];for(let a of n){let s=a.match(na);if(s){let l=parseInt(s[1],10),c=parseInt(s[3],10);if(Number.isNaN(l)||Number.isNaN(c)||l>c)return{ok:!1,data:null,errors:{"@nm":"Invalid range ${t}"}};r.push({from:l,to:c})}else{let l=Number(a.trim());if(!Number.isInteger(l))return{ok:!1,data:null,errors:{"@nm":"${t} is not an integer."}};t.push(l)}}let i=`number-${P(e)}-${Math.random().toString(36).slice(2)}`,o=`<edu-input type="number" variant="outline" id="${i}"></edu-input>`;return{ok:!0,data:{type:"number",id:i,targets:J(t),ranges:r,html:o},errors:null}},Xr=e=>{let n=j(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@dt":"provide at least one non-empty date option."}};let t=[];for(let a of n){let s=a.trim();if(!oa.test(s))return{ok:!1,data:null,errors:{"@dt":`"${s}" is not a valid date. Expected format: YYYY/MM/DD`}};t.push(s)}let r=J(t),i=`date-${P(e)}`,o=`<edu-input type="date" id="${i}" variant="outline"></edu-input>`;return{ok:!0,data:{type:"date",id:i,value:r[0],html:o},errors:null}},Jr=e=>{let n=j(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@tm":"provide at least one non-empty time option."}};let t=[];for(let a of n){let s=a.trim();if(!aa.test(s))return{ok:!1,data:null,errors:{"@tm":`"${s}" is not a valid time. Expected format: HH:MM (24-hour)`}};t.push(s)}let r=J(t),i=`time-${P(e)}`,o=`<edu-input type="time" id="${i}" variant="outline"></edu-input>`;return{ok:!0,data:{type:"time",id:i,value:r[0],html:o},errors:null}};function ei(e){return e.trim().split(";;")}var ti=["tx","nm","sl","dt","tm"],sa={tx:Wr,nm:Zr,sl:Qr,dt:Xr,tm:Jr},ri=e=>{let n=[],t=[],r={},i,o=/^\s*=\s*\[([^\]]+)\]\s*;/m,a=e.match(o);a&&(i=a[1].split("|").map(h=>h.trim().replace(/^["']|["']$/g,"")).filter(Boolean),e=e.replace(o,""));let s="",l=!1,c=null,d=0;for(;d<e.length;){let p=e[d];if(d+1<e.length&&p==="["&&e[d+1]==="["){s+="[",d+=2;continue}if(p==="["){s.trim().length>0&&(n.push(s.trim()),s=""),l=!0,c={words:[],startPos:n.length,endPos:n.length},d++;continue}if(p==="]"){if(!l){r[`at:${d}`]="Unexpected closing bracket ']' without matching opening bracket.",d++;continue}if(s.trim().length>0){let h=s.trim();c.words.push(h),n.push(h),s=""}c.words.length===0?r[`at:${d}`]="Empty brackets [] are not allowed as targets.":(c.endPos=n.length-1,t.push(c)),c=null,l=!1,d++;continue}if(p===" "||p===`
2549
2593
  `||p===" "||p==="\r"){if(s.trim().length>0){let h=s.trim();l&&c.words.push(h),n.push(h),s=""}d++;continue}s+=p,d++}if(s.trim().length>0){let p=s.trim();l&&(c.words.push(p),c.endPos=n.length,t.push(c)),n.push(p)}l&&(r.unclosed="Unclosed opening bracket '['. Expected ']'.");let u=Object.keys(r).length>0;return{ok:!u,data:{type:"base",parts:n,targets:t,...i&&{distractors:i}},errors:u?r:null}},ii=e=>{let n={},t=[],r=[],i="",o=0;for(;o<e.length;){let s=e[o];if(o+1<e.length&&s==="@"&&e[o+1]==="@"){i+="@",o+=2;continue}if(s!=="@"){if(s===" "||s===`
2550
2594
  `||s===" "||s==="\r"){i.trim().length>0&&(t.push(i.trim()),i=""),o++;continue}i+=s,o++;continue}i.trim().length>0&&(t.push(i.trim()),i="");let l=o;o++;let c="";for(;o<e.length&&/[a-z]/i.test(e[o]);)c+=e[o++];if(!c||!ti.includes(c)){n[`at:${l}`]=`Invalid element reference "@${c}". Expected one of: ${ti.join(", ")}.`;continue}if(o>=e.length||e[o]!=="("){n[`at:${l}`]=`Expected '(' after @${c} at position ${o}.`;continue}o++;let d="",u=!1;for(;o<e.length;){if(e[o]===")"){u=!0,o++;break}d+=e[o++]}if(!u){n[`at:${l}`]=`Unclosed parenthesis for @${c}. Expected ')'.`;continue}let p=sa[c];if(!p){n[`at:${l}`]=`No parser found for @${c}.`;continue}let h=p(d);if(!h.ok){n[`at:${l}`]=h.errors?JSON.stringify(h.errors):`Failed to parse @${c}(${d})`;continue}t.push(h.data.html);let g={id:h.data.id,expectedValue:h.data};r.push(g)}i.trim().length>0&&t.push(i.trim());let a=Object.keys(n).length>0;return{ok:!a,data:{type:"blanks",parts:t,targets:r},errors:a?n:null}},ni=e=>{let n=[],t={},r=new Map,i="",o=0;for(;o<e.length;){let l=e[o];if(o+1<e.length&&l==="@"&&e[o+1]==="@"){i+="@",o+=2;continue}if(l!=="@"){if(l===" "||l===`
2551
2595
  `||l===" "||l==="\r"){i.trim().length>0&&(n.push(i.trim()),i=""),o++;continue}i+=l,o++;continue}i.trim().length>0&&(n.push(i.trim()),i="");let c=o;o++;let d="";for(;o<e.length&&/[a-z]/i.test(e[o]);)d+=e[o++];if(d!=="ct"){t[`at:${c}`]=`Invalid reference "@${d}". Expected "@ct" for classification.`;continue}if(o>=e.length||e[o]!=="("){t[`at:${c}`]=`Expected '(' after @ct at position ${o}.`;continue}o++;let u="",p=!1;for(;o<e.length;){if(e[o]===")"){p=!0,o++;break}u+=e[o++]}if(!p){t[`at:${c}`]="Unclosed parenthesis for @ct. Expected ')'.";continue}let h=u.split(",").map(K=>K.trim());if(h.length!==2){t[`at:${c}`]=`Invalid @ct syntax. Expected: @ct(category, word). Got: @ct(${u})`;continue}let[g,m]=h;if(!g||!m){t[`at:${c}`]=`Category and word cannot be empty in @ct(${u}).`;continue}let b=m.split(/\s+/).filter(Boolean),w=n.length;for(let K of b)n.push(K);let v=n.length-1,q={words:b,startPos:w,endPos:v};r.has(g)||r.set(g,[]),r.get(g).push(q)}i.trim().length>0&&n.push(i.trim());let a=[];for(let[l,c]of r.entries())a.push({category:l,targets:c});let s=Object.keys(t).length>0;return{ok:!s,data:{type:"classification",parts:n,targets:a},errors:s?t:null}},la={base:ri,blanks:ii,classification:ni};function ca(e,n){let t=ei(e),r=la[n],i=[],o=[];for(let a of t){let s=r(a);if(!s.ok){s.errors&&(Array.isArray(s.errors)?o.push(...s.errors):o.push(s.errors));continue}i.push(s.data)}return o.length>0?{ok:!1,data:null,errors:o}:{ok:!0,data:i,errors:null}}function oi(e){let n={};if((!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one word."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No targets found. Text must contain at least one [target] to interact with."),e.targets&&e.targets.length>0&&e.parts&&e.parts.length>0)for(let t=0;t<e.targets.length;t++){let r=e.targets[t],i=`targets[${t}]`;if(!r.words||r.words.length===0){n[`${i}.words.empty`]=`Target ${t} has no words. Each target must contain at least one word.`;continue}if(r.startPos<0&&(n[`${i}.startPos.negative`]=`Target ${t} has negative startPos (${r.startPos}).`),r.endPos<0&&(n[`${i}.endPos.negative`]=`Target ${t} has negative endPos (${r.endPos}).`),r.startPos>r.endPos&&(n[`${i}.position.invalid`]=`Target ${t} has startPos (${r.startPos}) greater than endPos (${r.endPos}).`),r.startPos>=e.parts.length&&(n[`${i}.startPos.outOfBounds`]=`Target ${t} startPos (${r.startPos}) is out of bounds (parts length: ${e.parts.length}).`),r.endPos>=e.parts.length&&(n[`${i}.endPos.outOfBounds`]=`Target ${t} endPos (${r.endPos}) is out of bounds (parts length: ${e.parts.length}).`),r.startPos<e.parts.length&&r.endPos<e.parts.length){let o=r.endPos-r.startPos+1;r.words.length!==o&&(n[`${i}.words.countMismatch`]=`Target ${t} has ${r.words.length} words but position range indicates ${o} words.`);for(let a=0;a<r.words.length;a++){let s=r.startPos+a;if(s<e.parts.length){let l=e.parts[s],c=r.words[a];l!==c&&(n[`${i}.words[${a}].mismatch`]=`Target ${t} word "${c}" doesn't match part at position ${s}: "${l}".`)}}}}if(e.distractors)if(!Array.isArray(e.distractors))n["distractors.notArray"]="Distractors must be an array.";else{e.distractors.length===0&&(n["distractors.empty"]="Distractors array is empty. Remove distractors field or add at least one distractor.");let t=new Set;for(let r=0;r<e.distractors.length;r++){let i=e.distractors[r];t.has(i)&&(n[`distractors[${r}].duplicate`]=`Duplicate distractor found: "${i}".`),t.add(i),(!i||i.trim().length===0)&&(n[`distractors[${r}].empty`]=`Distractor at index ${r} is empty.`)}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function ai(e){let n={};(!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one part."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No targets found. Text must contain at least one input element (@tx, @nm, @sl, @dt, @tm).");let t=new Set;if(e.targets&&e.targets.length>0)for(let r=0;r<e.targets.length;r++){let i=e.targets[r],o=`targets[${r}]`;if(!i.id||i.id.trim().length===0?n[`${o}.id.empty`]=`Target ${r} has no ID. Each input element must have a unique ID.`:(t.has(i.id)&&(n[`${o}.id.duplicate`]=`Duplicate ID found: "${i.id}". Each input element must have a unique ID.`),t.add(i.id)),!i.expectedValue){n[`${o}.expectedValue.missing`]=`Target ${r} has no expectedValue. Each input element must define expected answer data.`;continue}let a=i.expectedValue;a.type||(n[`${o}.expectedValue.type.missing`]=`Target ${r} expectedValue has no type field.`),a.id||(n[`${o}.expectedValue.id.missing`]=`Target ${r} expectedValue has no id field.`),a.html||(n[`${o}.expectedValue.html.missing`]=`Target ${r} expectedValue has no html field.`);let s=a.type;if(s)switch(s){case"text":(!("value"in a)||!Array.isArray(a.value))&&(n[`${o}.expectedValue.text.value`]=`Target ${r} is type 'text' but has no valid 'value' array.`);break;case"number":"targets"in a||(n[`${o}.expectedValue.number.targets`]=`Target ${r} is type 'number' but has no 'targets' field.`);break;case"select":(!("correctOptions"in a)||!("options"in a))&&(n[`${o}.expectedValue.select.options`]=`Target ${r} is type 'select' but is missing 'correctOptions' or 'options' fields.`);break;case"date":case"time":"value"in a||(n[`${o}.expectedValue.${s}.value`]=`Target ${r} is type '${s}' but has no 'value' field.`);break}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function si(e){let n={};(!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one word."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No categories found. Text must contain at least one @ct(category, word) reference.");let t=new Set;if(e.targets&&e.targets.length>0)for(let r=0;r<e.targets.length;r++){let i=e.targets[r],o=`targets[${r}]`;if(!i.category||i.category.trim().length===0?n[`${o}.category.empty`]=`Category ${r} has no name.`:(t.has(i.category)&&(n[`${o}.category.duplicate`]=`Duplicate category found: "${i.category}". Each category must have a unique name.`),t.add(i.category)),!i.targets||i.targets.length===0){n[`${o}.targets.empty`]=`Category "${i.category}" has no targets. Each category must contain at least one word.`;continue}for(let a=0;a<i.targets.length;a++){let s=i.targets[a],l=`${o}.targets[${a}]`;if(!s.words||s.words.length===0){n[`${l}.words.empty`]=`Category "${i.category}" target ${a} has no words.`;continue}if(s.startPos<0&&(n[`${l}.startPos.negative`]=`Category "${i.category}" target ${a} has negative startPos.`),s.endPos<0&&(n[`${l}.endPos.negative`]=`Category "${i.category}" target ${a} has negative endPos.`),s.startPos>s.endPos&&(n[`${l}.position.invalid`]=`Category "${i.category}" target ${a} has startPos greater than endPos.`),e.parts&&e.parts.length>0&&(s.startPos>=e.parts.length&&(n[`${l}.startPos.outOfBounds`]=`Category "${i.category}" target ${a} startPos is out of bounds.`),s.endPos>=e.parts.length&&(n[`${l}.endPos.outOfBounds`]=`Category "${i.category}" target ${a} endPos is out of bounds.`),s.startPos<e.parts.length&&s.endPos<e.parts.length)){let c=s.endPos-s.startPos+1;s.words.length!==c&&(n[`${l}.words.countMismatch`]=`Category "${i.category}" target ${a} word count mismatch.`)}}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function da(e){switch(e.type){case"base":return oi(e);case"blanks":return ai(e);case"classification":return si(e);default:return{ok:!1,errors:{"type.invalid":`Unknown text engine type: ${e.type}`}}}}function _e(e,n){let t=new Set(n.selectedIndices??[]),r=new Set;for(let p of e.targets)for(let h=p.startPos;h<=p.endPos;h++)r.add(h);let i=0,o=0,a=0;for(let p=0;p<e.parts.length;p++){let h=r.has(p),g=t.has(p);h&&g?i++:h&&!g?a++:!h&&g&&o++}let s=r.size,l=i+o>0?i/(i+o):0,c=i+a>0?i/(i+a):0,d=l+c>0?2*l*c/(l+c):0;return{score:Math.round(d*100),correct:i,total:s}}function ua(e,n){let t=new Set,r=n.dndPlacements??{};for(let l of e.targets)for(let c=l.startPos;c<=l.endPos;c++)t.add(c);let i=0;if(Object.keys(r).length>0)for(let l of t){let c=e.parts[l],d=r[l];d&&Ze(d)===Ze(c)&&i++}else{let l=new Set(n.placedIndices??[]);for(let c of l)t.has(c)&&i++}let a=t.size;return{score:a>0?Math.round(i/a*100):0,correct:i,total:a}}function pa(e,n){let t={},r=n.dndPlacements??{};for(let i of e.targets)for(let o=i.startPos;o<=i.endPos;o++){let a=e.parts[o],s=r[o];s?Ze(s)===Ze(a)?t[o]="correct":t[o]="wrong":t[o]="missed"}return t}function Ie(e,n,t){let r=n.transformations??{},i=0,o=0;for(let s=0;s<e.targets.length;s++){let l=t[s],c=r[s];l&&(o++,c&&l.length===c.length&&l.every((u,p)=>u.toLowerCase().trim()===(c[p]||"").toLowerCase().trim())&&i++)}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function wt(e,n,t){let r=n.transformations??{},i={};for(let o=0;o<e.targets.length;o++){let a=t[o],s=r[o];if(!a){i[o]="missed";continue}if(!s||s.length===0){i[o]="missed";continue}if(a.length===s.length){let l=a.every((c,d)=>c.toLowerCase().trim()===(s[d]||"").toLowerCase().trim());i[o]=l?"correct":"wrong"}else i[o]="wrong"}return i}function Me(e,n){let t=new Set(n.selectedIndices??[]),r=new Set,i={};for(let o of e.targets)for(let a=o.startPos;a<=o.endPos;a++)r.add(a);for(let o=0;o<e.parts.length;o++){let a=r.has(o),s=t.has(o);a&&s?i[o]="correct":a&&!s?i[o]="missed":!a&&s&&(i[o]="wrong")}return i}function Le(e,n){let t=0,r=e.targets.length;for(let o of e.targets){let a=n.inputValues[o.id],s=o.expectedValue;di(s,a)&&t++}return{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}function De(e,n){let t={};for(let r of e.targets){let i=n.inputValues[r.id],o=r.expectedValue;i==null||i===""?t[r.id]="missed":di(o,i)?t[r.id]="correct":t[r.id]="wrong"}return t}function di(e,n){if(n==null||n==="")return!1;switch(e.type){case"text":{let t=String(n).toLowerCase().trim();return e.value.some(r=>r.toLowerCase().trim()===t)}case"number":{let t=Number(n);return isNaN(t)?!1:e.targets.includes(t)?!0:e.ranges?e.ranges.some(r=>t>=r.from&&t<=r.to):!1}case"select":{let t=String(n).trim();return e.correctOptions.some(r=>String(r).trim()===t)}case"date":{let t=li(String(e.value)),r=li(String(n));return t.length>0&&t===r}case"time":{let t=ci(String(e.value)),r=ci(String(n));return t.length>0&&t===r}default:return!1}}function Ze(e){return String(e).trim().toLowerCase()}function li(e){return String(e).trim().replace(/\//g,"-")}function ci(e){let n=String(e).trim(),t=n.match(/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d)?$/);return t?`${t[1]}:${t[2]}`:n}function Re(e,n){let t=0,r=0,i=new Map;for(let a of e.targets)for(let s of a.targets)for(let l=s.startPos;l<=s.endPos;l++)i.set(l,a.category),r++;for(let[a,s]of Object.entries(n.wordCategories)){let l=Number(a),c=i.get(l);c&&s===c&&t++}return{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}function Pe(e,n){let t={},r=new Map;for(let i of e.targets)for(let o of i.targets)for(let a=o.startPos;a<=o.endPos;a++)r.set(a,i.category);for(let[i,o]of r){let a=n.wordCategories[i];a?a===o?t[i]="correct":t[i]="wrong":t[i]="missed"}return t}var ui=`/* ==================== BASE STYLES ==================== */
@@ -3190,19 +3234,19 @@ slot {
3190
3234
  <div class="text-content" part="content">
3191
3235
  ${i}
3192
3236
  </div>
3193
- `}renderHighlight(t){let r=t.parts,i=this._state.selectedIndices??new Set,o=this._config.gradingState??{};return r.map((a,s)=>{let l=i.has(s),c=o[s],d=["word","word-selectable"];return l&&d.push("word-selected"),c&&d.push(`word-${c}`),`<span class="${d.join(" ")}" data-index="${s}">${C(a)}</span>`}).join(" ")}renderBlanks(t){let r=this._config.gradingState??{},i=this.getAttribute("variant")??this._config.variant??"outline";return t.parts.map((o,a)=>{if(o.startsWith("<")){let s=t.targets.find(l=>l.expectedValue.html===o);if(s){let l=r[s.id],c=l?`input-${l}`:"",d=this._state.inputValues?.[s.id]??"",u=o;if(/<edu-input\b/i.test(u)&&(u=this.upsertHtmlAttribute(u,"variant",i)),u=this.removeHtmlClassPrefix(u,"input-"),u=this.removeHtmlAttribute(u,"state"),l&&(/<edu-input\b/i.test(u)?u=this.upsertHtmlAttribute(u,"state",l):c&&(u=this.upsertHtmlClass(u,c))),d!==""){let p=C(String(d));u.includes("<edu-input")?/value="[^"]*"/.test(u)?u=u.replace(/value="[^"]*"/,`value="${p}"`):u=u.replace("<edu-input",`<edu-input value="${p}"`):u.includes("<input")&&(/value="[^"]*"/.test(u)?u=u.replace(/value="[^"]*"/,`value="${p}"`):u=u.replace("<input",`<input value="${p}"`))}return u}return o}else return`<span class="word">${C(o)}</span>`}).join(" ")}renderClassification(t){let r=t.parts,i=this._state.wordCategories??{},o=this._config.gradingState??{},a=this.getAttribute("variant")??"outline",s=t.targets.map(p=>p.category),l={},c=["--edu-first-accent","--edu-second-accent","--edu-third-accent","--edu-neutral"];s.forEach((p,h)=>{l[p]=c[h%c.length]});let d=r.map((p,h)=>{let g=i[h],m=o[h],b=["word","word-classifiable"];g&&b.push("word-assigned"),m&&b.push(`word-${m}`);let w=g?`style="--category-color: var(${l[g]})"`:"";return`
3237
+ `}renderHighlight(t){let r=t.parts,i=this._state.selectedIndices??new Set,o=this._config.gradingState??{};return r.map((a,s)=>{let l=i.has(s),c=o[s],d=["word","word-selectable"];return l&&d.push("word-selected"),c&&d.push(`word-${c}`),`<span class="${d.join(" ")}" data-index="${s}">${E(a)}</span>`}).join(" ")}renderBlanks(t){let r=this._config.gradingState??{},i=this.getAttribute("variant")??this._config.variant??"outline";return t.parts.map((o,a)=>{if(o.startsWith("<")){let s=t.targets.find(l=>l.expectedValue.html===o);if(s){let l=r[s.id],c=l?`input-${l}`:"",d=this._state.inputValues?.[s.id]??"",u=o;if(/<edu-input\b/i.test(u)&&(u=this.upsertHtmlAttribute(u,"variant",i)),u=this.removeHtmlClassPrefix(u,"input-"),u=this.removeHtmlAttribute(u,"state"),l&&(/<edu-input\b/i.test(u)?u=this.upsertHtmlAttribute(u,"state",l):c&&(u=this.upsertHtmlClass(u,c))),d!==""){let p=E(String(d));u.includes("<edu-input")?/value="[^"]*"/.test(u)?u=u.replace(/value="[^"]*"/,`value="${p}"`):u=u.replace("<edu-input",`<edu-input value="${p}"`):u.includes("<input")&&(/value="[^"]*"/.test(u)?u=u.replace(/value="[^"]*"/,`value="${p}"`):u=u.replace("<input",`<input value="${p}"`))}return u}return o}else return`<span class="word">${E(o)}</span>`}).join(" ")}renderClassification(t){let r=t.parts,i=this._state.wordCategories??{},o=this._config.gradingState??{},a=this.getAttribute("variant")??"outline",s=t.targets.map(p=>p.category),l={},c=["--edu-first-accent","--edu-second-accent","--edu-third-accent","--edu-neutral"];s.forEach((p,h)=>{l[p]=c[h%c.length]});let d=r.map((p,h)=>{let g=i[h],m=o[h],b=["word","word-classifiable"];g&&b.push("word-assigned"),m&&b.push(`word-${m}`);let w=g?`style="--category-color: var(${l[g]})"`:"";return`
3194
3238
  <span class="${b.join(" ")}" data-index="${h}" ${w}>
3195
- ${C(p)}
3239
+ ${E(p)}
3196
3240
  </span>
3197
3241
  `}).join(" "),u=`
3198
3242
  <div class="categories" part="categories">
3199
3243
  ${s.map(p=>`
3200
3244
  <edu-block class="category-btn"
3201
3245
  ${this._activeCategory===p?'data-active="true"':""}
3202
- data-category="${C(p)}"
3203
- variant="${C(a)}"
3246
+ data-category="${E(p)}"
3247
+ variant="${E(a)}"
3204
3248
  style="--category-color: var(${l[p]})">
3205
- ${C(p)}
3249
+ ${E(p)}
3206
3250
  </edu-block>
3207
3251
  `).join("")}
3208
3252
  </div>
@@ -3211,7 +3255,7 @@ slot {
3211
3255
  <div class="words" part="words">${d}</div>
3212
3256
  ${u}
3213
3257
  </div>
3214
- `}renderDND(t){let r=t.parts,i=this._state.dndPlacements??{},o=this._config.gradingState??{},a=new Set;for(let h of t.targets)for(let g=h.startPos;g<=h.endPos;g++)a.add(g);let s=r.map((h,g)=>{if(a.has(g)){let m=i[g],b=!!m,w=o[g],v=["dropzone"];b&&v.push("dropzone-filled"),w&&v.push(`dropzone-${w}`);let q=b?C(m):"";return`<span class="${v.join(" ")}" data-index="${g}">${q}</span>`}else return`<span class="word">${C(h)}</span>`}).join(" "),l=[...t.targets.flatMap(h=>h.words)];t.distractors&&l.push(...t.distractors);let c=Object.values(i),d=[...l];for(let h of c){let g=d.findIndex(m=>pi(m)===pi(h));g!==-1&&d.splice(g,1)}let p=S(d).map(h=>`<div class="chip" draggable="true" data-word="${C(h)}">${C(h)}</div>`).join("");return`
3258
+ `}renderDND(t){let r=t.parts,i=this._state.dndPlacements??{},o=this._config.gradingState??{},a=new Set;for(let h of t.targets)for(let g=h.startPos;g<=h.endPos;g++)a.add(g);let s=r.map((h,g)=>{if(a.has(g)){let m=i[g],b=!!m,w=o[g],v=["dropzone"];b&&v.push("dropzone-filled"),w&&v.push(`dropzone-${w}`);let q=b?E(m):"";return`<span class="${v.join(" ")}" data-index="${g}">${q}</span>`}else return`<span class="word">${E(h)}</span>`}).join(" "),l=[...t.targets.flatMap(h=>h.words)];t.distractors&&l.push(...t.distractors);let c=Object.values(i),d=[...l];for(let h of c){let g=d.findIndex(m=>pi(m)===pi(h));g!==-1&&d.splice(g,1)}let p=S(d).map(h=>`<div class="chip" draggable="true" data-word="${E(h)}">${E(h)}</div>`).join("");return`
3215
3259
  <div class="dnd-container">
3216
3260
  <div class="dnd-text">${s}</div>
3217
3261
  <div class="dnd-chips">${p}</div>
@@ -3220,8 +3264,8 @@ slot {
3220
3264
  <span class="${h.join(" ")}"
3221
3265
  contenteditable="true"
3222
3266
  data-target-index="${c}"
3223
- data-original="${C(s)}">${C(p)}</span>
3224
- `}else return`<span class="word">${C(s)}</span>`}).join(" ")}toggleWordSelection(t){this._state.selectedIndices||(this._state.selectedIndices=new Set),this._state.selectedIndices.has(t)?this._state.selectedIndices.delete(t):this._state.selectedIndices.add(t),this.render(),this.emitChange()}setActiveCategory(t){this._activeCategory=t,this.shadowRoot?.querySelectorAll(".category-btn").forEach(r=>{r.getAttribute("data-category")===t?(r.classList.add("category-active"),r.setAttribute("data-active","true")):(r.classList.remove("category-active"),r.removeAttribute("data-active")),r instanceof Y&&(r.variant=this.getAttribute("variant")??"outline")})}assignWordToCategory(t,r){this._state.wordCategories||(this._state.wordCategories={}),this._state.wordCategories[t]===r?delete this._state.wordCategories[t]:this._state.wordCategories[t]=r,this.render(),this.emitChange()}updateInputValue(t,r){this._state.inputValues||(this._state.inputValues={}),this._state.inputValues[t]=r,this.emitChange()}updateTransformation(t,r){this._state.transformations||(this._state.transformations={});let i=r.split(/\s+/).filter(Boolean);this._state.transformations[t]=i,this.emitChange()}placeWordInDropzone(t,r){this._state.dndPlacements||(this._state.dndPlacements={}),this._state.dndPlacements[t]=r,this.render(),this.emitChange()}clearDropzone(t){this._state.dndPlacements&&t in this._state.dndPlacements&&(delete this._state.dndPlacements[t],this.render(),this.emitChange())}emitChange(){let t={userState:this.getValue(),dataType:this._config.data.type};this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}};function pi(e){return e.trim().toLowerCase()}customElements.get("edu-text")||customElements.define("edu-text",Je);var ie=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._textConfig={data:t,mode:"highlight",variant:r.variant??"outline"},this.implementsProgress=!1}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.emitStateChange()}),this.innerHTML=`
3267
+ data-original="${E(s)}">${E(p)}</span>
3268
+ `}else return`<span class="word">${E(s)}</span>`}).join(" ")}toggleWordSelection(t){this._state.selectedIndices||(this._state.selectedIndices=new Set),this._state.selectedIndices.has(t)?this._state.selectedIndices.delete(t):this._state.selectedIndices.add(t),this.render(),this.emitChange()}setActiveCategory(t){this._activeCategory=t,this.shadowRoot?.querySelectorAll(".category-btn").forEach(r=>{r.getAttribute("data-category")===t?(r.classList.add("category-active"),r.setAttribute("data-active","true")):(r.classList.remove("category-active"),r.removeAttribute("data-active")),r instanceof Y&&(r.variant=this.getAttribute("variant")??"outline")})}assignWordToCategory(t,r){this._state.wordCategories||(this._state.wordCategories={}),this._state.wordCategories[t]===r?delete this._state.wordCategories[t]:this._state.wordCategories[t]=r,this.render(),this.emitChange()}updateInputValue(t,r){this._state.inputValues||(this._state.inputValues={}),this._state.inputValues[t]=r,this.emitChange()}updateTransformation(t,r){this._state.transformations||(this._state.transformations={});let i=r.split(/\s+/).filter(Boolean);this._state.transformations[t]=i,this.emitChange()}placeWordInDropzone(t,r){this._state.dndPlacements||(this._state.dndPlacements={}),this._state.dndPlacements[t]=r,this.render(),this.emitChange()}clearDropzone(t){this._state.dndPlacements&&t in this._state.dndPlacements&&(delete this._state.dndPlacements[t],this.render(),this.emitChange())}emitChange(){let t={userState:this.getValue(),dataType:this._config.data.type};this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}};function pi(e){return e.trim().toLowerCase()}customElements.get("edu-text")||customElements.define("edu-text",Je);var ie=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._textConfig={data:t,mode:"highlight",variant:r.variant??"outline"},this.implementsProgress=!1}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.emitStateChange()}),this.innerHTML=`
3225
3269
  <style>
3226
3270
  mark-the-words {
3227
3271
  display: flex;
@@ -3461,7 +3505,7 @@ slot {
3461
3505
  <div class="text-wrapper"></div>
3462
3506
  </div>
3463
3507
  `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+r.targets.length,0)}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{inputValues:{}}}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],a=this.getResponseForStep(r).inputValues??{};t+=i.targets.filter(s=>{let l=a[s.id];return l!=null&&String(l).trim()!==""}).length}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],i=this.getResponseForStep(this._currentStep).inputValues??{},o=t.targets.find(a=>{let s=i[a.id];return s==null||String(s).trim()===""});if(!o){this.emitHintShown("This step is complete. Move to another step or submit.");return}this.emitHintShown(`Complete the ${o.expectedValue.type} input on this step.`)}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=Le(l,c);t+=d.correct,r+=d.total,i[s]=De(l,c)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}};customElements.get("sequential-fill-blanks")||customElements.define("sequential-fill-blanks",de);function fa(e){let n={};if(!e)return n.data="Data is required",{ok:!1,errors:n};if(e.type!=="seriation"&&(n.type='Data type must be "seriation"'),!Array.isArray(e.items))return n.items="Items must be an array",{ok:!1,errors:n};e.items.length<2&&(n.items="At least 2 items are required for seriation"),e.items.some(i=>typeof i!="string"||i.trim()==="")&&(n.items="All items must be non-empty strings"),new Set(e.items).size!==e.items.length&&(n.items="All items must be unique (duplicates found)");let r=Object.keys(n).length===0;return{ok:r,errors:r?null:n}}function yt(e,n,t){let r=0,i=0,o=e.length;e.forEach((s,l)=>{let c=n.indexOf(s),d=t.querySelector(`[data-item="${s}"]`);if(c===-1){d&&(d.chipState="wrong");return}let u=Math.abs(c-l);u===0?(r+=100,i++,d&&(d.chipState="correct")):u===1?(r+=50,d&&(d.chipState="missed")):d&&(d.chipState="wrong")});let a=o>0?r/o:0;return console.log(`Seriation Score: ${a.toFixed(1)}% (${i}/${o} in correct position)`),{score:a,correct:i,total:o,answerKey:e,userResponse:n}}function ba(e){try{if(!e||typeof e!="string")return{ok:!1,errors:{input:"Input must be a non-empty string"}};let n=e.trim();if(n.length===0)return{ok:!1,errors:{input:"Input cannot be empty"}};let t=[];return n.includes("|")?t=n.split("|").map(i=>i.trim()).filter(i=>i.length>0):t=n.split(`
3464
- `).map(i=>i.replace(/^\s*[\d\w]+[\.\)]\s*/,"").trim()).filter(i=>i.length>0),t.length<2?{ok:!1,errors:{items:"At least 2 items are required for seriation"}}:{ok:!0,data:{type:"seriation",items:t}}}catch(n){return{ok:!1,errors:{"Parse Error":`${n instanceof Error?n.message:String(n)}`}}}}var ue=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="static";this.currentOrder=[];this.isGraded=!1;this.draggedRowIndex=null;this.dragOverRowIndex=null;this.isDragging=!1;this.draggedRow=null;this.dragOffsetY=0;this.MAX_ITEMS=10;this.MIN_ITEM_HEIGHT=44;if(!this.isValid||!this.data||!this.config)return;let o=this.data.items;this.data.items=o,this.config.shuffle?this.currentOrder=S([...this.data.items]):this.currentOrder=[...this.data.items],this.implementsProgress=!1,this.variant=this.config.variant}initialize(){this.boundPointerMove=this.handlePointerMove.bind(this),this.boundPointerUp=this.handlePointerUp.bind(this),window.addEventListener("pointermove",this.boundPointerMove),window.addEventListener("pointerup",this.boundPointerUp)}cleanup(){window.removeEventListener("pointermove",this.boundPointerMove),window.removeEventListener("pointerup",this.boundPointerUp)}onVariantChange(t){this.querySelectorAll("edu-chip").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}render(){this.innerHTML=`
3508
+ `).map(i=>i.replace(/^\s*[\d\w]+[\.\)]\s*/,"").trim()).filter(i=>i.length>0),t.length<2?{ok:!1,errors:{items:"At least 2 items are required for seriation"}}:{ok:!0,data:{type:"seriation",items:t}}}catch(n){return{ok:!1,errors:{"Parse Error":`${n instanceof Error?n.message:String(n)}`}}}}var ue=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="static";this.currentOrder=[];this.isGraded=!1;this.draggedRowIndex=null;this.dragOverRowIndex=null;this.isDragging=!1;this.draggedRow=null;this.dragOffsetY=0;this.MAX_ITEMS=10;this.MIN_ITEM_HEIGHT=56;if(!this.isValid||!this.data||!this.config)return;let o=this.data.items;this.data.items=o,this.config.shuffle?this.currentOrder=S([...this.data.items]):this.currentOrder=[...this.data.items],this.implementsProgress=!1,this.variant=this.config.variant}initialize(){this.boundPointerMove=this.handlePointerMove.bind(this),this.boundPointerUp=this.handlePointerUp.bind(this),window.addEventListener("pointermove",this.boundPointerMove),window.addEventListener("pointerup",this.boundPointerUp)}cleanup(){window.removeEventListener("pointermove",this.boundPointerMove),window.removeEventListener("pointerup",this.boundPointerUp)}onVariantChange(t){this.querySelectorAll("edu-chip").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}render(){this.innerHTML=`
3465
3509
  <style>
3466
3510
  rank-order {
3467
3511
  display: flex;
@@ -3680,8 +3724,14 @@ slot {
3680
3724
  <div class="container">
3681
3725
  <div class="rows-container"></div>
3682
3726
  </div>
3683
- `,this.$container=this.querySelector(".container"),this.$rowsContainer=this.querySelector(".rows-container"),this.renderRows()}renderRows(){this.$rowsContainer.innerHTML="",this.currentOrder.forEach((t,r)=>{let i=document.createElement("div");i.className="row",i.dataset.index=String(r);let o=document.createElement("div");o.className="chip-wrapper";let a=document.createElement("edu-chip");a.variant=this.variant,a.dataset.item=t,a.prefix=String(r+1),a.draggable=!0,D(t,a,this.assets?.assetsById),this.isGraded&&(this.data.items.indexOf(t)===r?a.chipState="correct":a.chipState="wrong"),o.appendChild(a);let s=document.createElement("div");s.className="controls";let l=this.createButton("up",r);s.appendChild(l),i.appendChild(o),i.appendChild(s),this.isGraded||i.addEventListener("pointerdown",c=>this.handlePointerDown(c,r)),this.$rowsContainer.appendChild(i)})}createButton(t,r){let i=document.createElement("button");i.className="btn",i.dataset.direction=t,i.dataset.index=String(r),i.setAttribute("aria-label",t==="up"?"Move up":"Move down"),t==="up"&&r===0&&(i.disabled=!0),t==="down"&&r===this.currentOrder.length-1&&(i.disabled=!0),this.isGraded&&(i.disabled=!0);let o=t==="up"?B("up"):B("down");return i.innerHTML=o,i.addEventListener("click",()=>{t==="up"&&r>0?this.swapItems(r,r-1):t==="down"&&r<this.currentOrder.length-1&&this.swapItems(r,r+1)}),i}swapItems(t,r){let i=this.currentOrder[t];this.currentOrder[t]=this.currentOrder[r],this.currentOrder[r]=i,this.renderRows(),this.emitStateChange()}handlePointerDown(t,r){if(t.target.closest(".btn, .controls"))return;t.preventDefault(),t.stopPropagation(),this.isDragging=!0,this.draggedRow=t.currentTarget,this.draggedRowIndex=r;let i=this.draggedRow.getBoundingClientRect();this.dragOffsetY=t.clientY-i.top;try{this.draggedRow.setPointerCapture(t.pointerId)}catch(o){console.warn("Failed to capture pointer:",o)}this.draggedRow.classList.add("dragging"),this.$rowsContainer.style.userSelect="none"}handlePointerMove(t){if(!this.isDragging||!this.draggedRow)return;let r=this.getRowIndexAtY(t.clientY);if(this.$rowsContainer.querySelectorAll(".row").forEach(i=>{i.classList.remove("drag-over")}),r!==-1&&r!==this.draggedRowIndex){let i=Array.from(this.$rowsContainer.children);i[r]&&i[r].classList.add("drag-over")}}handlePointerUp(t){if(!this.isDragging||!this.draggedRow)return;try{this.draggedRow.releasePointerCapture(t.pointerId)}catch{}let r=this.getRowIndexAtY(t.clientY);r!==-1&&r!==this.draggedRowIndex&&this.swapItems(this.draggedRowIndex,r),this.$rowsContainer.querySelectorAll(".row").forEach(i=>{i.classList.remove("dragging","drag-over")}),this.$rowsContainer.style.userSelect="",this.isDragging=!1,this.draggedRow=null,this.draggedRowIndex=null,this.dragOverRowIndex=null}getRowIndexAtY(t){let r=Array.from(this.$rowsContainer.children);for(let i=0;i<r.length;i++){let o=r[i].getBoundingClientRect();if(t>=o.top&&t<=o.bottom)return i}return-1}getCurrentState(){return{currentOrder:[...this.currentOrder],correctOrder:[...this.data.items]}}isInteractionComplete(){return!0}onHint(){let t=0;this.currentOrder.forEach((r,i)=>{this.data.items[i]===r&&t++}),t===this.currentOrder.length?(alert('All items are in the correct order! Click "Check" to submit.'),this.emitHintShown("All items correctly ordered")):(alert(`Hint: ${t} out of ${this.currentOrder.length} items are in the correct position. Keep reordering!`),this.emitHintShown(`${t}/${this.currentOrder.length} correct`))}submit(){super.submit();let t=yt(this.data.items,this.currentOrder,this);console.log(`Rank Order Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.isGraded=!0,this.renderRows(),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.config.shuffle?this.currentOrder=S([...this.data.items]):this.currentOrder=[...this.data.items],this.isGraded=!1,this.renderRows()}};customElements.get("rank-order")||customElements.define("rank-order",ue);var hi=!1,va=()=>{hi||(hi=!0,T({id:"open-classification",label:"Open Classification",elementTag:"open-classification",cognitiveOp:"classification",mechanic:"static",engine:"direct",ctor:we,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-classification",label:"Sequential Classification",elementTag:"sequential-classification",cognitiveOp:"classification",mechanic:"automatic-sequencing",engine:"direct",ctor:ye,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"mcq",label:"Multiple Choice / Multiple Response",elementTag:"mcq-interaction",cognitiveOp:"recognition",mechanic:"sequential",engine:"direct",ctor:ee,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"simultaneous-association",label:"Simultaneous Association",elementTag:"simultaneous-association",cognitiveOp:"association",mechanic:"static",engine:"direct",ctor:Ee,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"list-recall",label:"List Recall",elementTag:"list-recall",cognitiveOp:"freerecall",mechanic:"static",engine:"direct",ctor:te,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"lookup-table",label:"Lookup Table",elementTag:"lookup-table",cognitiveOp:"production",mechanic:"static",engine:"tables",ctor:Se,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"classification-matrix",label:"Classification Matrix",elementTag:"classification-matrix",cognitiveOp:"classification",mechanic:"static",engine:"tables",ctor:Te,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"nary-choice-table",label:"N-ary Choice Table",elementTag:"nary-choice-table",cognitiveOp:"discrimination",mechanic:"static",engine:"tables",ctor:$e,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"adjacency-table",label:"Adjacency Table",elementTag:"adjacency-table",cognitiveOp:"association",mechanic:"static",engine:"tables",ctor:Ae,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"mark-the-words",label:"Mark The Words",elementTag:"mark-the-words",cognitiveOp:"recognition",mechanic:"static",engine:"text",ctor:ie,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-mark-the-words",label:"Sequential Mark The Words",elementTag:"sequential-mark-the-words",cognitiveOp:"recognition",mechanic:"sequential",engine:"text",ctor:ne,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"categorize-the-words",label:"Categorize The Words",elementTag:"categorize-the-words",cognitiveOp:"classification",mechanic:"static",engine:"text",ctor:oe,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-categorize-the-words",label:"Sequential Categorize The Words",elementTag:"sequential-categorize-the-words",cognitiveOp:"classification",mechanic:"sequential",engine:"text",ctor:ae,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"text-transformation",label:"Text Transformation",elementTag:"text-transformation",cognitiveOp:"transformation",mechanic:"static",engine:"text",ctor:se,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-text-transformation",label:"Sequential Text Transformation",elementTag:"sequential-text-transformation",cognitiveOp:"transformation",mechanic:"sequential",engine:"text",ctor:le,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"fill-blanks",label:"Fill Blanks",elementTag:"fill-blanks",cognitiveOp:"cuedrecall",mechanic:"static",engine:"text",ctor:ce,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-fill-blanks",label:"Sequential Fill Blanks",elementTag:"sequential-fill-blanks",cognitiveOp:"cuedrecall",mechanic:"sequential",engine:"text",ctor:de,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"rank-order",label:"Rank Order",elementTag:"rank-order",cognitiveOp:"seriation",mechanic:"static",engine:"direct",ctor:ue,capabilities:{isSequential:!1,implementsProgress:!1,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}))};va();var gi=`<header part='header'>
3727
+ `,this.$container=this.querySelector(".container"),this.$rowsContainer=this.querySelector(".rows-container"),this.renderRows()}renderRows(){this.$rowsContainer.innerHTML="",this.currentOrder.forEach((t,r)=>{let i=document.createElement("div");i.className="row",i.dataset.index=String(r);let o=document.createElement("div");o.className="chip-wrapper";let a=document.createElement("edu-chip");a.variant=this.variant,a.dataset.item=t,a.prefix=String(r+1),a.draggable=!0,D(t,a,this.assets?.assetsById),this.isGraded&&(this.data.items.indexOf(t)===r?a.chipState="correct":a.chipState="wrong"),o.appendChild(a);let s=document.createElement("div");s.className="controls";let l=this.createButton("up",r);s.appendChild(l),i.appendChild(o),i.appendChild(s),this.isGraded||i.addEventListener("pointerdown",c=>this.handlePointerDown(c,r)),this.$rowsContainer.appendChild(i)})}createButton(t,r){let i=document.createElement("button");i.className="btn",i.dataset.direction=t,i.dataset.index=String(r),i.setAttribute("aria-label",t==="up"?"Move up":"Move down"),t==="up"&&r===0&&(i.disabled=!0),t==="down"&&r===this.currentOrder.length-1&&(i.disabled=!0),this.isGraded&&(i.disabled=!0);let o=t==="up"?B("up"):B("down");return i.innerHTML=o,i.addEventListener("click",()=>{t==="up"&&r>0?this.swapItems(r,r-1):t==="down"&&r<this.currentOrder.length-1&&this.swapItems(r,r+1)}),i}swapItems(t,r){let i=this.currentOrder[t];this.currentOrder[t]=this.currentOrder[r],this.currentOrder[r]=i,this.renderRows(),this.emitStateChange()}handlePointerDown(t,r){if(t.target.closest(".btn, .controls"))return;t.preventDefault(),t.stopPropagation(),this.isDragging=!0,this.draggedRow=t.currentTarget,this.draggedRowIndex=r;let i=this.draggedRow.getBoundingClientRect();this.dragOffsetY=t.clientY-i.top;try{this.draggedRow.setPointerCapture(t.pointerId)}catch(o){console.warn("Failed to capture pointer:",o)}this.draggedRow.classList.add("dragging"),this.$rowsContainer.style.userSelect="none"}handlePointerMove(t){if(!this.isDragging||!this.draggedRow)return;let r=this.getRowIndexAtY(t.clientY);if(this.$rowsContainer.querySelectorAll(".row").forEach(i=>{i.classList.remove("drag-over")}),r!==-1&&r!==this.draggedRowIndex){let i=Array.from(this.$rowsContainer.children);i[r]&&i[r].classList.add("drag-over")}}handlePointerUp(t){if(!this.isDragging||!this.draggedRow)return;try{this.draggedRow.releasePointerCapture(t.pointerId)}catch{}let r=this.getRowIndexAtY(t.clientY);r!==-1&&r!==this.draggedRowIndex&&this.swapItems(this.draggedRowIndex,r),this.$rowsContainer.querySelectorAll(".row").forEach(i=>{i.classList.remove("dragging","drag-over")}),this.$rowsContainer.style.userSelect="",this.isDragging=!1,this.draggedRow=null,this.draggedRowIndex=null,this.dragOverRowIndex=null}getRowIndexAtY(t){let r=Array.from(this.$rowsContainer.children);for(let i=0;i<r.length;i++){let o=r[i].getBoundingClientRect();if(t>=o.top&&t<=o.bottom)return i}return-1}getCurrentState(){return{currentOrder:[...this.currentOrder],correctOrder:[...this.data.items]}}isInteractionComplete(){return!0}onHint(){let t=0;this.currentOrder.forEach((r,i)=>{this.data.items[i]===r&&t++}),t===this.currentOrder.length?(alert('All items are in the correct order! Click "Check" to submit.'),this.emitHintShown("All items correctly ordered")):(alert(`Hint: ${t} out of ${this.currentOrder.length} items are in the correct position. Keep reordering!`),this.emitHintShown(`${t}/${this.currentOrder.length} correct`))}submit(){super.submit();let t=yt(this.data.items,this.currentOrder,this);console.log(`Rank Order Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.isGraded=!0,this.renderRows(),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.config.shuffle?this.currentOrder=S([...this.data.items]):this.currentOrder=[...this.data.items],this.isGraded=!1,this.renderRows()}};customElements.get("rank-order")||customElements.define("rank-order",ue);var hi=!1,va=()=>{hi||(hi=!0,T({id:"open-classification",label:"Open Classification",elementTag:"open-classification",cognitiveOp:"classification",mechanic:"static",engine:"direct",ctor:we,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-classification",label:"Sequential Classification",elementTag:"sequential-classification",cognitiveOp:"classification",mechanic:"automatic-sequencing",engine:"direct",ctor:ye,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"mcq",label:"Multiple Choice / Multiple Response",elementTag:"mcq-interaction",cognitiveOp:"recognition",mechanic:"sequential",engine:"direct",ctor:ee,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"simultaneous-association",label:"Simultaneous Association",elementTag:"simultaneous-association",cognitiveOp:"association",mechanic:"static",engine:"direct",ctor:Ce,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"list-recall",label:"List Recall",elementTag:"list-recall",cognitiveOp:"freerecall",mechanic:"static",engine:"direct",ctor:te,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"lookup-table",label:"Lookup Table",elementTag:"lookup-table",cognitiveOp:"production",mechanic:"static",engine:"tables",ctor:Se,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"classification-matrix",label:"Classification Matrix",elementTag:"classification-matrix",cognitiveOp:"classification",mechanic:"static",engine:"tables",ctor:Te,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"nary-choice-table",label:"N-ary Choice Table",elementTag:"nary-choice-table",cognitiveOp:"discrimination",mechanic:"static",engine:"tables",ctor:$e,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"adjacency-table",label:"Adjacency Table",elementTag:"adjacency-table",cognitiveOp:"association",mechanic:"static",engine:"tables",ctor:Ae,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),T({id:"mark-the-words",label:"Mark The Words",elementTag:"mark-the-words",cognitiveOp:"recognition",mechanic:"static",engine:"text",ctor:ie,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-mark-the-words",label:"Sequential Mark The Words",elementTag:"sequential-mark-the-words",cognitiveOp:"recognition",mechanic:"sequential",engine:"text",ctor:ne,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"categorize-the-words",label:"Categorize The Words",elementTag:"categorize-the-words",cognitiveOp:"classification",mechanic:"static",engine:"text",ctor:oe,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-categorize-the-words",label:"Sequential Categorize The Words",elementTag:"sequential-categorize-the-words",cognitiveOp:"classification",mechanic:"sequential",engine:"text",ctor:ae,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"text-transformation",label:"Text Transformation",elementTag:"text-transformation",cognitiveOp:"transformation",mechanic:"static",engine:"text",ctor:se,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-text-transformation",label:"Sequential Text Transformation",elementTag:"sequential-text-transformation",cognitiveOp:"transformation",mechanic:"sequential",engine:"text",ctor:le,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"fill-blanks",label:"Fill Blanks",elementTag:"fill-blanks",cognitiveOp:"cuedrecall",mechanic:"static",engine:"text",ctor:ce,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"sequential-fill-blanks",label:"Sequential Fill Blanks",elementTag:"sequential-fill-blanks",cognitiveOp:"cuedrecall",mechanic:"sequential",engine:"text",ctor:de,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),T({id:"rank-order",label:"Rank Order",elementTag:"rank-order",cognitiveOp:"seriation",mechanic:"static",engine:"direct",ctor:ue,capabilities:{isSequential:!1,implementsProgress:!1,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}))};va();var gi=`<header part='header'>
3684
3728
  <div class="prompt-container">
3729
+ <button class="close-btn btn" title="Close Fullscreen" part="close-part" style="display: none;">
3730
+ <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
3731
+ <path d="M18 6 6 18" />
3732
+ <path d="m6 6 12 12" />
3733
+ </svg>
3734
+ </button>
3685
3735
  <button class="prompt-btn btn" title="See Prompt Data" part="see-prompt">
3686
3736
  <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
3687
3737
  <path d="M12 3c4.97 0 9 1.79 9 4s-4.03 4-9 4-9-1.79-9-4 4.03-4 9-4Z"/>
@@ -3742,13 +3792,6 @@ slot {
3742
3792
  <div class="radio-nav" part="radio-nav"></div>
3743
3793
  <div class="action-buttons">
3744
3794
  <button class="check-btn" type="button" part="check">Check</button>
3745
-
3746
- <button class="see-answers-btn btn" title="See answers" part="see-answers">
3747
- <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
3748
- <path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6Z"/>
3749
- <circle cx="12" cy="12" r="3"/>
3750
- </svg>
3751
- </button>
3752
3795
  <button class="retry-btn btn" title="Retry" part="retry">
3753
3796
  <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
3754
3797
  <path d="M17 2v4h-4"/>
@@ -3916,13 +3959,15 @@ footer {
3916
3959
  position: relative;
3917
3960
  display: flex;
3918
3961
  flex-direction: column;
3919
- justify-content: center;
3962
+ justify-content: flex-start;
3920
3963
  align-items: center;
3921
- /* padding: clamp(0.3rem, 0.8cqh, 0.6rem);*/
3964
+ padding: clamp(0.35rem, 1cqh, 0.75rem) clamp(0.5rem, 1.5cqw, 1rem);
3922
3965
  gap: clamp(0.25rem, 0.8cqh, 0.5rem);
3923
3966
  flex-shrink: 0;
3924
- height: clamp(20px, 9cqh, 62px);
3925
- min-height: clamp(50px, 9cqh, 62px);
3967
+ height: auto;
3968
+ min-height: clamp(76px, 12cqh, 120px);
3969
+ box-sizing: border-box;
3970
+ overflow: visible;
3926
3971
  }
3927
3972
 
3928
3973
  .progress-container {
@@ -3932,6 +3977,7 @@ footer {
3932
3977
  justify-content: space-between;
3933
3978
  gap: clamp(0.25rem, 1cqw, 0.6rem);
3934
3979
  width: 100%;
3980
+ min-width: 0;
3935
3981
  }
3936
3982
 
3937
3983
  .progress-bar {
@@ -4051,6 +4097,14 @@ footer {
4051
4097
  align-items: center;
4052
4098
  justify-content: center;
4053
4099
  flex-wrap: wrap;
4100
+ width: 100%;
4101
+ min-width: 0;
4102
+ }
4103
+
4104
+ .prompt-btn,
4105
+ .retry-btn,
4106
+ .scores-btn {
4107
+ color: rgb(var(--edu-ink));
4054
4108
  }
4055
4109
 
4056
4110
  .check-btn {
@@ -4111,6 +4165,8 @@ footer {
4111
4165
  gap: 0.5rem;
4112
4166
  align-items: center;
4113
4167
  justify-content: center;
4168
+ width: 100%;
4169
+ min-width: 0;
4114
4170
  }
4115
4171
 
4116
4172
  .radio-nav[data-active="true"] {
@@ -4173,6 +4229,10 @@ footer {
4173
4229
 
4174
4230
  & .timer { }
4175
4231
 
4232
+ & footer {
4233
+ color: rgb(var(--edu-inverted-ink));
4234
+ }
4235
+
4176
4236
  & .check-btn {
4177
4237
  background: transparent;
4178
4238
  color: rgb(var(--edu-ink));
@@ -4206,7 +4266,8 @@ footer {
4206
4266
  :host([variant="minimal"]) {
4207
4267
  & .wrap {
4208
4268
  border: 1px solid rgb(var(--edu-border));
4209
- border-radius: 6px;
4269
+ border-radius: 10px;
4270
+ background: rgb(var(--edu-card));
4210
4271
  }
4211
4272
 
4212
4273
  & .timer {
@@ -4214,10 +4275,12 @@ footer {
4214
4275
  }
4215
4276
 
4216
4277
  & .check-btn {
4217
- border-radius: 4px;
4278
+ border-radius: 10px;
4279
+ box-shadow: none;
4218
4280
  }
4219
4281
 
4220
4282
  & footer {
4283
+ color: rgb(var(--edu-inverted-ink));
4221
4284
  border-top: 1px solid rgb(var(--edu-border));
4222
4285
  }
4223
4286
 
@@ -4234,7 +4297,8 @@ footer {
4234
4297
  }
4235
4298
 
4236
4299
  & .radio-nav label {
4237
- border-radius: 4px;
4300
+ border-radius: 999px;
4301
+ background: transparent;
4238
4302
  }
4239
4303
  }
4240
4304
 
@@ -4256,6 +4320,7 @@ footer {
4256
4320
  }
4257
4321
 
4258
4322
  & footer {
4323
+ color: rgb(var(--edu-inverted-ink));
4259
4324
  border-top: 1px solid rgb(var(--edu-border) / 0.5);
4260
4325
  padding: 1.25rem;
4261
4326
  }
@@ -4291,7 +4356,7 @@ footer {
4291
4356
 
4292
4357
  :host([variant="playful"]) {
4293
4358
  & .wrap {
4294
- color: rgb(var(--edu-first-accent));
4359
+ color: rgb(var(--edu-ink));
4295
4360
  border-radius: 14px;
4296
4361
  border: 2px dashed rgb(var(--edu-border));
4297
4362
  }
@@ -4302,10 +4367,13 @@ footer {
4302
4367
  }
4303
4368
 
4304
4369
  & .check-btn {
4370
+ background: linear-gradient(135deg, rgb(var(--edu-first-accent));
4371
+ color: rgb(var(--edu-inverted-ink));
4305
4372
  border-radius: 12px;
4306
4373
  font-weight: 700;
4307
4374
  text-transform: uppercase;
4308
4375
  letter-spacing: 0.5px;
4376
+ box-shadow: 0 8px 18px rgb(var(--edu-shadow-color) / 0.16);
4309
4377
  }
4310
4378
 
4311
4379
  & .check-btn:hover:not(:disabled) {
@@ -4313,6 +4381,7 @@ footer {
4313
4381
  }
4314
4382
 
4315
4383
  & footer {
4384
+ color: rgb(var(--edu-inverted-ink));
4316
4385
  border-top: 2px dashed rgb(var(--edu-border));
4317
4386
  }
4318
4387
 
@@ -4332,7 +4401,9 @@ footer {
4332
4401
  }
4333
4402
 
4334
4403
  & .radio-nav label {
4335
- background: rgb(var(--edu-muted));
4404
+ background: rgb(var(--edu-card));
4405
+ color: rgb(var(--edu-ink));
4406
+ border: 2px solid rgb(var(--edu-border));
4336
4407
  border-radius: 50px;
4337
4408
  font-weight: 700;
4338
4409
  }
@@ -4342,9 +4413,10 @@ footer {
4342
4413
  }
4343
4414
 
4344
4415
  & .radio-nav input:checked + label {
4345
- background: rgb(var(--edu-first-accent));
4416
+ background: linear-gradient(135deg, rgb(var(--edu-first-accent));
4346
4417
  color: rgb(var(--edu-inverted-ink));
4347
- box-shadow: 0 5px 15px rgb(var(--edu-first-accent) / 0.4);
4418
+ border-color: transparent;
4419
+ box-shadow: 0 5px 15px rgb(var(--edu-shadow-color) / 0.18);
4348
4420
  }
4349
4421
  }
4350
4422
 
@@ -4353,13 +4425,14 @@ footer {
4353
4425
  background: rgba(var(--edu-card), 0.7);
4354
4426
  backdrop-filter: blur(10px);
4355
4427
  border: 1px solid rgba(var(--edu-border), 0.35);
4356
- border-radius: 12px;
4428
+ border-radius: 14px;
4429
+ box-shadow: 0 16px 32px rgba(var(--edu-shadow-color), 0.12);
4357
4430
  }
4358
4431
 
4359
4432
  & .check-btn {
4360
- background: rgba(var(--edu-first-accent), 0.9);
4433
+ background: rgba(var(--edu-first-accent), 0.88);
4361
4434
  backdrop-filter: blur(5px);
4362
- border-radius: 10px;
4435
+ border-radius: 999px;
4363
4436
  }
4364
4437
 
4365
4438
  & .check-btn:hover:not(:disabled) {
@@ -4383,6 +4456,7 @@ footer {
4383
4456
  background: rgba(var(--edu-card), 0.5);
4384
4457
  backdrop-filter: blur(5px);
4385
4458
  border: 1px solid rgba(var(--edu-border), 0.35);
4459
+ border-radius: 999px;
4386
4460
  }
4387
4461
 
4388
4462
  & .radio-nav input:checked + label {
@@ -4412,6 +4486,7 @@ footer {
4412
4486
  }
4413
4487
 
4414
4488
  & footer {
4489
+ color: rgb(var(--edu-inverted-ink));
4415
4490
  border-top: 1px solid rgb(var(--edu-border));
4416
4491
  padding: 1rem 1.5rem;
4417
4492
  }
@@ -4465,6 +4540,7 @@ footer {
4465
4540
  }
4466
4541
 
4467
4542
  & footer {
4543
+ color: rgb(var(--edu-inverted-ink));
4468
4544
  border-top: 2px solid rgb(var(--edu-border));
4469
4545
  }
4470
4546
 
@@ -4561,13 +4637,14 @@ footer {
4561
4637
 
4562
4638
  :host([variant="card"]) {
4563
4639
  & .wrap {
4564
- border-radius: 8px;
4565
- box-shadow: 0 4px 12px rgba(var(--edu-shadow-color), 0.1), 0 2px 4px rgba(var(--edu-shadow-color), 0.05);
4640
+ border-radius: 14px;
4641
+ background: rgb(var(--edu-card));
4642
+ box-shadow: 0 10px 24px rgba(var(--edu-shadow-color), 0.12), 0 2px 4px rgba(var(--edu-shadow-color), 0.05);
4566
4643
  }
4567
4644
 
4568
4645
  & .check-btn {
4569
- border-radius: 6px;
4570
- box-shadow: 0 2px 4px rgba(var(--edu-shadow-color), 0.1);
4646
+ border-radius: 999px;
4647
+ box-shadow: 0 6px 14px rgba(var(--edu-shadow-color), 0.12);
4571
4648
  }
4572
4649
 
4573
4650
  & .check-btn:hover:not(:disabled) {
@@ -4579,20 +4656,20 @@ footer {
4579
4656
  }
4580
4657
 
4581
4658
  & .radio-nav label {
4582
- border-radius: 6px;
4583
- box-shadow: 0 2px 4px rgba(var(--edu-shadow-color), 0.1);
4659
+ border-radius: 999px;
4660
+ box-shadow: 0 4px 10px rgba(var(--edu-shadow-color), 0.08);
4584
4661
  }
4585
4662
 
4586
4663
  & .radio-nav input:checked + label {
4587
4664
  box-shadow: 0 4px 8px rgba(var(--edu-first-accent), 0.2);
4588
4665
  }
4589
4666
  }
4590
- `;var Be=class extends HTMLElement{constructor(){super();this.soundManager=new G;this.animationsManager=new L;this.timerInterval=null;this.remainingSeconds=0;this.interactionComplete=!1;this.attemptCount=0;this.attemptLimit=null;this.currentScreen="interaction";this.attachShadow({mode:"open"});let t=document.createElement("style");t.textContent=mi,this.shadowRoot.append(t);let r=document.createElement("section");r.className="wrap",r.innerHTML=gi,this.shadowRoot.append(r),L.injectKeyframes(this.shadowRoot),this.$headerEl=r.querySelector("header"),this.$footerEl=r.querySelector("footer"),this.$titleEl=r.querySelector(".title"),this.$promptBtn=r.querySelector(".prompt-btn"),this.$timerEl=r.querySelector(".timer"),this.$checkBtn=r.querySelector(".check-btn"),this.$scoresBtn=r.querySelector(".scores-btn"),this.$seeAnswersBtn=r.querySelector(".see-answers-btn"),this.$retryBtn=r.querySelector(".retry-btn"),this.$radioNav=r.querySelector(".radio-nav"),this.$progressContainer=r.querySelector(".progress-container"),this.$progressBar=r.querySelector(".progress-bar"),this.$progressIcon=r.querySelector(".progress-icon-wrapper"),this.$progressCounter=r.querySelector(".progress-counter"),this.$contentEl=r.querySelector('[part="content"]'),this.animationsManager.isEnabled=!0,this.$interactionScreen=r.querySelector('[data-screen="interaction"]'),this.$errorContent=r.querySelector(".error-content"),this.$attemptsMessage=r.querySelector(".attempts-message"),this.$scoreDisplay=r.querySelector(".score-display"),this.$timerDisplay=r.querySelector(".timer-display"),this.setupShellListeners()}static get observedAttributes(){return["show-header","show-footer"]}connectedCallback(){this.hasAttribute("show-header")||this.setAttribute("show-header","true"),this.hasAttribute("show-footer")||this.setAttribute("show-footer","true"),this.updateVisibility(),this.animationsManager.animate(this.$progressIcon,"heartbeat"),this.animationsManager.animate(this.$promptBtn,"wobble")}disconnectedCallback(){this.stopTimer(),this.removeInteractionListeners()}attributeChangedCallback(t,r,i){r!==i&&this.updateVisibility()}setInteraction(t){if(this.stopTimer(),!t.isValid){this.$errorContent.textContent=t.errors??"Error loading the interaction.",this.switchScreen("error");return}this.soundManager.playSound("start"),this.interaction&&(this.removeInteractionListeners(),this.$interactionScreen.innerHTML=""),this.interaction=t,this.interactionComplete=!1;let r=this.interaction.config;this.reset(),this.switchScreen("interaction");let i=r.variant??"elegant";this.setAttribute("variant",i),this.interaction.onVariantChange(i),this.$titleEl.textContent=r.prompt||"",r.promptData&&r.promptModality?(this.$titleEl.style.cursor="pointer",this.$titleEl.title="Click to view prompt details",this.$promptBtn.addEventListener("click",()=>this.openPromptDialog()),this.$titleEl.addEventListener("click",()=>this.openPromptDialog())):(this.$titleEl.style.cursor="",this.$titleEl.style.textDecoration="",this.$titleEl.title=""),r.timer!==null&&r.timer>30?(this.remainingSeconds=r.timer,this.$timerEl.classList.remove("edu-hidden"),this.updateTimerDisplay(),this.startTimer()):this.$timerEl.classList.add("edu-hidden"),this.attemptLimit=r.attemptLimit,this.attemptCount=0,this.interaction.interactionMechanic==="sequential"?(this.$radioNav.dataset.active="true",this.renderRadioNav()):this.$radioNav.dataset.active="false",this.interaction.implementsProgress?(this.$checkBtn.classList.add("edu-hidden"),this.$progressContainer.classList.remove("edu-hidden"),this.$progressCounter.textContent=`0/${this.interaction.progressTracker.total}`):(this.$progressContainer.classList.add("edu-hidden"),this.$checkBtn.classList.remove("edu-hidden")),this.setupInteractionListeners(),this.$interactionScreen.innerHTML="",this.$interactionScreen.appendChild(t)}removeInteraction(){this.interaction&&(this.removeInteractionListeners(),this.$interactionScreen.innerHTML="",this.interaction=void 0,this.interactionComplete=!1)}setupShellListeners(){this.$checkBtn.addEventListener("click",()=>{this.soundManager.playSound("pop");try{this.interaction.submit()}catch(t){console.error("Submit failed:",t)}}),this.$seeAnswersBtn.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.currentScreen==="solution"?this.switchScreen("interaction"):this.switchScreen("solution")}),this.$scoresBtn.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.currentScreen==="score"?this.switchScreen("interaction"):this.switchScreen("score")}),this.$timerEl.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.$timerDisplay.append(this.$timerEl),this.currentScreen==="time"?(this.switchScreen("interaction"),this.$headerEl.append(this.$timerEl)):this.switchScreen("time")}),this.$retryBtn.addEventListener("click",()=>this.handleRetry()),this.$radioNav.addEventListener("change",t=>{let r=t.target;if(r.type==="radio"){let i=parseInt(r.id.replace("step-",""),10);this.interaction&&this.interaction.setSteps(i),this.dispatchEvent(new CustomEvent("navigation-change",{detail:{step:i},bubbles:!0,composed:!0}))}})}setupInteractionListeners(){this.interaction.addEventListener("interaction:ready",t=>{console.log("[Shell] Interaction ready:",t.detail.id)}),this.interaction.addEventListener("interaction:progress",t=>{let{current:r,total:i,percentage:o}=t.detail;this.updateProgress(r,i),r===i&&i>0?(this.interactionComplete=!0,this.$checkBtn.classList.remove("edu-hidden")):(this.interactionComplete=!1,this.interaction.implementsProgress&&this.$checkBtn.classList.add("edu-hidden"))}),this.interaction.addEventListener("interaction:complete",t=>{console.log("[Shell] Interaction complete:",t.detail),this.stopTimer(),this.handleCompletion(t.detail.state)}),this.interaction.addEventListener("interaction:graded",t=>{t.detail.result.score===100?(this.soundManager.playSound("success"),this.animationsManager.animate(this.$progressIcon,"spin-pulse")):(this.soundManager.playSound("failure"),this.animationsManager.animate(this.$progressIcon,"shake")),this.handleGraded(t.detail.result)}),this.interaction.addEventListener("interaction:hint-shown",t=>{console.log("[Shell] Hint shown:",t.detail.message)}),this.interaction.addEventListener("interaction:error",t=>{console.error("[Shell] Interaction error:",t.detail),alert(t.detail.message)})}removeInteractionListeners(){}updateProgress(t,r){this.$progressBar.max=r,this.$progressBar.value=t??0,this.$progressCounter.textContent=`${t}/${r}`;let i=r>0?t/r*100:0,a=this.$progressBar.offsetWidth*i/100-12;this.$progressIcon.style.left=`${Math.max(0,a)}px`}handleCompletion(t){this.dispatchEvent(new CustomEvent("shell:interaction-complete",{detail:{state:t},bubbles:!0,composed:!0})),console.log("[Shell] Interaction submitted with state:",t)}handleGraded(t){this.$checkBtn.classList.add("edu-hidden"),this.$seeAnswersBtn.classList.remove("edu-hidden"),this.$scoresBtn.classList.remove("edu-hidden"),this.$retryBtn.classList.remove("edu-hidden"),this.attemptLimit&&this.attemptCount>this.attemptLimit&&this.$retryBtn.classList.add("edu-hidden");let r=t.score;this.$scoreDisplay.innerHTML=`
4667
+ `;var Be=class extends HTMLElement{constructor(){super();this.soundManager=new G;this.animationsManager=new L;this.timerInterval=null;this.remainingSeconds=0;this.interactionComplete=!1;this.attemptCount=0;this.attemptLimit=null;this.currentScreen="interaction";this.attachShadow({mode:"open"});let t=document.createElement("style");t.textContent=mi,this.shadowRoot.append(t);let r=document.createElement("section");r.className="wrap",r.innerHTML=gi,this.shadowRoot.append(r),L.injectKeyframes(this.shadowRoot),this.$headerEl=r.querySelector("header"),this.$footerEl=r.querySelector("footer"),this.$titleEl=r.querySelector(".title"),this.$closeBtn=r.querySelector(".close-btn"),this.$promptBtn=r.querySelector(".prompt-btn"),this.$timerEl=r.querySelector(".timer"),this.$checkBtn=r.querySelector(".check-btn"),this.$scoresBtn=r.querySelector(".scores-btn"),this.$retryBtn=r.querySelector(".retry-btn"),this.$radioNav=r.querySelector(".radio-nav"),this.$progressContainer=r.querySelector(".progress-container"),this.$progressBar=r.querySelector(".progress-bar"),this.$progressIcon=r.querySelector(".progress-icon-wrapper"),this.$progressCounter=r.querySelector(".progress-counter"),this.$contentEl=r.querySelector('[part="content"]'),this.animationsManager.isEnabled=!0,this.$interactionScreen=r.querySelector('[data-screen="interaction"]'),this.$errorContent=r.querySelector(".error-content"),this.$attemptsMessage=r.querySelector(".attempts-message"),this.$scoreDisplay=r.querySelector(".score-display"),this.$timerDisplay=r.querySelector(".timer-display"),this.setupShellListeners()}static get observedAttributes(){return["show-header","show-footer"]}connectedCallback(){this.hasAttribute("show-header")||this.setAttribute("show-header","true"),this.hasAttribute("show-footer")||this.setAttribute("show-footer","true"),this.updateVisibility(),this.animationsManager.animate(this.$progressIcon,"heartbeat")}disconnectedCallback(){this.stopTimer(),this.removeInteractionListeners()}attributeChangedCallback(t,r,i){r!==i&&this.updateVisibility()}setInteraction(t){if(this.stopTimer(),!t.isValid){this.$errorContent.textContent=t.errors??"Error loading the interaction.",this.switchScreen("error");return}this.soundManager.playSound("start"),this.interaction&&(this.removeInteractionListeners(),this.$interactionScreen.innerHTML=""),this.interaction=t,this.interactionComplete=!1;let r=this.interaction.config;this.reset(),this.switchScreen("interaction");let i=r.variant??"elegant";this.setAttribute("variant",i),this.interaction.onVariantChange(i),this.$titleEl.textContent=r.prompt||"",r.promptData&&r.promptModality?(this.$titleEl.style.cursor="pointer",this.$titleEl.title="Click to view prompt details",this.$promptBtn.addEventListener("click",()=>this.openPromptDialog()),this.$titleEl.addEventListener("click",()=>this.openPromptDialog())):(this.$titleEl.style.cursor="",this.$titleEl.style.textDecoration="",this.$titleEl.title=""),r.timer!==null&&r.timer>30?(this.remainingSeconds=r.timer,this.$timerEl.classList.remove("edu-hidden"),this.updateTimerDisplay(),this.startTimer()):this.$timerEl.classList.add("edu-hidden"),this.attemptLimit=r.attemptLimit,this.attemptCount=0,this.interaction.interactionMechanic==="sequential"?(this.$radioNav.dataset.active="true",this.renderRadioNav()):this.$radioNav.dataset.active="false",this.interaction.implementsProgress?(this.$checkBtn.classList.add("edu-hidden"),this.$progressContainer.classList.remove("edu-hidden"),this.$progressCounter.textContent=`0/${this.interaction.progressTracker.total}`):(this.$progressContainer.classList.add("edu-hidden"),this.$checkBtn.classList.remove("edu-hidden")),this.setupInteractionListeners(),this.$interactionScreen.innerHTML="",this.$interactionScreen.appendChild(t)}removeInteraction(){this.interaction&&(this.removeInteractionListeners(),this.$interactionScreen.innerHTML="",this.interaction=void 0,this.interactionComplete=!1)}toggleCloseBtn(t){if(this.$closeBtn.style.display==="none"){this.$closeBtn.style.display="block",this.$closeBtn.addEventListener("click",t);return}this.$closeBtn.removeEventListener("click",t),this.$closeBtn.style.display="none"}setupShellListeners(){this.$checkBtn.addEventListener("click",()=>{this.soundManager.playSound("pop");try{this.interaction.submit()}catch(t){console.error("Submit failed:",t)}}),this.$scoresBtn.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.currentScreen==="score"?this.switchScreen("interaction"):this.switchScreen("score")}),this.$timerEl.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.$timerDisplay.append(this.$timerEl),this.currentScreen==="time"?(this.switchScreen("interaction"),this.$headerEl.append(this.$timerEl)):this.switchScreen("time")}),this.$retryBtn.addEventListener("click",()=>this.handleRetry()),this.$radioNav.addEventListener("change",t=>{let r=t.target;if(r.type==="radio"){let i=parseInt(r.id.replace("step-",""),10);this.interaction&&this.interaction.setSteps(i),this.dispatchEvent(new CustomEvent("navigation-change",{detail:{step:i},bubbles:!0,composed:!0}))}})}setupInteractionListeners(){this.interaction.addEventListener("interaction:ready",t=>{console.log("[Shell] Interaction ready:",t.detail.id)}),this.interaction.addEventListener("interaction:progress",t=>{let{current:r,total:i,percentage:o}=t.detail;this.updateProgress(r,i),r===i&&i>0?(this.interactionComplete=!0,this.$checkBtn.classList.remove("edu-hidden")):(this.interactionComplete=!1,this.interaction.implementsProgress&&this.$checkBtn.classList.add("edu-hidden"))}),this.interaction.addEventListener("interaction:complete",t=>{console.log("[Shell] Interaction complete:",t.detail),this.stopTimer(),this.handleCompletion(t.detail.state)}),this.interaction.addEventListener("interaction:graded",t=>{t.detail.result.score===100?(this.soundManager.playSound("success"),this.animationsManager.animate(this.$progressIcon,"spin-pulse")):(this.soundManager.playSound("failure"),this.animationsManager.animate(this.$progressIcon,"shake")),this.handleGraded(t.detail.result)}),this.interaction.addEventListener("interaction:hint-shown",t=>{console.log("[Shell] Hint shown:",t.detail.message)}),this.interaction.addEventListener("interaction:error",t=>{console.error("[Shell] Interaction error:",t.detail),alert(t.detail.message)})}removeInteractionListeners(){}updateProgress(t,r){this.$progressBar.max=r,this.$progressBar.value=t??0,this.$progressCounter.textContent=`${t}/${r}`;let i=r>0?t/r*100:0,a=this.$progressBar.offsetWidth*i/100-12;this.$progressIcon.style.left=`${Math.max(0,a)}px`}handleCompletion(t){this.dispatchEvent(new CustomEvent("shell:interaction-complete",{detail:{state:t},bubbles:!0,composed:!0})),console.log("[Shell] Interaction submitted with state:",t)}handleGraded(t){this.$checkBtn.classList.add("edu-hidden"),this.$scoresBtn.classList.remove("edu-hidden"),this.$retryBtn.classList.remove("edu-hidden"),this.attemptLimit&&this.attemptCount>this.attemptLimit&&this.$retryBtn.classList.add("edu-hidden");let r=t.score;this.$scoreDisplay.innerHTML=`
4591
4668
  <div style="font-size: 4rem; font-weight: 700; color: ${r>=75?"rgb(var(--edu-success))":r>=50?"rgba(139, 195, 74)":r>=25?"rgb(var(--edu-warning))":"rgb(var(--edu-error))"}">${r}%</div>
4592
4669
  <div style="font-size: 1.5rem; margin-top: 1rem; color: rgb(var(--edu-second-ink));">
4593
4670
  ${r===100?"Perfect Score! \u{1F389}":r>=75?"Great Job!":r>=50?"Good Effort!":r>=25?"Keep Trying!":"Try Again!"}
4594
4671
  </div>
4595
- `,this.$progressIcon.classList.remove("score-fail","score-low","score-mid","score-high"),this.$progressBar.classList.remove("score-fail","score-low","score-mid","score-high");let i="";r<=25?i="score-fail":r<=50?i="score-low":r<=75?i="score-mid":i="score-high",this.$progressIcon.classList.add(i),this.$progressBar.classList.add(i)}reset(){this.resetTimer(),this.interaction.implementsProgress||this.$checkBtn.classList.remove("edu-hidden"),this.$seeAnswersBtn.classList.add("edu-hidden"),this.$scoresBtn.classList.add("edu-hidden"),this.$retryBtn.classList.add("edu-hidden"),this.$progressIcon.classList.remove("score-fail","score-low","score-mid","score-high"),this.$progressBar.classList.remove("score-fail","score-low","score-mid","score-high"),this.animationsManager.animate(this.$progressIcon,"heartbeat"),this.$progressBar.value=0,this.updateProgress(0,this.interaction.progressTracker.total),this.interaction.interactionMechanic==="sequential"&&this.renderRadioNav()}handleRetry(){if(this.$retryBtn.classList.add("edu-hidden"),this.soundManager.playSound("pop"),this.attemptCount++,this.attemptLimit&&this.attemptLimit>0){let t=this.attemptLimit-this.attemptCount+1;this.$attemptsMessage.textContent=`${t} attempt${t!==1?"s":""} remaining`,this.switchScreen("attempts"),setTimeout(()=>{this.switchScreen("interaction"),this.reset(),this.resumeTimer(),this.interaction?.reset(),this.soundManager.playSound("flip")},2e3)}else this.switchScreen("interaction"),this.interaction?.reset()}openPromptDialog(){let t=this.interaction?.config;if(!t)return;this.soundManager.playSound("pop");let r=document.querySelector("edu-dialog#prompt-dialog");r||(r=document.createElement("edu-dialog"),r.id="prompt-dialog",document.body.appendChild(r)),r.title=t.construct||this.interaction?.config.promptModality||"Prompt";let i=document.createElement("edu-media");i.setAttribute("type",t.promptModality),i.setAttribute("data",t.promptData),t.promptDataSpec&&i.setAttribute("spec",t.promptDataSpec),r.innerHTML="",r.appendChild(i),r.open()}switchScreen(t){this.shadowRoot.querySelectorAll(".screen").forEach(r=>{let i=r.getAttribute("data-screen");r.style.display=i===t?"block":"none"}),this.currentScreen=t,console.log(`[Shell] Switched to screen: ${t}`)}startTimer(){this.timerInterval=window.setInterval(()=>{this.remainingSeconds--,this.updateTimerDisplay(),this.remainingSeconds<=0&&(this.stopTimer(),this.handleTimerComplete())},1e3)}stopTimer(){this.timerInterval!==null&&(clearInterval(this.timerInterval),this.timerInterval=null)}getFormattedTime(t){let r=Math.floor(t/60),i=t%60;return`${r}:${i.toString().padStart(2,"0")}`}updateTimerDisplay(){this.$timerEl.textContent=this.getFormattedTime(this.remainingSeconds),this.remainingSeconds===30&&(this.soundManager.playSound("low-time"),this.animationsManager.animate(this.$timerEl,"shake")),delete this.$timerEl.dataset.warning,delete this.$timerEl.dataset.danger,this.remainingSeconds<=10?this.$timerEl.dataset.danger="true":this.remainingSeconds<=30&&(this.$timerEl.dataset.warning="true")}handleTimerComplete(){console.log("[Shell] Timer complete");try{this.interaction.submit()}catch(t){console.error("Auto-submit on timer failed:",t)}this.dispatchEvent(new CustomEvent("shell:timer-complete",{bubbles:!0,composed:!0}))}pauseTimer(){this.stopTimer()}resumeTimer(){this.remainingSeconds>0&&this.timerInterval===null&&this.startTimer()}resetTimer(){this.stopTimer(),this.remainingSeconds=this.interaction.config.timer,this.updateTimerDisplay()}updateVisibility(){let t=this.getAttribute("show-header")!=="false",r=this.getAttribute("show-footer")!=="false";this.$headerEl.style.display=t?"":"none",this.$footerEl.style.display=r?"":"none"}renderRadioNav(){let t=this.interaction&&"slidesCount"in this.interaction?this.interaction.slidesCount:1;this.$radioNav.innerHTML="";for(let r=1;r<=t;r++){let i=document.createElement("input");i.type="radio",i.name="step-nav",i.id=`step-${r}`,r===1&&(i.checked=!0);let o=document.createElement("label");o.htmlFor=`step-${r}`,o.textContent=String(r),this.$radioNav.appendChild(i),this.$radioNav.appendChild(o)}}getContentArea(){return this.$contentEl}};customElements.get("edu-window")||customElements.define("edu-window",Be);et();export{Ae as AdjacencyTable,be as AssetValidationError,x as BaseInteraction,oe as CategorizeTheWords,Te as ClassificationMatrix,Qe as EduTable,Je as EduText,ce as FillBlanks,Be as InteractionsBaseShell,te as ListRecall,Se as LookupTable,ee as MCQ,ie as MarkTheWords,$e as NaryChoiceTable,we as OpenClassification,ue as RankOrder,ae as SequentialCategorizeTheWords,ye as SequentialClassification,de as SequentialFillBlanks,ne as SequentialMarkTheWords,le as SequentialTextTransformation,Ee as SimultaneousAssociation,se as TextTransformation,ll as adjacencyTableDataParser,pl as adjacencyTableDataValidator,Or as adjacencyTableGrader,sl as basicTableDataParser,ul as basicTableDataValidator,Vr as classificationTableGrader,Ma as clearInteractionRegistry,Fe as cognikitThemePresets,ke as compareValues,No as configureCognikit,Ra as createInteraction,bt as defaultCognikitThemeVariables,We as detectCellKind,je as ensureCognikitTheme,Fr as getAdjacencyCellGrading,Ke as getAllUniqueValues,Ce as getAllValues,De as getBlanksGradingState,Ur as getClassificationCellGrading,Pe as getClassificationGradingState,Go as getCognikitConfig,Vo as getCognikitThemePresets,pa as getDNDGradingState,Me as getHighlightGradingState,Yo as getInteraction,La as getInteractionRegistry,jr as getLookupCellGrading,Yr as getNaryCellGrading,wt as getTransformationGradingState,Da as listInteractions,cl as lookupTableDataParser,hl as lookupTableDataValidator,Gr as lookupTableGrader,Nr as naryTableGrader,ca as parseTextEngineSequential,qo as parseYamlAssets,zr as recognitionGrader,Hs as recognitionParser,Gs as recognitionValidator,va as registerBuiltInInteractions,T as registerInteraction,Fo as resetCognikitTheme,Mr as resolveCognikitTheme,yt as seriationGrader,ba as seriationParser,fa as seriationValidator,Oo as setCognikitTheme,oi as textEngineBaseDataValidator,ri as textEngineBaseGrammarParser,ai as textEngineBlanksDataValidator,Le as textEngineBlanksGrader,ii as textEngineBlanksGrammarParser,si as textEngineClassificationDataValidator,Re as textEngineClassificationGrader,ni as textEngineClassificationGrammarParser,ua as textEngineDNDGrader,da as textEngineDataValidator,_e as textEngineHighlightGrader,Ie as textEngineTransformationGrader,Ia as unregisterInteraction,zo as validateAndNormalizeAssets};
4672
+ `,this.$progressIcon.classList.remove("score-fail","score-low","score-mid","score-high"),this.$progressBar.classList.remove("score-fail","score-low","score-mid","score-high");let i="";r<=25?i="score-fail":r<=50?i="score-low":r<=75?i="score-mid":i="score-high",this.$progressIcon.classList.add(i),this.$progressBar.classList.add(i)}reset(){this.resetTimer(),this.interaction.implementsProgress||this.$checkBtn.classList.remove("edu-hidden"),this.$scoresBtn.classList.add("edu-hidden"),this.$retryBtn.classList.add("edu-hidden"),this.$progressIcon.classList.remove("score-fail","score-low","score-mid","score-high"),this.$progressBar.classList.remove("score-fail","score-low","score-mid","score-high"),this.animationsManager.animate(this.$progressIcon,"heartbeat"),this.$progressBar.value=0,this.updateProgress(0,this.interaction.progressTracker.total),this.interaction.interactionMechanic==="sequential"&&this.renderRadioNav()}handleRetry(){if(this.$retryBtn.classList.add("edu-hidden"),this.soundManager.playSound("pop"),this.attemptCount++,this.attemptLimit&&this.attemptLimit>0){let t=this.attemptLimit-this.attemptCount+1;this.$attemptsMessage.textContent=`${t} attempt${t!==1?"s":""} remaining`,this.switchScreen("attempts"),setTimeout(()=>{this.switchScreen("interaction"),this.reset(),this.resumeTimer(),this.interaction?.reset(),this.soundManager.playSound("flip")},2e3)}else this.switchScreen("interaction"),this.interaction?.reset()}openPromptDialog(){let t=this.interaction?.config;if(!t)return;this.soundManager.playSound("pop");let r=document.querySelector("edu-dialog#prompt-dialog");r||(r=document.createElement("edu-dialog"),r.id="prompt-dialog",document.body.appendChild(r)),r.title=t.construct||this.interaction?.config.promptModality||"Prompt";let i=document.createElement("edu-media");i.setAttribute("type",t.promptModality),i.setAttribute("data",t.promptData),t.promptDataSpec&&i.setAttribute("spec",t.promptDataSpec),r.innerHTML="",r.appendChild(i),r.open()}switchScreen(t){this.shadowRoot.querySelectorAll(".screen").forEach(r=>{let i=r.getAttribute("data-screen");r.style.display=i===t?"block":"none"}),this.currentScreen=t,console.log(`[Shell] Switched to screen: ${t}`)}startTimer(){this.timerInterval=window.setInterval(()=>{this.remainingSeconds--,this.updateTimerDisplay(),this.remainingSeconds<=0&&(this.stopTimer(),this.handleTimerComplete())},1e3)}stopTimer(){this.timerInterval!==null&&(clearInterval(this.timerInterval),this.timerInterval=null)}getFormattedTime(t){let r=Math.floor(t/60),i=t%60;return`${r}:${i.toString().padStart(2,"0")}`}updateTimerDisplay(){this.$timerEl.textContent=this.getFormattedTime(this.remainingSeconds),this.remainingSeconds===30&&(this.soundManager.playSound("low-time"),this.animationsManager.animate(this.$timerEl,"shake")),delete this.$timerEl.dataset.warning,delete this.$timerEl.dataset.danger,this.remainingSeconds<=10?this.$timerEl.dataset.danger="true":this.remainingSeconds<=30&&(this.$timerEl.dataset.warning="true")}handleTimerComplete(){console.log("[Shell] Timer complete");try{this.interaction.submit()}catch(t){console.error("Auto-submit on timer failed:",t)}this.dispatchEvent(new CustomEvent("shell:timer-complete",{bubbles:!0,composed:!0}))}pauseTimer(){this.stopTimer()}resumeTimer(){this.remainingSeconds>0&&this.timerInterval===null&&this.startTimer()}resetTimer(){this.stopTimer(),this.remainingSeconds=this.interaction.config.timer,this.updateTimerDisplay()}updateVisibility(){let t=this.getAttribute("show-header")!=="false",r=this.getAttribute("show-footer")!=="false";this.$headerEl.style.display=t?"":"none",this.$footerEl.style.display=r?"":"none"}renderRadioNav(){let t=this.interaction&&"slidesCount"in this.interaction?this.interaction.slidesCount:1;this.$radioNav.innerHTML="";for(let r=1;r<=t;r++){let i=document.createElement("input");i.type="radio",i.name="step-nav",i.id=`step-${r}`,r===1&&(i.checked=!0);let o=document.createElement("label");o.htmlFor=`step-${r}`,o.textContent=String(r),this.$radioNav.appendChild(i),this.$radioNav.appendChild(o)}}getContentArea(){return this.$contentEl}};customElements.get("edu-window")||customElements.define("edu-window",Be);et();export{Ae as AdjacencyTable,be as AssetValidationError,x as BaseInteraction,oe as CategorizeTheWords,Te as ClassificationMatrix,Qe as EduTable,Je as EduText,ce as FillBlanks,Be as InteractionsBaseShell,te as ListRecall,Se as LookupTable,ee as MCQ,ie as MarkTheWords,$e as NaryChoiceTable,we as OpenClassification,ue as RankOrder,ae as SequentialCategorizeTheWords,ye as SequentialClassification,de as SequentialFillBlanks,ne as SequentialMarkTheWords,le as SequentialTextTransformation,Ce as SimultaneousAssociation,se as TextTransformation,ll as adjacencyTableDataParser,pl as adjacencyTableDataValidator,Vr as adjacencyTableGrader,sl as basicTableDataParser,ul as basicTableDataValidator,Or as classificationTableGrader,Ma as clearInteractionRegistry,Fe as cognikitThemePresets,ke as compareValues,No as configureCognikit,Ra as createInteraction,bt as defaultCognikitThemeVariables,We as detectCellKind,je as ensureCognikitTheme,Fr as getAdjacencyCellGrading,Ke as getAllUniqueValues,Ee as getAllValues,De as getBlanksGradingState,Ur as getClassificationCellGrading,Pe as getClassificationGradingState,Go as getCognikitConfig,Oo as getCognikitThemePresets,pa as getDNDGradingState,Me as getHighlightGradingState,Yo as getInteraction,La as getInteractionRegistry,jr as getLookupCellGrading,Yr as getNaryCellGrading,wt as getTransformationGradingState,Da as listInteractions,cl as lookupTableDataParser,hl as lookupTableDataValidator,Gr as lookupTableGrader,Nr as naryTableGrader,ca as parseTextEngineSequential,qo as parseYamlAssets,zr as recognitionGrader,Hs as recognitionParser,Gs as recognitionValidator,va as registerBuiltInInteractions,T as registerInteraction,Fo as resetCognikitTheme,Mr as resolveCognikitTheme,yt as seriationGrader,ba as seriationParser,fa as seriationValidator,Vo as setCognikitTheme,oi as textEngineBaseDataValidator,ri as textEngineBaseGrammarParser,ai as textEngineBlanksDataValidator,Le as textEngineBlanksGrader,ii as textEngineBlanksGrammarParser,si as textEngineClassificationDataValidator,Re as textEngineClassificationGrader,ni as textEngineClassificationGrammarParser,ua as textEngineDNDGrader,da as textEngineDataValidator,_e as textEngineHighlightGrader,Ie as textEngineTransformationGrader,Ia as unregisterInteraction,zo as validateAndNormalizeAssets};
4596
4673
  /*! Bundled license information:
4597
4674
 
4598
4675
  js-yaml/dist/js-yaml.mjs: