@pie-element/explicit-constructed-response 10.2.0-next.7 → 10.2.0-next.8
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 +6 -0
- package/configure/CHANGELOG.md +6 -0
- package/configure/package.json +3 -3
- package/module/configure.js +1 -0
- package/module/controller.js +6534 -0
- package/module/demo.js +45 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +18 -0
- package/module/print-demo.js +83 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +3 -3
package/module/print.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_dll_react_dom as e,_dll_debug as t,_dll_react as n,_dll_prop_types as r,_dll_mui__material_styles as o,_dll_mui__material as i,_dll_pie_lib__render_ui as a,_dll_classnames as s,_dll_mui__icons_material as l,_dll_pie_lib__correct_answer_toggle as c}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{_dll_pie_lib__math_rendering as u}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";import{_dll_pie_lib__drag as d}from"../../../@pie-lib/drag-module@^3.2.0/module/index.js";import{grey as p}from"@mui/material/colors";var h,g=e;h=g.createRoot,g.hydrateRoot;var f="object"==typeof global&&global&&global.Object===Object&&global,m="object"==typeof self&&self&&self.Object===Object&&self,v=f||m||Function("return this")(),b=v.Symbol,y=Object.prototype,x=y.hasOwnProperty,w=y.toString,C=b?b.toStringTag:void 0;var S=Object.prototype.toString;var k=b?b.toStringTag:void 0;function A(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":k&&k in Object(e)?function(e){var t=x.call(e,C),n=e[C];try{e[C]=void 0;var r=!0}catch(e){}var o=w.call(e);return r&&(t?e[C]=n:delete e[C]),o}(e):function(e){return S.call(e)}(e)}function O(e){return null!=e&&"object"==typeof e}function R(e){return"symbol"==typeof e||O(e)&&"[object Symbol]"==A(e)}var _=Array.isArray,E=b?b.prototype:void 0,L=E?E.toString:void 0;function j(e){if("string"==typeof e)return e;if(_(e))return function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(e,j)+"";if(R(e))return L?L.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var D=/\s/;var N=/^\s+/;function P(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&D.test(e.charAt(t)););return t}(e)+1).replace(N,""):e}function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var $=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,M=/^0o[0-7]+$/i,z=parseInt;function F(e){if("number"==typeof e)return e;if(R(e))return NaN;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=P(e);var n=I.test(e);return n||M.test(e)?z(e.slice(2),n?2:8):$.test(e)?NaN:+e}function W(e){return e}function B(e){if(!T(e))return!1;var t=A(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var H,V=v["__core-js_shared__"],U=(H=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var K=Function.prototype.toString;function q(e){if(null!=e){try{return K.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Y=/^\[object .+?Constructor\]$/,J=Function.prototype,X=Object.prototype,Q=J.toString,G=X.hasOwnProperty,Z=RegExp("^"+Q.call(G).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ee(e){return!(!T(e)||(t=e,U&&U in t))&&(B(e)?Z:Y).test(q(e));var t}function te(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ee(n)?n:void 0}var ne=te(v,"WeakMap"),re=/^(?:0|[1-9]\d*)$/;function oe(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ie(e,t){return e===t||e!=e&&t!=t}function ae(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function se(e){return null!=e&&ae(e.length)&&!B(e)}var le=Object.prototype;function ce(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||le)}function ue(e){return O(e)&&"[object Arguments]"==A(e)}var de=Object.prototype,pe=de.hasOwnProperty,he=de.propertyIsEnumerable,ge=ue(function(){return arguments}())?ue:function(e){return O(e)&&pe.call(e,"callee")&&!he.call(e,"callee")};var fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=fe&&"object"==typeof module&&module&&!module.nodeType&&module,ve=me&&me.exports===fe?v.Buffer:void 0,be=(ve?ve.isBuffer:void 0)||function(){return!1},ye={};ye["[object Float32Array]"]=ye["[object Float64Array]"]=ye["[object Int8Array]"]=ye["[object Int16Array]"]=ye["[object Int32Array]"]=ye["[object Uint8Array]"]=ye["[object Uint8ClampedArray]"]=ye["[object Uint16Array]"]=ye["[object Uint32Array]"]=!0,ye["[object Arguments]"]=ye["[object Array]"]=ye["[object ArrayBuffer]"]=ye["[object Boolean]"]=ye["[object DataView]"]=ye["[object Date]"]=ye["[object Error]"]=ye["[object Function]"]=ye["[object Map]"]=ye["[object Number]"]=ye["[object Object]"]=ye["[object RegExp]"]=ye["[object Set]"]=ye["[object String]"]=ye["[object WeakMap]"]=!1;var xe,we="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ce=we&&"object"==typeof module&&module&&!module.nodeType&&module,Se=Ce&&Ce.exports===we&&f.process,ke=function(){try{var e=Ce&&Ce.require&&Ce.require("util").types;return e||Se&&Se.binding&&Se.binding("util")}catch(e){}}(),Ae=ke&&ke.isTypedArray,Oe=Ae?(xe=Ae,function(e){return xe(e)}):function(e){return O(e)&&ae(e.length)&&!!ye[A(e)]},Re=Object.prototype.hasOwnProperty;function _e(e,t){var n=_(e),r=!n&&ge(e),o=!n&&!r&&be(e),i=!n&&!r&&!o&&Oe(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!Re.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oe(c,l))||s.push(c);return s}var Ee=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Le=Ee,je=Object.prototype.hasOwnProperty;function De(e){if(!ce(e))return Le(e);var t=[];for(var n in Object(e))je.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ne(e){return se(e)?_e(e):De(e)}var Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Te=/^\w*$/;function $e(e,t){if(_(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!R(e))||(Te.test(e)||!Pe.test(e)||null!=t&&e in Object(t))}var Ie=te(Object,"create");var Me=Object.prototype.hasOwnProperty;var ze=Object.prototype.hasOwnProperty;function Fe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function We(e,t){for(var n=e.length;n--;)if(ie(e[n][0],t))return n;return-1}Fe.prototype.clear=function(){this.__data__=Ie?Ie(null):{},this.size=0},Fe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Fe.prototype.get=function(e){var t=this.__data__;if(Ie){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Me.call(t,e)?t[e]:void 0},Fe.prototype.has=function(e){var t=this.__data__;return Ie?void 0!==t[e]:ze.call(t,e)},Fe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ie&&void 0===t?"__lodash_hash_undefined__":t,this};var Be=Array.prototype.splice;function He(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}He.prototype.clear=function(){this.__data__=[],this.size=0},He.prototype.delete=function(e){var t=this.__data__,n=We(t,e);return!(n<0)&&(n==t.length-1?t.pop():Be.call(t,n,1),--this.size,!0)},He.prototype.get=function(e){var t=this.__data__,n=We(t,e);return n<0?void 0:t[n][1]},He.prototype.has=function(e){return We(this.__data__,e)>-1},He.prototype.set=function(e,t){var n=this.__data__,r=We(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ve=te(v,"Map");function Ue(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ke(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ke.prototype.clear=function(){this.size=0,this.__data__={hash:new Fe,map:new(Ve||He),string:new Fe}},Ke.prototype.delete=function(e){var t=Ue(this,e).delete(e);return this.size-=t?1:0,t},Ke.prototype.get=function(e){return Ue(this,e).get(e)},Ke.prototype.has=function(e){return Ue(this,e).has(e)},Ke.prototype.set=function(e,t){var n=Ue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(qe.Cache||Ke),n}qe.Cache=Ke;var Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Je=/\\(\\)?/g,Xe=function(e){var t=qe(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ye,function(e,n,r,o){t.push(r?o.replace(Je,"$1"):n||e)}),t}),Qe=Xe;function Ge(e,t){return _(e)?e:$e(e,t)?[e]:Qe(function(e){return null==e?"":j(e)}(e))}function Ze(e){if("string"==typeof e||R(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function et(e,t){for(var n=0,r=(t=Ge(t,e)).length;null!=e&&n<r;)e=e[Ze(t[n++])];return n&&n==r?e:void 0}function tt(e,t,n){var r=null==e?void 0:et(e,t);return void 0===r?n:r}function nt(e){var t=this.__data__=new He(e);this.size=t.size}nt.prototype.clear=function(){this.__data__=new He,this.size=0},nt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},nt.prototype.get=function(e){return this.__data__.get(e)},nt.prototype.has=function(e){return this.__data__.has(e)},nt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof He){var r=n.__data__;if(!Ve||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ke(r)}return n.set(e,t),this.size=n.size,this};var rt=Object.prototype.propertyIsEnumerable,ot=Object.getOwnPropertySymbols,it=ot?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(ot(e),function(t){return rt.call(e,t)}))}:function(){return[]};function at(e){return function(e,t,n){var r=t(e);return _(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ne,it)}var st=te(v,"DataView"),lt=te(v,"Promise"),ct=te(v,"Set"),ut="[object Map]",dt="[object Promise]",pt="[object Set]",ht="[object WeakMap]",gt="[object DataView]",ft=q(st),mt=q(Ve),vt=q(lt),bt=q(ct),yt=q(ne),xt=A;(st&&xt(new st(new ArrayBuffer(1)))!=gt||Ve&&xt(new Ve)!=ut||lt&&xt(lt.resolve())!=dt||ct&&xt(new ct)!=pt||ne&&xt(new ne)!=ht)&&(xt=function(e){var t=A(e),n="[object Object]"==t?e.constructor:void 0,r=n?q(n):"";if(r)switch(r){case ft:return gt;case mt:return ut;case vt:return dt;case bt:return pt;case yt:return ht}return t});var wt=xt,Ct=v.Uint8Array;function St(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ke;++t<n;)this.add(e[t])}function kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function At(e,t){return e.has(t)}St.prototype.add=St.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},St.prototype.has=function(e){return this.__data__.has(e)};function Ot(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,h=2&n?new St:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var g=e[d],f=t[d];if(r)var m=a?r(f,g,d,t,e,i):r(g,f,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!kt(t,function(e,t){if(!At(h,t)&&(g===e||o(g,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(g!==f&&!o(g,f,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Rt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function _t(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Et=b?b.prototype:void 0,Lt=Et?Et.valueOf:void 0;var jt=Object.prototype.hasOwnProperty;var Dt="[object Arguments]",Nt="[object Array]",Pt="[object Object]",Tt=Object.prototype.hasOwnProperty;function $t(e,t,n,r,o,i){var a=_(e),s=_(t),l=a?Nt:wt(e),c=s?Nt:wt(t),u=(l=l==Dt?Pt:l)==Pt,d=(c=c==Dt?Pt:c)==Pt,p=l==c;if(p&&be(e)){if(!be(t))return!1;a=!0,u=!1}if(p&&!u)return i||(i=new nt),a||Oe(e)?Ot(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){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||!i(new Ct(e),new Ct(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ie(+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 s=Rt;case"[object Set]":var l=1&r;if(s||(s=_t),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=Ot(s(e),s(t),r,o,i,a);return a.delete(e),u;case"[object Symbol]":if(Lt)return Lt.call(e)==Lt.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=u&&Tt.call(e,"__wrapped__"),g=d&&Tt.call(t,"__wrapped__");if(h||g){var f=h?e.value():e,m=g?t.value():t;return i||(i=new nt),o(f,m,n,r,i)}}return!!p&&(i||(i=new nt),function(e,t,n,r,o,i){var a=1&n,s=at(e),l=s.length;if(l!=at(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:jt.call(t,u)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var g=a;++c<l;){var f=e[u=s[c]],m=t[u];if(r)var v=a?r(m,f,u,t,e,i):r(f,m,u,e,t,i);if(!(void 0===v?f===m||o(f,m,n,r,i):v)){h=!1;break}g||(g="constructor"==u)}if(h&&!g){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}function It(e,t,n,r,o){return e===t||(null==e||null==t||!O(e)&&!O(t)?e!=e&&t!=t:$t(e,t,n,r,It,o))}function Mt(e){return e==e&&!T(e)}function zt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Ft(e){var t=function(e){for(var t=Ne(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Mt(o)]}return t}(e);return 1==t.length&&t[0][2]?zt(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var l=(s=n[o])[0],c=e[l],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var d=new nt;if(r)var p=r(c,u,l,e,t,d);if(!(void 0===p?It(u,c,3,r,d):p))return!1}}return!0}(n,e,t)}}function Wt(e,t){return null!=e&&t in Object(e)}function Bt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Ge(t,e)).length,i=!1;++r<o;){var a=Ze(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ae(o)&&oe(a,o)&&(_(e)||ge(e))}(e,t,Wt)}function Ht(e){return $e(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Ze(e)):function(e){return function(t){return et(t,e)}}(e)}function Vt(e){return"function"==typeof e?e:null==e?W:"object"==typeof e?_(e)?(t=e[0],n=e[1],$e(t)&&Mt(n)?zt(Ze(t),n):function(e){var r=tt(e,t);return void 0===r&&r===n?Bt(e,t):It(n,r,3)}):Ft(e):Ht(e);var t,n}var Ut,Kt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[Ut?a:++r];if(!1===t(o[s],s,o))break}return e},qt=Kt;function Yt(e,t){return e&&qt(e,t,Ne)}var Jt=function(){return v.Date.now()},Xt=Math.max,Qt=Math.min;function Gt(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function g(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function f(){var e=Jt();if(g(e))return m(e);s=setTimeout(f,function(e){var n=t-(e-l);return d?Qt(n,i-(e-c)):n}(e))}function m(e){return s=void 0,p&&r?h(e):(r=o=void 0,a)}function v(){var e=Jt(),n=g(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(f,t),u?h(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(f,t),h(l)}return void 0===s&&(s=setTimeout(f,t)),a}return t=F(t)||0,T(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Xt(F(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},v.flush=function(){return void 0===s?a:m(Jt())},v}var Zt=Object.prototype.hasOwnProperty;var en,tn,nn,rn={"border-radius":1,"border-top-left-radius":1,"border-top-right-radius":1,"border-bottom-left-radius":1,"border-bottom-right-radius":1,"box-shadow":1,order:1,flex:function(e,t){return[t+"box-flex"]},"box-flex":1,"box-align":1,animation:1,"animation-duration":1,"animation-name":1,transition:1,"transition-duration":1,transform:1,"transform-style":1,"transform-origin":1,"backface-visibility":1,perspective:1,"box-pack":1},on={animation:1,"column-count":1,columns:1,"font-weight":1,opacity:1,"order ":1,"z-index":1,zoom:1,flex:1,"box-flex":1,transform:1,perspective:1,"box-pack":1,"box-align":1,colspan:1,rowspan:1},an=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},sn=an,ln=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,cn="undefined"==typeof document?{}:document.documentElement.style,un=(en=function(){for(var e in cn)if(ln.test(e))return e.match(ln)[0];return"WebkitOpacity"in cn?"Webkit":"KhtmlOpacity"in cn?"Khtml":""}(),tn=en.toLowerCase(),{style:en,css:"-"+tn+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[en]||sn(en)}),dn=function(e,t){return t?t.toUpperCase():""},pn=/[-\s]+(.)?/g,hn=function(e){return e?e.replace(pn,dn):""},gn=/::/g,fn=/([A-Z]+)([A-Z][a-z])/g,mn=/([a-z\d])([A-Z])/g,vn=/_/g,bn=function(e,t){return e?e.replace(gn,"/").replace(fn,"$1_$2").replace(mn,"$1_$2").replace(vn,t||"-"):""},yn=function(e){return bn(e).toLowerCase()},xn=hn,wn=yn,Cn=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},Sn=an,kn=un,An=rn,On="undefined"==typeof document?{}:document.documentElement.style,Rn=function(e,t){t=t||{};var n=Cn(xn(e)),r=wn(e),o=nn?n:r,i=kn.style?nn?kn.style:kn.css:"";if(n in On)return t.asString?o:[o];var a=o,s=An[r],l=[];if(nn&&(a=Sn(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return nn?Cn(xn(e)):wn(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},_n=Object.prototype.hasOwnProperty,En=function(e,t){return _n.call(e,t)},Ln=Object.prototype.toString,jn=Object.prototype.toString,Dn=Rn,Nn=yn,Pn=hn,Tn=En,$n=function(e){return!!e&&"[object Object]"===Ln.call(e)},In=function(e){return"[object Function]"===jn.apply(e)},Mn=function(e,t,n,r){Dn(t).forEach(function(t){e[r?r(t):t]=n})},zn={cssUnitless:on},Fn=function(e,t,n,r){"string"==typeof e&&(e=function(e){e=(e||"").split(";");var t={};return e.forEach(function(e){var n=e.split(":");2==n.length&&(t[n[0].trim()]=n[1].trim())}),t}(e)),(t=t||zn).cssUnitless=t.cssUnitless||zn.cssUnitless,r=r||{};var o,i,a,s,l,c,u,d,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,g=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},f=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?Pn:Nn;for(a in e)if(Tn(e,a)){if(s=e[a],i=Nn(n?n+a:a),o=!1,d=!1,In(s)&&(u=s.call(p||e,s,a,i,e),$n(u)&&null!=u.value?(s=u.value,d=u.prefix,i=u.name?Nn(u.name):i):s=u),c="number"==(l=typeof s)||"string"==l&&""!=s&&1*s==s,null==s||null==i||""===i)continue;if((c||"string"==l)&&(o=!0),!o&&null!=s.value&&s.prefix&&(o=!0,d=s.prefix,s=s.value),o){if(d=d||!!m[i],c&&(s=h&&!(i in g)?s+f:s+""),"border"!=i&&(i.indexOf("border")||~i.indexOf("radius")||~i.indexOf("width"))||!c||(i+="-width"),!i.indexOf("border-radius-")&&(i.replace(/border(-radius)(-(.*))/,function(e,t,n){var r={"-top":["-top-left","-top-right"],"-left":["-top-left","-bottom-left"],"-right":["-top-right","-bottom-right"],"-bottom":["-bottom-left","-bottom-right"]};n in r?(i=[],r[n].forEach(function(e){i.push("border"+e+t)})):i="border"+n+t}),Array.isArray(i))){i.forEach(function(e){d?Mn(r,e,s,v):r[v(e)]=s});continue}d?Mn(r,i,s,v):r[v(i)]=s}else Fn(s,t,i+"-",r)}return r},Wn=Fn,Bn=En,Hn={prefixProperties:rn,cssUnitless:on,object:Fn,string:function(e,t){e=Wn(e,t);var n,r=[];for(n in e)Bn(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Vn=t("@pie-lib:mask-markup:serialization"),Un=["span"],Kn=["em","strong","u"],qn=(e,t)=>{const n=e.getAttribute(t);return r=(e=>{const t=/([\w-]*)\s*:\s*([^;]*)/g;let n;const r={};for(;n=t.exec(e);)r[n[1]]=n[2].trim();return r})(n),Hn.object(r,{camelize:!0,addUnits:!1});var r},Yn=["border","class","style"],Jn={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},Xn=(e,t=[])=>{if(8===e.nodeType)return null;if(3===e.nodeType){const n={text:e.textContent};return t.length>0&&(n.marks=t.map(e=>({type:e,data:void 0}))),{object:"text",leaves:[n]}}if(1===e.nodeType){const r=e.tagName.toLowerCase(),o=Jn[r];if(o){Vn("[deserialize] mark: ",o);return{_flatten:!0,nodes:Qn(e.childNodes,[...t,o])}}if("math"===r)return{isMath:!0,nodes:[e]};const i=(e=>{if(!e.attributes||e.attributes.length<=0)return;const t={};let n;for(n=0;n<e.attributes.length;n++){const r=e.attributes[n];t[r.name]=r.value}return t})(e)||{};"audio"===r&&""===i.controls&&(i.controls=!0);const a=Yn.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=qn(n,t);break;case"class":e.className=((e,t,n)=>{const r=e.getAttribute(n);return delete t.class,r})(n,e,t);break;default:e[t]=n.getAttribute(t)}return e}),{...i}),s=(e=>Un.includes(e)?"inline":Kn.includes(e)?"mark":"block")(r),l=Qn(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},Qn=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=Xn(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},Gn=n,Zn=r,{styled:er}=o,{renderMath:tr}=u;function nr(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const rr=er("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),or=er("span")(()=>({display:"inline-block",width:".75em"})),ir=["tbody","tr"],ar=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,s)=>{const l=e.type?`${e.type}-${s}`:`${s}`;if(e.isMath)return a.push(Gn.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const l=r(e,t,n);if(l)return a.push(l),void("td"!==nr([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(Gn.createElement(or,{key:`spacer-${s}`})))}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,r=((e,t)=>{const n=""===t.trim(),r=e&&e.type;return n&&ir.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>tt(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in Jn)if(Jn[e]===n.type){const n=e;a.push(Gn.createElement(n,{key:l},t));break}}else t.length>0&&(a.push(t),"td"!==nr([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(Gn.createElement(or,{key:`spacer-${s}`})))}else{const o=ar(e,t,n,r,e,i);if("p"===e.type||"paragraph"===e.type)a.push(Gn.createElement(rr,{key:l},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(Gn.createElement(t,{key:l,...e.data.attributes},o)):a.push(Gn.createElement(t,{key:l,...e.data.attributes}))}}}),a},sr=er("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class lr extends Gn.Component{constructor(e){super(e),lr.prototype.__init.call(this),this.internalContainerRef=Gn.createRef()}static __initStatic(){this.propTypes={renderChildren:Zn.func,layout:Zn.object,value:Zn.object,onChange:Zn.func,elementType:Zn.string,containerRef:Zn.oneOfType([Zn.func,Zn.shape({current:Zn.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof tr&&tr(e.current)}__init(){this.handleChange=(e,t)=>{const n={...this.props.value,[e]:t};this.props.onChange(n)}}render(){const{value:e,layout:t,elementType:n,containerRef:r}=this.props,o=ar(t,e,this.handleChange,this.props.renderChildren,null,n),i=r||this.internalContainerRef;return Gn.createElement(sr,{ref:i},o)}}lr.__initStatic();const cr=/\{\{(\d+)\}\}/g;const ur=n,dr=r;var pr;const hr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(cr,(e,t)=>`<span data-component="${o}" data-id="${t}"></span>`)}:{markup:""});var r,o;return(e=>{if(!e||!e.trim())return{object:"value",document:{object:"document",data:{},nodes:[{object:"block",type:"span",data:{},isVoid:!1,nodes:[]}]}};const t=(new DOMParser).parseFromString(e,"text/html");let n=Qn(t.body.childNodes);return!n.some(e=>"block"===e.object||"inline"===e.object)&&n.length>0&&(n=[{object:"block",type:"span",data:{},isVoid:!1,nodes:n}]),0===n.length&&(n=[{object:"block",type:"span",data:{},isVoid:!1,nodes:[]}]),{object:"value",document:{object:"document",data:{},nodes:n}}})(n).document},gr=(e,t)=>((pr=class extends ur.Component{static __initStatic(){this.propTypes={markup:dr.string,layout:dr.object,value:dr.object,onChange:dr.func,customMarkMarkupComponent:dr.func,elementType:dr.string}}constructor(e){super(e),this.containerRef=ur.createRef()}componentDidUpdate(e){if(this.props.markup!==e.markup){const e=this.containerRef.current;(e&&e.querySelectorAll('[data-latex][data-math-handled="true"]')||[]).forEach(e=>{const t=e.querySelector("mjx-container");t&&e.removeChild(t);const n=e.getAttribute("data-raw");e.innerHTML=n,e.removeAttribute("data-math-handled")})}}render(){const{markup:n,layout:r,value:o,onChange:i,elementType:a}=this.props,s=r||hr(n,e);return ur.createElement(lr,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),pr),{useMemo:fr}=n,{useLayoutEffect:mr}=n,{useEffect:vr}=n,{useRef:br}=n,{useCallback:yr}=n,xr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function wr(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Cr(e){return"nodeType"in e}function Sr(e){var t,n;return e?wr(e)?e:Cr(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function kr(e){const{Document:t}=Sr(e);return e instanceof t}function Ar(e){return!wr(e)&&e instanceof Sr(e).HTMLElement}function Or(e){return e instanceof Sr(e).SVGElement}function Rr(e){return e?wr(e)?e.document:Cr(e)?kr(e)?e:Ar(e)||Or(e)?e.ownerDocument:document:document:document}const _r=xr?mr:vr;function Er(e){const t=br(e);return _r(()=>{t.current=e}),yr(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function Lr(e,t){void 0===t&&(t=[e]);const n=br(e);return _r(()=>{n.current!==e&&(n.current=e)},t),n}function jr(e,t){const n=br();return fr(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Dr(e){const t=Er(e),n=br(null),r=yr(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Nr(e){const t=br();return vr(()=>{t.current=e},[e]),t.current}let Pr={};function Tr(e,t){return fr(()=>{if(t)return t;const n=null==Pr[e]?0:Pr[e]+1;return Pr[e]=n,e+"-"+n},[e,t])}function $r(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const Ir=$r(1),Mr=$r(-1);function zr(e){if(!e)return!1;const{KeyboardEvent:t}=Sr(e.target);return t&&e instanceof t}function Fr(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Sr(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Wr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Wr.Translate.toString(e),Wr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Br="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Hr(e){return e.matches(Br)?e:e.querySelector(Br)}const Vr=n,{useState:Ur}=n,{useCallback:Kr}=n,qr={display:"none"};function Yr(e){let{id:t,value:n}=e;return Vr.createElement("div",{id:t,style:qr},n)}function Jr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Vr.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const Xr=n,{createContext:Qr}=n,{useContext:Gr}=n,{useEffect:Zr}=n,{useState:eo}=n,{useCallback:to}=n,{useMemo:no}=n,{useRef:ro}=n,{memo:oo}=n,{useReducer:io}=n,{cloneElement:ao}=n,{forwardRef:so}=n,{createPortal:lo}=e,{unstable_batchedUpdates:co}=e,uo=Qr(null);const po={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},ho={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function go(e){let{announcements:t=ho,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=po}=e;const{announce:i,announcement:a}=function(){const[e,t]=Ur("");return{announce:Kr(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=Tr("DndLiveRegion"),[l,c]=eo(!1);if(Zr(()=>{c(!0)},[]),function(e){const t=Gr(uo);Zr(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(no(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!l)return null;const u=Xr.createElement(Xr.Fragment,null,Xr.createElement(Yr,{id:r,value:o.draggable}),Xr.createElement(Jr,{id:s,announcement:a}));return n?lo(u,n):u}var fo;function mo(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(fo||(fo={}));const vo=Object.freeze({x:0,y:0});function bo(e,t){const n=Fr(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function yo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function xo(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,s=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*s;return Number((o/(n+r-o)).toFixed(4))}return 0}const wo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=xo(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(yo)};function Co(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:vo}const So=(ko=1,function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>({...e,top:e.top+ko*t.y,bottom:e.bottom+ko*t.y,left:e.left+ko*t.x,right:e.right+ko*t.x}),{...e})});var ko;function Ao(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Oo={ignoreTransform:!1};function Ro(e,t){void 0===t&&(t=Oo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Sr(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Ao(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:s,right:l}=n;return{top:r,left:o,width:i,height:a,bottom:s,right:l}}function _o(e){return Ro(e,{ignoreTransform:!0})}function Eo(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(kr(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ar(o)||Or(o))return n;if(n.includes(o))return n;const i=Sr(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Sr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=Sr(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Lo(e){const[t]=Eo(e,1);return null!=t?t:null}function jo(e){return xr&&e?wr(e)?e:Cr(e)?kr(e)||e===Rr(e).scrollingElement?window:Ar(e)?e:null:null:null}function Do(e){return wr(e)?e.scrollX:e.scrollLeft}function No(e){return wr(e)?e.scrollY:e.scrollTop}function Po(e){return{x:Do(e),y:No(e)}}var To;function $o(e){return!(!xr||!e)&&e===document.scrollingElement}function Io(e){const t={x:0,y:0},n=$o(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(To||(To={}));const Mo={x:.2,y:.2};function zo(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=Mo);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=Io(e),h={x:0,y:0},g={x:0,y:0},f=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+f?(h.y=To.Backward,g.y=r*Math.abs((t.top+f-i)/f)):!u&&l>=t.bottom-f&&(h.y=To.Forward,g.y=r*Math.abs((t.bottom-f-l)/f)),!p&&s>=t.right-m?(h.x=To.Forward,g.x=r*Math.abs((t.right-m-s)/m)):!d&&a<=t.left+m&&(h.x=To.Backward,g.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:g}}function Fo(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Wo(e){return e.reduce((e,t)=>Ir(e,Po(t)),vo)}function Bo(e,t){if(void 0===t&&(t=Ro),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Lo(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ho=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Do(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+No(t),0)}]];class Vo{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Eo(t),r=Wo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Ho)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Uo{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ko(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var qo,Yo;function Jo(e){e.preventDefault()}function Xo(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(qo||(qo={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Yo||(Yo={}));const Qo={start:[Yo.Space,Yo.Enter],cancel:[Yo.Esc],end:[Yo.Space,Yo.Enter,Yo.Tab]},Go=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Yo.Right:return{...n,x:n.x+25};case Yo.Left:return{...n,x:n.x-25};case Yo.Down:return{...n,y:n.y+25};case Yo.Up:return{...n,y:n.y-25}}};class Zo{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Uo(Rr(t)),this.windowListeners=new Uo(Sr(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qo.Resize,this.handleCancel),this.windowListeners.add(qo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Bo(n),t(vo)}handleKeyDown(e){if(zr(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Qo,coordinateGetter:i=Go,scrollBehavior:a="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:vo;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=Mr(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:s,isLeft:l,isBottom:c,maxScroll:d,minScroll:p}=Io(n),h=Fo(n),g={x:Math.min(o===Yo.Right?h.right-h.width/2:h.right,Math.max(o===Yo.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(o===Yo.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Yo.Down?h.top:h.top+h.height/2,u.y))},f=o===Yo.Right&&!s||o===Yo.Left&&!l,m=o===Yo.Down&&!c||o===Yo.Up&&!i;if(f&&g.x!==u.x){const e=n.scrollLeft+t.x,i=o===Yo.Right&&e<=d.x||o===Yo.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Yo.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&g.y!==u.y){const e=n.scrollTop+t.y,i=o===Yo.Down&&e<=d.y||o===Yo.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Yo.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Ir(Mr(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ei(e){return Boolean(e&&"distance"in e)}function ti(e){return Boolean(e&&"delay"in e)}Zo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Qo,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ni{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Sr(e);return e instanceof t?e:Rr(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=Rr(i),this.documentListeners=new Uo(this.document),this.listeners=new Uo(n),this.windowListeners=new Uo(Sr(i)),this.initialCoordinates=null!=(r=Fr(o))?r:vo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(qo.Resize,this.handleCancel),this.windowListeners.add(qo.DragStart,Jo),this.windowListeners.add(qo.VisibilityChange,this.handleCancel),this.windowListeners.add(qo.ContextMenu,Jo),this.documentListeners.add(qo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ti(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ei(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(qo.Click,Xo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qo.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const s=null!=(t=Fr(e))?t:vo,l=Mr(r,s);if(!n&&a){if(ei(a)){if(null!=a.tolerance&&Ko(l,a.tolerance))return this.handleCancel();if(Ko(l,a.distance))return this.handleStart()}return ti(a)&&Ko(l,a.tolerance)?this.handleCancel():void this.handlePending(a,l)}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Yo.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ri={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class oi extends ni{constructor(e){const{event:t}=e,n=Rr(t.target);super(e,ri,n)}}oi.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const ii={move:{name:"mousemove"},end:{name:"mouseup"}};var ai;!function(e){e[e.RightClick=2]="RightClick"}(ai||(ai={}));(class extends ni{constructor(e){super(e,ii,Rr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ai.RightClick&&(null==r||r({event:n}),!0)}}];const si={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var li,ci;function ui(e){let{acceleration:t,activator:n=li.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=ci.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=Nr(t);return jr(e=>{if(n||!r||!e)return di;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[To.Backward]:e.x[To.Backward]||-1===o.x,[To.Forward]:e.x[To.Forward]||1===o.x},y:{[To.Backward]:e.y[To.Backward]||-1===o.y,[To.Forward]:e.y[To.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!i}),[g,f]=function(){const e=br(null);return[yr((t,n)=>{e.current=setInterval(t,n)},[]),yr(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=ro({x:0,y:0}),v=ro({x:0,y:0}),b=no(()=>{switch(n){case li.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case li.DraggableRect:return o}},[n,o,l]),y=ro(null),x=to(()=>{const e=y.current;if(!e)return;const t=m.current.x*v.current.x,n=m.current.y*v.current.y;e.scrollBy(t,n)},[]),w=no(()=>s===ci.TreeOrder?[...c].reverse():c,[s,c]);Zr(()=>{if(i&&c.length&&b){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:s}=zo(e,o,b,t,p);for(const e of["x","y"])h[e][i[e]]||(s[e]=0,i[e]=0);if(s.x>0||s.y>0)return f(),y.current=e,g(x,a),m.current=s,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},f()}else f()},[t,x,r,f,i,a,JSON.stringify(b),JSON.stringify(h),g,c,w,u,JSON.stringify(p)])}(class extends ni{constructor(e){super(e,si)}static setup(){return window.addEventListener(si.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(si.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(li||(li={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ci||(ci={}));const di={x:{[To.Backward]:!1,[To.Forward]:!1},y:{[To.Backward]:!1,[To.Forward]:!1}};var pi,hi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(pi||(pi={})),function(e){e.Optimized="optimized"}(hi||(hi={}));const gi=new Map;function fi(e,t){return jr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function mi(e){let{callback:t,disabled:n}=e;const r=Er(t),o=no(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return Zr(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function vi(e){return new Vo(Ro(e),e)}function bi(e,t,n){void 0===t&&(t=vi);const[r,o]=eo(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=Er(t),o=no(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return Zr(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),s=mi({callback:i});return _r(()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())},[e]),r}const yi=[];function xi(e,t){void 0===t&&(t=[]);const n=ro(null);return Zr(()=>{n.current=null},t),Zr(()=>{const t=e!==vo;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Mr(e,n.current):vo}function wi(e){return no(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const Ci=[];function Si(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ar(t)?t:e}const ki=[{sensor:oi,options:{}},{sensor:Zo,options:{}}],Ai={current:{}},Oi={draggable:{measure:_o},droppable:{measure:_o,strategy:pi.WhileDragging,frequency:hi.Optimized},dragOverlay:{measure:Ro}};class Ri extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const _i={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ri,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:mo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Oi,measureDroppableContainers:mo,windowRect:null,measuringScheduled:!1},Ei={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:mo,draggableNodes:new Map,over:null,measureDroppableContainers:mo},Li=Qr(Ei),ji=Qr(_i);function Di(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ri}}}function Ni(e,t){switch(t.type){case fo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case fo.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case fo.DragEnd:case fo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case fo.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ri(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case fo.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Ri(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case fo.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ri(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Pi(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=Gr(Li),i=Nr(r),a=Nr(null==n?void 0:n.id);return Zr(()=>{if(!t&&!r&&i&&null!=a){if(!zr(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Hr(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function Ti(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const $i=Qr({...vo,scaleX:1,scaleY:1});var Ii;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ii||(Ii={})),oo(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=ki,collisionDetection:u=wo,measuring:d,modifiers:p,...h}=e;const g=io(Ni,void 0,Di),[f,m]=g,[v,b]=function(){const[e]=eo(()=>new Set),t=to(t=>(e.add(t),()=>e.delete(t)),[e]);return[to(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[y,x]=eo(Ii.Uninitialized),w=y===Ii.Initialized,{draggable:{active:C,nodes:S,translate:k},droppable:{containers:A}}=f,O=null!=C?S.get(C):null,R=ro({initial:null,translated:null}),_=no(()=>{var e;return null!=C?{id:C,data:null!=(e=null==O?void 0:O.data)?e:Ai,rect:R}:null},[C,O]),E=ro(null),[L,j]=eo(null),[D,N]=eo(null),P=Lr(h,Object.values(h)),T=Tr("DndDescribedBy",i),$=no(()=>A.getEnabled(),[A]),I=no(()=>({draggable:{...Oi.draggable,...null==M?void 0:M.draggable},droppable:{...Oi.droppable,...null==M?void 0:M.droppable},dragOverlay:{...Oi.dragOverlay,...null==M?void 0:M.dragOverlay}}),[null==(M=d)?void 0:M.draggable,null==M?void 0:M.droppable,null==M?void 0:M.dragOverlay]);var M;const{droppableRects:z,measureDroppableContainers:F,measuringScheduled:W}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=eo(null),{frequency:s,measure:l,strategy:c}=o,u=ro(e),d=function(){switch(c){case pi.Always:return!1;case pi.BeforeDragging:return n;default:return!n}}(),p=Lr(d),h=to(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),g=ro(null),f=jr(t=>{if(d&&!n)return gi;if(!t||t===gi||u.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Vo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,l]);return Zr(()=>{u.current=e},[e]),Zr(()=>{d||h()},[n,d]),Zr(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),Zr(()=>{d||"number"!=typeof s||null!==g.current||(g.current=setTimeout(()=>{h(),g.current=null},s))},[s,d,h,...r]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=i}}($,{dragging:w,dependencies:[k.x,k.y],config:I.droppable}),B=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return jr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(S,C),H=no(()=>D?Fr(D):null,[D]),V=function(){const e=!1===(null==L?void 0:L.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=w&&!e&&!t;if("object"==typeof s)return{...s,enabled:n};return{enabled:n}}(),U=function(e,t){return fi(e,t)}(B,I.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=ro(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;_r(()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Co(n(e),r);if(a||(o.x=0),s||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Lo(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=C?S.get(C):null,config:V.layoutShiftCompensation,initialRect:U,measure:I.draggable.measure});const K=bi(B,I.draggable.measure,U),q=bi(B?B.parentElement:null),Y=ro({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=A.getNodeFor(null==(t=Y.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,r]=eo(null),o=mi({callback:to(e=>{for(const{target:n}of e)if(Ar(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=to(e=>{const n=Si(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Dr(i);return no(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:I.dragOverlay.measure}),Q=null!=(n=X.nodeRef.current)?n:B,G=w?null!=(r=X.rect)?r:K:null,Z=Boolean(X.nodeRef.current&&X.rect),ee=Co(te=Z?null:K,fi(te));var te;const ne=wi(Q?Sr(Q):null),re=function(e){const t=ro(e),n=jr(n=>e?n&&n!==yi&&e&&t.current&&e.parentNode===t.current.parentNode?n:Eo(e):yi,[e]);return Zr(()=>{t.current=e},[e]),n}(w?null!=J?J:B:null),oe=function(e,t){void 0===t&&(t=Ro);const[n]=e,r=wi(n?Sr(n):null),[o,i]=eo(Ci);function a(){i(()=>e.length?e.map(e=>$o(e)?r:new Vo(t(e),e)):Ci)}const s=mi({callback:a});return _r(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=Ti(p,{transform:{x:k.x-ee.x,y:k.y-ee.y,scaleX:1,scaleY:1},activatorEvent:D,active:_,activeNodeRect:K,containerNodeRect:q,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:X.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=H?Ir(H,k):null,se=function(e){const[t,n]=eo(null),r=ro(e),o=to(e=>{const t=jo(e.target);t&&n(e=>e?(e.set(t,Po(t)),new Map(e)):null)},[]);return Zr(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=jo(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Po(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=jo(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),no(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Ir(e,t),vo):Wo(e):vo,[e,t])}(re),le=xi(se),ce=xi(se,[K]),ue=Ir(ie,le),de=G?So(G,ie):null,pe=_&&de?u({active:_,collisionRect:de,droppableRects:z,droppableContainers:$,pointerCoordinates:ae}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[ge,fe]=eo(null),me=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Z?ie:Ir(ie,ce),null!=(o=null==ge?void 0:ge.rect)?o:null,K),ve=ro(null),be=to((e,t)=>{let{sensor:n,options:r}=t;if(null==E.current)return;const o=S.get(E.current);if(!o)return;const i=e.nativeEvent,a=new n({active:E.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!S.get(e))return;const{onDragAbort:t}=P.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!S.get(e))return;const{onDragPending:o}=P.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=E.current;if(null==t)return;const n=S.get(t);if(!n)return;const{onDragStart:r}=P.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:R}};co(()=>{null==r||r(o),x(Ii.Initializing),m({type:fo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),j(ve.current),N(i)})},onMove(e){m({type:fo.DragMove,coordinates:e})},onEnd:s(fo.DragEnd),onCancel:s(fo.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let a=null;if(t&&o){const{cancelDrop:s}=P.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===fo.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=fo.DragCancel)}}E.current=null,co(()=>{m({type:e}),x(Ii.Uninitialized),fe(null),j(null),N(null),ve.current=null;const t=e===fo.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=P.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[S]),ye=to((e,t)=>(n,r)=>{const o=n.nativeEvent,i=S.get(r);if(null!==E.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},E.current=r,be(n,t))},[S,be]),xe=function(e,t){return no(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,ye);!function(e){Zr(()=>{if(!xr)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),_r(()=>{K&&y===Ii.Initializing&&x(Ii.Initialized)},[K,y]),Zr(()=>{const{onDragMove:e}=P.current,{active:t,activatorEvent:n,collisions:r,over:o}=Y.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:ue.x,y:ue.y},over:o};co(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ue.x,ue.y]),Zr(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==E.current||!t||!o)return;const{onDragOver:i}=P.current,a=r.get(he),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:s};co(()=>{fe(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),_r(()=>{Y.current={activatorEvent:D,active:_,activeNode:B,collisionRect:de,collisions:pe,droppableRects:z,draggableNodes:S,draggingNode:Q,draggingNodeRect:G,droppableContainers:A,over:ge,scrollableAncestors:re,scrollAdjustedTranslate:ue},R.current={initial:G,translated:de}},[_,B,pe,de,S,Q,G,z,A,ge,re,ue]),ui({...V,delta:k,draggingRect:de,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const we=no(()=>({active:_,activeNode:B,activeNodeRect:K,activatorEvent:D,collisions:pe,containerNodeRect:q,dragOverlay:X,draggableNodes:S,droppableContainers:A,droppableRects:z,over:ge,measureDroppableContainers:F,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:I,measuringScheduled:W,windowRect:ne}),[_,B,K,D,pe,q,X,S,A,z,ge,F,re,oe,I,W,ne]),Ce=no(()=>({activatorEvent:D,activators:xe,active:_,activeNodeRect:K,ariaDescribedById:{draggable:T},dispatch:m,draggableNodes:S,over:ge,measureDroppableContainers:F}),[D,xe,_,K,m,T,S,ge,F]);return Xr.createElement(uo.Provider,{value:b},Xr.createElement(Li.Provider,{value:Ce},Xr.createElement(ji.Provider,{value:we},Xr.createElement($i.Provider,{value:me},l)),Xr.createElement(Pi,{disabled:!1===(null==a?void 0:a.restoreFocus)})),Xr.createElement(go,{...a,hiddenTextDescribedById:T}))});const Mi=Qr(null),zi="button";function Fi(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Tr("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=Gr(Li),{role:h=zi,roleDescription:g="draggable",tabIndex:f=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=Gr(m?$i:Mi),[b,y]=Dr(),[x,w]=Dr(),C=function(e,t){return no(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),S=Lr(n);_r(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:x,data:S}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:no(()=>({role:h,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!m||h!==zi)||void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,h,f,m,g,u.draggable]),isDragging:m,listeners:r?void 0:C,node:b,over:p,setNodeRef:y,setActivatorNodeRef:w,transform:v}}const Wi={timeout:25};function Bi(e){let{animation:t,children:n}=e;const[r,o]=eo(null),[i,a]=eo(null),s=Nr(n);return n||r||!s||o(s),_r(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),Xr.createElement(Xr.Fragment,null,n,r?ao(r,{ref:a}):null)}const Hi={x:0,y:0,scaleX:1,scaleY:1};function Vi(e){let{children:t}=e;return Xr.createElement(Li.Provider,{value:Ei},Xr.createElement($i.Provider,{value:Hi},t))}const Ui={position:"fixed",touchAction:"none"},Ki=e=>zr(e)?"transform 250ms ease":void 0,qi=so((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:u=Ki}=e;if(!s)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Ui,width:s.width,height:s.height,top:s.top,left:s.left,transform:Wr.Transform.toString(d),transformOrigin:o&&r?bo(r,s):void 0,transition:"function"==typeof u?u(r):u,...l};return Xr.createElement(n,{className:a,style:p,ref:t},i)}),Yi={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Wr.Transform.toString(t)},{transform:Wr.Transform.toString(n)}]},sideEffects:(Ji={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=Ji;if(null!=o&&o.active)for(const[e,n]of Object.entries(o.active))void 0!==n&&(r[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null!=o&&o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=i&&i.active&&t.node.classList.add(i.active),null!=i&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[e,n]of Object.entries(r))t.node.style.setProperty(e,n);null!=i&&i.active&&t.node.classList.remove(i.active)}})};var Ji;function Xi(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Er((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Si(i);if(!l)return;const{transform:c}=Sr(i).getComputedStyle(i),u=Ao(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Yi,...e};return e=>{let{active:i,dragOverlay:a,transform:s,...l}=e;if(!t)return;const c={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},u={scaleX:1!==s.scaleX?i.rect.width*s.scaleX/a.rect.width:1,scaleY:1!==s.scaleY?i.rect.height*s.scaleY/a.rect.height:1},d={x:s.x-c.x,y:s.y-c.y,...u},p=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:d}}),[h]=p,g=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(g))return;const f=null==r?void 0:r({active:i,dragOverlay:a,...l}),m=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==f||f(),e()}})}}(t);return Bo(s,o.draggable.measure),d({active:{id:e,data:a.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:u})})}let Qi=0;function Gi(e){return no(()=>{if(null!=e)return Qi++,Qi},[e])}const Zi=Xr.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:a,wrapperElement:s="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggableNodes:g,droppableContainers:f,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:x,windowRect:w}=Gr(ji),C=Gr($i),S=Gi(null==d?void 0:d.id),k=Ti(a,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:x,transform:C,windowRect:w}),A=fi(p),O=Xi({config:r,draggableNodes:g,droppableContainers:f,measuringConfiguration:b}),R=A?m.setRef:void 0;return Xr.createElement(Vi,null,Xr.createElement(Bi,{animation:O},d&&S?Xr.createElement(qi,{key:S,id:d.id,ref:R,as:s,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:A,style:{zIndex:c,...o},transform:k},n):null))}),ea=n,{useEffect:ta}=n,{useRef:na}=n,ra=r,{styled:oa}=o,{Chip:ia}=i,{color:aa}=a,{renderMath:sa}=u;function la(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const ca=oa("span")(({theme:e,disabled:t})=>({border:`solid 0px ${e.palette.primary.main}`,borderRadius:e.spacing(2),margin:e.spacing(.5),transform:"translate(0, 0)",display:"inline-flex",...t&&{}})),ua=oa(ia)(()=>({backgroundColor:aa.white(),border:`1px solid ${aa.text()}`,color:aa.text(),alignItems:"center",display:"inline-flex",height:"initial",minHeight:"32px",fontSize:"inherit",whiteSpace:"pre-wrap",maxWidth:"374px",pointerEvents:"none",borderRadius:"3px",paddingTop:"12px",paddingBottom:"12px","&.Mui-disabled":{opacity:1}})),da=oa("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function pa({choice:e,disabled:t,instanceId:n}){const r=na(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=Fi({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return ta(()=>{sa(r.current)},[e.value]),ea.createElement(ca,{ref:a,style:s?{width:la([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:la([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},ea.createElement(ua,{clickable:!1,disabled:t,ref:r,label:ea.createElement(da,{dangerouslySetInnerHTML:{__html:e.value}})}))}pa.propTypes={choice:ra.object.isRequired,disabled:ra.bool,instanceId:ra.oneOfType([ra.string,ra.number])};const ha=n,ga=r,{DragDroppablePlaceholder:fa}=d;class ma extends ha.Component{constructor(...e){super(...e),ma.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:ga.bool,duplicates:ga.bool,choices:ga.arrayOf(ga.shape({label:ga.string,value:ga.string})),value:ga.object,choicePosition:ga.string.isRequired,instanceId:ga.string}}__init(){this.getStyleForWrapper=()=>{const{choicePosition:e}=this.props;switch(e){case"above":return{margin:"0 0 40px 0"};case"below":return{margin:"40px 0 0 0"};case"right":return{margin:"0 0 0 40px"};default:return{margin:"0 40px 0 0"}}}}render(){const{disabled:e,duplicates:t,choices:n,value:r,instanceId:o}=this.props,i=n.filter(e=>{if(!0===t)return!0;const n=function(e,t){var n;return Yt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,Vt(t=>t===e.id));return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return ha.createElement("div",{style:a},ha.createElement(fa,{disabled:e,instanceId:o},i.map((t,n)=>ha.createElement(pa,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}ma.__initStatic();const va=n,{useEffect:ba}=n,{useRef:ya}=n,{useState:xa}=n,wa=r,Ca=t,{styled:Sa}=o,{Chip:ka}=i,Aa=s,{color:Oa}=a,{renderMath:Ra}=u;function _a(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}Ca("pie-lib:mask-markup:blank");const Ea=Sa("span")(({dragged:e,over:t})=>({border:`solid 0px ${Oa.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),La=Sa(ka)(()=>({backgroundColor:Oa.background(),border:`2px dashed ${Oa.text()}`,touchAction:"none",color:Oa.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${p[500]}`,backgroundColor:`${p[300]}`},"&.correct":{border:`solid 1px ${Oa.correct()}`},"&.incorrect":{border:`solid 1px ${Oa.incorrect()}`},"&.Mui-disabled":{opacity:1}})),ja=Sa("span")(()=>({whiteSpace:"normal",pointerEvents:"none","& img":{display:"block",padding:"2px 0"},"& p":{marginTop:"0",marginBottom:"0"},"& mjx-frac":{fontSize:"120% !important"},"&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.hidden":{color:"transparent",opacity:0},"&.dragged":{position:"absolute",left:16,maxWidth:"60px",top:"50%",transform:"translateY(-50%)"}}));function Da({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=ya(null),c=ya(null),u=ya(null),[d,p]=xa({height:0,width:0}),h=()=>{f()},g=()=>{const e=_a([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{f()},300)},f=()=>{if(c.current&&l.current){l.current.style.width="auto",l.current.style.height="auto",l.current.offsetHeight;const e=(()=>{if(!c.current)return null;if(c.current.querySelector("mjx-container")&&c.current.parentElement)return c.current.parentElement;return c.current.querySelector("img")||c.current})()||c.current,t=e.getBoundingClientRect(),n=(t.width||e.offsetWidth||0)+24,r=Math.max(t.height||0,e.offsetHeight||0,e.scrollHeight||0,c.current.scrollHeight||0)+24,o=parseFloat(a)||0,i=parseFloat(s)||0,u=n<=o?o:n,d=r<=i?i:r;p(e=>({width:u>o?u:e.width,height:d>i?d:e.height})),l.current.style.width=`${u}px`,l.current.style.height=`${d}px`}};ba(()=>{g()},[]),ba(()=>{l.current&&Ra(l.current)},[n,_a([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),ba(()=>{t?g():p({height:0,width:0})},[t]),ba(()=>{n||r||(u.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,r]);const m=o&&n&&o.choice&&o.choice.value,v=t&&t.value,b=n||r?{width:_a([u,"access",e=>e.current,"optionalAccess",e=>e.width]),height:_a([u,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(a))?0:parseFloat(a),t=isNaN(parseFloat(s))?0:parseFloat(s);return{...{height:d.height||t,width:d.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return va.createElement(La,{clickable:!1,disabled:e,ref:l,component:"span",label:va.createElement(va.Fragment,null,va.createElement(ja,{ref:c,draggable:!0,className:Aa({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&va.createElement(ja,{draggable:!0,className:Aa({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Aa({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function Na({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}){const{attributes:c,listeners:u,setNodeRef:d,transform:p,isDragging:h}=Fi({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:g,isOver:f,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Tr("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=Gr(Li),u=ro({disabled:n}),d=ro(!1),p=ro(null),h=ro(null),{disabled:g,updateMeasurementsFor:f,timeout:m}={...Wi,...o},v=Lr(null!=f?f:r),b=mi({callback:to(()=>{d.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},m)):d.current=!0},[m]),disabled:g||!a}),y=to((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))},[b]),[x,w]=Dr(y),C=Lr(t);return Zr(()=>{b&&x.current&&(b.disconnect(),d.current=!1,b.observe(x.current))},[x,b]),Zr(()=>(s({type:fo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:p,data:C}}),()=>s({type:fo.UnregisterDroppable,key:i,id:r})),[r]),Zr(()=>{n!==u.current.disabled&&(s({type:fo.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,s]),{active:a,rect:p,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:w}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Wr.Translate.toString(p)};return va.createElement(Ea,{ref:e=>{d(e),g(e)},style:v,dragged:h,over:f,...c,...u},va.createElement(Da,{id:e,disabled:t,duplicates:n,choice:r,isOver:f,dragItem:_a([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}Da.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Da.propTypes={id:wa.oneOfType([wa.string,wa.number]),disabled:wa.bool,duplicates:wa.bool,choice:wa.object,isOver:wa.bool,dragItem:wa.object,correct:wa.bool,onChange:wa.func,emptyResponseAreaWidth:wa.oneOfType([wa.string,wa.number]),emptyResponseAreaHeight:wa.oneOfType([wa.string,wa.number]),instanceId:wa.string},Na.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Na.propTypes={id:wa.oneOfType([wa.string,wa.number]),disabled:wa.bool,duplicates:wa.bool,choice:wa.object,correct:wa.bool,onChange:wa.func,emptyResponseAreaWidth:wa.oneOfType([wa.string,wa.number]),emptyResponseAreaHeight:wa.oneOfType([wa.string,wa.number]),instanceId:wa.string};const Pa=n,Ta=r,{DragProvider:$a}=d;function Ia(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Ma=gr("blank",e=>(t,n,r)=>{const o=Ia([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:i,duplicates:a,correctResponse:s,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,instanceId:p,isDragging:h}=e,g=c?s[o.id]:n[o.id],f=g&&e.choices.find(e=>e.id===g);return Pa.createElement(Na,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:f,id:o.id,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,onChange:(e,t)=>{const o={...n};void 0===t?delete o[e]:o[e]=t,r(o)},instanceId:p,isDragging:h})}});class za extends Pa.Component{constructor(e){super(e),za.prototype.__init.call(this),za.prototype.__init2.call(this),za.prototype.__init3.call(this),za.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:Ta.string,layout:Ta.object,choicesPosition:Ta.string,choices:Ta.array,value:Ta.object,onChange:Ta.func,duplicates:Ta.bool,disabled:Ta.bool,feedback:Ta.object,correctResponse:Ta.object,showCorrectAnswer:Ta.bool,emptyResponseAreaWidth:Ta.oneOfType([Ta.string,Ta.number]),emptyResponseAreaHeight:Ta.oneOfType([Ta.string,Ta.number]),instanceId:Ta.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;Ia([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current,dropAnimation:void 0})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?Pa.createElement(pa,{disabled:e.disabled,choice:e.choice,instanceId:e.instanceId}):null}}__init3(){this.handleDragEnd=e=>{const{active:t,over:n}=e,{onChange:r,value:o}=this.props,i=Ia([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=Ia([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===Ia([i,"optionalAccess",e=>e.type])&&Ia([a,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")]);if(this.setState({activeDragItem:null,dropAnimation:s?null:void 0}),!s||!r)return;const l=i,c=a.id;if(!0===a.toChoiceBoard){if(!l.fromChoice&&l.id){const e={...o};delete e[l.id],r(e)}}else if(!0===l.fromChoice){if(c&&"drag-in-the-blank-droppable"!==c){const e={...o};e[c]=l.choice.id,r(e)}}else if(l.id&&l.id!==c){const e={...o};e[c]=l.choice.id,delete e[l.id],r(e)}}}__init4(){this.getPositionDirection=e=>{let t,n,r;switch(e){case"left":t="row",r="center";break;case"right":t="row-reverse",n="flex-end",r="center";break;case"below":t="column-reverse";break;default:t="column"}return{flexDirection:t,justifyContent:n,alignItems:r}}}render(){const{markup:e,duplicates:t,value:n,onChange:r,choicesPosition:o,choices:i,correctResponse:a,disabled:s,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,layout:p,instanceId:h}=this.props,g=o||"below",f={display:"flex",minWidth:"100px",...this.getPositionDirection(g)};return Pa.createElement($a,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:wo},Pa.createElement("div",{ref:e=>this.rootRef=e,style:f},Pa.createElement(ma,{choicePosition:g,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),Pa.createElement(Ma,{elementType:"drag-in-the-blank",markup:e,layout:p,value:n,choices:i,onChange:r,disabled:s,duplicates:t,feedback:l,correctResponse:a,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,instanceId:h,isDragging:!!this.state.activeDragItem}),Pa.createElement(Zi,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}za.__initStatic(),za.__initStatic2();const Fa=n,{styled:Wa}=o,Ba=s,{color:Ha}=a;function Va(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}let Ua,Ka;"undefined"!=typeof window&&(Ua=require("@pie-lib/editable-html-tip-tap").default,Ka=Wa(Ua)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Ha.black()}`,"&.correct":{border:`1px solid ${Ha.correct()}`},"&.incorrect":{border:`1px solid ${Ha.incorrect()}`}})));var qa=gr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:u}=e,d=Va([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===d.component){const p=(e.choices&&d&&e.choices[d.id]||[])[0],h=a?p&&p.label:n[d.id]||"",g=s&&s[d.id],f=i&&i[d.id],m=a||"correct"===f,v=!a&&"incorrect"===f,b=e=>{const t={...n,[d.id]:e};u(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return Fa.createElement(Ka,{id:d.id,key:`${t.type}-input-${d.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?g:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Va([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:Ba({correct:m,incorrect:v})})}});gr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Ya=n,Ja=r,{Button:Xa}=i,{InputLabel:Qa}=i,{Menu:Ga}=i,{MenuItem:Za}=i,{ArrowDropDown:es}=l,{ArrowDropUp:ts}=l,{Close:ns}=l,{Check:rs}=l,{styled:os}=o,{color:is}=a,{renderMath:as}=u,ss=os(Xa)(()=>({color:is.text(),border:`1px solid ${is.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:is.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"5px"},"& svg":{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:is.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${is.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:is.correct(),color:`${is.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:is.incorrectWithIcon(),color:`${is.text()} !important`}})),ls=os(Ga)(()=>({backgroundColor:is.background(),border:`1px solid ${is.correct()} !important`,"&:hover":{border:`1px solid ${is.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${is.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),cs=os(Za)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:is.text(),backgroundColor:is.background(),"&.Mui-focusVisible":{outline:`3px solid ${is.tertiary()}`,outlineOffset:"-1px",color:is.text(),backgroundColor:is.background()},"&:hover":{color:is.text(),backgroundColor:is.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${is.text()} !important`,backgroundColor:`${is.background()} !important`,"&:hover":{color:is.text(),backgroundColor:`${is.dropdownBackground()} !important`}}})),us=os("span")(()=>({fontSize:"max(1rem, 14px)"})),ds=os("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),ps=os(Qa)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),hs=os(rs)(()=>({color:`${is.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:is.correct()},"&.incorrect":{backgroundColor:is.incorrectWithIcon()}})),gs=os(ns)(()=>({color:`${is.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:is.correct()},"&.incorrect":{backgroundColor:is.incorrectWithIcon()}}));class fs extends Ya.Component{static __initStatic(){this.propTypes={id:Ja.string,value:Ja.string,disabled:Ja.bool,onChange:Ja.func,correct:Ja.bool,choices:Ja.arrayOf(Ja.shape({value:Ja.string,label:Ja.string})),showCorrectAnswer:Ja.bool,singleQuery:Ja.bool,correctValue:Ja.string}}constructor(e){super(e),fs.prototype.__init.call(this),fs.prototype.__init2.call(this),fs.prototype.__init3.call(this),fs.prototype.__init4.call(this),fs.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Ya.createRef(),this.buttonRef=Ya.createRef(),this.previewRef=Ya.createRef(),this.elementRefs=[]}componentDidMount(){this.hiddenRef.current&&null===this.state.menuWidth&&this.setState({menuWidth:this.hiddenRef.current.clientWidth})}componentDidUpdate(e,t){const n=this.hiddenRef.current;if(!t.anchorEl&&this.state.anchorEl&&this.elementRefs.forEach(e=>{if(!e)return;const t=e.querySelector("[data-latex], [data-raw]"),n=e.querySelector("mjx-container"),r=e.querySelector('[data-math-handled="true"]');!t||r&&n||as(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&as(e)}),as(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>this.setState({anchorEl:e.currentTarget})}__init2(){this.handleClose=()=>{const{value:e}=this.props;this.setState({anchorEl:null,previewValue:null,highlightedOptionId:null}),!e&&this.previewRef.current&&(this.previewRef.current.innerHTML="")}}__init3(){this.handleHighlight=e=>{const t={highlightedOptionId:`dropdown-option-${this.props.id}-${e}`};this.props.value||(t.previewValue=this.props.choices[e].value),this.setState(t)}}__init4(){this.handleSelect=(e,t)=>{this.props.onChange(this.props.id,e),this.handleHighlight(t),this.handleClose()}}__init5(){this.handleHover=e=>{if(this.props.value)return;const t=`dropdown-option-${this.props.id}-${e}`,n=this.state.previewValue;this.setState({highlightedOptionId:t,previewValue:n},()=>{const t=this.elementRefs[e],n=this.previewRef.current;t&&n&&(n.innerHTML=t.innerHTML)})}}getLabel(e,t){const n=(e||[]).find(e=>e.value===t);return n?n.label.trim():void 0}render(){const{id:e,correct:t,disabled:n,value:r,choices:o,showCorrectAnswer:i,singleQuery:a,correctValue:s}=this.props,{anchorEl:l}=this.state,c=Boolean(l),u=`dropdown-button-${e}`,d=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const g=parseInt(e,10)+1,f=a?"Query-label":`Query-label-${g}`,m=a?"Query":`Query ${g}`;let v=null;return n&&void 0!==t&&(v=t||i?Ya.createElement(hs,{className:"correct"}):Ya.createElement(gs,{className:"incorrect"})),Ya.createElement(Ya.Fragment,null,Ya.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Ya.createElement(cs,{key:t,tabIndex:-1,"aria-hidden":"true"},Ya.createElement(us,{dangerouslySetInnerHTML:{__html:e.label}})))),Ya.createElement(ps,{id:f,tabIndex:-1,"aria-hidden":"true"},m),Ya.createElement(ss,{ref:this.buttonRef,style:{...this.state.menuWidth&&{minWidth:`calc(${this.state.menuWidth}px + 8px)`},borderWidth:c?"2px":"1px",transition:"border-width 0.2s ease-in-out"},"aria-controls":c?d:void 0,"aria-haspopup":"listbox","aria-expanded":c?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:h,disabled:n,id:u,role:"combobox","aria-label":`Select an option for ${m}`,"aria-labelledby":p},v,Ya.createElement(us,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Ya.createElement(ts,null):Ya.createElement(es,null)),Ya.createElement(ls,{id:d,anchorEl:l,keepMounted:!0,open:c,onClose:this.handleClose,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},transitionDuration:{enter:225,exit:195},slotProps:{paper:this.state.menuWidth?{style:{minWidth:this.state.menuWidth,padding:"4px"}}:void 0,list:{"aria-labelledby":u,role:"listbox",disablePadding:!0}}},(o||[]).map((t,n)=>{const o=`dropdown-option-${e}-${n}`;return Ya.createElement(cs,{id:o,className:t.value===r?"selected":"",key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===o?"true":void 0,onMouseOver:()=>this.handleHover(n)},Ya.createElement(us,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Ya.createElement(ds,{dangerouslySetInnerHTML:{__html:t.value===r?" ✓":""}}))})))}}fs.__initStatic();const ms=n;function vs(e,t){return null!=e?e:t()}function bs(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}gr("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:i,disabled:a,feedback:s,showCorrectAnswer:l}=e,c=i&&i[o.id]&&i[o.id].find(e=>e.correct),u=l?c&&c.value:n[o.id];return ms.createElement(fs,{key:`${t.type}-dropdown-${o.id}`,correct:s&&s[o.id]&&"correct"===s[o.id],disabled:a||l,value:u,correctValue:l?c&&c.label:void 0,id:o.id,onChange:r,choices:i[o.id],showCorrectAnswer:l,singleQuery:1==Object.keys(i).length})}});const ys=e=>"string"==typeof e,xs=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ws=e=>null==e?"":""+e,Cs=/###/g,Ss=e=>e&&e.indexOf("###")>-1?e.replace(Cs,"."):e,ks=e=>!e||ys(e),As=(e,t,n)=>{const r=ys(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(ks(e))return{};const t=Ss(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return ks(e)?{}:{obj:e,k:Ss(r[o])}},Os=(e,t,n)=>{const{obj:r,k:o}=As(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],a=t.slice(0,t.length-1),s=As(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=As(e,a,Object),bs([s,"optionalAccess",e=>e.obj])&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},Rs=(e,t)=>{const{obj:n,k:r}=As(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},_s=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?ys(e[r])||e[r]instanceof String||ys(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):_s(e[r],t[r],n):e[r]=t[r]);return e},Es=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ls={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const js=e=>ys(e)?e.replace(/[&<>"'\/]/g,e=>Ls[e]):e;const Ds=[" ",",","?","!",";"],Ns=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 n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Ps=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let a=e;a<r.length;++a)if(a!==e&&(i+=n),i+=r[a],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}o=t}return o},Ts=e=>bs([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),$s={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){bs([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class Is{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||$s,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,n,r){return r&&!this.debug?null:(ys(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Is(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Is(this.logger,e)}}var Ms=new Is;class zs{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+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,n])=>{for(let r=0;r<n;r++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}}class Fs extends zs{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,n,r={}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):ys(n)&&o?a.push(...n.split(o)):a.push(n)));const s=Rs(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&ys(n)?Ps(bs([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,o):s}addResource(e,t,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),Os(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const r in n)(ys(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=Rs(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?_s(s,n,o):s={...s,...n},Os(this.data,a,s),i.silent||this.emit("added",e,t,n)}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 Ws={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=vs(bs([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,r,o)]),()=>t)}),t}};const Bs=Symbol("i18next/PATH_KEY");function Hs(e,t){const{[Bs]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(bs([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),o===Bs?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(vs(bs([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const Vs={},Us=e=>!ys(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Ks extends zs{constructor(e,t={}){var n,r;super(),n=e,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(r[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Ms.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);if(void 0===bs([r,"optionalAccess",e=>e.res]))return!1;const o=Us(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=Ds.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=Ns.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:ys(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:ys(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=Hs(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===bs([u,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return d?o?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;const p=this.resolve(e,r);let h=bs([p,"optionalAccess",e=>e.res]);const g=bs([p,"optionalAccess",e=>e.usedKey])||a,f=bs([p,"optionalAccess",e=>e.exactUsedKey])||a,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!ys(r.count),y=Ks.hasDefaultValue(r),x=b?this.pluralResolver.getSuffix(u,r.count,r):"",w=r.ordinal&&b?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",C=b&&!r.ordinal&&0===r.count,S=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${x}`]||r[`defaultValue${w}`]||r.defaultValue;let k=h;v&&!h&&y&&(k=S);const A=Us(k),O=Object.prototype.toString.apply(k);if(!(v&&k&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(O)<0)||ys(m)&&Array.isArray(k))if(v&&ys(m)&&Array.isArray(h))h=h.join(m),h&&(h=this.extendTranslation(h,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(h)&&y&&(t=!0,h=S),this.isValidLookup(h)||(o=!0,h=a);const s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,d=y&&S!==h&&this.options.updateMissing;if(o||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,a,d?S:h),i){const e=this.resolve(a,{...r,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,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const o=y&&n!==h?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,d,r):bs([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,o,d,r),this.emit("missingKey",e,l,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||S)})}):n(e,a,S))}h=this.extendTranslation(h,e,r,p,n),o&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}${c}${a}`),(o||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?h:void 0,r))}else{if(!r.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,k,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(p.res=e,p.usedParams=this.getUsedParamsDetails(r),p):e}if(i){const e=Array.isArray(k),t=e?[]:{},n=e?f:g;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const o=`${n}${i}${e}`;t[e]=y&&!h?this.translate(o,{...r,defaultValue:Us(S)?S[e]:void 0,joinArrays:!1,ns:s}):this.translate(o,{...r,joinArrays:!1,ns:s}),t[e]===o&&(t[e]=k[e])}h=t}}return o?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(e,t,n,r,o){if(bs([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=ys(e)&&(void 0!==bs([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(i){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!ys(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>bs([o,"optionalAccess",e=>e[0]])!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,a=ys(i)?[i]:i;return null!=e&&bs([a,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=Ws.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,a;return ys(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;r=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!ys(t.count),d=u&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(ys(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(a=e,Vs[`${h[0]}-${e}`]||!bs([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||bs([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(a)])||(Vs[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${h.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),h.forEach(r=>{if(this.isValidLookup(n))return;i=r;const a=[l];if(bs([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(a,l,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(o)&&a.push(l+e.replace(o,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+n)),p){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(r),u&&(t.ordinal&&0===e.indexOf(o)&&a.push(r+e.replace(o,this.options.pluralSeparator)),a.push(r+e),d&&a.push(r+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(o=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return bs([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!ys(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class qs{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ms.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Ts(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=Ts(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(ys(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 n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.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)),ys(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return ys(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):ys(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}const Ys={zero:0,one:1,two:2,few:3,many:4,other:5},Js={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Xs{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Ms.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ts("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Js;if(!e.match(/-|_/))return Js;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),bs([n,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Ys[e]-Ys[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Qs=(e,t,n,r=".",o=!0)=>{let i=((e,t,n)=>{const r=Rs(e,n);return void 0!==r?r:Rs(t,n)})(e,t,n);return!i&&o&&ys(n)&&(i=Ps(e,n,r),void 0===i&&(i=Ps(t,n,r))),i},Gs=e=>e.replace(/\$/g,"$$$$");class Zs{constructor(e={}){this.logger=Ms.create("interpolator"),this.options=e,this.format=bs([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:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:js,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Es(o):i||"{{",this.suffix=a?Es(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Es(d):p||Es("$t("),this.nestingSuffix=h?Es(h):g||Es(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>bs([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,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Qs(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Qs(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const c=bs([r,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,u=void 0!==bs([r,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Gs(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Gs(this.escape(e)):Gs(e)}].forEach(t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof c){const t=c(e,o,r);i=ys(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(u){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else ys(i)||this.useRawValueToEscape||(i=ws(i));const s=t.safeValue(i);if(e=e.replace(o[0],s),u?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;e=r[0],o=this.interpolate(o,i);const a=o.match(/'/g),s=o.match(/"/g);(vs(bs([a,"optionalAccess",e=>e.length]),()=>0)%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];i={...n},i=i.replace&&!ys(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=t(a.call(this,r[1].trim(),i),i),o&&r[0]===e&&!ys(o))return o;ys(o)||(o=ws(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}const el=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(Ts(r),o),t[a]=s),s(n)}},tl=e=>(t,n,r)=>e(Ts(n),r)(t);class nl{constructor(e={}){this.logger=Ms.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?el:tl;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=el(t)}format(e,t,n,r={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const a=bs([r,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[r.interpolationkey]])||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class rl extends zs{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Ms.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],bs([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,r.backend,r)])}queueLoad(e,t,n,r){const o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=As(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{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)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();ys(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ys(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},a=()=>{}){if(!bs([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||bs([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(bs([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const s={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,n,r,s):l(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" 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 ol=()=>({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]),ys(e[1])&&(t.defaultValue=e[1]),ys(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),il=e=>(ys(e.ns)&&(e.ns=[e.ns]),ys(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ys(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),bs([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),al=()=>{};class sl extends zs{constructor(e={},t){var n;if(super(),this.options=il(e),this.services={},this.logger=Ms,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),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&&(ys(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ol();var r;this.options={...n,...this.options,...il(e)},this.options.interpolation={...n.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=n.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(bs([r=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||bs([r,"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||bs([r,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&r.options.backend.backends.some(e=>bs([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||bs([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 o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Ms.init(o(this.modules.logger),this.options):Ms.init(null,this.options),e=this.modules.formatter?this.modules.formatter:nl;const t=new qs(this.options);this.store=new Fs(this.options.resources,this.options);const r=this.services;r.logger=Ms,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new Xs(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.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!==n.interpolation.format||(r.formatter=o(e),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new Zs(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new rl(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new Ks(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=al),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=xs(),a=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};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?a():setTimeout(a,0),i}loadResources(e,t=al){let n=t;const r=ys(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===bs([r,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return n();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(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}bs([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),n(e)})}else n(null)}reloadResources(e,t,n){const r=xs();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=al),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}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&&Ws.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 n=xs();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=ys(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(ys(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),bs([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...o)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);const a=this.options.keySeparator||".";let s;return i.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=Hs(e,{...this.options,...t})),`${i.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=Hs(e,{...this.options,...t})),s=i.keyPrefix?`${i.keyPrefix}${a}${e}`:e),this.t(s,i)};return ys(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return bs([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return bs([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 n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=xs();return this.options.ns?(ys(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=xs();ys(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(bs([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=bs([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new qs(ol());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 n=new sl(e,t);return n.createInstance=sl.createInstance,n}cloneInstance(e={},t=al){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new sl(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});o.store=new Fs(e,r),o.services.resourceStore=o.store}if(e.interpolation){const t={...ol().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};o.services.interpolator=new Zs(n)}return o.translator=new Ks(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ll=sl.createInstance();ll.createInstance,ll.dir,ll.init,ll.loadResources,ll.reloadResources,ll.use,ll.changeLanguage,ll.getFixedT,ll.t,ll.exists,ll.setDefaultNamespace,ll.hasLoadedNamespace,ll.loadNamespaces,ll.loadLanguages;ll.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 cl={translator:{...ll,t:(e,t)=>{const{lng:n}=t;switch(n){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 ll.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const ul=n,dl=r,pl=c,{color:hl}=a,{Collapsible:gl}=a,{hasText:fl}=a,{hasMedia:ml}=a,{PreviewPrompt:vl}=a,{UiLayout:bl}=a,{styled:yl}=o,{translator:xl}=cl,wl=yl(bl)(({alwaysShowCorrect:e})=>({color:hl.text(),backgroundColor:hl.background(),...e&&{"& *":{borderColor:`${hl.text()} !important`}}})),Cl=yl("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Sl=yl("div")(({theme:e})=>({marginBottom:e.spacing(2)})),kl=yl("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"});class Al extends ul.Component{constructor(...e){super(...e),Al.prototype.__init.call(this),Al.prototype.__init2.call(this),Al.prototype.__init3.call(this),Al.prototype.__init4.call(this),Al.prototype.__init5.call(this)}static __initStatic(){this.propTypes={alwaysShowCorrect:dl.bool,animationsDisabled:dl.bool,disabled:dl.bool,displayType:dl.string,feedback:dl.object,language:dl.string,markup:dl.string,maxLengthPerChoice:dl.array,maxLengthPerChoiceEnabled:dl.bool,mode:dl.string,note:dl.string,onChange:dl.func,playerSpellCheckEnabled:dl.bool,prompt:dl.string,rationale:dl.string,role:dl.string,showNote:dl.bool,teacherInstructions:dl.string,value:dl.object,responseAreaInputConfiguration:dl.object,model:dl.object.isRequired}}static __initStatic2(){this.defaultProps={value:{}}}__init(){this.state={showCorrectAnswer:this.props.alwaysShowCorrect||!1}}__init2(){this.getChangeSession=e=>e&&e.every((e,t,n)=>e===n[0]&&1===e)?this.props.onChange:Gt(this.props.onChange,200,{maxWait:200})}UNSAFE_componentWillReceiveProps(e){const{maxLengthPerChoice:t,language:n}=this.props;let{note:r}=this.props;var o,i;(function(e){if(null==e)return!0;if(se(e)&&(_(e)||"string"==typeof e||"function"==typeof e.splice||be(e)||Oe(e)||ge(e)))return!e.length;var t=wt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ce(e))return!De(e).length;for(var n in e)if(Zt.call(e,n))return!1;return!0})(e.feedback)&&this.setState({showCorrectAnswer:!1}),e.alwaysShowCorrect&&this.setState({showCorrectAnswer:!0}),t&&(o=t,i=e.maxLengthPerChoice,!It(o,i))&&(this.changeSession=this.getChangeSession(e.maxLengthPerChoice)),r&&n&&n!==e.language&&r===xl.t("common:commonCorrectAnswerWithAlternates",{lng:n})&&(r=xl.t("common:commonCorrectAnswerWithAlternates",{lng:e.language}))}__init3(){this.toggleShowCorrect=()=>{this.setState({showCorrectAnswer:!this.state.showCorrectAnswer})}}__init4(){this.changeSession=this.getChangeSession(this.props.maxLengthPerChoice)}__init5(){this.onChange=e=>{this.changeSession(e)}}render(){const{showCorrectAnswer:e}=this.state,{alwaysShowCorrect:t,animationsDisabled:n,mode:r,displayType:o,role:i,language:a,maxLengthPerChoice:s,maxLengthPerChoiceEnabled:l,note:c,playerSpellCheckEnabled:u,prompt:d,rationale:p,showNote:h,teacherInstructions:g,responseAreaInputConfiguration:f,model:m,value:v}=this.props,{extraCSSRules:b}=m||{},y=(e||"view"===r&&"instructor"===i)&&h&&c,x=ul.createElement(vl,{defaultClassName:"teacher-instructions",prompt:g}),w=ul.createElement(vl,{prompt:p}),C=p&&(fl(p)||ml(p)),S=g&&(fl(g)||ml(g));return ul.createElement(wl,{extraCSSRules:b,alwaysShowCorrect:t,style:{display:`${o}`}},"gather"===r&&ul.createElement(kl,null,"Fill in the Blank Question"),S&&ul.createElement(Sl,null,n?x:ul.createElement(gl,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},x)),d&&ul.createElement(vl,{prompt:d}),!t&&"evaluate"===r&&ul.createElement(pl,{show:!0,toggled:e,onToggle:this.toggleShowCorrect,language:a}),ul.createElement(qa,{...this.props,onChange:this.onChange,showCorrectAnswer:e,value:v,maxLength:s,adjustedLimit:l,spellCheck:u,pluginProps:f}),y&&ul.createElement(Cl,{dangerouslySetInnerHTML:{__html:c}}),C&&ul.createElement(Sl,null,n?w:ul.createElement(gl,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},w)))}}Al.__initStatic(),Al.__initStatic2();const Ol=n,Rl=t,{renderMath:_l}=u,El=Rl("pie-element:explicit-constructed-response:print");class Ll extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Gt(()=>{if(this._model&&this._session){const e=((e,t)=>{const n="instructor"===t.role;return e.prompt=!1!==e.promptEnabled?e.prompt:void 0,e.teacherInstructions=n&&!1!==e.teacherInstructionsEnabled?e.teacherInstructions:void 0,e.rationale=n&&!1!==e.rationaleEnabled?e.rationale:void 0,e.alwaysShowCorrect=n,e.mode=n?"evaluate":e.mode,e.disabled=!0,e.animationsDisabled=!0,e})(this._model,this._options),t=this._options&&Ol.createElement(Al,{...e,onChange:()=>{}});this._root||(this._root=h(this)),this._root.render(t),queueMicrotask(()=>{El("render complete - render math"),_l(this)})}else El("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{Ll as default};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "10.2.0-next.
|
|
7
|
+
"version": "10.2.0-next.8",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postpublish": "../../scripts/postpublish"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@mui/material": "^7.3.4",
|
|
17
17
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
18
18
|
"@pie-lib/correct-answer-toggle": "3.2.0-next.7",
|
|
19
|
-
"@pie-lib/mask-markup": "2.2.0-next.
|
|
19
|
+
"@pie-lib/mask-markup": "2.2.0-next.29",
|
|
20
20
|
"@pie-lib/math-rendering": "4.2.0-next.3",
|
|
21
21
|
"@pie-lib/render-ui": "5.2.0-next.7",
|
|
22
22
|
"@pie-lib/translator": "3.2.0-next.3",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"author": "",
|
|
31
31
|
"license": "ISC",
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "e9c9eb021e31f961170c60e147b17fc6a9f56957",
|
|
33
33
|
"main": "lib/index.js",
|
|
34
34
|
"module": "src/index.js",
|
|
35
35
|
"exports": {
|