@pie-element/multiple-choice 12.1.0-next.0 → 12.1.2-next.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/CHANGELOG.md +1246 -2946
- package/configure/CHANGELOG.md +962 -2385
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +652 -1634
- package/controller/package.json +2 -2
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/print.js +3 -1
- package/lib/print.js.map +1 -1
- package/package.json +7 -10
- package/module/configure.js +0 -1
- package/module/controller.js +0 -2998
- package/module/demo.js +0 -86
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -124
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/module/demo.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import Configure from './configure.js';
|
|
2
|
-
import Element from './element.js';
|
|
3
|
-
import * as controller from './controller.js';
|
|
4
|
-
|
|
5
|
-
var generate = {};
|
|
6
|
-
|
|
7
|
-
generate.model = (id, element) => ({
|
|
8
|
-
id,
|
|
9
|
-
element,
|
|
10
|
-
choiceMode: 'checkbox',
|
|
11
|
-
choicePrefix: 'numbers',
|
|
12
|
-
choices: [
|
|
13
|
-
{
|
|
14
|
-
correct: true,
|
|
15
|
-
value: 'sweden',
|
|
16
|
-
label: 'Sweden',
|
|
17
|
-
feedback: {
|
|
18
|
-
type: 'none',
|
|
19
|
-
value: '',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
value: 'iceland',
|
|
24
|
-
label: 'Iceland',
|
|
25
|
-
feedback: {
|
|
26
|
-
type: 'none',
|
|
27
|
-
value: '',
|
|
28
|
-
},
|
|
29
|
-
rationale: 'Rationale for Iceland',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
value: 'norway',
|
|
33
|
-
label: 'Norway',
|
|
34
|
-
feedback: {
|
|
35
|
-
type: 'none',
|
|
36
|
-
value: '',
|
|
37
|
-
},
|
|
38
|
-
rationale: 'Rationale for Norway',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
correct: true,
|
|
42
|
-
value: 'finland',
|
|
43
|
-
label: 'Finland',
|
|
44
|
-
feedback: {
|
|
45
|
-
type: 'none',
|
|
46
|
-
value: '',
|
|
47
|
-
},
|
|
48
|
-
rationale: 'Rationale for Finland',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
extraCSSRules: {
|
|
52
|
-
names: ['red', 'blue'],
|
|
53
|
-
rules: `
|
|
54
|
-
.red {
|
|
55
|
-
color: red !important;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.blue {
|
|
59
|
-
color: blue !important;
|
|
60
|
-
}
|
|
61
|
-
`,
|
|
62
|
-
},
|
|
63
|
-
prompt: '',
|
|
64
|
-
promptEnabled: true,
|
|
65
|
-
toolbarEditorPosition: 'bottom',
|
|
66
|
-
rubricEnabled: false,
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const { model } = generate;
|
|
70
|
-
|
|
71
|
-
var config = {
|
|
72
|
-
elements: {
|
|
73
|
-
'multiple-choice': '../..',
|
|
74
|
-
},
|
|
75
|
-
models: [model('1', 'multiple-choice')],
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
//Note: demo-el is a custom element loaded in the markup.
|
|
79
|
-
customElements.whenDefined("demo-el").then(() => {
|
|
80
|
-
config.models.forEach((m) => {
|
|
81
|
-
const de = document.createElement("demo-el");
|
|
82
|
-
document.body.appendChild(de);
|
|
83
|
-
de.def = { tagName: m.element, Element, Configure, controller };
|
|
84
|
-
de.model = m;
|
|
85
|
-
});
|
|
86
|
-
});
|
package/module/element.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_react as e,_dll_react_dom as t,_dll_mui__material_styles as o,_dll_mui__material as s,_dll_prop_types as n,_dll_pie_lib__render_ui as i,_dll_classnames as r,_dll_pie_lib__correct_answer_toggle as a,_dll_debug as l}from"../../../@pie-lib/shared-module@^4.0.1/module/index.js";import{_dll_pie_lib__math_rendering as c}from"../../../@pie-lib/math-rendering-module@^4.0.7/module/index.js";function d(e,t){return null!=e?e:t()}function h(e){let t,o=e[0],s=1;for(;s<e.length;){const n=e[s],i=e[s+1];if(s+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=i(o)):"call"!==n&&"optionalCall"!==n||(o=i((...e)=>o.call(t,...e)),t=void 0)}return o}const u=e=>"string"==typeof e,p=()=>{let e,t;const o=new Promise((o,s)=>{e=o,t=s});return o.resolve=e,o.reject=t,o},g=e=>null==e?"":""+e,f=/###/g,m=e=>e&&e.indexOf("###")>-1?e.replace(f,"."):e,b=e=>!e||u(e),v=(e,t,o)=>{const s=u(t)?t.split("."):t;let n=0;for(;n<s.length-1;){if(b(e))return{};const t=m(s[n]);!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++n}return b(e)?{}:{obj:e,k:m(s[n])}},y=(e,t,o)=>{const{obj:s,k:n}=v(e,t,Object);if(void 0!==s||1===t.length)return void(s[n]=o);let i=t[t.length-1],r=t.slice(0,t.length-1),a=v(e,r,Object);for(;void 0===a.obj&&r.length;)i=`${r[r.length-1]}.${i}`,r=r.slice(0,r.length-1),a=v(e,r,Object),h([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=o},x=(e,t)=>{const{obj:o,k:s}=v(e,t);if(o&&Object.prototype.hasOwnProperty.call(o,s))return o[s]},S=(e,t,o)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?u(e[s])||e[s]instanceof String||u(t[s])||t[s]instanceof String?o&&(e[s]=t[s]):S(e[s],t[s],o):e[s]=t[s]);return e},C=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var k={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const w=e=>u(e)?e.replace(/[&<>"'\/]/g,e=>k[e]):e;const E=[" ",",","?","!",";"],L=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const o=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,o),this.regExpQueue.push(e),o}}(20),A=(e,t,o=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(o);let n=e;for(let e=0;e<s.length;){if(!n||"object"!=typeof n)return;let t,i="";for(let r=e;r<s.length;++r)if(r!==e&&(i+=o),i+=s[r],t=n[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&r<s.length-1)continue;e+=r-e+1;break}n=t}return n},O=e=>h([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),_={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){h([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class N{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||_,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,o,s){return s&&!this.debug?null:(u(e[0])&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new N(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new N(this.logger,e)}}var R=new N;class P{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const o=this.observers[e].get(t)||0;this.observers[e].set(t,o+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,o])=>{for(let s=0;s<o;s++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([o,s])=>{for(let n=0;n<s;n++)o.apply(o,[e,...t])})}}}class T extends P{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,o,s={}){const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,i=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],o&&(Array.isArray(o)?r.push(...o):u(o)&&n?r.push(...o.split(n)):r.push(o)));const a=x(this.data,r);return!a&&!t&&!o&&e.indexOf(".")>-1&&(e=r[0],t=r[1],o=r.slice(2).join(".")),!a&&i&&u(o)?A(h([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),o,n):a}addResource(e,t,o,s,n={silent:!1}){const i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let r=[e,t];o&&(r=r.concat(i?o.split(i):o)),e.indexOf(".")>-1&&(r=e.split("."),s=t,t=r[1]),this.addNamespaces(t),y(this.data,r,s),n.silent||this.emit("added",e,t,o,s)}addResources(e,t,o,s={silent:!1}){for(const s in o)(u(o[s])||Array.isArray(o[s]))&&this.addResource(e,t,s,o[s],{silent:!0});s.silent||this.emit("added",e,t,o)}addResourceBundle(e,t,o,s,n,i={silent:!1,skipCopy:!1}){let r=[e,t];e.indexOf(".")>-1&&(r=e.split("."),s=o,o=t,t=r[1]),this.addNamespaces(t);let a=x(this.data,r)||{};i.skipCopy||(o=JSON.parse(JSON.stringify(o))),s?S(a,o,n):a={...a,...o},y(this.data,r,a),i.silent||this.emit("added",e,t,o)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var $={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,o,s,n){return e.forEach(e=>{t=d(h([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,o,s,n)]),()=>t)}),t}};const j=Symbol("i18next/PATH_KEY");function M(e,t){const{[j]:o}=e(function(){const e=[],t=Object.create(null);let o;return t.get=(s,n)=>(h([o,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),n===j?e:(e.push(n),o=Proxy.revocable(s,t),o.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return o.join(d(h([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const I={},F=e=>!u(e)&&"boolean"!=typeof e&&"number"!=typeof e;class D extends P{constructor(e,t={}){var o,s;super(),o=e,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{o[e]&&(s[e]=o[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=R.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const o={...t};if(null==e)return!1;const s=this.resolve(e,o);if(void 0===h([s,"optionalAccess",e=>e.res]))return!1;const n=F(s.res);return!1!==o.returnObjects||!n}extractFromKey(e,t){let o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let n=t.ns||this.options.defaultNS||[];const i=o&&e.indexOf(o)>-1,r=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,o)=>{t=t||"",o=o||"";const s=E.filter(e=>t.indexOf(e)<0&&o.indexOf(e)<0);if(0===s.length)return!0;const n=L.getRegExp(`(${s.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!n.test(e);if(!i){const t=e.indexOf(o);t>0&&!n.test(e.substring(0,t))&&(i=!0)}return i})(e,o,s));if(i&&!r){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:u(n)?[n]:n};const i=e.split(o);(o!==s||o===s&&this.options.ns.indexOf(i[0])>-1)&&(n=i.shift()),e=i.join(s)}return{key:e,namespaces:u(n)?[n]:n}}translate(e,t,o){let s="object"==typeof t?{...t}:t;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==e)return"";"function"==typeof e&&(e=M(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]);const n=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(e[e.length-1],s),l=a[a.length-1];let c=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const d=s.lng||this.language,p=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===h([d,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return p?n?{res:`${l}${c}${r}`,usedKey:r,exactUsedKey:r,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${c}${r}`:n?{res:r,usedKey:r,exactUsedKey:r,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:r;const g=this.resolve(e,s);let f=h([g,"optionalAccess",e=>e.res]);const m=h([g,"optionalAccess",e=>e.usedKey])||r,b=h([g,"optionalAccess",e=>e.exactUsedKey])||r,v=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,x=void 0!==s.count&&!u(s.count),S=D.hasDefaultValue(s),C=x?this.pluralResolver.getSuffix(d,s.count,s):"",k=s.ordinal&&x?this.pluralResolver.getSuffix(d,s.count,{ordinal:!1}):"",w=x&&!s.ordinal&&0===s.count,E=w&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${C}`]||s[`defaultValue${k}`]||s.defaultValue;let L=f;y&&!f&&S&&(L=E);const A=F(L),O=Object.prototype.toString.apply(L);if(!(y&&L&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(O)<0)||u(v)&&Array.isArray(L))if(y&&u(v)&&Array.isArray(f))f=f.join(v),f&&(f=this.extendTranslation(f,e,s,o));else{let t=!1,n=!1;!this.isValidLookup(f)&&S&&(t=!0,f=E),this.isValidLookup(f)||(n=!0,f=r);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:f,u=S&&E!==f&&this.options.updateMissing;if(n||t||u){if(this.logger.log(u?"updateKey":"missingKey",d,l,r,u?E:f),i){const e=this.resolve(r,{...s,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let o=0;o<t.length;o++)e.push(t[o]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(s.lng||this.language):e.push(s.lng||this.language);const o=(e,t,o)=>{const n=S&&o!==f?o:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,n,u,s):h([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,n,u,s),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,s);w&&s[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{o([e],r+t,s[`defaultValue${t}`]||E)})}):o(e,r,E))}f=this.extendTranslation(f,e,s,g,o),n&&f===r&&this.options.appendNamespaceToMissingKey&&(f=`${l}${c}${r}`),(n||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${r}`:r,t?f:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,L,{...s,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return n?(g.res=e,g.usedParams=this.getUsedParamsDetails(s),g):e}if(i){const e=Array.isArray(L),t=e?[]:{},o=e?b:m;for(const e in L)if(Object.prototype.hasOwnProperty.call(L,e)){const n=`${o}${i}${e}`;t[e]=S&&!f?this.translate(n,{...s,defaultValue:F(E)?E[e]:void 0,joinArrays:!1,ns:a}):this.translate(n,{...s,joinArrays:!1,ns:a}),t[e]===n&&(t[e]=L[e])}f=t}}return n?(g.res=f,g.usedParams=this.getUsedParamsDetails(s),g):f}extendTranslation(e,t,o,s,n){if(h([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const i=u(e)&&(void 0!==h([o,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(i){const t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let a=o.replace&&!u(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,o.lng||this.language||s.usedLng,o),i){const t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(o.nest=!1)}!o.lng&&s&&s.res&&(o.lng=this.language||s.usedLng),!1!==o.nest&&(e=this.interpolator.nest(e,(...e)=>h([n,"optionalAccess",e=>e[0]])!==e[0]||o.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),o)),o.interpolation&&this.interpolator.reset()}const i=o.postProcess||this.options.postProcess,r=u(i)?[i]:i;return null!=e&&h([r,"optionalAccess",e=>e.length])&&!1!==o.applyPostProcessor&&(e=$.handle(r,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),e}resolve(e,t={}){let o,s,n,i,r;return u(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(o))return;const a=this.extractFromKey(e,t),l=a.key;s=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==t.count&&!u(t.count),p=d&&!t.ordinal&&0===t.count,g=void 0!==t.context&&(u(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(o)||(r=e,I[`${f[0]}-${e}`]||!h([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||h([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(r)])||(I[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${s}" for languages "${f.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(s=>{if(this.isValidLookup(o))return;i=s;const r=[l];if(h([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(r,l,s,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(s,t.count,t));const o=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&0===e.indexOf(n)&&r.push(l+e.replace(n,this.options.pluralSeparator)),r.push(l+e),p&&r.push(l+o)),g){const s=`${l}${this.options.contextSeparator||"_"}${t.context}`;r.push(s),d&&(t.ordinal&&0===e.indexOf(n)&&r.push(s+e.replace(n,this.options.pluralSeparator)),r.push(s+e),p&&r.push(s+o))}}let a;for(;a=r.pop();)this.isValidLookup(o)||(n=a,o=this.getResource(s,e,a,t))}))})}),{res:o,usedKey:s,exactUsedKey:n,usedLng:i,usedNS:r}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,o,s={}){return h([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,o,s):this.resourceStore.getResource(e,t,o,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&!u(e.replace);let s=o?e.replace:e;if(o&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!o){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){const t="defaultValue";for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t===o.substring(0,12)&&void 0!==e[o])return!0;return!1}}class B{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=R.create("languageUtils")}getScriptPartFromCode(e){if(!(e=O(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=O(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(u(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const o=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(o)||(t=o)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const o=this.getScriptPartFromCode(e);if(this.isSupportedCode(o))return t=o;const s=this.getLanguagePartFromCode(e);if(this.isSupportedCode(s))return t=s;t=this.options.supportedLngs.find(e=>e===s?e:e.indexOf("-")<0&&s.indexOf("-")<0?void 0:e.indexOf("-")>0&&s.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===s||0===e.indexOf(s)&&s.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),u(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}toResolveHierarchy(e,t){const o=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),s=[],n=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return u(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(e))):u(e)&&n(this.formatLanguageCode(e)),o.forEach(e=>{s.indexOf(e)<0&&n(this.formatLanguageCode(e))}),s}}const V={zero:0,one:1,two:2,few:3,many:4,other:5},z={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class K{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=R.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const o=O("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:o,type:s});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let i;try{i=new Intl.PluralRules(o,{type:s})}catch(o){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),z;if(!e.match(/-|_/))return z;const s=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(s,t)}return this.pluralRulesCache[n]=i,i}needsPlural(e,t={}){let o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),h([o,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,o={}){return this.getSuffixes(e,o).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),o?o.resolvedOptions().pluralCategories.sort((e,t)=>V[e]-V[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,o={}){const s=this.getRule(e,o);return s?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,o))}}const U=(e,t,o,s=".",n=!0)=>{let i=((e,t,o)=>{const s=x(e,o);return void 0!==s?s:x(t,o)})(e,t,o);return!i&&n&&u(o)&&(i=A(e,o,s),void 0===i&&(i=A(t,o,s))),i},H=e=>e.replace(/\$/g,"$$$$");class q{constructor(e={}){this.logger=R.create("interpolator"),this.options=e,this.format=h([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:o,useRawValueToEscape:s,prefix:n,prefixEscaped:i,suffix:r,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:u,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:w,this.escapeValue=void 0===o||o,this.useRawValueToEscape=void 0!==s&&s,this.prefix=n?C(n):i||"{{",this.suffix=r?C(r):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?C(h):u||C("$t("),this.nestingSuffix=p?C(p):g||C(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>h([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,o,s){let n,i,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const n=U(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,o,{...s,...t,interpolationkey:e}):n}const n=e.split(this.formatSeparator),i=n.shift().trim(),r=n.join(this.formatSeparator).trim();return this.format(U(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),r,o,{...s,...t,interpolationkey:i})};this.resetRegExp();const c=h([s,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,d=void 0!==h([s,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>H(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?H(this.escape(e)):H(e)}].forEach(t=>{for(r=0;n=t.regex.exec(e);){const o=n[1].trim();if(i=l(o),void 0===i)if("function"==typeof c){const t=c(e,n,s);i=u(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,o))i="";else{if(d){i=n[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),i=""}else u(i)||this.useRawValueToEscape||(i=g(i));const a=t.safeValue(i);if(e=e.replace(n[0],a),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,r++,r>=this.maxReplaces)break}}),e}nest(e,t,o={}){let s,n,i;const r=(e,t)=>{const o=this.nestingOptionsSeparator;if(e.indexOf(o)<0)return e;const s=e.split(new RegExp(`${o}[ ]*{`));let n=`{${s[1]}`;e=s[0],n=this.interpolate(n,i);const r=n.match(/'/g),a=n.match(/"/g);(d(h([r,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(n=n.replace(/'/g,'"'));try{i=JSON.parse(n),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${o}${n}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;s=this.nestingRegexp.exec(e);){let a=[];i={...o},i=i.replace&&!u(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==l&&(a=s[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),s[1]=s[1].slice(0,l)),n=t(r.call(this,s[1].trim(),i),i),n&&s[0]===e&&!u(n))return n;u(n)||(n=g(n)),n||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),n=""),a.length&&(n=a.reduce((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:s[1].trim()}),n.trim())),e=e.replace(s[0],n),this.regexp.lastIndex=0}return e}}const W=e=>{const t={};return(o,s,n)=>{let i=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(i={...i,[n.interpolationkey]:void 0});const r=s+JSON.stringify(i);let a=t[r];return a||(a=e(O(s),n),t[r]=a),a(o)}},Y=e=>(t,o,s)=>e(O(o),s)(t);class J{constructor(e={}){this.logger=R.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const o=t.cacheInBuiltFormats?W:Y;this.formats={number:o((e,t)=>{const o=new Intl.NumberFormat(e,{...t});return e=>o.format(e)}),currency:o((e,t)=>{const o=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>o.format(e)}),datetime:o((e,t)=>{const o=new Intl.DateTimeFormat(e,{...t});return e=>o.format(e)}),relativetime:o((e,t)=>{const o=new Intl.RelativeTimeFormat(e,{...t});return e=>o.format(e,t.range||"day")}),list:o((e,t)=>{const o=new Intl.ListFormat(e,{...t});return e=>o.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=W(t)}format(e,t,o,s={}){const n=t.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find(e=>e.indexOf(")")>-1)){const e=n.findIndex(e=>e.indexOf(")")>-1);n[0]=[n[0],...n.splice(1,e)].join(this.formatSeparator)}return n.reduce((e,t)=>{const{formatName:n,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const o={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);"currency"===t&&n.indexOf(":")<0?o.currency||(o.currency=n.trim()):"relativetime"===t&&n.indexOf(":")<0?o.range||(o.range=n.trim()):n.split(";").forEach(e=>{if(e){const[t,...s]=e.split(":"),n=s.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();o[i]||(o[i]=n),"false"===n&&(o[i]=!1),"true"===n&&(o[i]=!0),isNaN(n)||(o[i]=parseInt(n,10))}})}return{formatName:t,formatOptions:o}})(t);if(this.formats[n]){let t=e;try{const r=h([s,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[s.interpolationkey]])||{},a=r.locale||r.lng||s.locale||s.lng||o;t=this.formats[n](e,a,{...i,...s,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${n}`),e},e)}}class G extends P{constructor(e,t,o,s={}){super(),this.backend=e,this.store=t,this.services=o,this.languageUtils=o.languageUtils,this.options=s,this.logger=R.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],h([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(o,s.backend,s)])}queueLoad(e,t,o,s){const n={},i={},r={},a={};return e.forEach(e=>{let s=!0;t.forEach(t=>{const r=`${e}|${t}`;!o.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===i[r]&&(i[r]=!0):(this.state[r]=1,s=!1,void 0===i[r]&&(i[r]=!0),void 0===n[r]&&(n[r]=!0),void 0===a[t]&&(a[t]=!0)))}),s||(r[e]=!0)}),(Object.keys(n).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(n),pending:Object.keys(i),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(e,t,o){const s=e.split("|"),n=s[0],i=s[1];t&&this.emit("failedLoading",n,i,t),!t&&o&&this.store.addResourceBundle(n,i,o,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&o&&(this.state[e]=0);const r={};this.queue.forEach(o=>{((e,t,o)=>{const{obj:s,k:n}=v(e,t,Object);s[n]=s[n]||[],s[n].push(o)})(o.loaded,[n],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(o,e),t&&o.errors.push(t),0!==o.pendingCount||o.done||(Object.keys(o.loaded).forEach(e=>{r[e]||(r[e]={});const t=o.loaded[e];t.length&&t.forEach(t=>{void 0===r[e][t]&&(r[e][t]=!0)})}),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())}),this.emit("loaded",r),this.queue=this.queue.filter(e=>!e.done)}read(e,t,o,s=0,n=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:o,tried:s,wait:n,callback:i});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}r&&a&&s<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,o,s+1,2*n,i)},n):i(r,a)},a=this.backend[o].bind(this.backend);if(2!==a.length)return a(e,t,r);try{const o=a(e,t);o&&"function"==typeof o.then?o.then(e=>r(null,e)).catch(r):r(null,o)}catch(e){r(e)}}prepareLoading(e,t,o={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();u(e)&&(e=this.languageUtils.toResolveHierarchy(e)),u(t)&&(t=[t]);const n=this.queueLoad(e,t,o,s);if(!n.toLoad.length)return n.pending.length||s(),null;n.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,o){this.prepareLoading(e,t,{},o)}reload(e,t,o){this.prepareLoading(e,t,{reload:!0},o)}loadOne(e,t=""){const o=e.split("|"),s=o[0],n=o[1];this.read(s,n,"read",void 0,void 0,(o,i)=>{o&&this.logger.warn(`${t}loading namespace ${n} for language ${s} failed`,o),!o&&i&&this.logger.log(`${t}loaded namespace ${n} for language ${s}`,i),this.loaded(e,o,i)})}saveMissing(e,t,o,s,n,i={},r=()=>{}){if(!h([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||h([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=o&&""!==o){if(h([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...i,isUpdate:n},l=this.backend.create.bind(this.backend);if(l.length<6)try{let n;n=5===l.length?l(e,t,o,s,a):l(e,t,o,s),n&&"function"==typeof n.then?n.then(e=>r(null,e)).catch(r):r(null,n)}catch(e){r(e)}else l(e,t,o,s,r,a)}e&&e[0]&&this.store.addResource(e[0],t,o,s)}}else this.logger.warn(`did not save key "${o}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Q=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),u(e[1])&&(t.defaultValue=e[1]),u(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const o=e[3]||e[2];Object.keys(o).forEach(e=>{t[e]=o[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),X=e=>(u(e.ns)&&(e.ns=[e.ns]),u(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),u(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),h([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),Z=()=>{};class ee extends P{constructor(e={},t){var o;if(super(),this.options=X(e),this.services={},this.logger=R,this.modules={external:[]},o=this,Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(e=>{"function"==typeof o[e]&&(o[e]=o[e].bind(o))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(u(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const o=Q();var s;this.options={...o,...this.options,...X(e)},this.options.interpolation={...o.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(h([s=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||h([s,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||h([s,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&s.options.backend.backends.some(e=>h([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||h([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?R.init(n(this.modules.logger),this.options):R.init(null,this.options),e=this.modules.formatter?this.modules.formatter:J;const t=new B(this.options);this.store=new T(this.options.resources,this.options);const s=this.services;s.logger=R,s.resourceStore=this.store,s.languageUtils=t,s.pluralResolver=new K(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(s.formatter=n(e),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new q(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new G(n(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(s.languageDetector=n(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=n(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new D(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Z),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=p(),r=()=>{const e=(e,o)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(o),t(e,o)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),i}loadResources(e,t=Z){let o=t;const s=u(e)?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===h([s,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return o();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(s)t(s);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}h([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),o(e)})}else o(null)}reloadResources(e,t,o){const s=p();return"function"==typeof e&&(o=e,e=void 0),"function"==typeof t&&(o=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),o||(o=Z),this.services.backendConnector.reload(e,t,e=>{s.resolve(),o(e)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&$.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const o=p();this.emit("languageChanging",e);const s=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},n=(n,i)=>{i?this.isLanguageChangingTo===e&&(s(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,o.resolve((...e)=>this.t(...e)),t&&t(n,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const o=u(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(o)?o:this.services.languageUtils.getBestMatchFromCodes(u(t)?[t]:t);i&&(this.language||s(i),this.translator.language||this.translator.changeLanguage(i),h([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{n(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),o}getFixedT(e,t,o){const s=(e,t,...n)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(n)):{...t},i.lng=i.lng||s.lng,i.lngs=i.lngs||s.lngs,i.ns=i.ns||s.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||o||s.keyPrefix);const r=this.options.keySeparator||".";let a;return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=M(e,{...this.options,...t})),`${i.keyPrefix}${r}${e}`)):("function"==typeof e&&(e=M(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${r}${e}`:e),this.t(a,i)};return u(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=o,s}t(...e){return h([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return h([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;const i=(e,t)=>{const o=this.services.backendConnector.state[`${e}|${t}`];return-1===o||0===o||2===o};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(o,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(o,e)||s&&!i(n,e)))}loadNamespaces(e,t){const o=p();return this.options.ns?(u(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}loadLanguages(e,t){const o=p();u(e)&&(e=[e]);const s=this.options.preload||[],n=e.filter(e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return n.length?(this.options.preload=s.concat(n),this.loadResources(e=>{o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(h([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=h([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new B(Q());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const o=new ee(e,t);return o.createInstance=ee.createInstance,o}cloneInstance(e={},t=Z){const o=e.forkResourceStore;o&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},n=new ee(s);void 0===e.debug&&void 0===e.prefix||(n.logger=n.logger.clone(e));if(["store","services","language"].forEach(e=>{n[e]=this[e]}),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},o){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((o,s)=>(o[s]={...e[t][s]},o),e[t]),e),{});n.store=new T(e,s),n.services.resourceStore=n.store}if(e.interpolation){const t={...Q().interpolation,...this.options.interpolation,...e.interpolation},o={...s,interpolation:t};n.services.interpolator=new q(o)}return n.translator=new D(n.services,s),n.translator.on("*",(e,...t)=>{n.emit(e,...t)}),n.init(s,t),n.translator.options=s,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const te=ee.createInstance();te.createInstance,te.dir,te.init,te.loadResources,te.reloadResources,te.use,te.changeLanguage,te.getFixedT,te.t,te.exists,te.setDefaultNamespace,te.hasLoadedNamespace,te.loadNamespaces,te.loadLanguages;te.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var oe={translator:{...te,t:(e,t)=>{const{lng:o}=t;switch(o){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return te.t(e,{lng:o,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var s in o)({}).hasOwnProperty.call(o,s)&&(e[s]=o[s])}return e},se.apply(null,arguments)}function ne(e,t){if(null==e)return{};var o={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;o[s]=e[s]}return o}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}function re(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ie(e,t)}function ae(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var le=!1;var ce=e.createContext(null),de=function(e){return e.scrollTop};const he=e,ue=t;var pe="unmounted",ge="exited",fe="entering",me="entered",be="exiting",ve=function(e){function t(t,o){var s;s=e.call(this,t,o)||this;var n,i=o&&!o.isMounting?t.enter:t.appear;return s.appearStatus=null,t.in?i?(n=ge,s.appearStatus=fe):n=me:n=t.unmountOnExit||t.mountOnEnter?pe:ge,s.state={status:n},s.nextCallback=null,s}re(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===pe?{status:ge}:null};var o=t.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(e){var t=null;if(e!==this.props){var o=this.state.status;this.props.in?o!==fe&&o!==me&&(t=fe):o!==fe&&o!==me||(t=be)}this.updateStatus(!1,t)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var e,t,o,s=this.props.timeout;return e=t=o=s,null!=s&&"number"!=typeof s&&(e=s.exit,t=s.enter,o=void 0!==s.appear?s.appear:t),{exit:e,enter:t,appear:o}},o.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===fe){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:ue.findDOMNode(this);o&&de(o)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ge&&this.setState({status:pe})},o.performEnter=function(e){var t=this,o=this.props.enter,s=this.context?this.context.isMounting:e,n=this.props.nodeRef?[s]:[ue.findDOMNode(this),s],i=n[0],r=n[1],a=this.getTimeouts(),l=s?a.appear:a.enter;!e&&!o||le?this.safeSetState({status:me},function(){t.props.onEntered(i)}):(this.props.onEnter(i,r),this.safeSetState({status:fe},function(){t.props.onEntering(i,r),t.onTransitionEnd(l,function(){t.safeSetState({status:me},function(){t.props.onEntered(i,r)})})}))},o.performExit=function(){var e=this,t=this.props.exit,o=this.getTimeouts(),s=this.props.nodeRef?void 0:ue.findDOMNode(this);t&&!le?(this.props.onExit(s),this.safeSetState({status:be},function(){e.props.onExiting(s),e.onTransitionEnd(o.exit,function(){e.safeSetState({status:ge},function(){e.props.onExited(s)})})})):this.safeSetState({status:ge},function(){e.props.onExited(s)})},o.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},o.setNextCallback=function(e){var t=this,o=!0;return this.nextCallback=function(s){o&&(o=!1,t.nextCallback=null,e(s))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},o.onTransitionEnd=function(e,t){this.setNextCallback(t);var o=this.props.nodeRef?this.props.nodeRef.current:ue.findDOMNode(this),s=null==e&&!this.props.addEndListener;if(o&&!s){if(this.props.addEndListener){var n=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],i=n[0],r=n[1];this.props.addEndListener(i,r)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},o.render=function(){var e=this.state.status;if(e===pe)return null;var t=this.props,o=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var s=ne(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return he.createElement(ce.Provider,{value:null},"function"==typeof o?o(e,s):he.cloneElement(he.Children.only(o),s))},t}(he.Component);function ye(){}ve.contextType=ce,ve.propTypes={},ve.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ye,onEntering:ye,onEntered:ye,onExit:ye,onExiting:ye,onExited:ye},ve.UNMOUNTED=pe,ve.EXITED=ge,ve.ENTERING=fe,ve.ENTERED=me,ve.EXITING=be;var xe=ve;const Se=e;var Ce=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return s=t,void((o=e).classList?o.classList.add(s):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(o,s)||("string"==typeof o.className?o.className=o.className+" "+s:o.setAttribute("class",(o.className&&o.className.baseVal||"")+" "+s)));var o,s})},ke=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return s=t,void((o=e).classList?o.classList.remove(s):"string"==typeof o.className?o.className=ae(o.className,s):o.setAttribute("class",ae(o.className&&o.className.baseVal||"",s)));var o,s})},we=function(e){function t(){for(var t,o=arguments.length,s=new Array(o),n=0;n<o;n++)s[n]=arguments[n];return(t=e.call.apply(e,[this].concat(s))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,o){var s=t.resolveArguments(e,o),n=s[0],i=s[1];t.removeClasses(n,"exit"),t.addClass(n,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,o)},t.onEntering=function(e,o){var s=t.resolveArguments(e,o),n=s[0],i=s[1]?"appear":"enter";t.addClass(n,i,"active"),t.props.onEntering&&t.props.onEntering(e,o)},t.onEntered=function(e,o){var s=t.resolveArguments(e,o),n=s[0],i=s[1]?"appear":"enter";t.removeClasses(n,i),t.addClass(n,i,"done"),t.props.onEntered&&t.props.onEntered(e,o)},t.onExit=function(e){var o=t.resolveArguments(e)[0];t.removeClasses(o,"appear"),t.removeClasses(o,"enter"),t.addClass(o,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var o=t.resolveArguments(e)[0];t.addClass(o,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var o=t.resolveArguments(e)[0];t.removeClasses(o,"exit"),t.addClass(o,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,o){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,o]},t.getClassNames=function(e){var o=t.props.classNames,s="string"==typeof o,n=s?""+(s&&o?o+"-":"")+e:o[e];return{baseClassName:n,activeClassName:s?n+"-active":o[e+"Active"],doneClassName:s?n+"-done":o[e+"Done"]}},t}re(t,e);var o=t.prototype;return o.addClass=function(e,t,o){var s=this.getClassNames(t)[o+"ClassName"],n=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===o&&n&&(s+=" "+n),"active"===o&&e&&de(e),s&&(this.appliedClasses[t][o]=s,Ce(e,s))},o.removeClasses=function(e,t){var o=this.appliedClasses[t],s=o.base,n=o.active,i=o.done;this.appliedClasses[t]={},s&&ke(e,s),n&&ke(e,n),i&&ke(e,i)},o.render=function(){var e=this.props;e.classNames;var t=ne(e,["classNames"]);return Se.createElement(xe,se({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Se.Component);we.defaultProps={classNames:""},we.propTypes={};var Ee=we;const{Children:Le}=e,{cloneElement:Ae}=e,{isValidElement:Oe}=e;function _e(e,t){var o=Object.create(null);return e&&Le.map(e,function(e){return e}).forEach(function(e){o[e.key]=function(e){return t&&Oe(e)?t(e):e}(e)}),o}function Ne(e,t,o){return null!=o[t]?o[t]:e.props[t]}function Re(e,t,o){var s=_e(e.children),n=function(e,t){function o(o){return o in t?t[o]:e[o]}e=e||{},t=t||{};var s,n=Object.create(null),i=[];for(var r in e)r in t?i.length&&(n[r]=i,i=[]):i.push(r);var a={};for(var l in t){if(n[l])for(s=0;s<n[l].length;s++){var c=n[l][s];a[n[l][s]]=o(c)}a[l]=o(l)}for(s=0;s<i.length;s++)a[i[s]]=o(i[s]);return a}(t,s);return Object.keys(n).forEach(function(i){var r=n[i];if(Oe(r)){var a=i in t,l=i in s,c=t[i],d=Oe(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&Oe(c)&&(n[i]=Ae(r,{onExited:o.bind(null,r),in:c.props.in,exit:Ne(r,"exit",e),enter:Ne(r,"enter",e)})):n[i]=Ae(r,{in:!1}):n[i]=Ae(r,{onExited:o.bind(null,r),in:!0,exit:Ne(r,"exit",e),enter:Ne(r,"enter",e)})}}),n}const Pe=e;var Te=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},$e=function(e){function t(t,o){var s,n=(s=e.call(this,t,o)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(s));return s.state={contextValue:{isMounting:!0},handleExited:n,firstRender:!0},s}re(t,e);var o=t.prototype;return o.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},o.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var o,s,n=t.children,i=t.handleExited;return{children:t.firstRender?(o=e,s=i,_e(o.children,function(e){return Ae(e,{onExited:s.bind(null,e),in:!0,appear:Ne(e,"appear",o),enter:Ne(e,"enter",o),exit:Ne(e,"exit",o)})})):Re(e,n,i),firstRender:!1}},o.handleExited=function(e,t){var o=_e(this.props.children);e.key in o||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var o=se({},t.children);return delete o[e.key],{children:o}}))},o.render=function(){var e=this.props,t=e.component,o=e.childFactory,s=ne(e,["component","childFactory"]),n=this.state.contextValue,i=Te(this.state.children).map(o);return delete s.appear,delete s.enter,delete s.exit,null===t?Pe.createElement(ce.Provider,{value:n},i):Pe.createElement(ce.Provider,{value:n},Pe.createElement(t,s,i))},t}(Pe.Component);$e.propTypes={},$e.defaultProps={component:"div",childFactory:function(e){return e}};var je=$e;const Me=e,{styled:Ie}=o,{Box:Fe}=s,De=n,{color:Be}=i,Ve=Ie(Fe)({width:"33px",height:"33px","& svg":{position:"absolute",display:"inline-block",width:"33px",height:"33px",verticalAlign:"middle","& hide":{display:"none"}}}),ze=Ie("svg")({"& .incorrect-fill":{fill:`var(--feedback-incorrect-bg-color, ${Be.incorrect()})`},"& .correct-fill":{fill:`var(--feedback-correct-bg-color, ${Be.correct()})`}}),Ke=Ie("div")({position:"relative","&.feedback-tick-enter":{opacity:"0",left:"-50px"},"&.feedback-tick-enter-active":{opacity:"1",left:"0px",transition:"left 500ms ease-in 200ms, opacity 500ms linear 200ms"},"&.feedback-tick-exit":{opacity:"1",left:"0px"},"&.feedback-tick-exit-active":{opacity:"0",left:"-50px",transition:"left 300ms ease-in, opacity 300ms"}});class Ue extends Me.Component{static __initStatic(){this.propTypes={correctness:De.string}}constructor(e){super(e),Ue.prototype.__init.call(this),Ue.prototype.__init2.call(this),this.nodeRef=Me.createRef()}__init(){this.getIncorrectIcon=()=>Me.createElement(ze,{key:"1",preserveAspectRatio:"xMinYMin meet",x:"0px",y:"0px",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40"}},Me.createElement("g",null,Me.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",className:"incorrect-fill",width:"16.6",height:"3.7"}),Me.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",className:"incorrect-fill",width:"3.7",height:"16.6"})))}__init2(){this.getCorrectIcon=()=>Me.createElement(ze,{key:"2",preserveAspectRatio:"xMinYMin meet",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40"}},Me.createElement("polygon",{className:"correct-fill",points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4"}))}render(){const{correctness:e}=this.props,t=(()=>"incorrect"===e?this.getIncorrectIcon():"correct"===e?this.getCorrectIcon():null)();return Me.createElement(Ve,null,Me.createElement(je,null,e&&Me.createElement(Ee,{nodeRef:this.nodeRef,classNames:{enter:"feedback-tick-enter",enterActive:"feedback-tick-enter-active",exit:"feedback-tick-exit",exitActive:"feedback-tick-exit-active"},timeout:{enter:700,exit:300}},Me.createElement(Ke,{ref:this.nodeRef},t))))}}Ue.__initStatic();const{FormControlLabel:He}=s,{Box:qe}=s,{Checkbox:We}=s,{Radio:Ye}=s,Je=e,Ge=n,{styled:Qe}=o,{Feedback:Xe}=i,{color:Ze}=i,{PreviewPrompt:et}=i,tt=r,ot="multiple-choice-component",st=Qe(qe)({display:"flex",alignItems:"center",backgroundColor:Ze.background()}),nt=Qe(qe)({display:"flex",alignItems:"center",backgroundColor:Ze.background(),flex:1,"& label":{color:Ze.text(),"& > span":{fontSize:"inherit"}}}),it=Qe("span")(({theme:e})=>({display:"flex",alignItems:"center","& > span":{marginLeft:`-${e.spacing(1)}px`}})),rt=Qe("span")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),at=Qe(He)({"& .MuiFormControlLabel-label":{color:`${Ze.text()} !important`,backgroundColor:Ze.background(),letterSpacing:"normal"},"&.Mui-disabled *":{cursor:"not-allowed !important"}}),lt=(e,t)=>({[`&.${ot}`]:{color:`var(--choice-input-${e}, ${t}) !important`}}),ct=e=>{const t=t=>e?`${e}-${t}`:t;return{[t("root")]:{...lt("color",Ze.text()),...e?{}:{"&:hover":{color:`${Ze.primaryLight()} !important`}},..."correct"===e?lt("correct-color",Ze.text()):{},..."incorrect"===e?lt("incorrect-color",Ze.incorrect()):{}},[t("checked")]:{..."correct"===e?lt("correct-selected-color",Ze.correct()):{},..."incorrect"===e?lt("incorrect-checked",Ze.incorrect()):{},...e?{}:lt("selected-color",Ze.primary())},[t("disabled")]:{...lt("disabled-color",Ze.text()),..."correct"===e?lt("correct-disabled-color",Ze.disabled()):{},..."incorrect"===e?lt("incorrect-disabled-color",Ze.disabled()):{},opacity:.6,cursor:"not-allowed !important",pointerEvents:"initial !important"},focusVisibleUnchecked:{outline:`2px solid ${Ze.focusUncheckedBorder()}`,backgroundColor:Ze.focusUnchecked()},focusVisibleChecked:{outline:`2px solid ${Ze.focusCheckedBorder()}`,backgroundColor:Ze.focusChecked()}}},dt=Qe(We,{shouldForwardProp:e=>"correctness"!==e})(({correctness:e})=>{const t=ct(e),o=t=>e?`${e}-${t}`:t;return{[`&.${ot}`]:{...t[o("root")],"&.Mui-checked":t[o("checked")],"&.Mui-disabled":e?{}:t[o("disabled")]},"&.Mui-focusVisible":{"&:not(.Mui-checked)":t.focusVisibleUnchecked,"&.Mui-checked":t.focusVisibleChecked}}}),ht=e=>{const{correctness:t,checked:o,onChange:s,disabled:n,value:i,id:r,onKeyDown:a,inputRef:l}=e,c={checked:o,onChange:s,disabled:n,value:i};return Je.createElement(dt,{id:r,slotProps:{input:{ref:l}},"aria-checked":o,onKeyDown:a,disableRipple:!0,...c,correctness:t,className:ot})},ut=Qe(Ye,{shouldForwardProp:e=>"correctness"!==e})(({correctness:e})=>{const t=ct(e),o=t=>e?`${e}-${t}`:t;return{[`&.${ot}`]:{...t[o("root")],"&.Mui-checked":t[o("checked")],"&.Mui-disabled":e?{}:t[o("disabled")]},"&.Mui-focusVisible":{"&:not(.Mui-checked)":t.focusVisibleUnchecked,"&.Mui-checked":t.focusVisibleChecked}}}),pt=e=>{const{correctness:t,checked:o,onChange:s,disabled:n,value:i,id:r,tagName:a,inputRef:l}=e,c={checked:o,onChange:s,disabled:n,value:i};return Je.createElement(ut,{id:r,slotProps:{input:{ref:l}},"aria-checked":o,disableRipple:!0,...c,correctness:t,className:ot,name:a})};class gt extends Je.Component{static __initStatic(){this.propTypes={choiceMode:Ge.oneOf(["radio","checkbox"]),displayKey:Ge.string,checked:Ge.bool.isRequired,correctness:Ge.string,disabled:Ge.bool.isRequired,feedback:Ge.string,label:Ge.string.isRequired,rationale:Ge.string,onChange:Ge.func.isRequired,value:Ge.string.isRequired,className:Ge.string,tagName:Ge.string,hideTick:Ge.bool,isEvaluateMode:Ge.bool,choicesLayout:Ge.oneOf(["vertical","grid","horizontal"]),isSelectionButtonBelow:Ge.bool}}static __initStatic2(){this.defaultProps={rationale:null,checked:!1,isEvaluateMode:!1}}constructor(e){super(e),gt.prototype.__init.call(this),this.onToggleChoice=this.onToggleChoice.bind(this),this.choiceId=this.generateChoiceId(),this.descId=`${this.choiceId}-desc`}onToggleChoice(e){this.props.onChange(e)}generateChoiceId(){return"choice-"+(1e4*Math.random()).toFixed()}__init(){this.handleKeyDown=e=>{const{choiceMode:t}=this.props;if("checkbox"!==t)return;const o="ArrowDown"===e.key,s="ArrowUp"===e.key;if(!o&&!s)return;e.preventDefault();const n=document.getElementById(this.choiceId);if(!n)return;const i=n.closest("fieldset");if(!i)return;const r=Array.from(i.querySelectorAll('input[type="checkbox"]')),a=r.findIndex(e=>e===n);if(-1===a)return;const l=r[o?a+1:a-1];l&&l.focus()}}render(){const{choiceMode:e,disabled:t,displayKey:o,feedback:s,label:n,correctness:i,className:r,rationale:a,hideTick:l,isEvaluateMode:c,choicesLayout:d,value:h,checked:u,tagName:p,isSelectionButtonBelow:g}=this.props,f="checkbox"===e?ht:pt,m="checkbox"===e?"checkbox":"radio-button",b={..."horizontal"===d&&{[`& .${ot}`]:{padding:"8px",margin:"4px 0 4px 4px"}},...g&&"grid"!==d&&{"& > label":{alignItems:"flex-start"}},...g&&"grid"===d&&{justifyContent:"center","& > label":{alignItems:"center"}}},v=Je.createElement(Je.Fragment,null,o&&!g?Je.createElement(st,{component:"span"},o,"."," ",Je.createElement(et,{className:"prompt-label",prompt:n,tagName:"span"})):Je.createElement(et,{className:"prompt-label",prompt:n,tagName:"span"})),y=Je.createElement(rt,{id:this.descId},"checkbox"===e?"Checkbox to select the answer below":"Radio button to select the answer below"),x={disabled:t,checked:u,correctness:i,tagName:p,value:h,id:this.choiceId,onChange:this.onToggleChoice,onKeyDown:this.handleKeyDown,"aria-describedby":this.descId},S="string"==typeof n&&(n.includes("<math")||n.includes("\\(")||n.includes("\\[")||n.includes("<img")||n.includes("data-latex")||n.includes("data-raw")||n.includes("<mjx-container")),C=g?Je.createElement(it,null,S&&y,Je.createElement(f,{...x,style:{padding:0}}),o?`${o}.`:""):Je.createElement(Je.Fragment,null,S&&y,Je.createElement(f,{...x,slotProps:{input:{ref:this.props.autoFocusRef}}}));return Je.createElement("div",{className:tt(r,"corespring-"+m,"choice-input")},Je.createElement(st,null,!l&&c&&Je.createElement(Ue,{correctness:i}),Je.createElement(nt,{className:"checkbox-holder",sx:b},Je.createElement(at,{label:v,value:h,htmlFor:this.choiceId,labelPlacement:g?"top":void 0,control:C}))),a&&Je.createElement(et,{className:"rationale",defaultClassName:"rationale",prompt:a}),Je.createElement(Xe,{feedback:s,correctness:i}))}}gt.__initStatic(),gt.__initStatic2();const ft=e,mt=n,{styled:bt}=o,{Box:vt}=s,yt=bt(vt,{shouldForwardProp:e=>"noBorder"!==e&&"horizontalLayout"!==e})(({theme:e,noBorder:t,horizontalLayout:o})=>({paddingTop:e.spacing(2.5),paddingBottom:e.spacing(1)+2,paddingLeft:e.spacing(1)+2,paddingRight:e.spacing(1)+2,borderBottom:t?"none":`1px solid ${e.palette.grey[300]}`,...o&&{paddingRight:e.spacing(2.5),"& label":{marginRight:e.spacing(1)}}}));class xt extends ft.Component{constructor(...e){super(...e),xt.prototype.__init.call(this),xt.prototype.__init2.call(this),xt.prototype.__init3.call(this),xt.prototype.__init4.call(this)}static __initStatic(){this.propTypes={}}__init(){this.state={isHovered:!1}}__init2(){this.handleMouseEnter=()=>{const{disabled:e,checked:t}=this.props;e||t||this.setState({isHovered:!0})}}__init3(){this.handleMouseLeave=()=>{this.setState({isHovered:!1})}}__init4(){this.onChange=e=>{const{disabled:t,onChoiceChanged:o}=this.props;t||o(e)}}render(){const{choice:e,index:t,choicesLength:o,showCorrect:s,isEvaluateMode:n,choiceMode:i,disabled:r,checked:a,correctness:l,displayKey:c,choicesLayout:d,gridColumns:h,isSelectionButtonBelow:u,selectedAnswerBackgroundColor:p,selectedAnswerStrokeColor:g,selectedAnswerStrokeWidth:f,hoverAnswerBackgroundColor:m,hoverAnswerStrokeColor:b,hoverAnswerStrokeWidth:v,autoFocusRef:y,tagName:x}=this.props,{isHovered:S}=this.state,C="choice"+(t===o-1?" last":""),k=!n||s?"":e.feedback,w={...e,checked:a,choiceMode:i,disabled:r,feedback:k,correctness:l,displayKey:c,index:t,choicesLayout:d,gridColumns:h,onChange:this.onChange,isEvaluateMode:n,isSelectionButtonBelow:u,selectedAnswerStrokeColor:g,selectedAnswerStrokeWidth:f,tagName:x},E=g&&"initial"!==g,L=b&&"initial"!==b;let A="transparent",O="2px",_="initial";(E||L)&&(a&&E?(A=g,O=f):S&&!r&&L&&(A=b,O=v)),a&&p&&"initial"!==p?_=p:S&&!r&&m&&"initial"!==m&&(_=m);const N=E||L,R=N?{border:`${(e=>{if(!e)return"2px";const t=String(e).trim();return/^\d+(\.\d+)?$/.test(t)?`${t}px`:t})(O)} solid ${A}`,borderRadius:"8px"}:{},P=t===o-1||"vertical"!==d||N,T="horizontal"===d,$="initial"!==_?_:"initial";return ft.createElement("div",{className:C,key:t,style:{backgroundColor:$,...R},onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},ft.createElement(yt,{component:"div",noBorder:P,horizontalLayout:T},ft.createElement(gt,{...w,autoFocusRef:y})))}}xt.__initStatic(),xt.propTypes={choiceMode:mt.oneOf(["radio","checkbox"]),choice:mt.object,disabled:mt.bool.isRequired,onChoiceChanged:mt.func,index:mt.number,choicesLength:mt.number,showCorrect:mt.bool,isEvaluateMode:mt.bool,checked:mt.bool,correctness:mt.string,displayKey:mt.string,choicesLayout:mt.oneOf(["vertical","grid","horizontal"]),gridColumns:mt.string,selectedAnswerBackgroundColor:mt.string,selectedAnswerStrokeColor:mt.string,selectedAnswerStrokeWidth:mt.string,hoverAnswerBackgroundColor:mt.string,hoverAnswerStrokeColor:mt.string,hoverAnswerStrokeWidth:mt.string,tagName:mt.string,isSelectionButtonBelow:mt.bool,autoFocusRef:mt.object};const St=e,Ct=n,kt=a,wt=r,{styled:Et}=o,{Box:Lt}=s,{color:At}=i,{Collapsible:Ot}=i,{PreviewPrompt:_t}=i;const{translator:Nt}=oe,Rt=Et(Lt)({color:At.text(),backgroundColor:At.background(),"& *":{"-webkit-font-smoothing":"antialiased"},position:"relative","& legend":{border:"none !important"}}),Pt=Et("h2")(({theme:e})=>({display:"block",fontSize:"inherit",margin:"0",fontWeight:"normal",paddingBottom:e.spacing(2)})),Tt=Et(Lt)(({theme:e})=>({marginBottom:e.spacing(2)})),$t=Et(Lt)({display:"flex",flexDirection:"row",flexWrap:"wrap"}),jt=Et(Lt)({display:"grid"}),Mt=Et("fieldset")({border:"0px",padding:"0.01em 0 0 0",margin:"0px",minWidth:"0px","&:focus":{outline:"none"}}),It=Et("h3")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Ft=Et("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class Dt extends St.Component{static __initStatic(){this.propTypes={className:Ct.string,mode:Ct.oneOf(["gather","view","evaluate"]),choiceMode:Ct.oneOf(["radio","checkbox"]),keyMode:Ct.oneOf(["numbers","letters","none"]),choices:Ct.array,partLabel:Ct.string,prompt:Ct.string,teacherInstructions:Ct.string,session:Ct.object,disabled:Ct.bool,onChoiceChanged:Ct.func,responseCorrect:Ct.bool,correctResponse:Ct.array,choicesLayout:Ct.oneOf(["vertical","grid","horizontal"]),gridColumns:Ct.string,alwaysShowCorrect:Ct.bool,animationsDisabled:Ct.bool,language:Ct.string,selectedAnswerBackgroundColor:Ct.string,selectedAnswerStrokeColor:Ct.string,selectedAnswerStrokeWidth:Ct.string,hoverAnswerBackgroundColor:Ct.string,hoverAnswerStrokeColor:Ct.string,hoverAnswerStrokeWidth:Ct.string,onShowCorrectToggle:Ct.func,isSelectionButtonBelow:Ct.bool,minSelections:Ct.number,maxSelections:Ct.number,autoplayAudioEnabled:Ct.bool,customAudioButton:{playImage:Ct.string,pauseImage:Ct.string},options:Ct.object}}constructor(e){super(e),Dt.prototype.__init.call(this),Dt.prototype.__init2.call(this),Dt.prototype.__init3.call(this),Dt.prototype.__init4.call(this),this.state={showCorrect:this.props.options&&this.props.alwaysShowCorrect||!1,maxSelectionsErrorState:!1},this.onToggle=this.onToggle.bind(this),this.firstInputRef=St.createRef()}isSelected(e){const t=this.props.session&&this.props.session.value;return t&&t.indexOf&&t.indexOf(e)>=0}__init(){this.handleChange=e=>{const{value:t,checked:o}=e.target,{maxSelections:s,onChoiceChanged:n,session:i}=this.props;i.value&&i.value.length>=s&&(this.setState({maxSelectionsErrorState:o}),o)||n({value:t,selected:o,selector:"Mouse"})}}__init2(){this.onToggle=()=>{"evaluate"===this.props.mode&&this.setState({showCorrect:!this.state.showCorrect},()=>{this.props.onShowCorrectToggle&&this.props.onShowCorrectToggle()})}}UNSAFE_componentWillReceiveProps(e){e.correctResponse||!1===this.state.showCorrect||this.setState({showCorrect:!1},()=>{this.props.onShowCorrectToggle&&this.props.onShowCorrectToggle()}),e.options&&e.alwaysShowCorrect&&!0!==this.state.showCorrect&&this.setState({showCorrect:!0},()=>{this.props.onShowCorrectToggle&&this.props.onShowCorrectToggle()})}indexToSymbol(e){return"numbers"===this.props.keyMode?`${e+1}`:"letters"===this.props.keyMode?String.fromCharCode(97+e).toUpperCase():""}__init3(){this.getCorrectness=(e={})=>{const t=e.correct,o=this.isSelected(e.value);return this.state.showCorrect?t?"correct":void 0:t?o?"correct":"incorrect":o?"incorrect":void 0}}getChecked(e){if(this.props.options&&this.props.alwaysShowCorrect)return e.correct||!1;return this.state.showCorrect&&"evaluate"===this.props.mode?e.correct||!1:this.isSelected(e.value)}renderHeading(){const{mode:e,choiceMode:t}=this.props;return"gather"!==e?null:"radio"===t?St.createElement(It,null,"Multiple Choice Question"):St.createElement(It,null,"Multiple Select Question")}__init4(){this.handleGroupFocus=e=>{const t=e.currentTarget,o=document.activeElement;t.contains(o)&&o!==t||(!e.relatedTarget||t.compareDocumentPosition(e.relatedTarget)&Node.DOCUMENT_POSITION_PRECEDING)&&function(e){let t,o=e[0],s=1;for(;s<e.length;){const n=e[s],i=e[s+1];if(s+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=i(o)):"call"!==n&&"optionalCall"!==n||(o=i((...e)=>o.call(t,...e)),t=void 0)}return o}([this,"access",e=>e.firstInputRef,"optionalAccess",e=>e.current])&&this.firstInputRef.current.focus()}}render(){const{mode:e,disabled:t,className:o,choices:s=[],choiceMode:n,gridColumns:i,partLabel:r,prompt:a,responseCorrect:l,teacherInstructions:c,alwaysShowCorrect:d,animationsDisabled:h,language:u,isSelectionButtonBelow:p,minSelections:g,maxSelections:f,autoplayAudioEnabled:m,session:b,customAudioButton:v,options:y}=this.props,{showCorrect:x,maxSelectionsErrorState:S}=this.state,C="evaluate"===e,k=C&&!l,w=i>1?{gridTemplateColumns:`repeat(${i}, 1fr)`}:void 0,E=b.value&&b.value.length||0,L=St.createElement(_t,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:c}),A="grid"===this.props.choicesLayout?jt:"horizontal"===this.props.choicesLayout?$t:Lt;return St.createElement(Rt,{id:"main-container",className:wt(o,"multiple-choice")},r&&St.createElement(Pt,null,r),this.renderHeading(),c&&St.createElement(Tt,null,h?L:St.createElement(Ot,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},L)),St.createElement(Mt,{tabIndex:0,onFocus:this.handleGroupFocus,role:"radio"===n?"radiogroup":"group"},St.createElement(_t,{className:"prompt",defaultClassName:"prompt",prompt:a,tagName:"legend",autoplayAudioEnabled:m,customAudioButton:v}),!(y&&d)&&St.createElement(kt,{show:k,toggled:x,onToggle:this.onToggle.bind(this),language:u}),St.createElement(A,{style:w},s.map((e,o)=>St.createElement(xt,{autoFocusRef:0===o?this.firstInputRef:null,choicesLayout:this.props.choicesLayout,selectedAnswerBackgroundColor:this.props.selectedAnswerBackgroundColor,selectedAnswerStrokeColor:this.props.selectedAnswerStrokeColor,selectedAnswerStrokeWidth:this.props.selectedAnswerStrokeWidth,hoverAnswerBackgroundColor:this.props.hoverAnswerBackgroundColor,hoverAnswerStrokeColor:this.props.hoverAnswerStrokeColor,hoverAnswerStrokeWidth:this.props.hoverAnswerStrokeWidth,gridColumns:i,key:`choice-${o}`,choice:e,index:o,choicesLength:s.length,showCorrect:x,isEvaluateMode:C,choiceMode:n,disabled:t,tagName:r?`group-${r}`:"group",onChoiceChanged:this.handleChange,hideTick:e.hideTick,checked:this.getChecked(e),correctness:C?this.getCorrectness(e):void 0,displayKey:this.indexToSymbol(o),isSelectionButtonBelow:p})))),"checkbox"===n&&E<g&&St.createElement(Ft,null,g&&f?g===f?Nt.t("translation:multipleChoice:minmaxSelections_equal",{lng:u,minSelections:g}):Nt.t("translation:multipleChoice:minmaxSelections_range",{lng:u,minSelections:g,maxSelections:f}):g?Nt.t("translation:multipleChoice:minSelections",{lng:u,minSelections:g}):""),"checkbox"===n&&S&&St.createElement(Ft,null,Nt.t("translation:multipleChoice:maxSelections_"+(1===f?"one":"other"),{lng:u,maxSelections:f})))}}Dt.__initStatic(),Dt.defaultProps={session:{value:[]}};const Bt=e,Vt=n,{PreviewLayout:zt}=i;class Kt extends Bt.Component{static __initStatic(){this.propTypes={model:Vt.object,session:Vt.object,options:Vt.object,onChoiceChanged:Vt.func,onShowCorrectToggle:Vt.func,extraCSSRules:Vt.shape({names:Vt.arrayOf(Vt.string),rules:Vt.string})}}static __initStatic2(){this.defaultProps={model:{},session:{}}}render(){const{model:e,onChoiceChanged:t,session:o,onShowCorrectToggle:s,options:n}=this.props,{extraCSSRules:i,fontSizeFactor:r}=e;return Bt.createElement(zt,{extraCSSRules:i,fontSizeFactor:r,classes:{}},Bt.createElement(Dt,{...e,options:n,session:o,onChoiceChanged:t,onShowCorrectToggle:s}))}}Kt.__initStatic(),Kt.__initStatic2();var Ut,Ht=t;Ut=Ht.createRoot,Ht.hydrateRoot;var qt="object"==typeof global&&global&&global.Object===Object&&global,Wt="object"==typeof self&&self&&self.Object===Object&&self,Yt=qt||Wt||Function("return this")(),Jt=Yt.Symbol,Gt=Object.prototype,Qt=Gt.hasOwnProperty,Xt=Gt.toString,Zt=Jt?Jt.toStringTag:void 0;var eo=Object.prototype.toString;var to=Jt?Jt.toStringTag:void 0;function oo(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":to&&to in Object(e)?function(e){var t=Qt.call(e,Zt),o=e[Zt];try{e[Zt]=void 0;var s=!0}catch(e){}var n=Xt.call(e);return s&&(t?e[Zt]=o:delete e[Zt]),n}(e):function(e){return eo.call(e)}(e)}var so=/\s/;var no=/^\s+/;function io(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&so.test(e.charAt(t)););return t}(e)+1).replace(no,""):e}function ro(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var ao=/^[-+]0x[0-9a-f]+$/i,lo=/^0b[01]+$/i,co=/^0o[0-7]+$/i,ho=parseInt;function uo(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==oo(e)}(e))return NaN;if(ro(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ro(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=io(e);var o=lo.test(e);return o||co.test(e)?ho(e.slice(2),o?2:8):ao.test(e)?NaN:+e}var po=function(){return Yt.Date.now()},go=Math.max,fo=Math.min;function mo(e,t,o){var s,n,i,r,a,l,c=0,d=!1,h=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var o=s,i=n;return s=n=void 0,c=t,r=e.apply(i,o)}function g(e){var o=e-l;return void 0===l||o>=t||o<0||h&&e-c>=i}function f(){var e=po();if(g(e))return m(e);a=setTimeout(f,function(e){var o=t-(e-l);return h?fo(o,i-(e-c)):o}(e))}function m(e){return a=void 0,u&&s?p(e):(s=n=void 0,r)}function b(){var e=po(),o=g(e);if(s=arguments,n=this,l=e,o){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),d?p(e):r}(l);if(h)return clearTimeout(a),a=setTimeout(f,t),p(l)}return void 0===a&&(a=setTimeout(f,t)),r}return t=uo(t)||0,ro(o)&&(d=!!o.leading,i=(h="maxWait"in o)?go(uo(o.maxWait)||0,t):i,u="trailing"in o?!!o.trailing:u),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,s=l=n=a=void 0},b.flush=function(){return void 0===a?r:m(po())},b}var bo={};Object.defineProperty(bo,"__esModule",{value:!0});class vo extends CustomEvent{constructor(e,t,o){super(vo.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:o}}),this.component=e,this.complete=t}}vo.TYPE="model-set";var yo=bo.ModelSetEvent=vo;class xo extends CustomEvent{constructor(e,t){super(xo.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}xo.TYPE="session-changed";var So=bo.SessionChangedEvent=xo;function Co(e,t){e.audioStartTime=e.audioStartTime||t.audioStartTime,e.audioEndTime=e.audioEndTime||t.audioEndTime,!e.waitTime&&e.audioStartTime&&e.audioEndTime&&(e.waitTime=e.audioEndTime-e.audioStartTime)}const ko=e,wo=l,{EnableAudioAutoplayImage:Eo}=i,{renderMath:Lo}=c;const Ao=wo("pie-ui:multiple-choice"),Oo=(e,t,o,s)=>{const{autoplayAudioEnabled:n,completeAudioEnabled:i}=t||{};if(n&&i&&!o&&s){const e=s.querySelector("audio"),t=e&&e.closest("#preview-prompt");if(e&&t)return!1}if(!e||!e.value)return!1;const{choiceMode:r,minSelections:a=1,maxSelections:l}=t||{},c=e.value.length||0;return"radio"===r?!!c:!(c<a||c>l)};class _o extends HTMLElement{constructor(){super(),this._model=null,this._session=null,this._options=null,this.audioComplete=!1,this._boundHandleKeyDown=this.handleKeyDown.bind(this),this._keyboardEventsEnabled=!1,this._audioInitialized=!1,this._root=null,this._rerender=mo(()=>{if(this._model&&this._session){var e=ko.createElement(Kt,{model:this._model,session:this._session,options:this._options,onChoiceChanged:this._onChange.bind(this),onShowCorrectToggle:this.onShowCorrectToggle.bind(this)});this.setAttribute("aria-label","radio"===this._model.choiceMode?"Multiple Choice Question":"Multiple Correct Answer Question"),this.setAttribute("role","region"),this.setLangAttribute(),this._root||(this._root=Ut(this)),this._root.render(e),queueMicrotask(()=>{Ao("render complete - render math"),Lo(this)}),!0!==this._model.keyboardEventsEnabled||this._keyboardEventsEnabled||this.enableKeyboardEvents()}else Ao("skip")},50,{leading:!1,trailing:!0}),this._dispatchResponseChanged=mo(()=>{this.dispatchEvent(new So(this.tagName.toLowerCase(),Oo(this._session,this._model,this.audioComplete,this)))}),this._dispatchModelSet=mo(()=>{this.dispatchEvent(new yo(this.tagName.toLowerCase(),Oo(this._session,this._model,this.audioComplete,this),void 0!==this._model))},50,{leading:!1,trailing:!0})}onShowCorrectToggle(){Lo(this)}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}set model(e){this._model=e,this._rerender(),this._audioInitialized=!1,this._dispatchModelSet()}get session(){return this._session}get options(){return this._options}set options(e){this._options=e,this._rerender()}set session(e){this._session=e,this._rerender(),this._dispatchResponseChanged()}_onChange(e){!function(e,t,o){e.value=e.value||[],"checkbox"===t&&(o.selected?e.value=Array.from(new Set([...e.value,o.value])):e.value=e.value.filter(e=>e!==o.value)),"radio"===t&&(o.selected?e.value=[o.value]:e.value=[]),e.selector=o.selector}(this._session,this._model.choiceMode,e),this._dispatchResponseChanged(),this._rerender()}_createAudioInfoToast(){const e=document.createElement("div");e.id="play-audio-info",Object.assign(e.style,{position:"absolute",top:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"white",zIndex:"1000",cursor:"pointer"});const t=document.createElement("img");return t.src=Eo,t.alt="Click anywhere to enable audio autoplay",t.width=500,t.height=300,e.appendChild(t),e}connectedCallback(){this._rerender();new MutationObserver((e,t)=>{e.forEach(e=>{if("childList"===e.type){if(this._audioInitialized)return;const e=this.querySelector("audio"),o=e&&e.closest("#preview-prompt");if(!this._model)return;if(!this._model.autoplayAudioEnabled)return;if(e&&!o)return;if(!e)return;const s=this._createAudioInfoToast(),n=this.querySelector("#main-container"),i=()=>{this.querySelector("#play-audio-info")&&(e.play(),n.removeChild(s)),document.removeEventListener("click",i)};setTimeout(()=>{e.paused&&!this.querySelector("#play-audio-info")?(n.appendChild(s),document.addEventListener("click",i)):document.removeEventListener("click",i)},500);const r=()=>{Co(this._session,{audioStartTime:(new Date).getTime()});const t=this.querySelector("#play-audio-info");t&&n.removeChild(t),e.removeEventListener("playing",r)};e.addEventListener("playing",r);const a=()=>{Co(this._session,{audioEndTime:(new Date).getTime()}),this.audioComplete=!0,this._dispatchResponseChanged(),e.removeEventListener("ended",a)};e.addEventListener("ended",a),this._audio=e,this._handlePlaying=r,this._handleEnded=a,this._enableAudio=i,this._audioInitialized=!0,t.disconnect()}})}).observe(this,{childList:!0,subtree:!0})}enableKeyboardEvents(){this._keyboardEventsEnabled||(window.addEventListener("keydown",this._boundHandleKeyDown),this._keyboardEventsEnabled=!0)}disconnectedCallback(){this._keyboardEventsEnabled&&(window.removeEventListener("keydown",this._boundHandleKeyDown),this._keyboardEventsEnabled=!1),document.removeEventListener("click",this._enableAudio),this._audio&&(this._audio.removeEventListener("playing",this._handlePlaying),this._audio.removeEventListener("ended",this._handleEnded),this._audio=null),this._root&&this._root.unmount()}handleKeyDown(e){if(!this._model||!this._session)return;const{mode:t}=this._model;if("gather"!==t)return;const o=(e=>{const t=e>="1"&&e<="9"?e-"1":"0"===e?9:-1,o=/^[a-jA-J]$/.test(e)?e.toLowerCase().charCodeAt(0)-"a".charCodeAt(0):-1;return t>=0?t:o})(e.key);if(void 0===o||o<=-1||o>=function(e){let t,o=e[0],s=1;for(;s<e.length;){const n=e[s],i=e[s+1];if(s+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=i(o)):"call"!==n&&"optionalCall"!==n||(o=i((...e)=>o.call(t,...e)),t=void 0)}return o}([this,"access",e=>e._model,"access",e=>e.choices,"optionalAccess",e=>e.length]))return;const s=this._session.value||[],n=this._model.choices[o].value,i={value:n,selected:!s.includes(n),selector:"Keyboard"};this._onChange(i)}}export{_o as default,Oo as isComplete};
|
package/module/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/multiple-choice@12.1.0-next.0</title>
|
|
6
|
-
<script
|
|
7
|
-
type="module"
|
|
8
|
-
src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
|
|
9
|
-
|
|
10
|
-
<link
|
|
11
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
12
|
-
rel="stylesheet"
|
|
13
|
-
/>
|
|
14
|
-
<style>
|
|
15
|
-
html, body {
|
|
16
|
-
font-family: 'Roboto', sans-serif;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
<script type="module" src="./demo.js"></script>
|
|
20
|
-
</head>
|
|
21
|
-
</html>
|
package/module/manifest.json
DELETED
package/module/print-demo.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import PrintElement from './print.js';
|
|
2
|
-
|
|
3
|
-
var generate = {};
|
|
4
|
-
|
|
5
|
-
generate.model = (id, element) => ({
|
|
6
|
-
id,
|
|
7
|
-
element,
|
|
8
|
-
choiceMode: 'checkbox',
|
|
9
|
-
choicePrefix: 'numbers',
|
|
10
|
-
choices: [
|
|
11
|
-
{
|
|
12
|
-
correct: true,
|
|
13
|
-
value: 'sweden',
|
|
14
|
-
label: 'Sweden',
|
|
15
|
-
feedback: {
|
|
16
|
-
type: 'none',
|
|
17
|
-
value: '',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
value: 'iceland',
|
|
22
|
-
label: 'Iceland',
|
|
23
|
-
feedback: {
|
|
24
|
-
type: 'none',
|
|
25
|
-
value: '',
|
|
26
|
-
},
|
|
27
|
-
rationale: 'Rationale for Iceland',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
value: 'norway',
|
|
31
|
-
label: 'Norway',
|
|
32
|
-
feedback: {
|
|
33
|
-
type: 'none',
|
|
34
|
-
value: '',
|
|
35
|
-
},
|
|
36
|
-
rationale: 'Rationale for Norway',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
correct: true,
|
|
40
|
-
value: 'finland',
|
|
41
|
-
label: 'Finland',
|
|
42
|
-
feedback: {
|
|
43
|
-
type: 'none',
|
|
44
|
-
value: '',
|
|
45
|
-
},
|
|
46
|
-
rationale: 'Rationale for Finland',
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
extraCSSRules: {
|
|
50
|
-
names: ['red', 'blue'],
|
|
51
|
-
rules: `
|
|
52
|
-
.red {
|
|
53
|
-
color: red !important;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.blue {
|
|
57
|
-
color: blue !important;
|
|
58
|
-
}
|
|
59
|
-
`,
|
|
60
|
-
},
|
|
61
|
-
prompt: '',
|
|
62
|
-
promptEnabled: true,
|
|
63
|
-
toolbarEditorPosition: 'bottom',
|
|
64
|
-
rubricEnabled: false,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const { model } = generate;
|
|
68
|
-
|
|
69
|
-
var config = {
|
|
70
|
-
elements: {
|
|
71
|
-
'multiple-choice': '../..',
|
|
72
|
-
},
|
|
73
|
-
models: [model('1', 'multiple-choice')],
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// new init - just shows off print!
|
|
77
|
-
|
|
78
|
-
const init = async () => {
|
|
79
|
-
console.log('define the element...');
|
|
80
|
-
await Promise.all(
|
|
81
|
-
config.models.map(async (m) => {
|
|
82
|
-
try {
|
|
83
|
-
const printTag = `${m.element}-print`;
|
|
84
|
-
if (customElements.get(printTag)) {
|
|
85
|
-
return true;
|
|
86
|
-
} else {
|
|
87
|
-
customElements.define(printTag, PrintElement);
|
|
88
|
-
await customElements.whenDefined(printTag);
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
} catch (e) {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
console.log('now apply the model...');
|
|
98
|
-
config.models.forEach((m) => {
|
|
99
|
-
const printTag = `${m.element}-print`;
|
|
100
|
-
const h3s = document.createElement('h3');
|
|
101
|
-
h3s.textContent = 'student mode';
|
|
102
|
-
document.body.appendChild(h3s);
|
|
103
|
-
const de = document.createElement(printTag);
|
|
104
|
-
document.body.appendChild(de);
|
|
105
|
-
de.options = {};
|
|
106
|
-
de.model = m;
|
|
107
|
-
|
|
108
|
-
const h3 = document.createElement('h3');
|
|
109
|
-
h3.textContent = 'instructor mode';
|
|
110
|
-
document.body.appendChild(h3);
|
|
111
|
-
const instr = document.createElement(printTag);
|
|
112
|
-
document.body.appendChild(instr);
|
|
113
|
-
instr.options = { mode: 'instructor' };
|
|
114
|
-
instr.model = JSON.parse(JSON.stringify(m));
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
init()
|
|
119
|
-
.then(() => {
|
|
120
|
-
console.log('ready');
|
|
121
|
-
})
|
|
122
|
-
.catch((e) => {
|
|
123
|
-
console.error(e);
|
|
124
|
-
});
|
package/module/print.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/multiple-choice@12.1.0-next.0</title>
|
|
6
|
-
<link
|
|
7
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
8
|
-
rel="stylesheet"
|
|
9
|
-
/>
|
|
10
|
-
<style>
|
|
11
|
-
html, body {
|
|
12
|
-
font-family: 'Roboto', sans-serif;
|
|
13
|
-
}
|
|
14
|
-
</style>
|
|
15
|
-
<script type="module" src="./print-demo.js"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body></body>
|
|
18
|
-
</html>
|