@pie-element/math-inline 11.0.0-beta.0 → 11.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -11
- package/configure/CHANGELOG.md +0 -11
- package/configure/lib/configure.js +2 -2
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/defaults.js +3 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/general-config-block.js +5 -5
- package/configure/lib/general-config-block.js.map +1 -1
- package/configure/lib/index.js +2 -2
- package/configure/lib/index.js.map +1 -1
- package/configure/package.json +10 -10
- package/controller/CHANGELOG.md +0 -11
- package/controller/lib/index.js +5 -5
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +5 -5
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/main.js +17 -15
- package/lib/main.js.map +1 -1
- package/lib/print.js +2 -2
- package/lib/print.js.map +1 -1
- package/module/configure.js +1 -0
- package/module/controller.js +3709 -0
- package/module/demo.js +66 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +18 -0
- package/module/print-demo.js +104 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +16 -12
package/module/print.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_dll_react_dom as e,_dll_react as t,_dll_mui__material_styles as o,_dll_prop_types as s,_dll_pie_lib__render_ui as n,_dll_pie_lib__correct_answer_toggle as r,_dll_mui__material as i,_dll_debug as a}from"../../../@pie-lib/shared-module@^4.0.1/module/index.js";import{_dll_pie_lib__math_rendering as l}from"../../../@pie-lib/math-rendering-module@^4.0.7/module/index.js";import{_dll_pie_lib__math_toolbar as c,_dll_pie_lib__math_input as p,_dll_pie_framework__mathquill as u}from"../../../@pie-lib/math-edit-module@^3.1.2/module/index.js";var h,d=e;h=d.createRoot,d.hydrateRoot;var g="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")(),y=m.Symbol,b=Object.prototype,v=b.hasOwnProperty,x=b.toString,w=y?y.toStringTag:void 0;var S=Object.prototype.toString;var k=y?y.toStringTag:void 0;function _(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":k&&k in Object(e)?function(e){var t=v.call(e,w),o=e[w];try{e[w]=void 0;var s=!0}catch(e){}var n=x.call(e);return s&&(t?e[w]=o:delete e[w]),n}(e):function(e){return S.call(e)}(e)}function C(e){return null!=e&&"object"==typeof e}var O=Array.isArray,A=/\s/;var L=/^\s+/;function j(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&A.test(e.charAt(t)););return t}(e)+1).replace(L,""):e}function E(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var R=/^[-+]0x[0-9a-f]+$/i,$=/^0b[01]+$/i,P=/^0o[0-7]+$/i,N=parseInt;function T(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==_(e)}(e))return NaN;if(E(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=E(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=j(e);var o=$.test(e);return o||P.test(e)?N(e.slice(2),o?2:8):R.test(e)?NaN:+e}function F(e){if(!E(e))return!1;var t=_(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var I,D=m["__core-js_shared__"],M=(I=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var q=Function.prototype.toString;function B(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var z=/^\[object .+?Constructor\]$/,V=Function.prototype,U=Object.prototype,K=V.toString,H=U.hasOwnProperty,W=RegExp("^"+K.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function J(e){return!(!E(e)||(t=e,M&&M in t))&&(F(e)?W:z).test(B(e));var t}function Y(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return J(o)?o:void 0}var Q=Y(m,"WeakMap"),G=/^(?:0|[1-9]\d*)$/;function X(e,t){var o=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==o||"symbol"!=o&&G.test(e))&&e>-1&&e%1==0&&e<t}function Z(e,t){return e===t||e!=e&&t!=t}function ee(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function te(e){return null!=e&&ee(e.length)&&!F(e)}var oe=Object.prototype;function se(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||oe)}function ne(e){return C(e)&&"[object Arguments]"==_(e)}var re=Object.prototype,ie=re.hasOwnProperty,ae=re.propertyIsEnumerable,le=ne(function(){return arguments}())?ne:function(e){return C(e)&&ie.call(e,"callee")&&!ae.call(e,"callee")};var ce="object"==typeof exports&&exports&&!exports.nodeType&&exports,pe=ce&&"object"==typeof module&&module&&!module.nodeType&&module,ue=pe&&pe.exports===ce?m.Buffer:void 0,he=(ue?ue.isBuffer:void 0)||function(){return!1},de={};de["[object Float32Array]"]=de["[object Float64Array]"]=de["[object Int8Array]"]=de["[object Int16Array]"]=de["[object Int32Array]"]=de["[object Uint8Array]"]=de["[object Uint8ClampedArray]"]=de["[object Uint16Array]"]=de["[object Uint32Array]"]=!0,de["[object Arguments]"]=de["[object Array]"]=de["[object ArrayBuffer]"]=de["[object Boolean]"]=de["[object DataView]"]=de["[object Date]"]=de["[object Error]"]=de["[object Function]"]=de["[object Map]"]=de["[object Number]"]=de["[object Object]"]=de["[object RegExp]"]=de["[object Set]"]=de["[object String]"]=de["[object WeakMap]"]=!1;var ge,fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=fe&&"object"==typeof module&&module&&!module.nodeType&&module,ye=me&&me.exports===fe&&g.process,be=function(){try{var e=me&&me.require&&me.require("util").types;return e||ye&&ye.binding&&ye.binding("util")}catch(e){}}(),ve=be&&be.isTypedArray,xe=ve?(ge=ve,function(e){return ge(e)}):function(e){return C(e)&&ee(e.length)&&!!de[_(e)]},we=Object.prototype.hasOwnProperty;function Se(e,t){var o=O(e),s=!o&&le(e),n=!o&&!s&&he(e),r=!o&&!s&&!n&&xe(e),i=o||s||n||r,a=i?function(e,t){for(var o=-1,s=Array(e);++o<e;)s[o]=t(o);return s}(e.length,String):[],l=a.length;for(var c in e)!t&&!we.call(e,c)||i&&("length"==c||n&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||X(c,l))||a.push(c);return a}var ke=function(e,t){return function(o){return e(t(o))}}(Object.keys,Object),_e=ke,Ce=Object.prototype.hasOwnProperty;function Oe(e){if(!se(e))return _e(e);var t=[];for(var o in Object(e))Ce.call(e,o)&&"constructor"!=o&&t.push(o);return t}function Ae(e){return te(e)?Se(e):Oe(e)}var Le=Y(Object,"create");var je=Object.prototype.hasOwnProperty;var Ee=Object.prototype.hasOwnProperty;function Re(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var s=e[t];this.set(s[0],s[1])}}function $e(e,t){for(var o=e.length;o--;)if(Z(e[o][0],t))return o;return-1}Re.prototype.clear=function(){this.__data__=Le?Le(null):{},this.size=0},Re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Re.prototype.get=function(e){var t=this.__data__;if(Le){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return je.call(t,e)?t[e]:void 0},Re.prototype.has=function(e){var t=this.__data__;return Le?void 0!==t[e]:Ee.call(t,e)},Re.prototype.set=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Le&&void 0===t?"__lodash_hash_undefined__":t,this};var Pe=Array.prototype.splice;function Ne(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var s=e[t];this.set(s[0],s[1])}}Ne.prototype.clear=function(){this.__data__=[],this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,o=$e(t,e);return!(o<0)&&(o==t.length-1?t.pop():Pe.call(t,o,1),--this.size,!0)},Ne.prototype.get=function(e){var t=this.__data__,o=$e(t,e);return o<0?void 0:t[o][1]},Ne.prototype.has=function(e){return $e(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var o=this.__data__,s=$e(o,e);return s<0?(++this.size,o.push([e,t])):o[s][1]=t,this};var Te=Y(m,"Map");function Fe(e,t){var o,s,n=e.__data__;return("string"==(s=typeof(o=t))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==o:null===o)?n["string"==typeof t?"string":"hash"]:n.map}function Ie(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var s=e[t];this.set(s[0],s[1])}}Ie.prototype.clear=function(){this.size=0,this.__data__={hash:new Re,map:new(Te||Ne),string:new Re}},Ie.prototype.delete=function(e){var t=Fe(this,e).delete(e);return this.size-=t?1:0,t},Ie.prototype.get=function(e){return Fe(this,e).get(e)},Ie.prototype.has=function(e){return Fe(this,e).has(e)},Ie.prototype.set=function(e,t){var o=Fe(this,e),s=o.size;return o.set(e,t),this.size+=o.size==s?0:1,this};function De(e){var t=this.__data__=new Ne(e);this.size=t.size}De.prototype.clear=function(){this.__data__=new Ne,this.size=0},De.prototype.delete=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o},De.prototype.get=function(e){return this.__data__.get(e)},De.prototype.has=function(e){return this.__data__.has(e)},De.prototype.set=function(e,t){var o=this.__data__;if(o instanceof Ne){var s=o.__data__;if(!Te||s.length<199)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new Ie(s)}return o.set(e,t),this.size=o.size,this};var Me=Object.prototype.propertyIsEnumerable,qe=Object.getOwnPropertySymbols,Be=qe?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var o=-1,s=null==e?0:e.length,n=0,r=[];++o<s;){var i=e[o];t(i,o,e)&&(r[n++]=i)}return r}(qe(e),function(t){return Me.call(e,t)}))}:function(){return[]};function ze(e){return function(e,t,o){var s=t(e);return O(e)?s:function(e,t){for(var o=-1,s=t.length,n=e.length;++o<s;)e[n+o]=t[o];return e}(s,o(e))}(e,Ae,Be)}var Ve=Y(m,"DataView"),Ue=Y(m,"Promise"),Ke=Y(m,"Set"),He="[object Map]",We="[object Promise]",Je="[object Set]",Ye="[object WeakMap]",Qe="[object DataView]",Ge=B(Ve),Xe=B(Te),Ze=B(Ue),et=B(Ke),tt=B(Q),ot=_;(Ve&&ot(new Ve(new ArrayBuffer(1)))!=Qe||Te&&ot(new Te)!=He||Ue&&ot(Ue.resolve())!=We||Ke&&ot(new Ke)!=Je||Q&&ot(new Q)!=Ye)&&(ot=function(e){var t=_(e),o="[object Object]"==t?e.constructor:void 0,s=o?B(o):"";if(s)switch(s){case Ge:return Qe;case Xe:return He;case Ze:return We;case et:return Je;case tt:return Ye}return t});var st=ot,nt=m.Uint8Array;function rt(e){var t=-1,o=null==e?0:e.length;for(this.__data__=new Ie;++t<o;)this.add(e[t])}function it(e,t){for(var o=-1,s=null==e?0:e.length;++o<s;)if(t(e[o],o,e))return!0;return!1}rt.prototype.add=rt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},rt.prototype.has=function(e){return this.__data__.has(e)};function at(e,t,o,s,n,r){var i=1&o,a=e.length,l=t.length;if(a!=l&&!(i&&l>a))return!1;var c=r.get(e),p=r.get(t);if(c&&p)return c==t&&p==e;var u=-1,h=!0,d=2&o?new rt:void 0;for(r.set(e,t),r.set(t,e);++u<a;){var g=e[u],f=t[u];if(s)var m=i?s(f,g,u,t,e,r):s(g,f,u,e,t,r);if(void 0!==m){if(m)continue;h=!1;break}if(d){if(!it(t,function(e,t){if(i=t,!d.has(i)&&(g===e||n(g,e,o,s,r)))return d.push(t);var i})){h=!1;break}}else if(g!==f&&!n(g,f,o,s,r)){h=!1;break}}return r.delete(e),r.delete(t),h}function lt(e){var t=-1,o=Array(e.size);return e.forEach(function(e,s){o[++t]=[s,e]}),o}function ct(e){var t=-1,o=Array(e.size);return e.forEach(function(e){o[++t]=e}),o}var pt=y?y.prototype:void 0,ut=pt?pt.valueOf:void 0;var ht=Object.prototype.hasOwnProperty;var dt="[object Arguments]",gt="[object Array]",ft="[object Object]",mt=Object.prototype.hasOwnProperty;function yt(e,t,o,s,n,r){var i=O(e),a=O(t),l=i?gt:st(e),c=a?gt:st(t),p=(l=l==dt?ft:l)==ft,u=(c=c==dt?ft:c)==ft,h=l==c;if(h&&he(e)){if(!he(t))return!1;i=!0,p=!1}if(h&&!p)return r||(r=new De),i||xe(e)?at(e,t,o,s,n,r):function(e,t,o,s,n,r,i){switch(o){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new nt(e),new nt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Z(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=lt;case"[object Set]":var l=1&s;if(a||(a=ct),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;s|=2,i.set(e,t);var p=at(a(e),a(t),s,n,r,i);return i.delete(e),p;case"[object Symbol]":if(ut)return ut.call(e)==ut.call(t)}return!1}(e,t,l,o,s,n,r);if(!(1&o)){var d=p&&mt.call(e,"__wrapped__"),g=u&&mt.call(t,"__wrapped__");if(d||g){var f=d?e.value():e,m=g?t.value():t;return r||(r=new De),n(f,m,o,s,r)}}return!!h&&(r||(r=new De),function(e,t,o,s,n,r){var i=1&o,a=ze(e),l=a.length;if(l!=ze(t).length&&!i)return!1;for(var c=l;c--;){var p=a[c];if(!(i?p in t:ht.call(t,p)))return!1}var u=r.get(e),h=r.get(t);if(u&&h)return u==t&&h==e;var d=!0;r.set(e,t),r.set(t,e);for(var g=i;++c<l;){var f=e[p=a[c]],m=t[p];if(s)var y=i?s(m,f,p,t,e,r):s(f,m,p,e,t,r);if(!(void 0===y?f===m||n(f,m,o,s,r):y)){d=!1;break}g||(g="constructor"==p)}if(d&&!g){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return r.delete(e),r.delete(t),d}(e,t,o,s,n,r))}function bt(e,t,o,s,n){return e===t||(null==e||null==t||!C(e)&&!C(t)?e!=e&&t!=t:yt(e,t,o,s,bt,n))}var vt=function(){return m.Date.now()},xt=Math.max,wt=Math.min;function St(e,t,o){var s,n,r,i,a,l,c=0,p=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var o=s,r=n;return s=n=void 0,c=t,i=e.apply(r,o)}function g(e){var o=e-l;return void 0===l||o>=t||o<0||u&&e-c>=r}function f(){var e=vt();if(g(e))return m(e);a=setTimeout(f,function(e){var o=t-(e-l);return u?wt(o,r-(e-c)):o}(e))}function m(e){return a=void 0,h&&s?d(e):(s=n=void 0,i)}function y(){var e=vt(),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),p?d(e):i}(l);if(u)return clearTimeout(a),a=setTimeout(f,t),d(l)}return void 0===a&&(a=setTimeout(f,t)),i}return t=T(t)||0,E(o)&&(p=!!o.leading,r=(u="maxWait"in o)?xt(T(o.maxWait)||0,t):r,h="trailing"in o?!!o.trailing:h),y.cancel=function(){void 0!==a&&clearTimeout(a),c=0,s=l=n=a=void 0},y.flush=function(){return void 0===a?i:m(vt())},y}var kt=Object.prototype.hasOwnProperty;function _t(e,t){return bt(e,t)}const Ct="Advanced Multi",Ot="Simple",At=t,{styled:Lt}=o,jt=s,{color:Et}=n,{MathToolbar:Rt}=c,{mq:$t}=p,Pt=Lt("div")(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2),padding:e.spacing(1)})),Nt=Lt("div",{shouldForwardProp:e=>!["isCorrect","isIncorrect"].includes(e)})(({theme:e,isCorrect:t,isIncorrect:o})=>({color:Et.text(),background:Et.background(),border:t?`2px solid ${Et.correct()} !important`:o?`2px solid ${Et.incorrect()} !important`:`1px solid ${Et.primaryLight()}`,width:"fit-content",fontSize:"1rem",padding:t||o?e.spacing(1):e.spacing(.5),letterSpacing:t||o?"0.5px":"normal","& > .mq-math-mode":{"& > .mq-hasCursor":{"& > .mq-cursor":{display:"none"}}}}));if("undefined"!=typeof document){const e="math-inline-simple-question-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`\n .response-editor {\n display: flex;\n justify-content: center;\n width: auto;\n max-width: fit-content;\n height: auto;\n text-align: left;\n padding: 8px;\n }\n .response-editor.mq-math-mode {\n border: 1px solid ${Et.primaryLight()};\n }\n `,document.head.appendChild(t)}}class Tt extends At.Component{static __initStatic(){this.propTypes={onSimpleResponseChange:jt.func,model:jt.object.isRequired,emptyResponse:jt.bool,session:jt.object.isRequired,showCorrect:jt.bool,onSubFieldFocus:jt.func.isRequired,showKeypad:jt.bool.isRequired}}constructor(e){super(e),Tt.prototype.__init.call(this),Tt.prototype.__init2.call(this),Tt.prototype.__init3.call(this),this.mathToolBarId=`math-toolbar-${(new Date).getTime()}`}__init(){this.mathToolBarContainsTarget=e=>document.getElementById(this.mathToolBarId).contains(e.target)}__init2(){this.handleClick=e=>{try{this.mathToolBarContainsTarget(e)||this.setState({showKeypad:!1})}catch(e){}}}__init3(){this.onFocus=()=>{const{onSubFieldFocus:e}=this.props;e(this.mathToolBarId)}}render(){const{model:e,showCorrect:t,session:o,emptyResponse:s,onSimpleResponseChange:n,showKeypad:r}=this.props,{config:i,disabled:a,correctness:l}=e||{};if(!i)return;const c=l&&l.correct,{responses:p,equationEditor:u}=i;return At.createElement(Pt,{"data-keypad":!0},t||a?At.createElement(Nt,{isIncorrect:!s&&!c&&!t,isCorrect:!s&&(c||t)},At.createElement($t.Static,{latex:t?p&&p.length&&p[0].answer:o.response||""})):At.createElement("div",{id:this.mathToolBarId},At.createElement(Rt,{classNames:{editor:"response-editor"},latex:o.response,keypadMode:u,onChange:n,onDone:()=>{},onFocus:this.onFocus,controlledKeypad:!0,showKeypad:r,hideDoneButton:!0})))}}function Ft(e,t){return null!=e?e:t()}function It(e){let t,o=e[0],s=1;for(;s<e.length;){const n=e[s],r=e[s+1];if(s+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=r(o)):"call"!==n&&"optionalCall"!==n||(o=r((...e)=>o.call(t,...e)),t=void 0)}return o}Tt.__initStatic();const Dt=e=>"string"==typeof e,Mt=()=>{let e,t;const o=new Promise((o,s)=>{e=o,t=s});return o.resolve=e,o.reject=t,o},qt=e=>null==e?"":""+e,Bt=/###/g,zt=e=>e&&e.indexOf("###")>-1?e.replace(Bt,"."):e,Vt=e=>!e||Dt(e),Ut=(e,t,o)=>{const s=Dt(t)?t.split("."):t;let n=0;for(;n<s.length-1;){if(Vt(e))return{};const t=zt(s[n]);!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++n}return Vt(e)?{}:{obj:e,k:zt(s[n])}},Kt=(e,t,o)=>{const{obj:s,k:n}=Ut(e,t,Object);if(void 0!==s||1===t.length)return void(s[n]=o);let r=t[t.length-1],i=t.slice(0,t.length-1),a=Ut(e,i,Object);for(;void 0===a.obj&&i.length;)r=`${i[i.length-1]}.${r}`,i=i.slice(0,i.length-1),a=Ut(e,i,Object),It([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${r}`]&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=o},Ht=(e,t)=>{const{obj:o,k:s}=Ut(e,t);if(o&&Object.prototype.hasOwnProperty.call(o,s))return o[s]},Wt=(e,t,o)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?Dt(e[s])||e[s]instanceof String||Dt(t[s])||t[s]instanceof String?o&&(e[s]=t[s]):Wt(e[s],t[s],o):e[s]=t[s]);return e},Jt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Yt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Qt=e=>Dt(e)?e.replace(/[&<>"'\/]/g,e=>Yt[e]):e;const Gt=[" ",",","?","!",";"],Xt=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),Zt=(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,r="";for(let i=e;i<s.length;++i)if(i!==e&&(r+=o),r+=s[i],t=n[r],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<s.length-1)continue;e+=i-e+1;break}n=t}return n},eo=e=>It([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),to={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){It([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class oo{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||to,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:(Dt(e[0])&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new oo(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new oo(this.logger,e)}}var so=new oo;class no{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 ro extends no{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,r=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],o&&(Array.isArray(o)?i.push(...o):Dt(o)&&n?i.push(...o.split(n)):i.push(o)));const a=Ht(this.data,i);return!a&&!t&&!o&&e.indexOf(".")>-1&&(e=i[0],t=i[1],o=i.slice(2).join(".")),!a&&r&&Dt(o)?Zt(It([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 r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let i=[e,t];o&&(i=i.concat(r?o.split(r):o)),e.indexOf(".")>-1&&(i=e.split("."),s=t,t=i[1]),this.addNamespaces(t),Kt(this.data,i,s),n.silent||this.emit("added",e,t,o,s)}addResources(e,t,o,s={silent:!1}){for(const s in o)(Dt(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,r={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),s=o,o=t,t=i[1]),this.addNamespaces(t);let a=Ht(this.data,i)||{};r.skipCopy||(o=JSON.parse(JSON.stringify(o))),s?Wt(a,o,n):a={...a,...o},Kt(this.data,i,a),r.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 io={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,o,s,n){return e.forEach(e=>{t=Ft(It([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,o,s,n)]),()=>t)}),t}};const ao=Symbol("i18next/PATH_KEY");function lo(e,t){const{[ao]:o}=e(function(){const e=[],t=Object.create(null);let o;return t.get=(s,n)=>(It([o,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),n===ao?e:(e.push(n),o=Proxy.revocable(s,t),o.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return o.join(Ft(It([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const co={},po=e=>!Dt(e)&&"boolean"!=typeof e&&"number"!=typeof e;class uo extends no{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=so.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===It([s,"optionalAccess",e=>e.res]))return!1;const n=po(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 r=o&&e.indexOf(o)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,o)=>{t=t||"",o=o||"";const s=Gt.filter(e=>t.indexOf(e)<0&&o.indexOf(e)<0);if(0===s.length)return!0;const n=Xt.getRegExp(`(${s.map(e=>"?"===e?"\\?":e).join("|")})`);let r=!n.test(e);if(!r){const t=e.indexOf(o);t>0&&!n.test(e.substring(0,t))&&(r=!0)}return r})(e,o,s));if(r&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Dt(n)?[n]:n};const r=e.split(o);(o!==s||o===s&&this.options.ns.indexOf(r[0])>-1)&&(n=r.shift()),e=r.join(s)}return{key:e,namespaces:Dt(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=lo(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]);const n=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,r=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:i,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 p=s.lng||this.language,u=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===It([p,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return u?n?{res:`${l}${c}${i}`,usedKey:i,exactUsedKey:i,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${c}${i}`:n?{res:i,usedKey:i,exactUsedKey:i,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:i;const h=this.resolve(e,s);let d=It([h,"optionalAccess",e=>e.res]);const g=It([h,"optionalAccess",e=>e.usedKey])||i,f=It([h,"optionalAccess",e=>e.exactUsedKey])||i,m=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==s.count&&!Dt(s.count),v=uo.hasDefaultValue(s),x=b?this.pluralResolver.getSuffix(p,s.count,s):"",w=s.ordinal&&b?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",S=b&&!s.ordinal&&0===s.count,k=S&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${x}`]||s[`defaultValue${w}`]||s.defaultValue;let _=d;y&&!d&&v&&(_=k);const C=po(_),O=Object.prototype.toString.apply(_);if(!(y&&_&&C&&["[object Number]","[object Function]","[object RegExp]"].indexOf(O)<0)||Dt(m)&&Array.isArray(_))if(y&&Dt(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,s,o));else{let t=!1,n=!1;!this.isValidLookup(d)&&v&&(t=!0,d=k),this.isValidLookup(d)||(n=!0,d=i);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:d,u=v&&k!==d&&this.options.updateMissing;if(n||t||u){if(this.logger.log(u?"updateKey":"missingKey",p,l,i,u?k:d),r){const e=this.resolve(i,{...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=v&&o!==d?o:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,n,u,s):It([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,n,u,s),this.emit("missingKey",e,l,t,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,s);S&&s[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{o([e],i+t,s[`defaultValue${t}`]||k)})}):o(e,i,k))}d=this.extendTranslation(d,e,s,h,o),n&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${l}${c}${i}`),(n||t)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${i}`:i,t?d: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(g,_,{...s,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return n?(h.res=e,h.usedParams=this.getUsedParamsDetails(s),h):e}if(r){const e=Array.isArray(_),t=e?[]:{},o=e?f:g;for(const e in _)if(Object.prototype.hasOwnProperty.call(_,e)){const n=`${o}${r}${e}`;t[e]=v&&!d?this.translate(n,{...s,defaultValue:po(k)?k[e]:void 0,joinArrays:!1,ns:a}):this.translate(n,{...s,joinArrays:!1,ns:a}),t[e]===n&&(t[e]=_[e])}d=t}}return n?(h.res=d,h.usedParams=this.getUsedParamsDetails(s),h):d}extendTranslation(e,t,o,s,n){if(It([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 r=Dt(e)&&(void 0!==It([o,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let i;if(r){const t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let a=o.replace&&!Dt(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),r){const t=e.match(this.interpolator.nestingRegexp);i<(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)=>It([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 r=o.postProcess||this.options.postProcess,i=Dt(r)?[r]:r;return null!=e&&It([i,"optionalAccess",e=>e.length])&&!1!==o.applyPostProcessor&&(e=io.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),e}resolve(e,t={}){let o,s,n,r,i;return Dt(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 p=void 0!==t.count&&!Dt(t.count),u=p&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Dt(t.context)||"number"==typeof t.context)&&""!==t.context,d=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(o)||(i=e,co[`${d[0]}-${e}`]||!It([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||It([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(i)])||(co[`${d[0]}-${e}`]=!0,this.logger.warn(`key "${s}" for languages "${d.join(", ")}" won't get resolved as namespace "${i}" 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!!!")),d.forEach(s=>{if(this.isValidLookup(o))return;r=s;const i=[l];if(It([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(i,l,s,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(s,t.count,t));const o=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&0===e.indexOf(n)&&i.push(l+e.replace(n,this.options.pluralSeparator)),i.push(l+e),u&&i.push(l+o)),h){const s=`${l}${this.options.contextSeparator||"_"}${t.context}`;i.push(s),p&&(t.ordinal&&0===e.indexOf(n)&&i.push(s+e.replace(n,this.options.pluralSeparator)),i.push(s+e),u&&i.push(s+o))}}let a;for(;a=i.pop();)this.isValidLookup(o)||(n=a,o=this.getResource(s,e,a,t))}))})}),{res:o,usedKey:s,exactUsedKey:n,usedLng:r,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,o,s={}){return It([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&&!Dt(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 ho{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=so.create("languageUtils")}getScriptPartFromCode(e){if(!(e=eo(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=eo(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Dt(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)),Dt(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 Dt(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))):Dt(e)&&n(this.formatLanguageCode(e)),o.forEach(e=>{s.indexOf(e)<0&&n(this.formatLanguageCode(e))}),s}}const go={zero:0,one:1,two:2,few:3,many:4,other:5},fo={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class mo{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=so.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const o=eo("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 r;try{r=new Intl.PluralRules(o,{type:s})}catch(o){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),fo;if(!e.match(/-|_/))return fo;const s=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(s,t)}return this.pluralRulesCache[n]=r,r}needsPlural(e,t={}){let o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),It([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)=>go[e]-go[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 yo=(e,t,o,s=".",n=!0)=>{let r=((e,t,o)=>{const s=Ht(e,o);return void 0!==s?s:Ht(t,o)})(e,t,o);return!r&&n&&Dt(o)&&(r=Zt(e,o,s),void 0===r&&(r=Zt(t,o,s))),r},bo=e=>e.replace(/\$/g,"$$$$");class vo{constructor(e={}){this.logger=so.create("interpolator"),this.options=e,this.format=It([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:r,suffix:i,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:p,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:d,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:Qt,this.escapeValue=void 0===o||o,this.useRawValueToEscape=void 0!==s&&s,this.prefix=n?Jt(n):r||"{{",this.suffix=i?Jt(i):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?Jt(u):h||Jt("$t("),this.nestingSuffix=d?Jt(d):g||Jt(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>It([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,r,i;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const n=yo(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),r=n.shift().trim(),i=n.join(this.formatSeparator).trim();return this.format(yo(t,a,r,this.options.keySeparator,this.options.ignoreJSONStructure),i,o,{...s,...t,interpolationkey:r})};this.resetRegExp();const c=It([s,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,p=void 0!==It([s,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>bo(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?bo(this.escape(e)):bo(e)}].forEach(t=>{for(i=0;n=t.regex.exec(e);){const o=n[1].trim();if(r=l(o),void 0===r)if("function"==typeof c){const t=c(e,n,s);r=Dt(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,o))r="";else{if(p){r=n[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),r=""}else Dt(r)||this.useRawValueToEscape||(r=qt(r));const a=t.safeValue(r);if(e=e.replace(n[0],a),p?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t,o={}){let s,n,r;const i=(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,r);const i=n.match(/'/g),a=n.match(/"/g);(Ft(It([i,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(n=n.replace(/'/g,'"'));try{r=JSON.parse(n),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${o}${n}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,e};for(;s=this.nestingRegexp.exec(e);){let a=[];r={...o},r=r.replace&&!Dt(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.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(i.call(this,s[1].trim(),r),r),n&&s[0]===e&&!Dt(n))return n;Dt(n)||(n=qt(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 xo=e=>{const t={};return(o,s,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const i=s+JSON.stringify(r);let a=t[i];return a||(a=e(eo(s),n),t[i]=a),a(o)}},wo=e=>(t,o,s)=>e(eo(o),s)(t);class So{constructor(e={}){this.logger=so.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const o=t.cacheInBuiltFormats?xo:wo;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()]=xo(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:r}=(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,""),r=t.trim();o[r]||(o[r]=n),"false"===n&&(o[r]=!1),"true"===n&&(o[r]=!0),isNaN(n)||(o[r]=parseInt(n,10))}})}return{formatName:t,formatOptions:o}})(t);if(this.formats[n]){let t=e;try{const i=It([s,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[s.interpolationkey]])||{},a=i.locale||i.lng||s.locale||s.lng||o;t=this.formats[n](e,a,{...r,...s,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${n}`),e},e)}}class ko extends no{constructor(e,t,o,s={}){super(),this.backend=e,this.store=t,this.services=o,this.languageUtils=o.languageUtils,this.options=s,this.logger=so.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=[],It([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(o,s.backend,s)])}queueLoad(e,t,o,s){const n={},r={},i={},a={};return e.forEach(e=>{let s=!0;t.forEach(t=>{const i=`${e}|${t}`;!o.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===r[i]&&(r[i]=!0):(this.state[i]=1,s=!1,void 0===r[i]&&(r[i]=!0),void 0===n[i]&&(n[i]=!0),void 0===a[t]&&(a[t]=!0)))}),s||(i[e]=!0)}),(Object.keys(n).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(n),pending:Object.keys(r),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(a)}}loaded(e,t,o){const s=e.split("|"),n=s[0],r=s[1];t&&this.emit("failedLoading",n,r,t),!t&&o&&this.store.addResourceBundle(n,r,o,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&o&&(this.state[e]=0);const i={};this.queue.forEach(o=>{((e,t,o)=>{const{obj:s,k:n}=Ut(e,t,Object);s[n]=s[n]||[],s[n].push(o)})(o.loaded,[n],r),((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=>{i[e]||(i[e]={});const t=o.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,o,s=0,n=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:o,tried:s,wait:n,callback:r});this.readingCalls++;const i=(i,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)}i&&a&&s<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,o,s+1,2*n,r)},n):r(i,a)},a=this.backend[o].bind(this.backend);if(2!==a.length)return a(e,t,i);try{const o=a(e,t);o&&"function"==typeof o.then?o.then(e=>i(null,e)).catch(i):i(null,o)}catch(e){i(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();Dt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Dt(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,r)=>{o&&this.logger.warn(`${t}loading namespace ${n} for language ${s} failed`,o),!o&&r&&this.logger.log(`${t}loaded namespace ${n} for language ${s}`,r),this.loaded(e,o,r)})}saveMissing(e,t,o,s,n,r={},i=()=>{}){if(!It([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||It([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=o&&""!==o){if(It([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...r,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=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}else l(e,t,o,s,i,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 _o=()=>({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]),Dt(e[1])&&(t.defaultValue=e[1]),Dt(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}),Co=e=>(Dt(e.ns)&&(e.ns=[e.ns]),Dt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Dt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),It([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),Oo=()=>{};class Ao extends no{constructor(e={},t){var o;if(super(),this.options=Co(e),this.services={},this.logger=so,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&&(Dt(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const o=_o();var s;this.options={...o,...this.options,...Co(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||(It([s=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||It([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||It([s,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&s.options.backend.backends.some(e=>It([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||It([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?so.init(n(this.modules.logger),this.options):so.init(null,this.options),e=this.modules.formatter?this.modules.formatter:So;const t=new ho(this.options);this.store=new ro(this.options.resources,this.options);const s=this.services;s.logger=so,s.resourceStore=this.store,s.languageUtils=t,s.pluralResolver=new mo(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 vo(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new ko(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 uo(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=Oo),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 r=Mt(),i=()=>{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),r.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?i():setTimeout(i,0),r}loadResources(e,t=Oo){let o=t;const s=Dt(e)?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===It([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))}It([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=Mt();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=Oo),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&&io.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=Mt();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,r)=>{r?this.isLanguageChangingTo===e&&(s(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,o.resolve((...e)=>this.t(...e)),t&&t(n,(...e)=>this.t(...e))},r=t=>{e||t||!this.services.languageDetector||(t=[]);const o=Dt(t)?t:t&&t[0],r=this.store.hasLanguageSomeTranslations(o)?o:this.services.languageUtils.getBestMatchFromCodes(Dt(t)?[t]:t);r&&(this.language||s(r),this.translator.language||this.translator.changeLanguage(r),It([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(r)])),this.loadResources(r,e=>{n(e,r)})};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(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),o}getFixedT(e,t,o){const s=(e,t,...n)=>{let r;r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(n)):{...t},r.lng=r.lng||s.lng,r.lngs=r.lngs||s.lngs,r.ns=r.ns||s.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||o||s.keyPrefix);const i=this.options.keySeparator||".";let a;return r.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=lo(e,{...this.options,...t})),`${r.keyPrefix}${i}${e}`)):("function"==typeof e&&(e=lo(e,{...this.options,...t})),a=r.keyPrefix?`${r.keyPrefix}${i}${e}`:e),this.t(a,r)};return Dt(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=o,s}t(...e){return It([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return It([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 r=(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,r);if(void 0!==e)return e}return!!this.hasResourceBundle(o,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!r(o,e)||s&&!r(n,e)))}loadNamespaces(e,t){const o=Mt();return this.options.ns?(Dt(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=Mt();Dt(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||(It([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=It([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new ho(_o());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 Ao(e,t);return o.createInstance=Ao.createInstance,o}cloneInstance(e={},t=Oo){const o=e.forkResourceStore;o&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},n=new Ao(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 ro(e,s),n.services.resourceStore=n.store}if(e.interpolation){const t={..._o().interpolation,...this.options.interpolation,...e.interpolation},o={...s,interpolation:t};n.services.interpolator=new vo(o)}return n.translator=new uo(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 Lo=Ao.createInstance();Lo.createInstance,Lo.dir,Lo.init,Lo.loadResources,Lo.reloadResources,Lo.use,Lo.changeLanguage,Lo.getFixedT,Lo.t,Lo.exists,Lo.setDefaultNamespace,Lo.hasLoadedNamespace,Lo.loadNamespaces,Lo.loadLanguages;Lo.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 jo={translator:{...Lo,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 Lo.t(e,{lng:o,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const Eo=t,Ro=s,$o=r,{Feedback:Po}=n,{Collapsible:No}=n,{Readable:To}=n,{hasText:Fo}=n,{hasMedia:Io}=n,{PreviewPrompt:Do}=n,{UiLayout:Mo}=n,{color:qo}=n,{styled:Bo}=o,{Tooltip:zo}=i,Vo=e,{mq:Uo}=p,{HorizontalKeypad:Ko}=p,{updateSpans:Ho}=p,Wo=u,{renderMath:Jo}=l;function Yo(e){let t,o=e[0],s=1;for(;s<e.length;){const n=e[s],r=e[s+1];if(s+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=r(o)):"call"!==n&&"optionalCall"!==n||(o=r((...e)=>o.call(t,...e)),t=void 0)}return o}const{translator:Qo}=jo;let Go=!1;const Xo=/\\newline/g,Zo=/{{response}}/gm,es=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function ts(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function os(e,t){const o={};if(t.config&&t.config.expression){let s=1;(t.config.expression||"").replace(Zo,()=>{o[`r${s}`]={value:e&&e.answers&&e.answers[`r${s}`]&&e.answers[`r${s}`].value||""},s+=1})}return o}class ss extends Eo.Component{static __initStatic(){this.propTypes={session:Ro.object.isRequired,onSessionChange:Ro.func,model:Ro.object.isRequired}}constructor(e){super(e),ss.prototype.__init.call(this),ss.prototype.__init2.call(this),ss.prototype.__init3.call(this),ss.prototype.__init4.call(this),ss.prototype.__init5.call(this),ss.prototype.__init6.call(this),ss.prototype.__init7.call(this),ss.prototype.__init8.call(this),ss.prototype.__init9.call(this),ss.prototype.__init10.call(this),ss.prototype.__init11.call(this),ss.prototype.__init12.call(this),ss.prototype.__init13.call(this),ss.prototype.__init14.call(this),ss.prototype.__init15.call(this),ss.prototype.__init16.call(this);const{model:t,session:o}=e,s=os(o,t);this.state={session:{...e.session,answers:s},activeAnswerBlock:"",showCorrect:this.props.model.config.alwaysShowCorrect||!1,tooltipContainerRef:Eo.createRef()}}UNSAFE_componentWillMount(){if("undefined"!=typeof window){let e=Wo.getInterface(2);Go||(e.registerEmbed("answerBlock",e=>{const t=ns();return{htmlString:`<div class="${t.blockContainer}">\n <div class="${t.blockResponse}" id="${e}Index">R</div>\n <div class="${t.blockMath}">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`}}),Go=!0)}}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:o}=this.state,s=t.answers;this.root&&e.disabled&&!o&&Object.keys(s).forEach(t=>{const o=this.root.querySelector(`#${t}`),n=this.root.querySelector(`#${t}Index`);if(o){let r=Wo.getInterface(2);const i=s[t];o.textContent=i&&i.value||"",e.view&&(o.parentElement.parentElement.classList.remove("correct"),o.parentElement.parentElement.classList.remove("incorrect")),r.StaticMath(o),n.textContent="R"}}),Jo(this.root)}}countResponseOccurrences(e){const t=/\{\{response\}\}/g,o=Yo([e,"optionalAccess",e=>e.match,"call",e=>e(t)]);return o?o.length:0}UNSAFE_componentWillReceiveProps(e){const{config:t}=this.props.model,{config:o={}}=e.model||{},{session:s}=this.props,{session:n={}}=e||{};if(s&&n&&!_t(s.answers,n.answers)&&this.setState({session:{...n,answers:os(n,this.props.model)}}),t.note&&t.language&&t.language!==o.language&&t.note===Qo.t("mathInline.primaryCorrectWithAlternates",{lng:t.language})&&(t.note=Qo.t("mathInline.primaryCorrectWithAlternates",{lng:o.language})),(t.env&&"evaluate"!==t.env.mode||o.env&&"evaluate"!==o.env.mode)&&this.setState({...this.state.session,showCorrect:!1}),o.alwaysShowCorrect&&this.setState({showCorrect:!0}),this.countResponseOccurrences(t.expression)<this.countResponseOccurrences(o.expression)&&setTimeout(()=>this.updateAria(),100),t&&t.responses&&t.responses.length!==o.responses.length||!t&&o&&o.responses||t&&o&&t.expression!==o.expression){const e={},t=this.state.session.answers;let s=1;(o.expression||"").replace(Zo,()=>{e[`r${s}`]={value:t&&t[`r${s}`]&&t[`r${s}`].value||""},s++}),this.setState(t=>({session:{...t.session,completeAnswer:this.mqStatic&&this.mqStatic.mathField.latex(),answers:e}}),this.handleAnswerBlockDomUpdate)}}shouldComponentUpdate(e,t){const o=_t(this.props.model,e.model),s=_t(this.state,t);return!o||!s}componentDidMount(){this.handleAnswerBlockDomUpdate(),this.updateAria(),setTimeout(()=>Jo(this.root),100)}componentDidUpdate(e,t){this.handleAnswerBlockDomUpdate();Yo([e,"access",e=>e.model,"optionalAccess",e=>e.config,"optionalAccess",e=>e.responseType])!==Yo([this,"access",e=>e.props,"access",e=>e.model,"optionalAccess",e=>e.config,"optionalAccess",e=>e.responseType])&&this.updateAria()}__init2(){this.updateAria=()=>{if(this.root){this.root.querySelectorAll(".mq-selectable").forEach(e=>e.setAttribute("aria-hidden","true"));this.root.querySelectorAll("textarea").forEach((e,t)=>{e.setAttribute("aria-label","Enter answer.");const o=`instructions-${t}`,s=e.closest(".mq-textarea");if(s){let t=s.querySelector(`#${o}`);t||(t=document.createElement("span"),t.id=o,t.className="sr-only",t.textContent="This field supports both keypad and keyboard input. Use the keyboard to access and interact with the on-screen math keypad, which accepts LaTeX markup. Use the down arrow key to open the keypad and navigate its buttons. Use the escape key to close the keypad and return to the input field.",s.insertBefore(t,e)),e.setAttribute("aria-describedby",o)}})}}}__init3(){this.focusFirstKeypadElement=()=>{setTimeout(()=>{const e=document.querySelector("[data-keypad]");if(e){const t=e.querySelector("button, [role='button']");t&&t.focus()}},0)}}__init4(){this.handleKeyDown=(e,t)=>{const o=function(e,t){let o=e;for(;null!==o;){if(t&&o===t)return!0;o=o.parentNode}return!1}(e.target,this.root),s=this.mqStatic&&Yo([this,"access",e=>e.mqStatic,"access",e=>e.inputRef,"optionalAccess",e=>e.current])?Yo([this,"access",e=>e.mqStatic,"access",e=>e.inputRef,"optionalAccess",e=>e.current,"access",e=>e.contains,"call",e=>e(document.activeElement)]):"Enter answer."===Yo([document,"access",e=>e.activeElement,"optionalAccess",e=>e.getAttribute,"call",e=>e("aria-label")]),{key:n,type:r}=e;s&&("ArrowDown"===n||("click"===r||"touchstart"===r))?this.state.activeAnswerBlock!==t&&o&&(this.cleanupKeyDownListener(),this.setState({activeAnswerBlock:t},()=>{this.onSubFieldFocus(t),"ArrowDown"===n&&this.focusFirstKeypadElement()})):"Escape"===e.key&&this.setState({activeAnswerBlock:""})}}__init5(){this.onSubFieldFocus=e=>{this.handleEvent||(this.handleEvent=t=>{this.handleKeyDown(t,e)},document.addEventListener("keydown",this.handleEvent),document.addEventListener("click",this.handleEvent),document.addEventListener("touchstart",this.handleEvent))}}__init6(){this.cleanupKeyDownListener=()=>{this.handleEvent&&(document.removeEventListener("keydown",this.handleEvent),document.removeEventListener("click",this.handleEvent),document.removeEventListener("touchstart",this.handleEvent),this.handleEvent=null)}}componentWillUnmount(){this.cleanupKeyDownListener&&this.cleanupKeyDownListener()}__init7(){this.onDone=()=>{}}__init8(){this.onSimpleResponseChange=e=>{this.setState(t=>({session:{...t.session,response:e}}),this.callOnSessionChange)}}__init9(){this.toNodeData=e=>{if(!e)return;const{type:t,value:o}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===o?{type:"clear"}:{type:"write",value:o}}}__init10(){this.setInput=e=>{this.input=e}}__init11(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value),this.input.focus()}}__init12(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init13(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init14(){this.subFieldChanged=(e,t)=>{Ho(),e&&this.setState(o=>({session:{...o.session,completeAnswer:this.mqStatic&&this.mqStatic.mathField.latex(),answers:{...o.session.answers,[e]:{value:t}}}}),this.callOnSessionChange)}}__init15(){this.getFieldName=(e,t)=>{const{answers:o}=this.state.session;if(Object.keys(o||{}).length){return Object.keys(o).find(o=>{const s=t[o];return s&&s.id==e.id})}}}__init16(){this.onBlur=e=>{const{relatedTarget:t,currentTarget:o}=e||{},s=o&&o.closest("[role=tooltip]");const n=function e(t,o=0){if(!t||o>=16)return null;const s=t.offsetParent;return s?"tooltip"===s.getAttribute("role")?s:e(s,o+1):null}(t),r=n?function e(t,o=0){if(!t||o>=4)return null;const s=Yo([t,"optionalAccess",e=>e.children,"optionalAccess",e=>e[0]]);return s?s.attributes&&s.attributes["data-keypad"]?s:e(s,o+1):null}(n):null;t&&o&&Yo([r,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||s||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&es){const e=document.querySelector("[role='tooltip']");if(e){e.firstChild.setAttribute("tabindex","-1")}}},1)}render(){const{model:e}=this.props,{activeAnswerBlock:t,showCorrect:o,session:s,tooltipContainerRef:n}=this.state,{config:r,correctness:i,disabled:a,extraCSSRules:l,view:c,teacherInstructions:p,rationale:u,feedback:h,animationsDisabled:d,printMode:g,alwaysShowCorrect:f,language:m}=e||{};if(!r)return null;const{showNote:y,note:b,prompt:v,responses:x,responseType:w,equationEditor:S,customKeys:k,id:_,env:{mode:C,role:A}={}}=r||{},L=(o||"view"===C&&"instructor"===A)&&y&&b,j=function(e){if(null==e)return!0;if(te(e)&&(O(e)||"string"==typeof e||"function"==typeof e.splice||he(e)||xe(e)||le(e)))return!e.length;var t=st(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(se(e))return!Oe(e).length;for(var o in e)if(kt.call(e,o))return!1;return!0}(x),E=!j&&i&&"correct"!==i.correctness,R=a&&i,$=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(k),P=i&&i.correct,N=function(e,t){const{config:o,disabled:s}=e||{},{expression:n,responses:r,printMode:i,alwaysShowCorrect:a}=o||{};if(o&&n){const e=n;if(t.showCorrect)return r&&r.length&&r[0].answer;let o=1;return(e||"").replace(Zo,function(){const e=t.session.answers[`r${o}`];if(i&&!a){const e="\\ \\ ".repeat(30)+"\\newline ";return`\\MathQuillMathField[r${o++}]{${e.repeat(3)}}`}return s?`\\embed{answerBlock}[r${o++}]`:`\\MathQuillMathField[r${o++}]{${e&&e.value||""}}`}).replace(Xo,"\\embed{newLine}[]")}}(e,this.state)||"",T=a&&!i,F=g&&!f,I=u&&(Fo(u)||Io(u)),D=p&&(Fo(p)||Io(p)),M=Eo.createElement(gs,null,Eo.createElement(Uo.Static,{className:"static-math",ref:e=>{e&&(this.mqStatic=e)},latex:N,onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur})),q=Eo.createElement(ls,null,"gather"===C&&Eo.createElement(fs,null,"Math Equation Response Question"),T&&D&&(d?Eo.createElement("div",{dangerouslySetInnerHTML:{__html:p}}):Eo.createElement(ps,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},Eo.createElement("div",{dangerouslySetInnerHTML:{__html:p}}))),v&&Eo.createElement(as,null,Eo.createElement(Do,{prompt:v})),F?M:Eo.createElement(To,{false:!0},Eo.createElement(ds,{tabIndex:0},w===Ot&&Eo.createElement(Tt,{onSimpleResponseChange:this.onSimpleResponseChange,showCorrect:o,emptyResponse:j,model:e,session:s,onSubFieldFocus:this.onSubFieldFocus,showKeypad:!!t}),w===Ct&&Eo.createElement(hs,{ref:n,isIncorrect:!j&&!P&&!o,isCorrect:!j&&(P||o),showCorrectness:!j&&a&&i&&!c,correctAnswerShown:o,printCorrect:g&&f},Eo.createElement(zo,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:!!t,slotProps:{popper:{container:Yo([n,"optionalAccess",e=>e.current])||void 0,placement:"bottom-start",sx:{backgroundColor:"transparent",width:"650px",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:[{name:"offset",options:{offset:[0,8]}},{name:"preventOverflow",enabled:!0,options:{boundary:"viewport",padding:8}},{name:"computeStyles",options:{adaptive:!0,gpuAcceleration:!0}},{name:"flip",enabled:!1}]},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"600px",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(s.answers).map(e=>e===t&&!(o||a)&&Eo.createElement(us,{"data-keypad":!0,key:e,style:{width:ts($,S)}},Eo.createElement(Ko,{additionalKeys:$,mode:S||6,onClick:this.onClick}))||null)},Eo.createElement("div",null,Eo.createElement(Uo.Static,{className:"static-math",ref:e=>{e&&(this.mqStatic=e)},latex:N,onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur})))))),T&&L&&Eo.createElement(cs,{dangerouslySetInnerHTML:{__html:`<strong>Note:</strong> ${b}`}}),T&&I&&(d?Eo.createElement("div",{dangerouslySetInnerHTML:{__html:u}}):Eo.createElement(No,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},Eo.createElement("div",{dangerouslySetInnerHTML:{__html:u}}))));return R&&(E||D||I||h)?Eo.createElement(rs,{extraCSSRules:l,ref:e=>{const t=Vo.findDOMNode(e);this.root=t||this.root}},Eo.createElement(is,{interactive:!0,enterTouchDelay:0,placement:"bottom-start",slotProps:{tooltip:{sx:e=>({background:`${qo.primaryLight()} !important`,color:qo.text(),padding:e.spacing(2),border:`1px solid ${qo.secondary()}`,fontSize:"16px","& :not(.MathJax) > table tr":{"&:nth-child(2n)":{backgroundColor:"unset !important"}}})},popper:{sx:{opacity:1},modifiers:[{name:"offset",options:{offset:[0,2]}}]}},title:Eo.createElement("div",null,Eo.createElement(ls,null,E&&Eo.createElement(ms,{language:m,show:!0,toggled:o,onToggle:this.toggleShowCorrect})),D&&Eo.createElement(ps,{key:"collapsible-teacher-instructions",labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},Eo.createElement(Do,{prompt:p})),L&&Fo(b)&&Eo.createElement(ps,{key:"collapsible-note",labels:{hidden:Qo.t("common:showNote",{lng:m}),visible:Qo.t("common:hideNote",{lng:m})}},Eo.createElement(Do,{prompt:b})),I&&Eo.createElement(ps,{key:"collapsible-rationale",labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},Eo.createElement(Do,{prompt:u})),h&&Eo.createElement(Po,{correctness:i.correctness,feedback:h}))},q)):Eo.createElement(rs,{id:_,extraCSSRules:l,ref:e=>{const t=Vo.findDOMNode(e);this.root=t||this.root}},q)}}ss.__initStatic();const ns=()=>({blockContainer:"block-container",blockResponse:"block-response",blockMath:"block-math"});if("undefined"!=typeof document){const e="math-inline-block-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`\n .block-container {\n margin: 8px !important;\n display: inline-flex;\n border: 2px solid grey !important;\n }\n .block-response {\n color: grey;\n background: #f5f5f5;\n font-size: 0.8rem !important;\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 2px solid #bdbdbd !important;\n flex-shrink: 0;\n flex-grow: 0;\n flex-basis: auto;\n }\n .block-math {\n color: ${qo.text()};\n background-color: ${qo.background()};\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n }\n .block-math > .mq-math-mode > .mq-hasCursor > .mq-cursor {\n display: none;\n }\n .sr-only {\n position: absolute;\n left: -10000px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n }\n .static-math > .mq-root-block > .mq-editable-field {\n border-color: ${qo.text()};\n }\n `,document.head.appendChild(t)}}const rs=Bo(Mo)(()=>({color:qo.text(),backgroundColor:qo.background(),display:"inline-block"})),is=Bo(zo)({}),as=Bo("div")(({theme:e})=>({marginBottom:e.spacing(2)})),ls=Bo("div")({width:"100%",position:"relative",backgroundColor:qo.background(),color:qo.text()}),cs=Bo("div")(({theme:e})=>({paddingBottom:e.spacing(2)})),ps=Bo(No)(({theme:e})=>({marginBottom:e.spacing(2)})),us=Bo("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),hs=Bo("div",{shouldForwardProp:e=>!["isIncorrect","isCorrect","showCorrectness","correctAnswerShown","printCorrect"].includes(e)})(({theme:e,isIncorrect:t,isCorrect:o,showCorrectness:s,correctAnswerShown:n,printCorrect:r})=>{const i=t?qo.incorrect():o?qo.correct():void 0;return{maxWidth:"fit-content",padding:e.spacing(.25),...s&&{border:i?`2px solid ${i} !important`:"2px solid"},...!s&&i&&{borderColor:`${i} !important`},...n&&{padding:e.spacing(1),letterSpacing:"0.5px"},...r&&{border:`2px solid ${qo.correct()} !important`},"& > .mq-math-mode":{"& > .mq-root-block":{paddingRight:"0 !important",paddingLeft:"0 !important","& > .mq-editable-field":{minWidth:"10px",padding:e.spacing(.25)}},"& sup":{top:0}}}}),ds=Bo("div")({position:"relative","& .mq-overarrow-inner":{border:"none !important",padding:"0 !important"},"& .mq-overarrow-inner-right":{display:"none !important"},"& .mq-overarrow-inner-left":{display:"none !important"},"& .mq-overarrow.mq-arrow-both":{minWidth:"1.23em","& *":{lineHeight:"1 !important"},"&:before":{top:"-0.4em",left:"-1px"},"&:after":{top:"-2.4em",right:"-1px"},"&.mq-empty:after":{top:"-0.45em"}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:"-0.4em",right:"-1px"}},"& .mq-longdiv-inner":{borderTop:"1px solid !important",paddingTop:"1.5px !important"},"& .mq-parallelogram":{lineHeight:.85}}),gs=Bo("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),fs=Bo("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),ms=Bo($o)(({theme:e})=>({color:qo.text(),marginBottom:e.spacing(2)})),ys=t,bs=a,{renderMath:vs}=l,xs=bs("pie-element:math-inline:print");class ws extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=St(()=>{if(this._model&&this._session){const e=((e,t)=>{const o="instructor"===t.role;return e.prompt=!1!==e.promptEnabled?e.prompt:void 0,e.teacherInstructions=o&&!1!==e.teacherInstructionsEnabled?e.teacherInstructions:void 0,e.rationale=o&&!1!==e.rationaleEnabled?e.rationale:void 0,e.showTeacherInstructions=o,e.alwaysShowCorrect=o,e.printMode=!0,e.feedback=void 0,e.expression=e.expression||"{{response}}",e.animationsDisabled=!0,{...e,disabled:!0,config:{...e,env:{mode:o?"evaluate":e.mode,role:t.role}}}})(this._model,this._options),t=this._options&&ys.createElement(ss,{model:e,session:{}});this._root||(this._root=h(this)),this._root.render(t),queueMicrotask(()=>{xs("render complete - render math"),vs(this)})}else xs("skip")},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{ws as default};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "11.0.0-
|
|
7
|
+
"version": "11.0.0-next.0+67da381",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"description": "",
|
|
10
10
|
"scripts": {
|
|
@@ -17,21 +17,25 @@
|
|
|
17
17
|
"@mui/material": "^7.3.4",
|
|
18
18
|
"@pie-framework/mathquill": "^1.1.3",
|
|
19
19
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
20
|
-
"@pie-lib/correct-answer-toggle": "
|
|
21
|
-
"@pie-lib/math-input": "
|
|
22
|
-
"@pie-lib/math-rendering": "
|
|
23
|
-
"@pie-lib/math-toolbar": "1.
|
|
24
|
-
"@pie-lib/render-ui": "
|
|
25
|
-
"@pie-lib/translator": "
|
|
20
|
+
"@pie-lib/correct-answer-toggle": "3.1.1-next.1",
|
|
21
|
+
"@pie-lib/math-input": "7.1.1-next.1",
|
|
22
|
+
"@pie-lib/math-rendering": "4.1.1-next.1",
|
|
23
|
+
"@pie-lib/math-toolbar": "2.1.1-next.1",
|
|
24
|
+
"@pie-lib/render-ui": "5.1.1-next.1",
|
|
25
|
+
"@pie-lib/translator": "3.1.1-next.1",
|
|
26
26
|
"classnames": "^2.2.5",
|
|
27
27
|
"debug": "^4.1.1",
|
|
28
|
-
"lodash": "^4.17.
|
|
28
|
+
"lodash-es": "^4.17.23",
|
|
29
29
|
"prop-types": "^15.6.1",
|
|
30
|
-
"react": "18.
|
|
31
|
-
"react-dom": "18.
|
|
30
|
+
"react": "18.3.1",
|
|
31
|
+
"react-dom": "18.3.1"
|
|
32
32
|
},
|
|
33
33
|
"author": "",
|
|
34
34
|
"license": "ISC",
|
|
35
|
-
"gitHead": "
|
|
36
|
-
"module": "src/index.js"
|
|
35
|
+
"gitHead": "67da3818d2af966110c6e85f6e8e238b79515eb2",
|
|
36
|
+
"module": "src/index.js",
|
|
37
|
+
"exports": {
|
|
38
|
+
".": "./src/index.js",
|
|
39
|
+
"./print": "./src/print.js"
|
|
40
|
+
}
|
|
37
41
|
}
|