@pie-element/ebsr 13.1.0-next.0 → 13.1.2-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr-controller",
3
3
  "private": true,
4
- "version": "10.1.0-next.0",
4
+ "version": "10.1.1-next.1",
5
5
  "description": "",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-lib/controller-utils": "1.1.1-next.1",
11
- "@pie-lib/translator": "3.1.1-next.1",
10
+ "@pie-lib/controller-utils": "1.2.0-next.3",
11
+ "@pie-lib/translator": "3.2.0-next.3",
12
12
  "lodash-es": "^4.17.23"
13
13
  },
14
14
  "author": "",
package/package.json CHANGED
@@ -1,25 +1,22 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr",
3
- "repository": {
4
- "type": "git",
5
- "url": "https://github.com/pie-framework/pie-elements"
6
- },
7
- "version": "13.1.0-next.0+20d879b",
3
+ "repository": "pie-framework/pie-elements",
4
+ "version": "13.1.2-next.2",
8
5
  "description": "",
9
6
  "publishConfig": {
10
7
  "access": "public"
11
8
  },
12
9
  "dependencies": {
13
- "@pie-element/multiple-choice": "^12.1.0-next.0+20d879b",
10
+ "@pie-element/multiple-choice": "^12.1.2-next.2",
14
11
  "@pie-framework/pie-player-events": "^0.1.0",
15
- "@pie-lib/translator": "3.1.1-next.1",
12
+ "@pie-lib/translator": "3.2.0-next.3",
16
13
  "classnames": "^2.2.5",
17
14
  "debug": "^4.1.1",
18
15
  "lodash-es": "^4.17.23"
19
16
  },
20
17
  "author": "pie framework developers",
21
18
  "license": "ISC",
22
- "gitHead": "20d879b8b8fa74decf5028d860d54cd09cbdf051",
19
+ "gitHead": "dec64abbc528e9aa8dff3bed3c55133c3318b96d",
23
20
  "scripts": {
24
21
  "postpublish": "../../scripts/postpublish"
25
22
  },
@@ -1 +0,0 @@
1
- import{_dll_react_dom as t,_dll_react as e,_dll_prop_types as r,_dll_mui__material_styles as n}from"../../../@pie-lib/shared-module@^4.0.1/module/index.js";import o from"@pie-element/multiple-choice/configure/lib";import{_dll_pie_lib__config_ui as a}from"../../../@pie-lib/config-module@^3.0.1/module/index.js";var i,s=t;i=s.createRoot,s.hydrateRoot;var c={};Object.defineProperty(c,"__esModule",{value:!0});class l extends CustomEvent{constructor(t,e=!1){super(l.TYPE,{bubbles:!0,detail:{update:t,reset:e}}),this.update=t,this.reset=e}}l.TYPE="model.updated";var u=c.ModelUpdatedEvent=l;class d extends CustomEvent{constructor(t,e){super(d.TYPE,{bubbles:!0,detail:{src:t,done:e}}),this.src=t,this.done=e}}d.TYPE="delete.image",c.DeleteImageEvent=d;class p extends CustomEvent{constructor(t){super(p.TYPE,{bubbles:!0,detail:t}),this.handler=t}}p.TYPE="insert.image",c.InsertImageEvent=p;class h extends CustomEvent{constructor(t,e){super(h.TYPE,{bubbles:!0,detail:{src:t,done:e}}),this.src=t,this.done=e}}h.TYPE="delete.sound",c.DeleteSoundEvent=h;class b extends CustomEvent{constructor(t){super(b.TYPE,{bubbles:!0,detail:t}),this.handler=t}}b.TYPE="insert.sound",c.InsertSoundEvent=b;var f="object"==typeof global&&global&&global.Object===Object&&global,g="object"==typeof self&&self&&self.Object===Object&&self,_=f||g||Function("return this")(),y=_.Symbol,m=Object.prototype,v=m.hasOwnProperty,j=m.toString,A=y?y.toStringTag:void 0,C=Object.prototype.toString,E=y?y.toStringTag:void 0;function O(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":E&&E in Object(t)?function(t){var e=v.call(t,A),r=t[A];try{t[A]=void 0;var n=!0}catch(t){}var o=j.call(t);return n&&(e?t[A]=r:delete t[A]),o}(t):function(t){return C.call(t)}(t)}function x(t){return null!=t&&"object"==typeof t}var w=Array.isArray;function P(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function B(t){return t}function M(t){if(!P(t))return!1;var e=O(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var S,I=_["__core-js_shared__"],L=(S=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",k=Function.prototype.toString;function T(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var z=/^\[object .+?Constructor\]$/,U=Function.prototype,D=Object.prototype,F=U.toString,$=D.hasOwnProperty,R=RegExp("^"+F.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Y(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!P(t)||(e=t,L&&L in e))&&(M(t)?R:z).test(T(t));var e}(r)?r:void 0}var N,q,V,W=Y(_,"WeakMap"),G=Object.create,H=function(){function t(){}return function(e){if(!P(e))return{};if(G)return G(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),J=Date.now,K=function(){try{var t=Y(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Q=K,X=Q?function(t,e){return Q(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:B,Z=(N=X,q=0,V=0,function(){var t=J(),e=16-(t-V);if(V=t,e>0){if(++q>=800)return arguments[0]}else q=0;return N.apply(void 0,arguments)}),tt=/^(?:0|[1-9]\d*)$/;function et(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&tt.test(t))&&t>-1&&t%1==0&&t<e}function rt(t,e,r){"__proto__"==e&&Q?Q(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function nt(t,e){return t===e||t!=t&&e!=e}var ot=Object.prototype.hasOwnProperty;function at(t,e,r){var n=t[e];ot.call(t,e)&&nt(n,r)&&(void 0!==r||e in t)||rt(t,e,r)}function it(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;void 0===c&&(c=t[s]),o?rt(r,s,c):at(r,s,c)}return r}var st=Math.max;function ct(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function lt(t){return null!=t&&ct(t.length)&&!M(t)}var ut=Object.prototype;function dt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ut)}function pt(t){return x(t)&&"[object Arguments]"==O(t)}var ht=Object.prototype,bt=ht.hasOwnProperty,ft=ht.propertyIsEnumerable,gt=pt(function(){return arguments}())?pt:function(t){return x(t)&&bt.call(t,"callee")&&!ft.call(t,"callee")},_t="object"==typeof exports&&exports&&!exports.nodeType&&exports,yt=_t&&"object"==typeof module&&module&&!module.nodeType&&module,mt=yt&&yt.exports===_t?_.Buffer:void 0,vt=(mt?mt.isBuffer:void 0)||function(){return!1},jt={};function At(t){return function(e){return t(e)}}jt["[object Float32Array]"]=jt["[object Float64Array]"]=jt["[object Int8Array]"]=jt["[object Int16Array]"]=jt["[object Int32Array]"]=jt["[object Uint8Array]"]=jt["[object Uint8ClampedArray]"]=jt["[object Uint16Array]"]=jt["[object Uint32Array]"]=!0,jt["[object Arguments]"]=jt["[object Array]"]=jt["[object ArrayBuffer]"]=jt["[object Boolean]"]=jt["[object DataView]"]=jt["[object Date]"]=jt["[object Error]"]=jt["[object Function]"]=jt["[object Map]"]=jt["[object Number]"]=jt["[object Object]"]=jt["[object RegExp]"]=jt["[object Set]"]=jt["[object String]"]=jt["[object WeakMap]"]=!1;var Ct="object"==typeof exports&&exports&&!exports.nodeType&&exports,Et=Ct&&"object"==typeof module&&module&&!module.nodeType&&module,Ot=Et&&Et.exports===Ct&&f.process,xt=function(){try{return Et&&Et.require&&Et.require("util").types||Ot&&Ot.binding&&Ot.binding("util")}catch(t){}}(),wt=xt&&xt.isTypedArray,Pt=wt?At(wt):function(t){return x(t)&&ct(t.length)&&!!jt[O(t)]},Bt=Object.prototype.hasOwnProperty;function Mt(t,e){var r=w(t),n=!r&&gt(t),o=!r&&!n&&vt(t),a=!r&&!n&&!o&&Pt(t),i=r||n||o||a,s=i?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=s.length;for(var l in t)!e&&!Bt.call(t,l)||i&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||et(l,c))||s.push(l);return s}function St(t,e){return function(r){return t(e(r))}}var It=St(Object.keys,Object),Lt=Object.prototype.hasOwnProperty;function kt(t){return lt(t)?Mt(t):function(t){if(!dt(t))return It(t);var e=[];for(var r in Object(t))Lt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}var Tt=Object.prototype.hasOwnProperty;function zt(t){return lt(t)?Mt(t,!0):function(t){if(!P(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=dt(t),r=[];for(var n in t)("constructor"!=n||!e&&Tt.call(t,n))&&r.push(n);return r}(t)}var Ut=Y(Object,"create"),Dt=Object.prototype.hasOwnProperty,Ft=Object.prototype.hasOwnProperty;function $t(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Rt(t,e){for(var r=t.length;r--;)if(nt(t[r][0],e))return r;return-1}$t.prototype.clear=function(){this.__data__=Ut?Ut(null):{},this.size=0},$t.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$t.prototype.get=function(t){var e=this.__data__;if(Ut){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Dt.call(e,t)?e[t]:void 0},$t.prototype.has=function(t){var e=this.__data__;return Ut?void 0!==e[t]:Ft.call(e,t)},$t.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ut&&void 0===e?"__lodash_hash_undefined__":e,this};var Yt=Array.prototype.splice;function Nt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Nt.prototype.clear=function(){this.__data__=[],this.size=0},Nt.prototype.delete=function(t){var e=this.__data__,r=Rt(e,t);return!(r<0||(r==e.length-1?e.pop():Yt.call(e,r,1),--this.size,0))},Nt.prototype.get=function(t){var e=this.__data__,r=Rt(e,t);return r<0?void 0:e[r][1]},Nt.prototype.has=function(t){return Rt(this.__data__,t)>-1},Nt.prototype.set=function(t,e){var r=this.__data__,n=Rt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var qt=Y(_,"Map");function Vt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Wt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Gt(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}Wt.prototype.clear=function(){this.size=0,this.__data__={hash:new $t,map:new(qt||Nt),string:new $t}},Wt.prototype.delete=function(t){var e=Vt(this,t).delete(t);return this.size-=e?1:0,e},Wt.prototype.get=function(t){return Vt(this,t).get(t)},Wt.prototype.has=function(t){return Vt(this,t).has(t)},Wt.prototype.set=function(t,e){var r=Vt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var Ht=St(Object.getPrototypeOf,Object);function Jt(t){var e=this.__data__=new Nt(t);this.size=e.size}Jt.prototype.clear=function(){this.__data__=new Nt,this.size=0},Jt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Jt.prototype.get=function(t){return this.__data__.get(t)},Jt.prototype.has=function(t){return this.__data__.has(t)},Jt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Nt){var n=r.__data__;if(!qt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Wt(n)}return r.set(t,e),this.size=r.size,this};var Kt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Qt=Kt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Qt&&Qt.exports===Kt?_.Buffer:void 0,Zt=Xt?Xt.allocUnsafe:void 0;function te(){return[]}var ee=Object.prototype.propertyIsEnumerable,re=Object.getOwnPropertySymbols,ne=re?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i)&&(a[o++]=i)}return a}(re(t),function(e){return ee.call(t,e)}))}:te,oe=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Gt(e,ne(t)),t=Ht(t);return e}:te;function ae(t,e,r){var n=e(t);return w(t)?n:Gt(n,r(t))}function ie(t){return ae(t,kt,ne)}function se(t){return ae(t,zt,oe)}var ce=Y(_,"DataView"),le=Y(_,"Promise"),ue=Y(_,"Set"),de="[object Map]",pe="[object Promise]",he="[object Set]",be="[object WeakMap]",fe="[object DataView]",ge=T(ce),_e=T(qt),ye=T(le),me=T(ue),ve=T(W),je=O;(ce&&je(new ce(new ArrayBuffer(1)))!=fe||qt&&je(new qt)!=de||le&&je(le.resolve())!=pe||ue&&je(new ue)!=he||W&&je(new W)!=be)&&(je=function(t){var e=O(t),r="[object Object]"==e?t.constructor:void 0,n=r?T(r):"";if(n)switch(n){case ge:return fe;case _e:return de;case ye:return pe;case me:return he;case ve:return be}return e});var Ae=je,Ce=Object.prototype.hasOwnProperty,Ee=_.Uint8Array;function Oe(t){var e=new t.constructor(t.byteLength);return new Ee(e).set(new Ee(t)),e}var xe=/\w*$/,we=y?y.prototype:void 0,Pe=we?we.valueOf:void 0;var Be=xt&&xt.isMap,Me=Be?At(Be):function(t){return x(t)&&"[object Map]"==Ae(t)},Se=xt&&xt.isSet,Ie=Se?At(Se):function(t){return x(t)&&"[object Set]"==Ae(t)},Le="[object Arguments]",ke="[object Function]",Te="[object Object]",ze={};function Ue(t,e,r,n,o,a){var i,s=1&e,c=2&e,l=4&e;if(r&&(i=o?r(t,n,o,a):r(t)),void 0!==i)return i;if(!P(t))return t;var u=w(t);if(u){if(i=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Ce.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!s)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,i)}else{var d=Ae(t),p=d==ke||"[object GeneratorFunction]"==d;if(vt(t))return function(t,e){if(e)return t.slice();var r=t.length,n=Zt?Zt(r):new t.constructor(r);return t.copy(n),n}(t,s);if(d==Te||d==Le||p&&!o){if(i=c||p?{}:function(t){return"function"!=typeof t.constructor||dt(t)?{}:H(Ht(t))}(t),!s)return c?function(t,e){return it(t,oe(t),e)}(t,function(t,e){return t&&it(e,zt(e),t)}(i,t)):function(t,e){return it(t,ne(t),e)}(t,function(t,e){return t&&it(e,kt(e),t)}(i,t))}else{if(!ze[d])return o?t:{};i=function(t,e,r){var n,o,a,i=t.constructor;switch(e){case"[object ArrayBuffer]":return Oe(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return function(t,e){var r=e?Oe(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var r=e?Oe(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,r);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return(a=new(o=t).constructor(o.source,xe.exec(o))).lastIndex=o.lastIndex,a;case"[object Symbol]":return n=t,Pe?Object(Pe.call(n)):{}}}(t,d,s)}}a||(a=new Jt);var h=a.get(t);if(h)return h;a.set(t,i),Ie(t)?t.forEach(function(n){i.add(Ue(n,e,r,n,t,a))}):Me(t)&&t.forEach(function(n,o){i.set(o,Ue(n,e,r,o,t,a))});var b=u?void 0:(l?c?se:ie:c?zt:kt)(t);return function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r););}(b||t,function(n,o){b&&(n=t[o=n]),at(i,o,Ue(n,e,r,o,t,a))}),i}function De(t){return Ue(t,5)}ze[Le]=ze["[object Array]"]=ze["[object ArrayBuffer]"]=ze["[object DataView]"]=ze["[object Boolean]"]=ze["[object Date]"]=ze["[object Float32Array]"]=ze["[object Float64Array]"]=ze["[object Int8Array]"]=ze["[object Int16Array]"]=ze["[object Int32Array]"]=ze["[object Map]"]=ze["[object Number]"]=ze[Te]=ze["[object RegExp]"]=ze["[object Set]"]=ze["[object String]"]=ze["[object Symbol]"]=ze["[object Uint8Array]"]=ze["[object Uint8ClampedArray]"]=ze["[object Uint16Array]"]=ze["[object Uint32Array]"]=!0,ze["[object Error]"]=ze[ke]=ze["[object WeakMap]"]=!1;var Fe=Object.prototype,$e=Fe.hasOwnProperty,Re=function(t){return Z(function(t,e,r){return e=st(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=st(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(i),function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,s)}}(t,void 0,B),t+"")}(function(t,e){t=Object(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&function(t,e,r){if(!P(r))return!1;var n=typeof e;return!!("number"==n?lt(r)&&et(e,r.length):"string"==n&&e in r)&&nt(r[e],t)}(e[0],e[1],o)&&(n=1);++r<n;)for(var a=e[r],i=zt(a),s=-1,c=i.length;++s<c;){var l=i[s],u=t[l];(void 0===u||nt(u,Fe[l])&&!$e.call(t,l))&&(t[l]=a[l])}return t}),Ye=Re;const Ne=e,qe=r,{styled:Ve}=n,{settings:We}=a,{layout:Ge}=a,{Panel:He,toggle:Je,radio:Ke,dropdown:Qe}=We,Xe=Ve("div")(({theme:t})=>({paddingBottom:t.spacing(2)})),Ze=Ve("div")(({theme:t})=>({flex:1,height:t.spacing(2.5)}));class tr extends Ne.Component{constructor(...t){super(...t),tr.prototype.__init.call(this),tr.prototype.__init2.call(this)}static __initStatic(){this.propTypes={configuration:qe.object,model:qe.object,onModelChanged:qe.func,onConfigurationChanged:qe.func}}__init(){this.removeExtraChoices=t=>{let e=!1;return(t||[]).map(t=>e?(t.correct=!1,t):(t.correct&&(e=!0),t))}}__init2(){this.onModelChanged=(t,e)=>{const{onModelChanged:r}=this.props;return"partA.choiceMode"===e&&"radio"===t.partA.choiceMode?(t.partA.choices=this.removeExtraChoices(t.partA.choices),r(t,!0)):"partB.choiceMode"===e&&"radio"===t.partB.choiceMode?(t.partB.choices=this.removeExtraChoices(t.partB.choices),r(t,!0)):r(t)}}render(){const{model:t,configuration:e,onConfigurationChanged:r}=this.props,{partLabelType:n,partA:o,partB:a,extraCSSRules:i}=t,{contentDimensions:s={},partA:c={},partB:l={},partialScoring:u={},settingsPanelDisabled:d,scoringType:p={},language:h={},languageChoices:b={},...f}=e,{feedback:g={},choiceMode:_={},choicePrefix:y={},lockChoiceOrder:m={},prompt:v={},teacherInstructions:j={},studentInstructions:A={},choicesLayout:C={},gridColumns:E={},rationale:O={},spellCheck:x={}}=c||{},{feedback:w={},choiceMode:P={},choicePrefix:B={},lockChoiceOrder:M={},prompt:S={},teacherInstructions:I={},studentInstructions:L={},choicesLayout:k={},gridColumns:T={},rationale:z={},spellCheck:U={}}=l||{},D="Numbers"===(n||"Numbers"),F="Part "+(D?"1":"A"),$="Part "+(D?"2":"B"),R={partA:o.choices&&o.choices.length?Array.from({length:o.choices.length},(t,e)=>`${e+1}`):[],partB:a.choices&&a.choices.length?Array.from({length:a.choices.length},(t,e)=>`${e+1}`):[]},Y={partLabels:f.partLabels.settings&&Je(f.partLabels.label),partLabelType:t.partLabels&&Qe("",["Numbers","Letters"]),partialScoring:u.settings&&Je(u.label),scoringType:p.settings&&Ke(p.label,["auto","rubric"]),"language.enabled":h.settings&&Je(h.label,!0),language:h.settings&&h.enabled&&Qe(b.label,b.options)},N={"partA.choiceMode":_.settings&&Ke(_.label,["checkbox","radio"]),"partA.choicePrefix":y.settings&&Ke(y.label,["numbers","letters"]),"partA.lockChoiceOrder":m.settings&&Je(m.label),"partA.choicesLayout":C.settings&&Qe(C.label,["vertical","grid","horizontal"]),"partA.gridColumns":C.settings&&"grid"===o.choicesLayout&&R.partA.length>0&&Qe(E.label,R.partA)},q={"partA.feedbackEnabled":g.settings&&Je(g.label),"partA.promptEnabled":v.settings&&Je(v.label),"partA.teacherInstructionsEnabled":j.settings&&Je(j.label),"partA.studentInstructionsEnabled":A.settings&&Je(A.label),"partA.rationaleEnabled":O.settings&&Je(O.label),"partA.spellCheckEnabled":x.settings&&Je(x.label)},V={"partB.choiceMode":P.settings&&Ke(P.label,["checkbox","radio"]),"partB.choicePrefix":B.settings&&Ke(B.label,["numbers","letters"]),"partB.lockChoiceOrder":M.settings&&Je(M.label),"partB.choicesLayout":k.settings&&Qe(k.label,["vertical","grid","horizontal"]),"partB.gridColumns":k.settings&&"grid"===a.choicesLayout&&R.partB.length>0&&Qe(T.label,R.partB)},W={"partB.feedbackEnabled":w.settings&&Je(w.label),"partB.promptEnabled":S.settings&&Je(S.label),"partB.teacherInstructionsEnabled":I.settings&&Je(I.label),"partB.studentInstructionsEnabled":L.settings&&Je(L.label),"partB.rationaleEnabled":z.settings&&Je(z.label),"partB.spellCheckEnabled":U.settings&&Je(U.label)};return Ne.createElement(Ge.ConfigLayout,{extraCSSRules:i,dimensions:s,hideSettings:d,settings:Ne.createElement(He,{model:t,onChangeModel:this.onModelChanged,configuration:e,onChangeConfiguration:r,groups:{"Settings for both":Y,[`Settings ${F}`]:N,[`Properties ${F}`]:q,[`Settings ${$}`]:V,[`Properties ${$}`]:W}})},t.partLabels&&Ne.createElement(Xe,null,F),Ne.createElement("ebsr-multiple-choice-configure",{id:"A",key:"partA",ref:t=>{t&&(this.partA=t,this.partA._model={...this.props.model.partA,errors:this.props.model.errors&&this.props.model.errors.partA||{}},this.partA.configuration={...c,...f})}}),Ne.createElement(Ze,null),t.partLabels&&Ne.createElement(Xe,null,$),Ne.createElement("ebsr-multiple-choice-configure",{id:"B",key:"partB",ref:t=>{t&&(this.partB=t,this.partB._model={...this.props.model.partB,errors:this.props.model.errors&&this.props.model.errors.partB||{}},this.partB.configuration={...l,...f})}}))}}tr.__initStatic();const er={addChoiceButton:{settings:!0,label:"Add a Choice"},choiceMode:{settings:!0,label:"Response Type"},choicePrefix:{settings:!0,label:"Choice Labels"},deleteChoice:{settings:!0},feedback:{settings:!0,label:"Feedback"},lockChoiceOrder:{settings:!0,label:"Lock Choice Order"},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},settingsPanelDisabled:!0,studentInstructions:{settings:!1,label:"Student Instructions"},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},choicesLayout:{settings:!1,label:"Choices Layout"},gridColumns:{label:"Grid columns"},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},maxImageWidth:{teacherInstructions:300,prompt:300,rationale:636,choices:636},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300,choices:300},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},choices:{inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},baseInputConfiguration:{h3:{disabled:!0},audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}}},rr=t=>({choiceMode:"radio",choicePrefix:"letters",choices:[],choicesLayout:"vertical",feedbackEnabled:!1,gridColumns:2,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,spellCheckEnabled:!0,studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom",...t});var nr={model:{partLabels:!0,partLabelType:"Letters",partA:rr(),partB:rr()},configuration:{baseInputConfiguration:{h3:{disabled:!0},audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},partialScoring:{label:"Allow Partial Scoring",settings:!1},scoringType:{settings:!1,label:"Scoring Type"},partA:De(er),partB:De(er),partLabels:{settings:!0,label:"Part Labels"},settingsPanelDisabled:!1,language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]}}};const or=e;function ar(t){let e,r=t[0],n=1;for(;n<t.length;){const o=t[n],a=t[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(e=r,r=a(r)):"call"!==o&&"optionalCall"!==o||(r=a((...t)=>r.call(e,...t)),e=void 0)}return r}const ir=u.TYPE,sr="ebsr-multiple-choice-configure";customElements.get(sr)||customElements.define(sr,class extends o{});const cr=(t,e)=>({configuration:Ye(t,nr.configuration),model:e}),{model:lr}=nr||{};class ur extends HTMLElement{static __initStatic(){this.createDefaultModel=({partA:t={},partB:e={},...r}={},n=lr)=>({...n,...r,partA:{...n.partA,...t,choicesLayout:t.choicesLayout||!1===t.verticalMode&&"horizontal"||n.partA.choicesLayout},partB:{...n.partB,...e,choicesLayout:e.choicesLayout||!1===e.verticalMode&&"horizontal"||n.partB.choicesLayout}})}constructor(){super(),ur.prototype.__init.call(this),ur.prototype.__init2.call(this),this._root=null,this._model=ur.createDefaultModel(),this._configuration=nr.configuration,this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(t){this._model=ur.createDefaultModel(t,this._model),this._render()}dispatchModelUpdated(t){const e=!!t;this.dispatchEvent(new u(this._model,e))}__init(){this.onModelChanged=(t,e)=>{this._model=ur.createDefaultModel(t,this._model),this.dispatchModelUpdated(e),this._render()}}set configuration(t){const e=cr(t,this._model),r={...nr.configuration,...e.configuration};this._configuration=r,ar([r,"optionalAccess",t=>t.language,"optionalAccess",t=>t.enabled])?ar([r,"optionalAccess",t=>t.languageChoices,"optionalAccess",t=>t.options,"optionalAccess",t=>t.length])&&(this._model.language=ar([r,"optionalAccess",t=>t.languageChoices,"access",t=>t.options,"access",t=>t[0],"access",t=>t.value])):r.language.settings&&this._model.language?(this._configuration.language.enabled=!0,this._configuration.languageChoices.options&&this._configuration.languageChoices.options.length||(this._configuration.languageChoices.options=[]),this._configuration.languageChoices.options.find(t=>t.value===this._model.language)||this._configuration.languageChoices.options.push({value:this._model.language,label:this._model.language})):delete this._model.language,this._render()}onConfigurationChanged(t){this._configuration=cr(t,this._model).configuration,this._model&&this.onModelChanged(this._model),this._render()}__init2(){this.onModelUpdated=t=>{if(t.target===this)return;t.preventDefault(),t.stopImmediatePropagation();const e=t.target&&t.target.getAttribute("id");e&&(t.update&&(this._model[`part${e}`]=t.update),this.dispatchEvent(new u(this._model)))}}connectedCallback(){this.addEventListener(ir,this.onModelUpdated),this._render()}_render(){let t=or.createElement(tr,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged,onConfigurationChanged:this.onConfigurationChanged});this._root||(this._root=i(this)),this._root.render(t)}disconnectedCallback(){this.removeEventListener(ir,this.onModelUpdated),this._root&&this._root.unmount()}}ur.__initStatic();export{ur as default};