@pie-element/math-templated 7.2.1 → 7.2.2-beta.3

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/module/print.js CHANGED
@@ -1 +1 @@
1
- import{_dll_prop_types as e,_dll_react as t,_dll_mui__material_styles as n,_dll_react_dom as r,_dll_mui__material_colors as o,_dll_mui__material as i,_dll_debug as s,_dll_mui__material_collapse as a,_dll_classnames as l,_dll_mui__icons_material as c,_dll_react_dom_client as d}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__math_rendering as u}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";import{_dll_pie_lib__math_input as p}from"../../../@pie-lib/math-edit-module@5.0.0/module/index.js";import{_dll_pie_lib__drag as h}from"../../../@pie-lib/drag-module@5.0.0/module/index.js";var f="object"==typeof global&&global&&global.Object===Object&&global,g="object"==typeof self&&self&&self.Object===Object&&self,m=f||g||Function("return this")(),v=m.Symbol,b=Object.prototype,y=b.hasOwnProperty,x=b.toString,E=v?v.toStringTag:void 0;var w=Object.prototype.toString;var C=v?v.toStringTag:void 0;function S(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":C&&C in Object(e)?function(e){var t=y.call(e,E),n=e[E];try{e[E]=void 0;var r=!0}catch(e){}var o=x.call(e);return r&&(t?e[E]=n:delete e[E]),o}(e):function(e){return w.call(e)}(e)}function k(e){return null!=e&&"object"==typeof e}function _(e){return"symbol"==typeof e||k(e)&&"[object Symbol]"==S(e)}var A=Array.isArray,R=v?v.prototype:void 0,O=R?R.toString:void 0;function T(e){if("string"==typeof e)return e;if(A(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,T)+"";if(_(e))return O?O.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var D=/\s/;var N=/^\s+/;function L(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 j(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var I=/^[-+]0x[0-9a-f]+$/i,M=/^0b[01]+$/i,P=/^0o[0-7]+$/i,$=parseInt;function F(e){if("number"==typeof e)return e;if(_(e))return NaN;if(j(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=j(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=L(e);var n=M.test(e);return n||P.test(e)?$(e.slice(2),n?2:8):I.test(e)?NaN:+e}function B(e){return e}function z(e){if(!j(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var U,W=m["__core-js_shared__"],H=(U=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var q=Function.prototype.toString;function K(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var V=/^\[object .+?Constructor\]$/,Y=Function.prototype,J=Object.prototype,G=Y.toString,X=J.hasOwnProperty,Q=RegExp("^"+G.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Z(e){return!(!j(e)||(t=e,H&&H in t))&&(z(e)?Q:V).test(K(e));var t}function ee(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Z(n)?n:void 0}var te=ee(m,"WeakMap"),ne=/^(?:0|[1-9]\d*)$/;function re(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ne.test(e))&&e>-1&&e%1==0&&e<t}function oe(e,t){return e===t||e!=e&&t!=t}function ie(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function se(e){return null!=e&&ie(e.length)&&!z(e)}var ae=Object.prototype;function le(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ae)}function ce(e){return k(e)&&"[object Arguments]"==S(e)}var de=Object.prototype,ue=de.hasOwnProperty,pe=de.propertyIsEnumerable,he=ce(function(){return arguments}())?ce:function(e){return k(e)&&ue.call(e,"callee")&&!pe.call(e,"callee")};var fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,ge=fe&&"object"==typeof module&&module&&!module.nodeType&&module,me=ge&&ge.exports===fe?m.Buffer:void 0,ve=(me?me.isBuffer:void 0)||function(){return!1},be={};be["[object Float32Array]"]=be["[object Float64Array]"]=be["[object Int8Array]"]=be["[object Int16Array]"]=be["[object Int32Array]"]=be["[object Uint8Array]"]=be["[object Uint8ClampedArray]"]=be["[object Uint16Array]"]=be["[object Uint32Array]"]=!0,be["[object Arguments]"]=be["[object Array]"]=be["[object ArrayBuffer]"]=be["[object Boolean]"]=be["[object DataView]"]=be["[object Date]"]=be["[object Error]"]=be["[object Function]"]=be["[object Map]"]=be["[object Number]"]=be["[object Object]"]=be["[object RegExp]"]=be["[object Set]"]=be["[object String]"]=be["[object WeakMap]"]=!1;var ye,xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ee=xe&&"object"==typeof module&&module&&!module.nodeType&&module,we=Ee&&Ee.exports===xe&&f.process,Ce=function(){try{var e=Ee&&Ee.require&&Ee.require("util").types;return e||we&&we.binding&&we.binding("util")}catch(e){}}(),Se=Ce&&Ce.isTypedArray,ke=Se?(ye=Se,function(e){return ye(e)}):function(e){return k(e)&&ie(e.length)&&!!be[S(e)]},_e=Object.prototype.hasOwnProperty;function Ae(e,t){var n=A(e),r=!n&&he(e),o=!n&&!r&&ve(e),i=!n&&!r&&!o&&ke(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=a.length;for(var c in e)!t&&!_e.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||re(c,l))||a.push(c);return a}var Re=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Oe=Re,Te=Object.prototype.hasOwnProperty;function De(e){if(!le(e))return Oe(e);var t=[];for(var n in Object(e))Te.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ne(e){return se(e)?Ae(e):De(e)}var Le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,je=/^\w*$/;function Ie(e,t){if(A(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!_(e))||(je.test(e)||!Le.test(e)||null!=t&&e in Object(t))}var Me=ee(Object,"create");var Pe=Object.prototype.hasOwnProperty;var $e=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 Be(e,t){for(var n=e.length;n--;)if(oe(e[n][0],t))return n;return-1}Fe.prototype.clear=function(){this.__data__=Me?Me(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(Me){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Pe.call(t,e)?t[e]:void 0},Fe.prototype.has=function(e){var t=this.__data__;return Me?void 0!==t[e]:$e.call(t,e)},Fe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Me&&void 0===t?"__lodash_hash_undefined__":t,this};var ze=Array.prototype.splice;function Ue(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])}}Ue.prototype.clear=function(){this.__data__=[],this.size=0},Ue.prototype.delete=function(e){var t=this.__data__,n=Be(t,e);return!(n<0)&&(n==t.length-1?t.pop():ze.call(t,n,1),--this.size,!0)},Ue.prototype.get=function(e){var t=this.__data__,n=Be(t,e);return n<0?void 0:t[n][1]},Ue.prototype.has=function(e){return Be(this.__data__,e)>-1},Ue.prototype.set=function(e,t){var n=this.__data__,r=Be(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var We=ee(m,"Map");function He(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 qe(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])}}qe.prototype.clear=function(){this.size=0,this.__data__={hash:new Fe,map:new(We||Ue),string:new Fe}},qe.prototype.delete=function(e){var t=He(this,e).delete(e);return this.size-=t?1:0,t},qe.prototype.get=function(e){return He(this,e).get(e)},qe.prototype.has=function(e){return He(this,e).has(e)},qe.prototype.set=function(e,t){var n=He(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ke(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 s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Ke.Cache||qe),n}Ke.Cache=qe;var Ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ye=/\\(\\)?/g,Je=function(e){var t=Ke(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(Ve,function(e,n,r,o){t.push(r?o.replace(Ye,"$1"):n||e)}),t}),Ge=Je;function Xe(e,t){return A(e)?e:Ie(e,t)?[e]:Ge(function(e){return null==e?"":T(e)}(e))}function Qe(e){if("string"==typeof e||_(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ze(e,t){for(var n=0,r=(t=Xe(t,e)).length;null!=e&&n<r;)e=e[Qe(t[n++])];return n&&n==r?e:void 0}function et(e,t,n){var r=null==e?void 0:Ze(e,t);return void 0===r?n:r}function tt(e){var t=this.__data__=new Ue(e);this.size=t.size}tt.prototype.clear=function(){this.__data__=new Ue,this.size=0},tt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},tt.prototype.get=function(e){return this.__data__.get(e)},tt.prototype.has=function(e){return this.__data__.has(e)},tt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ue){var r=n.__data__;if(!We||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qe(r)}return n.set(e,t),this.size=n.size,this};var nt=Object.prototype.propertyIsEnumerable,rt=Object.getOwnPropertySymbols,ot=rt?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 s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(rt(e),function(t){return nt.call(e,t)}))}:function(){return[]};function it(e){return function(e,t,n){var r=t(e);return A(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,ot)}var st=ee(m,"DataView"),at=ee(m,"Promise"),lt=ee(m,"Set"),ct="[object Map]",dt="[object Promise]",ut="[object Set]",pt="[object WeakMap]",ht="[object DataView]",ft=K(st),gt=K(We),mt=K(at),vt=K(lt),bt=K(te),yt=S;(st&&yt(new st(new ArrayBuffer(1)))!=ht||We&&yt(new We)!=ct||at&&yt(at.resolve())!=dt||lt&&yt(new lt)!=ut||te&&yt(new te)!=pt)&&(yt=function(e){var t=S(e),n="[object Object]"==t?e.constructor:void 0,r=n?K(n):"";if(r)switch(r){case ft:return ht;case gt:return ct;case mt:return dt;case vt:return ut;case bt:return pt}return t});var xt=yt,Et=m.Uint8Array;function wt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new qe;++t<n;)this.add(e[t])}function Ct(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 St(e,t){return e.has(t)}wt.prototype.add=wt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},wt.prototype.has=function(e){return this.__data__.has(e)};function kt(e,t,n,r,o,i){var s=1&n,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=i.get(e),d=i.get(t);if(c&&d)return c==t&&d==e;var u=-1,p=!0,h=2&n?new wt:void 0;for(i.set(e,t),i.set(t,e);++u<a;){var f=e[u],g=t[u];if(r)var m=s?r(g,f,u,t,e,i):r(f,g,u,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Ct(t,function(e,t){if(!St(h,t)&&(f===e||o(f,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(f!==g&&!o(f,g,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function _t(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function At(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Rt=v?v.prototype:void 0,Ot=Rt?Rt.valueOf:void 0;var Tt=Object.prototype.hasOwnProperty;var Dt="[object Arguments]",Nt="[object Array]",Lt="[object Object]",jt=Object.prototype.hasOwnProperty;function It(e,t,n,r,o,i){var s=A(e),a=A(t),l=s?Nt:xt(e),c=a?Nt:xt(t),d=(l=l==Dt?Lt:l)==Lt,u=(c=c==Dt?Lt:c)==Lt,p=l==c;if(p&&ve(e)){if(!ve(t))return!1;s=!0,d=!1}if(p&&!d)return i||(i=new tt),s||ke(e)?kt(e,t,n,r,o,i):function(e,t,n,r,o,i,s){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 Et(e),new Et(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return oe(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=_t;case"[object Set]":var l=1&r;if(a||(a=At),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var d=kt(a(e),a(t),r,o,i,s);return s.delete(e),d;case"[object Symbol]":if(Ot)return Ot.call(e)==Ot.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=d&&jt.call(e,"__wrapped__"),f=u&&jt.call(t,"__wrapped__");if(h||f){var g=h?e.value():e,m=f?t.value():t;return i||(i=new tt),o(g,m,n,r,i)}}return!!p&&(i||(i=new tt),function(e,t,n,r,o,i){var s=1&n,a=it(e),l=a.length;if(l!=it(t).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in t:Tt.call(t,d)))return!1}var u=i.get(e),p=i.get(t);if(u&&p)return u==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var f=s;++c<l;){var g=e[d=a[c]],m=t[d];if(r)var v=s?r(m,g,d,t,e,i):r(g,m,d,e,t,i);if(!(void 0===v?g===m||o(g,m,n,r,i):v)){h=!1;break}f||(f="constructor"==d)}if(h&&!f){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 Mt(e,t,n,r,o){return e===t||(null==e||null==t||!k(e)&&!k(t)?e!=e&&t!=t:It(e,t,n,r,Mt,o))}function Pt(e){return e==e&&!j(e)}function $t(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,Pt(o)]}return t}(e);return 1==t.length&&t[0][2]?$t(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,s=!r;if(null==e)return!i;for(e=Object(e);o--;){var a=n[o];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var l=(a=n[o])[0],c=e[l],d=a[1];if(s&&a[2]){if(void 0===c&&!(l in e))return!1}else{var u=new tt;if(r)var p=r(c,d,l,e,t,u);if(!(void 0===p?Mt(d,c,3,r,u):p))return!1}}return!0}(n,e,t)}}function Bt(e,t){return null!=e&&t in Object(e)}function zt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Xe(t,e)).length,i=!1;++r<o;){var s=Qe(t[r]);if(!(i=null!=e&&n(e,s)))break;e=e[s]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ie(o)&&re(s,o)&&(A(e)||he(e))}(e,t,Bt)}function Ut(e){return Ie(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Qe(e)):function(e){return function(t){return Ze(t,e)}}(e)}function Wt(e){return"function"==typeof e?e:null==e?B:"object"==typeof e?A(e)?(t=e[0],n=e[1],Ie(t)&&Pt(n)?$t(Qe(t),n):function(e){var r=et(e,t);return void 0===r&&r===n?zt(e,t):Mt(n,r,3)}):Ft(e):Ut(e);var t,n}var Ht,qt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),s=i.length;s--;){var a=i[Ht?s:++r];if(!1===t(o[a],a,o))break}return e},Kt=qt;function Vt(e,t){return e&&Kt(e,t,Ne)}var Yt=function(){return m.Date.now()},Jt=Math.max,Gt=Math.min;function Xt(e,t,n){var r,o,i,s,a,l,c=0,d=!1,u=!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,s=e.apply(i,n)}function f(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=i}function g(){var e=Yt();if(f(e))return m(e);a=setTimeout(g,function(e){var n=t-(e-l);return u?Gt(n,i-(e-c)):n}(e))}function m(e){return a=void 0,p&&r?h(e):(r=o=void 0,s)}function v(){var e=Yt(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(g,t),d?h(e):s}(l);if(u)return clearTimeout(a),a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=F(t)||0,j(n)&&(d=!!n.leading,i=(u="maxWait"in n)?Jt(F(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0},v.flush=function(){return void 0===a?s:m(Yt())},v}var Qt=Object.prototype.hasOwnProperty;function Zt(e){if(null==e)return!0;if(se(e)&&(A(e)||"string"==typeof e||"function"==typeof e.splice||ve(e)||ke(e)||he(e)))return!e.length;var t=xt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(le(e))return!De(e).length;for(var n in e)if(Qt.call(e,n))return!1;return!0}function en(e,t){return Mt(e,t)}const tn=t,nn=e,rn=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",on=({size:e,children:t})=>{const n={height:e=rn(e),width:e,display:"inline-block",position:"relative"};return tn.createElement("div",{style:n},t)};on.propTypes={size:nn.number,children:nn.oneOfType([nn.arrayOf(nn.node),nn.node]).isRequired};const sn=t,an=e,ln=({size:e,children:t,sx:n})=>sn.createElement(on,{size:e},sn.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));ln.propTypes={size:an.oneOfType([an.string,an.number]),children:an.oneOfType([an.arrayOf(an.node),an.node]).isRequired,sx:an.object},an.string.isRequired;const cn=({fill:e})=>sn.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});cn.propTypes={fill:an.string.isRequired};const dn=({fill:e})=>sn.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});dn.propTypes={fill:an.string.isRequired};const un=({fill:e})=>sn.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});un.propTypes={fill:an.string.isRequired};const pn=({fill:e})=>sn.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});pn.propTypes={fill:an.string.isRequired};const hn=e,fn=t;var gn=(e,t)=>{class n extends fn.Component{static __initStatic(){this.propTypes={iconSet:hn.oneOf(["emoji","check"]),shape:hn.oneOf(["round","square"]),category:hn.oneOf(["feedback",void 0]),open:hn.bool,size:hn.oneOfType([hn.number,hn.string]),fg:hn.string,bg:hn.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:r,category:o,open:i,size:s,fg:a,bg:l}=this.props,c="check"===n?fn.createElement(e,{fill:a}):fn.createElement(t,{fill:a}),d="check"===n?fn.createElement(e,{fill:l}):fn.createElement(t,{fill:l});return i?fn.createElement(ln,{size:s},d):fn.createElement(ln,{size:s},"feedback"===o?"round"===r?fn.createElement(dn,{fill:l}):fn.createElement(cn,{fill:l}):"round"===r?fn.createElement(un,{fill:l}):fn.createElement(pn,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const mn=e,vn=t,bn=({fill:e})=>vn.createElement("g",{transform:"translate(1, 0)"},vn.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),vn.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),vn.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));bn.propTypes={fill:mn.string.isRequired};const yn=({fill:e,x:t=0,y:n=0})=>vn.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});yn.propTypes={fill:mn.string.isRequired,x:mn.number,y:mn.number};const xn=gn(yn,bn);xn.propTypes={iconSet:mn.oneOf(["emoji","check"]),shape:mn.oneOf(["round","square"]),category:mn.oneOf(["feedback",void 0]),open:mn.bool,fg:mn.string,bg:mn.string,size:mn.oneOfType([mn.string,mn.number])},xn.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const En=e,wn=t,{styled:Cn}=n,Sn=({bgFill:e,fgFill:t})=>wn.createElement("svg",{preserveAspectRatio:"xMinYMin meet",version:"1.1",viewBox:"-283 359 34 35",style:{enableBackground:"new -283 359 34 35"}},wn.createElement("circle",{cx:"-266",cy:"375.9",r:"14",fill:e}),wn.createElement("path",{d:"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",fill:e}),wn.createElement("polygon",{points:"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",fill:t}));Sn.propTypes={bgFill:En.string.isRequired,fgFill:En.string.isRequired};const kn=({bgFill:e,fgFill:t,borderFill:n})=>wn.createElement("svg",{preserveAspectRatio:"xMinYMin meet",version:"1.1",viewBox:"-129.5 127 34 35",style:{enableBackground:"new -129.5 127 34 35"}},wn.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z"}),wn.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"}),wn.createElement("circle",{cx:"-114.2",cy:"143.5",r:"14",fill:e}),wn.createElement("path",{d:"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",fill:n}),wn.createElement("polygon",{points:"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",fill:t}));kn.propTypes={bgFill:En.string.isRequired,fgFill:En.string.isRequired,borderFill:En.string.isRequired};const _n=Cn("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),An=({open:e,size:t})=>wn.createElement(_n,{size:t},e?wn.createElement(Sn,{bgFill:"#bce2ff",fgFill:"#1a9cff"}):wn.createElement(kn,{bgFill:"white",fgFill:"#1a9cff",borderFill:"#bce2ff"}));An.propTypes={open:En.bool,size:En.string},An.defaultProps={open:!1};const Rn=e,On=t,Tn=({fill:e})=>On.createElement("g",{transform:"translate(0.5, 0.5)"},On.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),On.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));Tn.propTypes={fill:Rn.string.isRequired};const Dn=({fill:e})=>On.createElement("g",{transform:"translate(1,0)"},On.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),On.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),On.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));Dn.propTypes={fill:Rn.string.isRequired};const Nn=gn(Tn,Dn);Nn.propTypes={iconSet:Rn.oneOf(["emoji","check"]),shape:Rn.oneOf(["round","square"]),category:Rn.oneOf(["feedback",void 0]),open:Rn.bool,fg:Rn.string,bg:Rn.string,size:Rn.oneOfType([Rn.string,Rn.number])},Nn.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const Ln=e,jn=t,In=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return jn.createElement("g",null,jn.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),jn.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),jn.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},Mn=({children:e,size:t})=>jn.createElement(on,{size:t},jn.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));Mn.propTypes={children:Ln.oneOfType([Ln.arrayOf(Ln.node),Ln.node]).isRequired,size:Ln.number};const Pn=()=>jn.createElement("g",null,jn.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),jn.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),jn.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),jn.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),jn.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),jn.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),$n=()=>jn.createElement("g",null,jn.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),jn.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),jn.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),jn.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),jn.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),jn.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class Fn extends jn.Component{constructor(e){super(e)}render(){return!0===this.props.open?jn.createElement(Mn,null,jn.createElement(Pn,null),jn.createElement(In,null)):jn.createElement(Mn,null,jn.createElement($n,null),jn.createElement(In,null))}}Fn.propTypes={open:Ln.bool},Fn.defaultProps={open:!1};const Bn=e,zn=t,Un=({fill:e})=>zn.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});Un.propTypes={fill:Bn.string};class Wn extends zn.Component{static __initStatic(){this.propTypes={classes:Bn.object.isRequired,size:Bn.number}}render(){const{size:e}=this.props;return!0===this.props.open?zn.createElement(on,{size:e},zn.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},zn.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),zn.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),zn.createElement(Un,{fill:"#1A9CFF"}))):zn.createElement(on,{size:e},zn.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},zn.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),zn.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),zn.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",zn.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),zn.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),zn.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),zn.createElement(Un,{fill:"1A9CFF"})))}}Wn.__initStatic(),Wn.propTypes={open:Bn.bool},Wn.defaultProps={open:!1};const Hn=e,qn=t,Kn=({fill:e})=>qn.createElement("g",null,qn.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),qn.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));Kn.propTypes={fill:Hn.string.isRequired};const Vn=({fill:e})=>qn.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});Vn.propTypes={fill:Hn.string.isRequired};const Yn=({fill:e})=>qn.createElement("g",null,qn.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),qn.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),qn.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));Yn.propTypes={fill:Hn.string.isRequired};class Jn extends qn.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:qn.createElement(ln,null,qn.createElement(Vn,{fill:n}),qn.createElement(Kn,{fill:t})),emoji:qn.createElement(ln,null,qn.createElement(Vn,{fill:n}),qn.createElement(Yn,{fill:t})),feedback:{check:qn.createElement(ln,null,qn.createElement(Vn,{fill:n}),qn.createElement(Yn,{fill:t})),emoji:qn.createElement(ln,null,qn.createElement(Vn,{fill:n}),qn.createElement(Yn,{fill:t})),square:{check:qn.createElement(ln,null,qn.createElement(Vn,{fill:n}),qn.createElement(Kn,{fill:t})),emoji:qn.createElement(ln,null,qn.createElement(Vn,{fill:n}),qn.createElement(Yn,{fill:t})),open:{check:qn.createElement(ln,null,qn.createElement(Kn,{fill:n})),emoji:qn.createElement(ln,null,qn.createElement(Yn,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:r}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===r?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}Jn.propTypes={iconSet:Hn.oneOf(["emoji","check",void 0]),shape:Hn.oneOf(["square",void 0]),category:Hn.oneOf(["feedback",void 0]),open:Hn.bool,fg:Hn.string,bg:Hn.string},Jn.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const Gn=e,Xn=t,Qn=({fill:e})=>Xn.createElement("g",{transform:"translate(0, 0)"},Xn.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),Xn.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));Qn.propTypes={fill:Gn.string.isRequired};const Zn=({fill:e})=>Xn.createElement("g",{transform:"translate(2, 0)"},Xn.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),Xn.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),Xn.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));Zn.propTypes={fill:Gn.string.isRequired};const er=gn(Qn,Zn);er.propTypes={iconSet:Gn.oneOf(["emoji","check"]),shape:Gn.oneOf(["round","square"]),category:Gn.oneOf(["feedback",void 0]),open:Gn.bool,fg:Gn.string,bg:Gn.string,size:Gn.oneOfType([Gn.string,Gn.number])},er.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const tr=e,nr=t,rr=({fill:e})=>nr.createElement("g",null,nr.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),nr.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));rr.propTypes={fill:tr.string.isRequired};const or=({fill:e})=>nr.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});or.propTypes={fill:tr.string.isRequired};const ir=({fill:e="#FFFFFF"})=>nr.createElement("g",null,nr.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),nr.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),nr.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));ir.propTypes={fill:tr.string};const sr=({children:e,size:t})=>{const n=rn(t),r={height:n,width:n,display:"inline-block",position:"relative"};return nr.createElement("div",{style:r},nr.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};sr.propTypes={children:tr.oneOfType([tr.arrayOf(tr.node),tr.node]).isRequired,size:tr.oneOfType([tr.string,tr.number])};class ar extends nr.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:r="#bce2ff",border:o="#bbe3fd"}=this.props,i=nr.createElement(rr,{fill:n}),s={check:nr.createElement(sr,{size:this.props.size},nr.createElement(ir,null),i,nr.createElement(or,{fill:o})),emoji:nr.createElement(sr,{size:this.props.size},nr.createElement(ir,null),i,nr.createElement(or,{fill:o})),open:{check:nr.createElement(sr,{size:this.props.size},nr.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),nr.createElement(rr,{fill:r}),nr.createElement(or,{fill:"#FFFFFF"})),emoji:nr.createElement(sr,{size:this.props.size},nr.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),nr.createElement(rr,{fill:r}),nr.createElement(or,{fill:o}))}};return!0===t?s.open[e]:s[e]}}function lr(){return lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(null,arguments)}function cr(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function dr(e,t){return dr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dr(e,t)}function ur(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,dr(e,t)}function pr(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}ar.propTypes={iconSet:tr.oneOf(["emoji","check"]),open:tr.bool,fg:tr.string,bg:tr.string,border:tr.string,size:tr.oneOfType([tr.string,tr.number])},ar.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var hr=!1;var fr=t.createContext(null),gr=function(e){return e.scrollTop};const mr=t,vr=r;var br="unmounted",yr="exited",xr="entering",Er="entered",wr="exiting",Cr=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=yr,r.appearStatus=xr):o=Er:o=t.unmountOnExit||t.mountOnEnter?br:yr,r.state={status:o},r.nextCallback=null,r}ur(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===br?{status:yr}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==xr&&n!==Er&&(t=xr):n!==xr&&n!==Er||(t=wr)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===xr){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:vr.findDOMNode(this);n&&gr(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===yr&&this.setState({status:br})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[vr.findDOMNode(this),r],i=o[0],s=o[1],a=this.getTimeouts(),l=r?a.appear:a.enter;!e&&!n||hr?this.safeSetState({status:Er},function(){t.props.onEntered(i)}):(this.props.onEnter(i,s),this.safeSetState({status:xr},function(){t.props.onEntering(i,s),t.onTransitionEnd(l,function(){t.safeSetState({status:Er},function(){t.props.onEntered(i,s)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:vr.findDOMNode(this);t&&!hr?(this.props.onExit(r),this.safeSetState({status:wr},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:yr},function(){e.props.onExited(r)})})})):this.safeSetState({status:yr},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:vr.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],s=o[1];this.props.addEndListener(i,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===br)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=cr(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return mr.createElement(fr.Provider,{value:null},"function"==typeof n?n(e,r):mr.cloneElement(mr.Children.only(n),r))},t}(mr.Component);function Sr(){}Cr.contextType=fr,Cr.propTypes={},Cr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Sr,onEntering:Sr,onEntered:Sr,onExit:Sr,onExiting:Sr,onExited:Sr},Cr.UNMOUNTED=br,Cr.EXITED=yr,Cr.ENTERING=xr,Cr.ENTERED=Er,Cr.EXITING=wr;var kr=Cr;const _r=t;var Ar=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r})},Rr=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=pr(n.className,r):n.setAttribute("class",pr(n.className&&n.className.baseVal||"",r)));var n,r})},Or=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1];t.removeClasses(o,"exit"),t.addClass(o,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1]?"appear":"enter";t.addClass(o,i,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1]?"appear":"enter";t.removeClasses(o,i),t.addClass(o,i,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:o,activeClassName:r?o+"-active":n[e+"Active"],doneClassName:r?o+"-done":n[e+"Done"]}},t}ur(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&gr(e),r&&(this.appliedClasses[t][n]=r,Ar(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,o=n.active,i=n.done;this.appliedClasses[t]={},r&&Rr(e,r),o&&Rr(e,o),i&&Rr(e,i)},n.render=function(){var e=this.props;e.classNames;var t=cr(e,["classNames"]);return _r.createElement(kr,lr({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(_r.Component);Or.defaultProps={classNames:""},Or.propTypes={};var Tr=Or;const{Children:Dr}=t,{cloneElement:Nr}=t,{isValidElement:Lr}=t;function jr(e,t){var n=Object.create(null);return e&&Dr.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&Lr(e)?t(e):e}(e)}),n}function Ir(e,t,n){return null!=n[t]?n[t]:e.props[t]}function Mr(e,t,n){var r=jr(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),i=[];for(var s in e)s in t?i.length&&(o[s]=i,i=[]):i.push(s);var a={};for(var l in t){if(o[l])for(r=0;r<o[l].length;r++){var c=o[l][r];a[o[l][r]]=n(c)}a[l]=n(l)}for(r=0;r<i.length;r++)a[i[r]]=n(i[r]);return a}(t,r);return Object.keys(o).forEach(function(i){var s=o[i];if(Lr(s)){var a=i in t,l=i in r,c=t[i],d=Lr(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&Lr(c)&&(o[i]=Nr(s,{onExited:n.bind(null,s),in:c.props.in,exit:Ir(s,"exit",e),enter:Ir(s,"enter",e)})):o[i]=Nr(s,{in:!1}):o[i]=Nr(s,{onExited:n.bind(null,s),in:!0,exit:Ir(s,"exit",e),enter:Ir(s,"enter",e)})}}),o}const Pr=t;var $r=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Fr=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},r}ur(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,o=t.children,i=t.handleExited;return{children:t.firstRender?(n=e,r=i,jr(n.children,function(e){return Nr(e,{onExited:r.bind(null,e),in:!0,appear:Ir(e,"appear",n),enter:Ir(e,"enter",n),exit:Ir(e,"exit",n)})})):Mr(e,o,i),firstRender:!1}},n.handleExited=function(e,t){var n=jr(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=lr({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=cr(e,["component","childFactory"]),o=this.state.contextValue,i=$r(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?Pr.createElement(fr.Provider,{value:o},i):Pr.createElement(fr.Provider,{value:o},Pr.createElement(t,r,i))},t}(Pr.Component);Fr.propTypes={},Fr.defaultProps={component:"div",childFactory:function(e){return e}};var Br=Fr;const{green:zr}=o,{indigo:Ur}=o,{orange:Wr}=o,{pink:Hr}=o,{red:qr}=o,Kr={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:zr[500],CORRECT_SECONDARY:zr[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:Wr[500],INCORRECT_SECONDARY:qr[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:qr[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:Ur[500],PRIMARY_LIGHT:Ur[200],PRIMARY_DARK:Ur[800],SECONDARY:Hr.A400,SECONDARY_LIGHT:Hr[200],SECONDARY_DARK:Hr[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(Kr);const Vr=(Yr="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${Yr}-${t}, ${e})`,t)});var Yr;const Jr=()=>Vr("text",Kr.TEXT),Gr=()=>Vr("correct",Kr.CORRECT),Xr=()=>Vr("incorrect",Kr.INCORRECT),Qr=()=>Vr("incorrect-icon",Kr.INCORRECT_WITH_ICON),Zr=()=>Vr("background",Kr.BACKGROUND),eo=()=>Vr("dropdown-background",Kr.DROPDOWN_BACKGROUND),to=()=>Vr("tertiary",Kr.TERTIARY),no=()=>Vr("table-stripe","background-dark",Kr.TABLE_STRIPE),ro=()=>Vr("white",Kr.WHITE),oo=t,io=e,{styled:so}=n,ao=so("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),lo=so("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${Vr("disabled",Kr.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${Gr()})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${Xr()})`}}),co=so("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class uo extends oo.Component{constructor(...e){super(...e),uo.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:io.string,feedback:io.string}}__init(){this.nodeRef=oo.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?oo.createElement(Tr,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},oo.createElement(co,{ref:this.nodeRef},oo.createElement(ao,null,oo.createElement(lo,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return oo.createElement("div",null,oo.createElement(Br,null,this.renderFeedback()))}}uo.__initStatic();const po=t,ho=e,{Popover:fo}=i,{styled:go}=n,mo=s("pie-libs:render-ui:response-indicators"),vo=go("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),bo=go(fo)({cursor:"pointer"}),yo=go("div")({padding:"0",borderRadius:"4px"}),xo=(e,t)=>{class n extends po.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{mo("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:r}=this.state;return po.createElement(vo,{hasFeedback:!!n},po.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},po.createElement(e,null)),n&&po.createElement(bo,{PaperComponent:yo,open:!!r,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},po.createElement(uo,{feedback:n,correctness:t})))}}return n.propTypes={feedback:ho.string},n};xo(xn,"correct"),xo(Nn,"incorrect"),xo(er,"partially-correct"),xo(Jn,"nothing-submitted");const Eo=t,{styled:wo}=n,Co=a,So=e,{renderMath:ko}=u,_o=wo("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Ao=wo(Co)(({theme:e})=>({paddingTop:e.spacing(2)}));class Ro extends Eo.Component{constructor(...e){super(...e),Ro.prototype.__init.call(this),Ro.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:So.string,children:So.object,labels:So.shape({visible:So.string,hidden:So.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){ko(this.root)}componentDidUpdate(){ko(this.root)}render(){const{labels:e,children:t,className:n}=this.props,r=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return Eo.createElement("div",{className:n,ref:e=>this.root=e},Eo.createElement("div",{onClick:this.toggleExpanded},Eo.createElement(_o,null,r)),Eo.createElement(Ao,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}Ro.__initStatic(),Ro.__initStatic2();const{Button:Oo}=i,{styled:To}=n;To("div")({display:"flex",flexDirection:"column"}),To("div")({display:"flex",alignItems:"center",justifyContent:"center"}),To("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),To(Oo)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Do=t,{createTheme:No}=n,{styled:Lo}=n,{StyledEngineProvider:jo}=n,{ThemeProvider:Io}=n,Mo=e;const Po=No({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),$o=Lo("div")({"& table, th, td":{fontSize:"inherit"}});class Fo extends Do.Component{static __initStatic(){this.propTypes={className:Mo.string,children:Mo.array,extraCSSRules:Mo.shape({names:Mo.arrayOf(Mo.string),rules:Mo.string}),fontSizeFactor:Mo.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),r=t(document.body),o=Math.max(n,r),i=null!=e&&"number"==typeof e?e:1;return 1!==i?{fontSize:o*i+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...r}=this.props,{extraCSSRules:o,...i}=r,s=this.computeStyle(n);return Do.createElement(jo,{injectFirst:!0},Do.createElement(Io,{theme:Po},function(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}([o,"optionalAccess",e=>e.rules])?Do.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${o.rules} }`}}):null,Do.createElement($o,{className:`${t} extraCSSRules`,...i,...s&&{style:s}},e)))}}Fo.__initStatic(),Fo.__initStatic2();const Bo=t,{styled:zo}=n,Uo=e,Wo=zo(Fo)({display:"flex",flexDirection:"column",position:"relative"});class Ho extends Bo.Component{static __initStatic(){this.propTypes={ariaLabel:Uo.string,children:Uo.oneOfType([Uo.arrayOf(Uo.node),Uo.node]).isRequired,role:Uo.string,extraCSSRules:Uo.shape({names:Uo.arrayOf(Uo.string),rules:Uo.string}),fontSizeFactor:Uo.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:r,fontSizeFactor:o,classes:i}=this.props,s=t?{"aria-label":t,role:n}:{};return Bo.createElement(Wo,{...s,extraCSSRules:r,fontSizeFactor:o,classes:i},e)}}Ho.__initStatic();const qo=t,Ko=e;class Vo extends qo.Component{static __initStatic(){this.propTypes={tag:Ko.string,className:Ko.string,html:Ko.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,r=e||"div";return qo.createElement(r,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}Vo.__initStatic(),Vo.__initStatic2();const{InputLabel:Yo}=i,{FormControl:Jo}=i,Go=e,{styled:Xo}=n;Xo(Jo)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),Xo(Yo)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),Go.oneOfType([Go.string,Go.object]).isRequired,Go.string,Go.oneOfType([Go.arrayOf(Go.node),Go.node]).isRequired;const Qo=t,{Component:Zo}=t,{styled:ei}=n,ti=e,{renderMath:ni}=u,ri=ei("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:Vr("table-grid","text",Kr.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:no()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:no()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:Jr()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${Jr()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),oi=/\\embed\{newLine\}\[\]/g;class ii extends Zo{constructor(...e){super(...e),ii.prototype.__init.call(this),ii.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:ti.string,tagName:ti.string,className:ti.string,onClick:ti.func,defaultClassName:ti.string,autoplayAudioEnabled:ti.bool,customAudioButton:{playImage:ti.string,pauseImage:ti.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=Qo.createRef()}__init2(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const r=n.querySelector("audio");if(r){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",r.getAttribute("src")),r.removeAttribute("src"),r.setAttribute("id","pie-prompt-audio-player"),r.appendChild(e),t){r.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),r.parentNode.insertBefore(e,r)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),r=document.getElementById("pie-prompt-audio-player");if(e&&r&&r.play().then(()=>{n&&t&&r.addEventListener("ended",i)}).catch(e=>{console.error("Error playing audio",e)}),!n||!r||!t)return;const o=()=>{r.paused&&(n.style.backgroundImage.includes(t.pauseImage)||r.play())},i=()=>{n.style.backgroundImage=`url(${t.playImage})`},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",o),r.addEventListener("play",s),r.addEventListener("pause",a),r.addEventListener("ended",i),this._handlePlayClick=o,this._handleAudioPlay=s,this._handleAudioPause=a,this._handleAudioEnded=i}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=this.promptRef.current;e&&"function"==typeof ni&&ni(e)}alignImages(){const e=this.promptRef.current;if(!e)return;const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",r=e.parentElement;if("DIV"===r.tagName&&"flex"===r.style.display&&"100%"===r.style.width)r.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const o=e.cloneNode(!0);t.appendChild(o),r.replaceChild(t,e)}}}render(){const{prompt:e,tagName:t,className:n,onClick:r,defaultClassName:o}=this.props,i=`${n||""} ${o||""} ${"legend"===t?"legend":""} preview-prompt`.trim();return Qo.createElement(ri,{as:t||"div",ref:this.promptRef,onClick:r,className:i,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(oi,"\\newline ")}})}}ii.__initStatic(),ii.__initStatic2();const si=e,ai=t,li=e=>ai.createElement(ai.Fragment,null,ai.Children.map(e.children,t=>ai.cloneElement(t,{"data-pie-readable":void 0===e.false})));li.propTypes={children:si.node,false:si.bool};const ci=e;let di;ci.node,ci.string,"undefined"!=typeof window&&(di=new DOMParser);const ui=e=>{if(!e)return!1;const t=(e=>di.parseFromString(e,"text/html").body.textContent)(e);return!(!t||!t.trim())};let pi;"undefined"!=typeof window&&(pi=new DOMParser);const hi=e=>{if(!e)return!1;const t=pi.parseFromString(e,"text/html");return!!t.body.querySelector("img")||!!t.body.querySelector("video")||!!t.body.querySelector("audio")};var fi,gi={"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},mi={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},vi=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},bi=vi,yi=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,xi="undefined"==typeof document?{}:document.documentElement.style,Ei=function(){var e=function(){for(var e in xi)if(yi.test(e))return e.match(yi)[0];return"WebkitOpacity"in xi?"Webkit":"KhtmlOpacity"in xi?"Khtml":""}(),t=e.toLowerCase();return{style:e,css:"-"+t+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[e]||bi(e)}}(),wi=function(e,t){return t?t.toUpperCase():""},Ci=/[-\s]+(.)?/g,Si=function(e){return e?e.replace(Ci,wi):""},ki=/::/g,_i=/([A-Z]+)([A-Z][a-z])/g,Ai=/([a-z\d])([A-Z])/g,Ri=/_/g,Oi=function(e,t){return e?e.replace(ki,"/").replace(_i,"$1_$2").replace(Ai,"$1_$2").replace(Ri,t||"-"):""},Ti=function(e){return Oi(e).toLowerCase()},Di=Si,Ni=Ti,Li=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},ji=vi,Ii=Ei,Mi=gi,Pi="undefined"==typeof document?{}:document.documentElement.style,$i=function(e,t){t=t||{};var n=Li(Di(e)),r=Ni(e),o=fi?n:r,i=Ii.style?fi?Ii.style:Ii.css:"";if(n in Pi)return t.asString?o:[o];var s=o,a=Mi[r],l=[];if(fi&&(s=ji(o)),"function"==typeof a){var c=a(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return fi?Li(Di(e)):Ni(e)})),l=l.concat(c)}return i&&l.push(i+s),l.push(o),t.asString||1==l.length?l[0]:l},Fi=Object.prototype.hasOwnProperty,Bi=function(e,t){return Fi.call(e,t)},zi=Object.prototype.toString,Ui=Object.prototype.toString,Wi=$i,Hi=Ti,qi=Si,Ki=Bi,Vi=function(e){return!!e&&"[object Object]"===zi.call(e)},Yi=function(e){return"[object Function]"===Ui.apply(e)},Ji=function(e,t,n,r){Wi(t).forEach(function(t){e[r?r(t):t]=n})},Gi={cssUnitless:mi},Xi=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||Gi).cssUnitless=t.cssUnitless||Gi.cssUnitless,r=r||{};var o,i,s,a,l,c,d,u,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,f=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},g=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?qi:Hi;for(s in e)if(Ki(e,s)){if(a=e[s],i=Hi(n?n+s:s),o=!1,u=!1,Yi(a)&&(d=a.call(p||e,a,s,i,e),Vi(d)&&null!=d.value?(a=d.value,u=d.prefix,i=d.name?Hi(d.name):i):a=d),c="number"==(l=typeof a)||"string"==l&&""!=a&&1*a==a,null==a||null==i||""===i)continue;if((c||"string"==l)&&(o=!0),!o&&null!=a.value&&a.prefix&&(o=!0,u=a.prefix,a=a.value),o){if(u=u||!!m[i],c&&(a=h&&!(i in f)?a+g:a+""),"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){u?Ji(r,e,a,v):r[v(e)]=a});continue}u?Ji(r,i,a,v):r[v(i)]=a}else Xi(a,t,i+"-",r)}return r},Qi=Xi,Zi=Bi,es={prefixProperties:gi,cssUnitless:mi,object:Xi,string:function(e,t){e=Qi(e,t);var n,r=[];for(n in e)Zi(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const ts=s("@pie-lib:mask-markup:serialization"),ns=["span"],rs=["em","strong","u"],os=(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),es.object(r,{camelize:!0,addUnits:!1});var r},is=["border","class","style"],ss={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},as=(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=ss[r];if(o){ts("[deserialize] mark: ",o);return{_flatten:!0,nodes:ls(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 s=is.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=os(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}),a=(e=>ns.includes(e)?"inline":rs.includes(e)?"mark":"block")(r),l=ls(e.childNodes,t);return{object:a,type:r,data:{dataset:{...e.dataset},attributes:{...s}},nodes:l}}var n;return null},ls=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=as(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},cs=t,ds=e,{styled:us}=n,{renderMath:ps}=u;function hs(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 fs=us("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),gs=us("span")(()=>({display:"inline-block",width:".75em"})),ms=["tbody","tr"],vs=(e,t,n,r,o,i)=>{if(!t)return null;const s=[];return(e.nodes||[]).forEach((e,i)=>{const a=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return s.push(cs.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),s;if(r){const o=r(e,t,n);if(o){const t="blank"===hs([e,"access",e=>e.data,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.component]);return t&&s.push(cs.createElement(gs,{key:`spacer-${i}`})),s.push(o),void(t&&s.push(cs.createElement(gs,{key:`spacer-${i}`})))}}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&&ms.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>et(e,"marks",[]).length);return t?t.marks:null})(e);if(hs([n,"optionalAccess",e=>e.length])>0){const e=n.map(e=>Object.keys(ss).find(t=>ss[t]===e.type)).filter(Boolean);e.length>0?s.push(e.reduceRight((e,t,n)=>cs.createElement(t,{key:`${a}-${t}-${n}`},e),t)):s.push(t)}else t.length>0&&s.push(t)}else{const o=vs(e,t,n,r,e);if("p"===e.type||"paragraph"===e.type)s.push(cs.createElement(fs,{key:a},o));else{const t=e.type;e.nodes&&e.nodes.length>0?s.push(cs.createElement(t,{key:a,...e.data.attributes},o)):s.push(cs.createElement(t,{key:a,...e.data.attributes}))}}}),s},bs=us("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class ys extends cs.Component{constructor(e){super(e),ys.prototype.__init.call(this),this.internalContainerRef=cs.createRef()}static __initStatic(){this.propTypes={renderChildren:ds.func,layout:ds.object,value:ds.object,onChange:ds.func,elementType:ds.string,containerRef:ds.oneOfType([ds.func,ds.shape({current:ds.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof ps&&ps(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=vs(t,e,this.handleChange,this.props.renderChildren,null),i=r||this.internalContainerRef;return cs.createElement(bs,{ref:i},o)}}ys.__initStatic();const xs=/\{\{(\d+)\}\}/g;const Es=t,ws=e;var Cs;const Ss=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(xs,(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=ls(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},ks=(e,t)=>((Cs=class extends Es.Component{static __initStatic(){this.propTypes={markup:ws.string,layout:ws.object,value:ws.object,onChange:ws.func,customMarkMarkupComponent:ws.func,elementType:ws.string}}constructor(e){super(e),this.containerRef=Es.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:s}=this.props,a=r||Ss(n,e);return Es.createElement(ys,{containerRef:this.containerRef,elementType:s,layout:a,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),Cs),{useMemo:_s}=t,{useLayoutEffect:As}=t,{useEffect:Rs}=t,{useRef:Os}=t,{useCallback:Ts}=t,Ds="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Ns(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Ls(e){return"nodeType"in e}function js(e){var t,n;return e?Ns(e)?e:Ls(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Is(e){const{Document:t}=js(e);return e instanceof t}function Ms(e){return!Ns(e)&&e instanceof js(e).HTMLElement}function Ps(e){return e instanceof js(e).SVGElement}function $s(e){return e?Ns(e)?e.document:Ls(e)?Is(e)?e:Ms(e)||Ps(e)?e.ownerDocument:document:document:document}const Fs=Ds?As:Rs;function Bs(e){const t=Os(e);return Fs(()=>{t.current=e}),Ts(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 zs(e,t){void 0===t&&(t=[e]);const n=Os(e);return Fs(()=>{n.current!==e&&(n.current=e)},t),n}function Us(e,t){const n=Os();return _s(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Ws(e){const t=Bs(e),n=Os(null),r=Ts(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Hs(e){const t=Os();return Rs(()=>{t.current=e},[e]),t.current}let qs={};function Ks(e,t){return _s(()=>{if(t)return t;const n=null==qs[e]?0:qs[e]+1;return qs[e]=n,e+"-"+n},[e,t])}function Vs(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 Ys=Vs(1),Js=Vs(-1);function Gs(e){if(!e)return!1;const{KeyboardEvent:t}=js(e.target);return t&&e instanceof t}function Xs(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=js(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 Qs=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[Qs.Translate.toString(e),Qs.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Zs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ea(e){return e.matches(Zs)?e:e.querySelector(Zs)}const ta=t,{useState:na}=t,{useCallback:ra}=t,oa={display:"none"};function ia(e){let{id:t,value:n}=e;return ta.createElement("div",{id:t,style:oa},n)}function sa(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return ta.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 aa=t,{createContext:la}=t,{useContext:ca}=t,{useEffect:da}=t,{useState:ua}=t,{useCallback:pa}=t,{useMemo:ha}=t,{useRef:fa}=t,{memo:ga}=t,{useReducer:ma}=t,{cloneElement:va}=t,{forwardRef:ba}=t,{createPortal:ya}=r,{unstable_batchedUpdates:xa}=r,Ea=la(null);const wa={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 "},Ca={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 Sa(e){let{announcements:t=Ca,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=wa}=e;const{announce:i,announcement:s}=function(){const[e,t]=na("");return{announce:ra(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=Ks("DndLiveRegion"),[l,c]=ua(!1);if(da(()=>{c(!0)},[]),function(e){const t=ca(Ea);da(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(ha(()=>({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 d=aa.createElement(aa.Fragment,null,aa.createElement(ia,{id:r,value:o.draggable}),aa.createElement(sa,{id:a,announcement:s}));return n?ya(d,n):d}var ka;function _a(){}!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"}(ka||(ka={}));const Aa=Object.freeze({x:0,y:0});function Ra(e,t){const n=Xs(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function Oa(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ta(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),s=o-r,a=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=s*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const Da=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=Ta(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Oa)};function Na(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Aa}const La=(ja=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+ja*t.y,bottom:e.bottom+ja*t.y,left:e.left+ja*t.x,right:e.right+ja*t.x}),{...e})});var ja;function Ia(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 Ma={ignoreTransform:!1};function Pa(e,t){void 0===t&&(t=Ma);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=js(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Ia(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,t,r))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function $a(e){return Pa(e,{ignoreTransform:!0})}function Fa(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(Is(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ms(o)||Ps(o))return n;if(n.includes(o))return n;const i=js(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=js(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=js(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Ba(e){const[t]=Fa(e,1);return null!=t?t:null}function za(e){return Ds&&e?Ns(e)?e:Ls(e)?Is(e)||e===$s(e).scrollingElement?window:Ms(e)?e:null:null:null}function Ua(e){return Ns(e)?e.scrollX:e.scrollLeft}function Wa(e){return Ns(e)?e.scrollY:e.scrollTop}function Ha(e){return{x:Ua(e),y:Wa(e)}}var qa;function Ka(e){return!(!Ds||!e)&&e===document.scrollingElement}function Va(e){const t={x:0,y:0},n=Ka(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"}(qa||(qa={}));const Ya={x:.2,y:.2};function Ja(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=Ya);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=Va(e),h={x:0,y:0},f={x:0,y:0},g=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+g?(h.y=qa.Backward,f.y=r*Math.abs((t.top+g-i)/g)):!d&&l>=t.bottom-g&&(h.y=qa.Forward,f.y=r*Math.abs((t.bottom-g-l)/g)),!p&&a>=t.right-m?(h.x=qa.Forward,f.x=r*Math.abs((t.right-m-a)/m)):!u&&s<=t.left+m&&(h.x=qa.Backward,f.x=r*Math.abs((t.left+m-s)/m)),{direction:h,speed:f}}function Ga(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 Xa(e){return e.reduce((e,t)=>Ys(e,Ha(t)),Aa)}function Qa(e,t){if(void 0===t&&(t=Pa),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Ba(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Za=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Ua(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Wa(t),0)}]];class el{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=Fa(t),r=Xa(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Za)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),s=r[e]-t;return this.rect[i]+s},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class tl{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 nl(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 rl,ol;function il(e){e.preventDefault()}function sl(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"}(rl||(rl={})),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"}(ol||(ol={}));const al={start:[ol.Space,ol.Enter],cancel:[ol.Esc],end:[ol.Space,ol.Enter,ol.Tab]},ll=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ol.Right:return{...n,x:n.x+25};case ol.Left:return{...n,x:n.x-25};case ol.Down:return{...n,y:n.y+25};case ol.Up:return{...n,y:n.y-25}}};class cl{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 tl($s(t)),this.windowListeners=new tl(js(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(rl.Resize,this.handleCancel),this.windowListeners.add(rl.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(rl.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Qa(n),t(Aa)}handleKeyDown(e){if(Gs(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=al,coordinateGetter:i=ll,scrollBehavior:s="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:Aa;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=Js(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:l,isBottom:c,maxScroll:u,minScroll:p}=Va(n),h=Ga(n),f={x:Math.min(o===ol.Right?h.right-h.width/2:h.right,Math.max(o===ol.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===ol.Down?h.bottom-h.height/2:h.bottom,Math.max(o===ol.Down?h.top:h.top+h.height/2,d.y))},g=o===ol.Right&&!a||o===ol.Left&&!l,m=o===ol.Down&&!c||o===ol.Up&&!i;if(g&&f.x!==d.x){const e=n.scrollLeft+t.x,i=o===ol.Right&&e<=u.x||o===ol.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=i?n.scrollLeft-e:o===ol.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(m&&f.y!==d.y){const e=n.scrollTop+t.y,i=o===ol.Down&&e<=u.y||o===ol.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=i?n.scrollTop-e:o===ol.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,Ys(Js(d,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 dl(e){return Boolean(e&&"distance"in e)}function ul(e){return Boolean(e&&"delay"in e)}cl.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=al,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class pl{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=js(e);return e instanceof t?e:$s(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=$s(i),this.documentListeners=new tl(this.document),this.listeners=new tl(n),this.windowListeners=new tl(js(i)),this.initialCoordinates=null!=(r=Xs(o))?r:Aa,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(rl.Resize,this.handleCancel),this.windowListeners.add(rl.DragStart,il),this.windowListeners.add(rl.VisibilityChange,this.handleCancel),this.windowListeners.add(rl.ContextMenu,il),this.documentListeners.add(rl.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ul(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(dl(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(rl.Click,sl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(rl.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:s}}=o;if(!r)return;const a=null!=(t=Xs(e))?t:Aa,l=Js(r,a);if(!n&&s){if(dl(s)){if(null!=s.tolerance&&nl(l,s.tolerance))return this.handleCancel();if(nl(l,s.distance))return this.handleStart()}return ul(s)&&nl(l,s.tolerance)?this.handleCancel():void this.handlePending(s,l)}e.cancelable&&e.preventDefault(),i(a)}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===ol.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const hl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class fl extends pl{constructor(e){const{event:t}=e,n=$s(t.target);super(e,hl,n)}}fl.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 gl={move:{name:"mousemove"},end:{name:"mouseup"}};var ml;!function(e){e[e.RightClick=2]="RightClick"}(ml||(ml={}));(class extends pl{constructor(e){super(e,gl,$s(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ml.RightClick&&(null==r||r({event:n}),!0)}}];const vl={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var bl,yl;function xl(e){let{acceleration:t,activator:n=bl.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=yl.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=Hs(t);return Us(e=>{if(n||!r||!e)return El;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[qa.Backward]:e.x[qa.Backward]||-1===o.x,[qa.Forward]:e.x[qa.Forward]||1===o.x},y:{[qa.Backward]:e.y[qa.Backward]||-1===o.y,[qa.Forward]:e.y[qa.Forward]||1===o.y}}},[n,t,r])}({delta:u,disabled:!i}),[f,g]=function(){const e=Os(null);return[Ts((t,n)=>{e.current=setInterval(t,n)},[]),Ts(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=fa({x:0,y:0}),v=fa({x:0,y:0}),b=ha(()=>{switch(n){case bl.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case bl.DraggableRect:return o}},[n,o,l]),y=fa(null),x=pa(()=>{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)},[]),E=ha(()=>a===yl.TreeOrder?[...c].reverse():c,[a,c]);da(()=>{if(i&&c.length&&b){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=d[n];if(!o)continue;const{direction:i,speed:a}=Ja(e,o,b,t,p);for(const e of["x","y"])h[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return g(),y.current=e,f(x,s),m.current=a,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,x,r,g,i,s,JSON.stringify(b),JSON.stringify(h),f,c,E,d,JSON.stringify(p)])}(class extends pl{constructor(e){super(e,vl)}static setup(){return window.addEventListener(vl.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(vl.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"}(bl||(bl={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(yl||(yl={}));const El={x:{[qa.Backward]:!1,[qa.Forward]:!1},y:{[qa.Backward]:!1,[qa.Forward]:!1}};var wl,Cl;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(wl||(wl={})),function(e){e.Optimized="optimized"}(Cl||(Cl={}));const Sl=new Map;function kl(e,t){return Us(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function _l(e){let{callback:t,disabled:n}=e;const r=Bs(t),o=ha(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return da(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Al(e){return new el(Pa(e),e)}function Rl(e,t,n){void 0===t&&(t=Al);const[r,o]=ua(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 s=function(e){let{callback:t,disabled:n}=e;const r=Bs(t),o=ha(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return da(()=>()=>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}}}}),a=_l({callback:i});return Fs(()=>{i(),e?(null==a||a.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==s||s.disconnect())},[e]),r}const Ol=[];function Tl(e,t){void 0===t&&(t=[]);const n=fa(null);return da(()=>{n.current=null},t),da(()=>{const t=e!==Aa;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Js(e,n.current):Aa}function Dl(e){return ha(()=>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 Nl=[];function Ll(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ms(t)?t:e}const jl=[{sensor:fl,options:{}},{sensor:cl,options:{}}],Il={current:{}},Ml={draggable:{measure:$a},droppable:{measure:$a,strategy:wl.WhileDragging,frequency:Cl.Optimized},dragOverlay:{measure:Pa}};class Pl 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 $l={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Pl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_a},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ml,measureDroppableContainers:_a,windowRect:null,measuringScheduled:!1},Fl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_a,draggableNodes:new Map,over:null,measureDroppableContainers:_a},Bl=la(Fl),zl=la($l);function Ul(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pl}}}function Wl(e,t){switch(t.type){case ka.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ka.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 ka.DragEnd:case ka.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ka.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Pl(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case ka.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Pl(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case ka.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Pl(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Hl(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=ca(Bl),i=Hs(r),s=Hs(null==n?void 0:n.id);return da(()=>{if(!t&&!r&&i&&null!=s){if(!Gs(i))return;if(document.activeElement===i.target)return;const e=o.get(s);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=ea(e);if(t){t.focus();break}}})}},[r,t,o,s,i]),null}function ql(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Kl=la({...Aa,scaleX:1,scaleY:1});var Vl;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Vl||(Vl={})),ga(function(e){var t,n,r,o;let{id:i,accessibility:s,autoScroll:a=!0,children:l,sensors:c=jl,collisionDetection:d=Da,measuring:u,modifiers:p,...h}=e;const f=ma(Wl,void 0,Ul),[g,m]=f,[v,b]=function(){const[e]=ua(()=>new Set),t=pa(t=>(e.add(t),()=>e.delete(t)),[e]);return[pa(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]=ua(Vl.Uninitialized),E=y===Vl.Initialized,{draggable:{active:w,nodes:C,translate:S},droppable:{containers:k}}=g,_=null!=w?C.get(w):null,A=fa({initial:null,translated:null}),R=ha(()=>{var e;return null!=w?{id:w,data:null!=(e=null==_?void 0:_.data)?e:Il,rect:A}:null},[w,_]),O=fa(null),[T,D]=ua(null),[N,L]=ua(null),j=zs(h,Object.values(h)),I=Ks("DndDescribedBy",i),M=ha(()=>k.getEnabled(),[k]),P=function(e){return ha(()=>({draggable:{...Ml.draggable,...null==e?void 0:e.draggable},droppable:{...Ml.droppable,...null==e?void 0:e.droppable},dragOverlay:{...Ml.dragOverlay,...null==e?void 0:e.dragOverlay}}),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(u),{droppableRects:$,measureDroppableContainers:F,measuringScheduled:B}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=ua(null),{frequency:a,measure:l,strategy:c}=o,d=fa(e),u=function(){switch(c){case wl.Always:return!1;case wl.BeforeDragging:return n;default:return!n}}(),p=zs(u),h=pa(function(e){void 0===e&&(e=[]),p.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),f=fa(null),g=Us(t=>{if(u&&!n)return Sl;if(!t||t===Sl||d.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 el(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,l]);return da(()=>{d.current=e},[e]),da(()=>{u||h()},[n,u]),da(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),da(()=>{u||"number"!=typeof a||null!==f.current||(f.current=setTimeout(()=>{h(),f.current=null},a))},[a,u,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}(M,{dragging:E,dependencies:[S.x,S.y],config:P.droppable}),z=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Us(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,w),U=ha(()=>N?Xs(N):null,[N]),W=function(){const e=!1===(null==T?void 0:T.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=E&&!e&&!t;if("object"==typeof a)return{...a,enabled:n};return{enabled:n}}(),H=function(e,t){return kl(e,t)}(z,P.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=fa(!1),{x:s,y:a}="boolean"==typeof o?{x:o,y:o}:o;Fs(()=>{if(!s&&!a||!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=Na(n(e),r);if(s||(o.x=0),a||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Ba(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,s,a,r,n])}({activeNode:null!=w?C.get(w):null,config:W.layoutShiftCompensation,initialRect:H,measure:P.draggable.measure});const q=Rl(z,P.draggable.measure,H),K=Rl(z?z.parentElement:null),V=fa({activatorEvent:null,active:null,activeNode:z,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Y=k.getNodeFor(null==(t=V.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=ua(null),o=_l({callback:pa(e=>{for(const{target:n}of e)if(Ms(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=pa(e=>{const n=Ll(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[s,a]=Ws(i);return ha(()=>({nodeRef:s,rect:n,setRef:a}),[n,s,a])}({measure:P.dragOverlay.measure}),G=null!=(n=J.nodeRef.current)?n:z,X=E?null!=(r=J.rect)?r:q:null,Q=Boolean(J.nodeRef.current&&J.rect),Z=Na(ee=Q?null:q,kl(ee));var ee;const te=Dl(G?js(G):null),ne=function(e){const t=fa(e),n=Us(n=>e?n&&n!==Ol&&e&&t.current&&e.parentNode===t.current.parentNode?n:Fa(e):Ol,[e]);return da(()=>{t.current=e},[e]),n}(E?null!=Y?Y:z:null),re=function(e,t){void 0===t&&(t=Pa);const[n]=e,r=Dl(n?js(n):null),[o,i]=ua(Nl);function s(){i(()=>e.length?e.map(e=>Ka(e)?r:new el(t(e),e)):Nl)}const a=_l({callback:s});return Fs(()=>{null==a||a.disconnect(),s(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),o}(ne),oe=ql(p,{transform:{x:S.x-Z.x,y:S.y-Z.y,scaleX:1,scaleY:1},activatorEvent:N,active:R,activeNodeRect:q,containerNodeRect:K,draggingNodeRect:X,over:V.current.over,overlayNodeRect:J.rect,scrollableAncestors:ne,scrollableAncestorRects:re,windowRect:te}),ie=U?Ys(U,S):null,se=function(e){const[t,n]=ua(null),r=fa(e),o=pa(e=>{const t=za(e.target);t&&n(e=>e?(e.set(t,Ha(t)),new Map(e)):null)},[]);return da(()=>{const t=r.current;if(e!==t){i(t);const s=e.map(e=>{const t=za(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Ha(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=za(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),ha(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Ys(e,t),Aa):Xa(e):Aa,[e,t])}(ne),ae=Tl(se),le=Tl(se,[q]),ce=Ys(oe,ae),de=X?La(X,oe):null,ue=R&&de?d({active:R,collisionRect:de,droppableRects:$,droppableContainers:M,pointerCoordinates:ie}):null,pe=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(ue,"id"),[he,fe]=ua(null),ge=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Q?oe:Ys(oe,le),null!=(o=null==he?void 0:he.rect)?o:null,q),me=fa(null),ve=pa((e,t)=>{let{sensor:n,options:r}=t;if(null==O.current)return;const o=C.get(O.current);if(!o)return;const i=e.nativeEvent,s=new n({active:O.current,activeNode:o,event:i,options:r,context:V,onAbort(e){if(!C.get(e))return;const{onDragAbort:t}=j.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!C.get(e))return;const{onDragPending:o}=j.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=O.current;if(null==t)return;const n=C.get(t);if(!n)return;const{onDragStart:r}=j.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:A}};xa(()=>{null==r||r(o),x(Vl.Initializing),m({type:ka.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),D(me.current),L(i)})},onMove(e){m({type:ka.DragMove,coordinates:e})},onEnd:a(ka.DragEnd),onCancel:a(ka.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=V.current;let s=null;if(t&&o){const{cancelDrop:a}=j.current;if(s={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===ka.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=ka.DragCancel)}}O.current=null,xa(()=>{m({type:e}),x(Vl.Uninitialized),fe(null),D(null),L(null),me.current=null;const t=e===ka.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=j.current[t];null==e||e(s),v({type:t,event:s})}})}}me.current=s},[C]),be=pa((e,t)=>(n,r)=>{const o=n.nativeEvent,i=C.get(r);if(null!==O.current||!i||o.dndKit||o.defaultPrevented)return;const s={active:i};!0===e(n,t.options,s)&&(o.dndKit={capturedBy:t.sensor},O.current=r,ve(n,t))},[C,ve]),ye=function(e,t){return ha(()=>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,be);!function(e){da(()=>{if(!Ds)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),Fs(()=>{q&&y===Vl.Initializing&&x(Vl.Initialized)},[q,y]),da(()=>{const{onDragMove:e}=j.current,{active:t,activatorEvent:n,collisions:r,over:o}=V.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:ce.x,y:ce.y},over:o};xa(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ce.x,ce.y]),da(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=V.current;if(!e||null==O.current||!t||!o)return;const{onDragOver:i}=j.current,s=r.get(pe),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};xa(()=>{fe(a),null==i||i(l),v({type:"onDragOver",event:l})})},[pe]),Fs(()=>{V.current={activatorEvent:N,active:R,activeNode:z,collisionRect:de,collisions:ue,droppableRects:$,draggableNodes:C,draggingNode:G,draggingNodeRect:X,droppableContainers:k,over:he,scrollableAncestors:ne,scrollAdjustedTranslate:ce},A.current={initial:X,translated:de}},[R,z,ue,de,C,G,X,$,k,he,ne,ce]),xl({...W,delta:S,draggingRect:de,pointerCoordinates:ie,scrollableAncestors:ne,scrollableAncestorRects:re});const xe=ha(()=>({active:R,activeNode:z,activeNodeRect:q,activatorEvent:N,collisions:ue,containerNodeRect:K,dragOverlay:J,draggableNodes:C,droppableContainers:k,droppableRects:$,over:he,measureDroppableContainers:F,scrollableAncestors:ne,scrollableAncestorRects:re,measuringConfiguration:P,measuringScheduled:B,windowRect:te}),[R,z,q,N,ue,K,J,C,k,$,he,F,ne,re,P,B,te]),Ee=ha(()=>({activatorEvent:N,activators:ye,active:R,activeNodeRect:q,ariaDescribedById:{draggable:I},dispatch:m,draggableNodes:C,over:he,measureDroppableContainers:F}),[N,ye,R,q,m,I,C,he,F]);return aa.createElement(Ea.Provider,{value:b},aa.createElement(Bl.Provider,{value:Ee},aa.createElement(zl.Provider,{value:xe},aa.createElement(Kl.Provider,{value:ge},l)),aa.createElement(Hl,{disabled:!1===(null==s?void 0:s.restoreFocus)})),aa.createElement(Sa,{...s,hiddenTextDescribedById:I}))});const Yl=la(null),Jl="button";function Gl(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Ks("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=ca(Bl),{role:h=Jl,roleDescription:f="draggable",tabIndex:g=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=ca(m?Kl:Yl),[b,y]=Ws(),[x,E]=Ws(),w=function(e,t){return ha(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(s,t),C=zs(n);Fs(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:x,data:C}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:ha(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!m||h!==Jl)||void 0,"aria-roledescription":f,"aria-describedby":d.draggable}),[r,h,g,m,f,d.draggable]),isDragging:m,listeners:r?void 0:w,node:b,over:p,setNodeRef:y,setActivatorNodeRef:E,transform:v}}const Xl={timeout:25};function Ql(e){let{animation:t,children:n}=e;const[r,o]=ua(null),[i,s]=ua(null),a=Hs(n);return n||r||!a||o(a),Fs(()=>{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]),aa.createElement(aa.Fragment,null,n,r?va(r,{ref:s}):null)}const Zl={x:0,y:0,scaleX:1,scaleY:1};function ec(e){let{children:t}=e;return aa.createElement(Bl.Provider,{value:Fl},aa.createElement(Kl.Provider,{value:Zl},t))}const tc={position:"fixed",touchAction:"none"},nc=e=>Gs(e)?"transform 250ms ease":void 0,rc=ba((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=nc}=e;if(!a)return null;const u=o?c:{...c,scaleX:1,scaleY:1},p={...tc,width:a.width,height:a.height,top:a.top,left:a.left,transform:Qs.Transform.toString(u),transformOrigin:o&&r?Ra(r,a):void 0,transition:"function"==typeof d?d(r):d,...l};return aa.createElement(n,{className:s,style:p,ref:t},i)}),oc={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Qs.Transform.toString(t)},{transform:Qs.Transform.toString(n)}]},sideEffects:(ic={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=ic;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 ic;function sc(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Bs((e,i)=>{if(null===t)return;const s=n.get(e);if(!s)return;const a=s.node.current;if(!a)return;const l=Ll(i);if(!l)return;const{transform:c}=js(i).getComputedStyle(i),d=Ia(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...oc,...e};return e=>{let{active:i,dragOverlay:s,transform:a,...l}=e;if(!t)return;const c={x:s.rect.left-i.rect.left,y:s.rect.top-i.rect.top},d={scaleX:1!==a.scaleX?i.rect.width*a.scaleX/s.rect.width:1,scaleY:1!==a.scaleY?i.rect.height*a.scaleY/s.rect.height:1},u={x:a.x-c.x,y:a.y-c.y,...d},p=o({...l,active:i,dragOverlay:s,transform:{initial:a,final:u}}),[h]=p,f=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(f))return;const g=null==r?void 0:r({active:i,dragOverlay:s,...l}),m=s.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==g||g(),e()}})}}(t);return Qa(a,o.draggable.measure),u({active:{id:e,data:s.data,node:a,rect:o.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}let ac=0;function lc(e){return ha(()=>{if(null!=e)return ac++,ac},[e])}const cc=aa.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggableNodes:f,droppableContainers:g,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:x,windowRect:E}=ca(zl),w=ca(Kl),C=lc(null==u?void 0:u.id),S=ql(s,{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:x,transform:w,windowRect:E}),k=kl(p),_=sc({config:r,draggableNodes:f,droppableContainers:g,measuringConfiguration:b}),A=k?m.setRef:void 0;return aa.createElement(ec,null,aa.createElement(Ql,{animation:_},u&&C?aa.createElement(rc,{key:C,id:u.id,ref:A,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:k,style:{zIndex:c,...o},transform:S},n):null))}),dc=t,{useEffect:uc}=t,{useRef:pc}=t,hc=e,{styled:fc}=n,{Chip:gc}=i,{renderMath:mc}=u;function vc(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 bc="MaskBlank",yc=fc("span")(({theme:e,disabled:t,selected:n})=>({border:`solid 0px ${e.palette.primary.main}`,margin:e.spacing(.5),transform:"translate(0, 0)",display:"inline-flex",opacity:n?.7:1,...t&&{}})),xc=fc(gc)(()=>({backgroundColor:ro(),border:`1px solid ${Jr()}`,color:Jr(),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}})),Ec=fc("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"},"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{fontSize:"120% !important"}}));function wc({choice:e,disabled:t,instanceId:n,selectedItem:r,onSelectClick:o}){const i=pc(null),{attributes:s,listeners:a,setNodeRef:l,isDragging:c}=Gl({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:bc},disabled:t});uc(()=>{mc(i.current)},[e.value]);const d=!!r&&!0===r.fromChoice&&r.choice.id===e.id;return dc.createElement(yc,{ref:l,style:c?{width:vc([i,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth])||90,height:vc([i,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])||32}:{},disabled:t,selected:d,onClick:r=>{t||(r.stopPropagation(),vc([o,"optionalCall",t=>t({choice:e,instanceId:n,fromChoice:!0,type:bc})]))},...a,...s},dc.createElement(xc,{clickable:!1,disabled:t,ref:i,label:dc.createElement(Ec,{dangerouslySetInnerHTML:{__html:e.value}})}))}wc.propTypes={choice:hc.object.isRequired,disabled:hc.bool,instanceId:hc.oneOfType([hc.string,hc.number]),selectedItem:hc.object,onSelectClick:hc.func};const Cc=t,Sc=e,{DragDroppablePlaceholder:kc}=h;class _c extends Cc.Component{constructor(...e){super(...e),_c.prototype.__init.call(this),_c.prototype.__init2.call(this)}static __initStatic(){this.propTypes={disabled:Sc.bool,duplicates:Sc.bool,choices:Sc.arrayOf(Sc.shape({label:Sc.string,value:Sc.string})),value:Sc.object,choicePosition:Sc.string.isRequired,instanceId:Sc.string,selectedItem:Sc.object,onSelectClick:Sc.func,onPlacementClick:Sc.func}}__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"}}}}__init2(){this.handlePoolClick=()=>{const{disabled:e,selectedItem:t,onPlacementClick:n}=this.props;e||t&&function(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)}}([n,"optionalCall",e=>e(void 0)])}}render(){const{disabled:e,duplicates:t,choices:n,value:r,instanceId:o,selectedItem:i,onSelectClick:s}=this.props,a=n.filter(e=>{if(!0===t)return!0;const n=(o=t=>t===e.id,function(e,t){var n;return Vt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,Wt(o)));var o;return void 0===n}),l={...this.getStyleForWrapper(),minWidth:"100px"};return Cc.createElement("div",{style:l,onClick:this.handlePoolClick},Cc.createElement(kc,{disabled:e,instanceId:o},a.map((t,n)=>Cc.createElement(wc,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o,selectedItem:i,onSelectClick:s}))))}}_c.__initStatic();const Ac=t,{useEffect:Rc}=t,{useRef:Oc}=t,{useState:Tc}=t,Dc=e,Nc=s,{styled:Lc}=n,{Chip:jc}=i,Ic=l,{grey:Mc}=o,{renderMath:Pc}=u;function $c(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}Nc("pie-lib:mask-markup:blank");const Fc=Lc("span")(({dragged:e,over:t,selected:n,showsPointerCursor:r})=>({border:`solid 0px ${Vr("primary",Kr.PRIMARY)}`,minWidth:"200px",overflow:"hidden",whiteSpace:"nowrap",opacity:1,cursor:"default",...t&&{whiteSpace:"nowrap",overflow:"hidden"},...(e||n)&&{opacity:.5},...r&&{"&:hover":{cursor:"pointer"}}})),Bc=Lc("span")({display:"inline-flex",touchAction:"none"}),zc=Lc(jc)(()=>({backgroundColor:Zr(),border:`2px dashed ${Jr()}`,touchAction:"none",color:Jr(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Mc[500]}`,backgroundColor:`${Mc[300]}`},"&.correct":{border:`solid 1px ${Gr()}`},"&.incorrect":{border:`solid 1px ${Xr()}`},"&.Mui-disabled":{opacity:1}})),Uc=Lc("span")(()=>({whiteSpace:"normal",pointerEvents:"none","& img":{display:"block",padding:"2px 0"},"& p":{marginTop:"0",marginBottom:"0"},"& mjx-frac":{fontSize:"120% !important"},"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{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 Wc({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a}){const l=Oc(null),c=Oc(null),d=Oc(null),u=Oc(!1),[p,h]=Tc({height:0,width:0}),f=()=>{m()},g=()=>{const e=$c([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=f:setTimeout(()=>{m()},300)},m=()=>{if(c.current&&l.current&&!u.current){u.current=!0,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;const e=c.current.querySelector("img");if(e)return c.current.textContent.trim().length>0?c.current:e;return c.current})()||c.current,t=e.getBoundingClientRect(),n=12,r=2,o=1,i=(e.offsetWidth||t.width||0)+2*n+2*r+o,d=Math.max(e.offsetHeight||0,t.height||0,e.scrollHeight||0,c.current.scrollHeight||0)+2*n+2*r+o,p=parseFloat(s)||0,f=parseFloat(a)||0,g=i<=p?p:i,m=d<=f?f:d;h(e=>({width:g>p?g:e.width,height:m>f?m:e.height}));const v=`${g}px`,b=`${m}px`;l.current.style.width!==v&&(l.current.style.width=v),l.current.style.height!==b&&(l.current.style.height=b),u.current=!1}};Rc(()=>{g()},[]),Rc(()=>{if("undefined"==typeof IntersectionObserver||!l.current)return;const e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&m()},{threshold:0});return e.observe(l.current),()=>e.disconnect()},[]),Rc(()=>{l.current&&Pc(l.current)},[i,n,$c([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),Rc(()=>{t?g():h({height:0,width:0})},[$c([t,"optionalAccess",e=>e.value])]),Rc(()=>{n||r||(d.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,r]);const v=o&&n&&o.choice&&o.choice.value,b=t&&t.value,y=n||r?{width:$c([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:$c([d,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(s))?0:parseFloat(s),t=isNaN(parseFloat(a))?0:parseFloat(a);return{...{height:p.height||t,width:p.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return Ac.createElement(zc,{clickable:!1,disabled:e,ref:l,component:"span",label:Ac.createElement(Ac.Fragment,null,Ac.createElement(Uc,{ref:c,draggable:!0,className:Ic({over:n,hidden:v}),dangerouslySetInnerHTML:{__html:b||""}}),v&&Ac.createElement(Uc,{draggable:!0,className:Ic({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:v||""}})),className:Ic({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:y})}function Hc({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l,selectedItem:c,onSelectClick:d,onPlacementClick:u}){const[p,h]=Tc(!1),f={id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"},{attributes:g,listeners:m,setNodeRef:v,isDragging:b}=Gl({id:`mask-blank-drag-${e}`,disabled:t||!r,data:f,attributes:{tabIndex:r&&!t?0:-1}}),{setNodeRef:y,isOver:x,active:E}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Ks("Droppable"),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=ca(Bl),d=fa({disabled:n}),u=fa(!1),p=fa(null),h=fa(null),{disabled:f,updateMeasurementsFor:g,timeout:m}={...Xl,...o},v=zs(null!=g?g:r),b=_l({callback:pa(()=>{u.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},m)):u.current=!0},[m]),disabled:f||!s}),y=pa((e,t)=>{b&&(t&&(b.unobserve(t),u.current=!1),e&&b.observe(e))},[b]),[x,E]=Ws(y),w=zs(t);return da(()=>{b&&x.current&&(b.disconnect(),u.current=!1,b.observe(x.current))},[x,b]),da(()=>(a({type:ka.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:p,data:w}}),()=>a({type:ka.UnregisterDroppable,key:i,id:r})),[r]),da(()=>{n!==d.current.disabled&&(a({type:ka.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:s,rect:p,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:E}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),w=!!c&&!1===c.fromChoice&&c.id===e,C=()=>{t||(w?$c([d,"optionalCall",e=>e(f)]):c?$c([u,"optionalCall",t=>t(e)]):r&&$c([d,"optionalCall",e=>e(f)]))},S=!r&&!t,k=!!r&&!t,_=!!c,A=x||_&&p&&!t;return Ac.createElement(Fc,{ref:y,role:S?"button":void 0,tabIndex:S?0:-1,onClick:C,onKeyDown:S?e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),C())}:void 0,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),dragged:b,over:A,selected:w,showsPointerCursor:_&&!t},Ac.createElement(Bc,{ref:v,...k?g:{},...m},Ac.createElement(Wc,{id:e,disabled:t,duplicates:n,choice:r,isOver:A,dragItem:$c([E,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l})))}function qc(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}Wc.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Wc.propTypes={id:Dc.oneOfType([Dc.string,Dc.number]),disabled:Dc.bool,duplicates:Dc.bool,choice:Dc.object,isOver:Dc.bool,dragItem:Dc.object,correct:Dc.bool,onChange:Dc.func,emptyResponseAreaWidth:Dc.oneOfType([Dc.string,Dc.number]),emptyResponseAreaHeight:Dc.oneOfType([Dc.string,Dc.number]),instanceId:Dc.string},Hc.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Hc.propTypes={id:Dc.oneOfType([Dc.string,Dc.number]),disabled:Dc.bool,duplicates:Dc.bool,choice:Dc.object,correct:Dc.bool,onChange:Dc.func,emptyResponseAreaWidth:Dc.oneOfType([Dc.string,Dc.number]),emptyResponseAreaHeight:Dc.oneOfType([Dc.string,Dc.number]),instanceId:Dc.string,selectedItem:Dc.object,onSelectClick:Dc.func,onPlacementClick:Dc.func};const Kc=(e,{active:t,context:n,currentCoordinates:r})=>{const{code:o}=e,i=o===ol.Tab,s=o===ol.Down||o===ol.Up||o===ol.Left||o===ol.Right;if(!i&&!s)return;if(s)return ll(e,{context:n,currentCoordinates:r});e.preventDefault();const{droppableRects:a,droppableContainers:l,collisionRect:c}=n;if(!a||0===a.size)return r;const d=qc([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),u=d&&!1===d.fromChoice&&null!=d.id?`mask-blank-drop-${d.id}`:void 0,p=[];let h;for(const[e,t]of l){if(qc([t,"optionalAccess",e=>e.disabled]))continue;if(e===u)continue;const n=a.get(e);if(!n)continue;const r={x:n.left+n.width/2,y:n.top+n.height/2},o={id:e,rect:n,dropPosition:{x:n.left,y:n.top+n.height/2},center:r};"drag-in-the-blank-droppable"===e?h=o:p.push(o)}if(0===p.length&&!h)return r;const f=e.shiftKey;p.sort((e,t)=>Math.abs(e.center.y-t.center.y)>10?e.center.y-t.center.y:e.center.x-t.center.x),h&&p.push(h);const g=c?{x:c.left+c.width/2,y:c.top+c.height/2}:r;let m=p.findIndex(e=>g.x>=e.rect.left&&g.x<=e.rect.right&&g.y>=e.rect.top&&g.y<=e.rect.bottom);if(-1===m){let e=1/0;for(let t=0;t<p.length;t++){const n=Vc(r,p[t].dropPosition);n<e&&(e=n,m=t)}}return p[f?(m-1+p.length)%p.length:(m+1)%p.length].dropPosition},Vc=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),Yc=t,Jc=e,{DragProvider:Gc}=h;function Xc(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 Qc=ks("blank",e=>(t,n,r)=>{const o=Xc([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:i,duplicates:s,correctResponse:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:p,isDragging:h,selectedItem:f,onSelectClick:g,onPlacementClick:m}=e,v=c?a[o.id]:n[o.id],b=v&&e.choices.find(e=>e.id===v);return Yc.createElement(Hc,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:s,choice:b,id:o.id,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,onChange:(e,t)=>{const o={...n};void 0===t?delete o[e]:o[e]=t,r(o)},instanceId:p,isDragging:h,selectedItem:f,onSelectClick:g,onPlacementClick:m})}});class Zc extends Yc.Component{constructor(e){super(e),Zc.prototype.__init.call(this),Zc.prototype.__init2.call(this),Zc.prototype.__init3.call(this),Zc.prototype.__init4.call(this),Zc.prototype.__init5.call(this),Zc.prototype.__init6.call(this),Zc.prototype.__init7.call(this),Zc.prototype.__init8.call(this),Zc.prototype.__init9.call(this),Zc.prototype.__init10.call(this),Zc.prototype.__init11.call(this),Zc.prototype.__init12.call(this),Zc.prototype.__init13.call(this),Zc.prototype.__init14.call(this),this.state={activeDragItem:null,dropAnimation:void 0,selectedItem:null},this.lastDragEndAt=0}static __initStatic(){this.propTypes={markup:Jc.string,layout:Jc.object,choicesPosition:Jc.string,choices:Jc.array,value:Jc.object,onChange:Jc.func,duplicates:Jc.bool,disabled:Jc.bool,feedback:Jc.object,correctResponse:Jc.object,showCorrectAnswer:Jc.bool,emptyResponseAreaWidth:Jc.oneOfType([Jc.string,Jc.number]),emptyResponseAreaHeight:Jc.oneOfType([Jc.string,Jc.number]),instanceId:Jc.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;Xc([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current,dropAnimation:void 0,selectedItem:t.data.current})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?Yc.createElement(wc,{disabled:e.disabled,choice:e.choice,instanceId:e.instanceId}):null}}__init3(){this.commitPlacement=(e,t)=>{const{onChange:n,value:r}=this.props;if(n)if(void 0!==t){if(!0===e.fromChoice){const o={...r};o[t]=e.choice.id,n(o)}else if(e.id&&e.id!==t){const o={...r};o[t]=e.choice.id,delete o[e.id],n(o)}}else if(!e.fromChoice&&e.id){const t={...r};delete t[e.id],n(t)}}}__init4(){this.handleDragEnd=e=>{const{active:t,over:n}=e,r=Xc([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),o=Xc([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),i=!!t&&!!n&&"MaskBlank"===Xc([r,"optionalAccess",e=>e.type])&&Xc([o,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")]);if(this.setState({activeDragItem:null,dropAnimation:i?null:void 0}),this.cancelSelection(),this.lastDragEndAt=Date.now(),!i)return;const s=!0===o.toChoiceBoard?void 0:o.id;this.commitPlacement(r,s)}}__init5(){this.onDragCancel=()=>{this.setState({activeDragItem:null,dropAnimation:void 0}),this.cancelSelection(),this.lastDragEndAt=Date.now()}}__init6(){this.isSameItem=(e,t)=>!(!e||!t||e.fromChoice!==t.fromChoice)&&(e.fromChoice?e.choice.id===t.choice.id:e.id===t.id)}__init7(){this.toggleItemSelection=e=>{this.setState(t=>({selectedItem:this.isSameItem(t.selectedItem,e)?null:e}))}}__init8(){this.cancelSelection=()=>{this.setState({selectedItem:null})}}__init9(){this.endAnyLiveKeyboardDrag=()=>{this.state.activeDragItem&&document.dispatchEvent(new KeyboardEvent("keydown",{code:"Escape",bubbles:!0,cancelable:!0}))}}__init10(){this.placeSelectedItem=e=>{const{selectedItem:t}=this.state;t&&(this.commitPlacement(t,e),this.cancelSelection(),this.endAnyLiveKeyboardDrag())}}__init11(){this.isClickSoonAfterDragEnd=()=>Date.now()-this.lastDragEndAt<250}__init12(){this.onItemClick=e=>{this.isClickSoonAfterDragEnd()||(this.endAnyLiveKeyboardDrag(),this.toggleItemSelection(e))}}__init13(){this.onPlacementClick=e=>{this.isClickSoonAfterDragEnd()||this.placeSelectedItem(e)}}__init14(){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:s,disabled:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,layout:p,instanceId:h}=this.props,f=o||"below",g={display:"flex",minWidth:"100px",...this.getPositionDirection(f)};return Yc.createElement(Gc,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,onDragCancel:this.onDragCancel,collisionDetection:Da,keyboardCoordinateGetter:Kc,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter"]}},Yc.createElement("div",{ref:e=>this.rootRef=e,style:g},Yc.createElement(_c,{choicePosition:f,choices:i,value:n,duplicates:t,disabled:a,instanceId:h,selectedItem:this.state.selectedItem,onSelectClick:this.onItemClick,onPlacementClick:this.onPlacementClick}),Yc.createElement(Qc,{elementType:"drag-in-the-blank",markup:e,layout:p,value:n,choices:i,onChange:r,disabled:a,duplicates:t,feedback:l,correctResponse:s,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:h,isDragging:!!this.state.activeDragItem,selectedItem:this.state.selectedItem,onSelectClick:this.onItemClick,onPlacementClick:this.onPlacementClick}),Yc.createElement(cc,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Zc.__initStatic(),Zc.__initStatic2();const ed=t,{styled:td}=n,nd=l;function rd(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 od,id;"undefined"!=typeof window&&(od=require("@pie-lib/editable-html-tip-tap").default,id=td(od)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Vr("black",Kr.BLACK)}`,"&.correct":{border:`1px solid ${Gr()}`},"&.incorrect":{border:`1px solid ${Xr()}`}})));ks("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:s,maxLength:a,spellCheck:l,pluginProps:c,onChange:d}=e,u=rd([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===u.component){const p=(e.choices&&u&&e.choices[u.id]||[])[0],h=s?p&&p.label:n[u.id]||"",f=a&&a[u.id],g=i&&i[u.id],m=s||"correct"===g,v=!s&&"incorrect"===g,b=e=>{const t={...n,[u.id]:e};d(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return ed.createElement(id,{id:u.id,key:`${t.type}-input-${u.id}`,disabled:s||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?f:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!rd([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:nd({correct:m,incorrect:v})})}});var sd=ks("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const ad=t,ld=e,{Button:cd}=i,{InputLabel:dd}=i,{Menu:ud}=i,{MenuItem:pd}=i,{ArrowDropDown:hd}=c,{ArrowDropUp:fd}=c,{Close:gd}=c,{Check:md}=c,{styled:vd}=n,{renderMath:bd}=u,yd=vd(cd)(()=>({color:Jr(),border:`1px solid ${Vr("border-gray",Kr.BORDER_GRAY)}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:Zr(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"24px"},"& svg":{position:"absolute",right:"4px",top:"calc(50% - 12px)",pointerEvents:"none",color:Jr(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${to()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:Gr(),color:`${Jr()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:Qr(),color:`${Jr()} !important`}})),xd=vd(ud)(()=>({"& .MuiPaper-root":{backgroundColor:Zr()},"& .MuiList-root":{padding:0}})),Ed=vd(pd)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:Jr(),backgroundColor:Zr(),"&.Mui-focusVisible":{outline:`3px solid ${to()}`,outlineOffset:"-1px",color:Jr(),backgroundColor:Zr()},"&:hover":{color:Jr(),backgroundColor:eo()},boxSizing:"border-box",padding:"16px 8px",borderRadius:"4px","&.selected":{color:`${Jr()} !important`,backgroundColor:`${Zr()} !important`,"&:hover":{color:Jr(),backgroundColor:`${eo()} !important`}}})),wd=vd("span")(()=>({fontSize:"max(1rem, 14px)"})),Cd=vd("span")(()=>({fontSize:"max(1rem, 14px)",flexShrink:0,paddingLeft:"8px"})),Sd=vd(dd)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),kd=vd(md)(()=>({color:`${ro()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Gr()},"&.incorrect":{backgroundColor:Qr()}})),_d=vd(gd)(()=>({color:`${ro()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Gr()},"&.incorrect":{backgroundColor:Qr()}}));class Ad extends ad.Component{static __initStatic(){this.propTypes={id:ld.string,value:ld.string,disabled:ld.bool,onChange:ld.func,correct:ld.bool,choices:ld.arrayOf(ld.shape({value:ld.string,label:ld.string})),showCorrectAnswer:ld.bool,singleQuery:ld.bool,correctValue:ld.string}}constructor(e){super(e),Ad.prototype.__init.call(this),Ad.prototype.__init2.call(this),Ad.prototype.__init3.call(this),Ad.prototype.__init4.call(this),Ad.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=ad.createRef(),this.buttonRef=ad.createRef(),this.previewRef=ad.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||bd(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&bd(e)}),bd(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>{const{id:t,value:n,choices:r}=this.props;let o=null;if(n){const e=(r||[]).findIndex(e=>e.value===n);e>=0&&(o=`dropdown-option-${t}-${e}`)}this.setState({anchorEl:e.currentTarget,highlightedOptionId:o})}}__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:s,correctValue:a}=this.props,{anchorEl:l}=this.state,c=Boolean(l),d=`dropdown-button-${e}`,u=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const f=parseInt(e,10)+1,g=s?"Query-label":`Query-label-${f}`,m=s?"Query":`Query ${f}`;let v=null;return n&&void 0!==t&&(v=t||i?ad.createElement(kd,{className:"correct"}):ad.createElement(_d,{className:"incorrect"})),ad.createElement(ad.Fragment,null,ad.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>ad.createElement(Ed,{key:t,tabIndex:-1,"aria-hidden":"true"},ad.createElement(wd,{dangerouslySetInnerHTML:{__html:e.label}})))),ad.createElement(Sd,{id:g,tabIndex:-1,"aria-hidden":"true"},m),ad.createElement(yd,{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?u:void 0,"aria-haspopup":"listbox","aria-expanded":c?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:h,disabled:n,id:d,role:"combobox","aria-label":`Select an option for ${m}`,"aria-labelledby":p},v,ad.createElement(wd,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:a||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?ad.createElement(fd,null):ad.createElement(hd,null)),ad.createElement(xd,{id:u,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":d,role:"listbox",disablePadding:!0}}},(o||[]).map((t,n)=>{const o=`dropdown-option-${e}-${n}`;return ad.createElement(Ed,{id:o,className:t.value===r?"selected":"",selected:t.value===r,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)},ad.createElement(wd,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),ad.createElement(Cd,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}Ad.__initStatic();const Rd=t;ks("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:i,disabled:s,feedback:a,showCorrectAnswer:l}=e,c=i&&i[o.id]&&i[o.id].find(e=>e.correct),d=l?c&&c.value:n[o.id];return Rd.createElement(Ad,{key:`${t.type}-dropdown-${o.id}`,correct:a&&a[o.id]&&"correct"===a[o.id],disabled:s||l,value:d,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 Od=t,{useRef:Td}=t,Dd=e,{styled:Nd}=n,Ld="height ease-in 300ms, opacity ease-in 300ms",jd=Nd("div")(()=>({position:"relative",height:0,overflow:"hidden",display:"flex",visibility:"hidden",width:0,"&.enter":{transition:Ld,opacity:1,height:"auto",width:"auto",visibility:"visible",minHeight:"25px"},"&.enter-done":{height:"auto",visibility:"visible",width:"auto",minHeight:"25px"},"&.exit":{transition:Ld,opacity:0,height:0,visibility:"visible",width:0},"&.exit-done":{opacity:0,visibility:"hidden",height:0,width:0}})),Id=e=>{const{show:t,children:n,className:r}=e,o=Td(null);return Od.createElement(Tr,{nodeRef:o,in:t,appear:!0,mountOnEnter:!1,timeout:300,classNames:{enter:"enter",enterDone:"enter-done",exit:"exit",exitDone:"exit-done"}},Od.createElement(jd,{ref:o,className:r},n))};function Md(e,t){return null!=e?e:t()}function Pd(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}Id.propTypes={show:Dd.bool.isRequired,className:Dd.string,children:Dd.oneOfType([Dd.arrayOf(Dd.node),Dd.node]).isRequired};const $d=e=>"string"==typeof e,Fd=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Bd=e=>null==e?"":""+e,zd=/###/g,Ud=e=>e&&e.indexOf("###")>-1?e.replace(zd,"."):e,Wd=e=>!e||$d(e),Hd=(e,t,n)=>{const r=$d(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Wd(e))return{};const t=Ud(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return Wd(e)?{}:{obj:e,k:Ud(r[o])}},qd=(e,t,n)=>{const{obj:r,k:o}=Hd(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=Hd(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=Hd(e,s,Object),Pd([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Kd=(e,t)=>{const{obj:n,k:r}=Hd(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Vd=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?$d(e[r])||e[r]instanceof String||$d(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Vd(e[r],t[r],n):e[r]=t[r]);return e},Yd=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Jd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Gd=e=>$d(e)?e.replace(/[&<>"'\/]/g,e=>Jd[e]):e;const Xd=[" ",",","?","!",";"],Qd=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),Zd=(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 s=e;s<r.length;++s)if(s!==e&&(i+=n),i+=r[s],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<r.length-1)continue;e+=s-e+1;break}o=t}return o},eu=e=>Pd([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),tu={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){Pd([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class nu{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||tu,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:($d(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new nu(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new nu(this.logger,e)}}var ru=new nu;class ou{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 iu extends ou{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 s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):$d(n)&&o?s.push(...n.split(o)):s.push(n)));const a=Kd(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&$d(n)?Zd(Pd([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,o):a}addResource(e,t,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),r=t,t=s[1]),this.addNamespaces(t),qd(this.data,s,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const r in n)($d(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 s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),r=n,n=t,t=s[1]),this.addNamespaces(t);let a=Kd(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Vd(a,n,o):a={...a,...n},qd(this.data,s,a),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 su={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=Md(Pd([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,r,o)]),()=>t)}),t}};const au=Symbol("i18next/PATH_KEY");function lu(e,t){const{[au]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(Pd([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),o===au?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(Md(Pd([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const cu={},du=e=>!$d(e)&&"boolean"!=typeof e&&"number"!=typeof e;class uu extends ou{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=ru.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===Pd([r,"optionalAccess",e=>e.res]))return!1;const o=du(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,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=Xd.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=Qd.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&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:$d(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:$d(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=lu(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:s,namespaces:a}=this.extractFromKey(e[e.length-1],r),l=a[a.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const d=r.lng||this.language,u=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===Pd([d,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return u?o?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:s;const p=this.resolve(e,r);let h=Pd([p,"optionalAccess",e=>e.res]);const f=Pd([p,"optionalAccess",e=>e.usedKey])||s,g=Pd([p,"optionalAccess",e=>e.exactUsedKey])||s,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!$d(r.count),y=uu.hasDefaultValue(r),x=b?this.pluralResolver.getSuffix(d,r.count,r):"",E=r.ordinal&&b?this.pluralResolver.getSuffix(d,r.count,{ordinal:!1}):"",w=b&&!r.ordinal&&0===r.count,C=w&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${x}`]||r[`defaultValue${E}`]||r.defaultValue;let S=h;v&&!h&&y&&(S=C);const k=du(S),_=Object.prototype.toString.apply(S);if(!(v&&S&&k&&["[object Number]","[object Function]","[object RegExp]"].indexOf(_)<0)||$d(m)&&Array.isArray(S))if(v&&$d(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=C),this.isValidLookup(h)||(o=!0,h=s);const a=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,u=y&&C!==h&&this.options.updateMissing;if(o||t||u){if(this.logger.log(u?"updateKey":"missingKey",d,l,s,u?C:h),i){const e=this.resolve(s,{...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:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,u,r):Pd([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,o,u,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);w&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,r[`defaultValue${t}`]||C)})}):n(e,s,C))}h=this.extendTranslation(h,e,r,p,n),o&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${l}${c}${s}`),(o||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,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(f,S,{...r,ns:a}):`key '${s} (${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(S),t=e?[]:{},n=e?g:f;for(const e in S)if(Object.prototype.hasOwnProperty.call(S,e)){const o=`${n}${i}${e}`;t[e]=y&&!h?this.translate(o,{...r,defaultValue:du(C)?C[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...r,joinArrays:!1,ns:a}),t[e]===o&&(t[e]=S[e])}h=t}}return o?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(e,t,n,r,o){if(Pd([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=$d(e)&&(void 0!==Pd([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let a=n.replace&&!$d(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(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)=>Pd([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,s=$d(i)?[i]:i;return null!=e&&Pd([s,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=su.handle(s,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,s;return $d(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;r=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==t.count&&!$d(t.count),u=d&&!t.ordinal&&0===t.count,p=void 0!==t.context&&($d(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)||(s=e,cu[`${h[0]}-${e}`]||!Pd([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Pd([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(s)])||(cu[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${h.join(", ")}" won't get resolved as namespace "${s}" 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 s=[l];if(Pd([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(s,l,r,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&0===e.indexOf(o)&&s.push(l+e.replace(o,this.options.pluralSeparator)),s.push(l+e),u&&s.push(l+n)),p){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(r),d&&(t.ordinal&&0===e.indexOf(o)&&s.push(r+e.replace(o,this.options.pluralSeparator)),s.push(r+e),u&&s.push(r+n))}}let a;for(;a=s.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(r,e,a,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:s}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return Pd([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&&!$d(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 pu{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ru.create("languageUtils")}getScriptPartFromCode(e){if(!(e=eu(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=eu(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if($d(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)),$d(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 $d(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))):$d(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}const hu={zero:0,one:1,two:2,few:3,many:4,other:5},fu={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class gu{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ru.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=eu("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!"),fu;if(!e.match(/-|_/))return fu;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)),Pd([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)=>hu[e]-hu[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 mu=(e,t,n,r=".",o=!0)=>{let i=((e,t,n)=>{const r=Kd(e,n);return void 0!==r?r:Kd(t,n)})(e,t,n);return!i&&o&&$d(n)&&(i=Zd(e,n,r),void 0===i&&(i=Zd(t,n,r))),i},vu=e=>e.replace(/\$/g,"$$$$");class bu{constructor(e={}){this.logger=ru.create("interpolator"),this.options=e,this.format=Pd([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:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:f,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:Gd,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Yd(o):i||"{{",this.suffix=s?Yd(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?Yd(u):p||Yd("$t("),this.nestingSuffix=h?Yd(h):f||Yd(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>Pd([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,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=mu(t,a,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(),s=o.join(this.formatSeparator).trim();return this.format(mu(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const c=Pd([r,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,d=void 0!==Pd([r,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>vu(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?vu(this.escape(e)):vu(e)}].forEach(t=>{for(s=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=$d(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(d){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else $d(i)||this.useRawValueToEscape||(i=Bd(i));const a=t.safeValue(i);if(e=e.replace(o[0],a),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i;const s=(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 s=o.match(/'/g),a=o.match(/"/g);(Md(Pd([s,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.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 a=[];i={...n},i=i.replace&&!$d(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&&(a=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=t(s.call(this,r[1].trim(),i),i),o&&r[0]===e&&!$d(o))return o;$d(o)||(o=Bd(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),a.length&&(o=a.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 yu=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 s=r+JSON.stringify(i);let a=t[s];return a||(a=e(eu(r),o),t[s]=a),a(n)}},xu=e=>(t,n,r)=>e(eu(n),r)(t);class Eu{constructor(e={}){this.logger=ru.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?yu:xu;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()]=yu(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 s=Pd([r,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[r.interpolationkey]])||{},a=s.locale||s.lng||r.locale||r.lng||n;t=this.formats[o](e,a,{...i,...r,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class wu extends ou{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=ru.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=[],Pd([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,r.backend,r)])}queueLoad(e,t,n,r){const o={},i={},s={},a={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const s=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,r=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[t]&&(a[t]=!0)))}),r||(s[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(s),toLoadNamespaces:Object.keys(a)}}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 s={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=Hd(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=>{s[e]||(s[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===s[e][t]&&(s[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",s),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 s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const n=a(e,t);n&&"function"==typeof n.then?n.then(e=>s(null,e)).catch(s):s(null,n)}catch(e){s(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();$d(e)&&(e=this.languageUtils.toResolveHierarchy(e)),$d(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={},s=()=>{}){if(!Pd([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Pd([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(Pd([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...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,a):l(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>s(null,e)).catch(s):s(null,o)}catch(e){s(e)}else l(e,t,n,r,s,a)}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 Cu=()=>({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]),$d(e[1])&&(t.defaultValue=e[1]),$d(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}),Su=e=>($d(e.ns)&&(e.ns=[e.ns]),$d(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),$d(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),Pd([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),ku=()=>{};class _u extends ou{constructor(e={},t){var n;if(super(),this.options=Su(e),this.services={},this.logger=ru,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&&($d(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Cu();var r;this.options={...n,...this.options,...Su(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||(Pd([r=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Pd([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||Pd([r,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&r.options.backend.backends.some(e=>Pd([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||Pd([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?ru.init(o(this.modules.logger),this.options):ru.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Eu;const t=new pu(this.options);this.store=new iu(this.options.resources,this.options);const r=this.services;r.logger=ru,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new gu(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 bu(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new wu(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 uu(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=ku),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=Fd(),s=()=>{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?s():setTimeout(s,0),i}loadResources(e,t=ku){let n=t;const r=$d(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===Pd([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))}Pd([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=Fd();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=ku),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&&su.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=Fd();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=$d(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes($d(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),Pd([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 s=this.options.keySeparator||".";let a;return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=lu(e,{...this.options,...t})),`${i.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=lu(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${s}${e}`:e),this.t(a,i)};return $d(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return Pd([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return Pd([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=Fd();return this.options.ns?($d(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=Fd();$d(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||(Pd([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=Pd([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new pu(Cu());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 _u(e,t);return n.createInstance=_u.createInstance,n}cloneInstance(e={},t=ku){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new _u(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 iu(e,r),o.services.resourceStore=o.store}if(e.interpolation){const t={...Cu().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};o.services.interpolator=new bu(n)}return o.translator=new uu(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 Au=_u.createInstance();Au.createInstance,Au.dir,Au.init,Au.loadResources,Au.reloadResources,Au.use,Au.changeLanguage,Au.getFixedT,Au.t,Au.exists,Au.setDefaultNamespace,Au.hasLoadedNamespace,Au.loadNamespaces,Au.loadLanguages;Au.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 Ru={translator:{...Au,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 Au.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const{styled:Ou}=n,Tu=t,Du=e;const{translator:Nu}=Ru,Lu={"-webkit-touchCcallout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},ju=Ou("div")(()=>({width:"100%",cursor:"pointer"})),Iu=Ou("div")(()=>({margin:"0 auto",textAlign:"center",display:"flex"})),Mu=Ou("div")(()=>({width:"fit-content",minWidth:"140px",alignSelf:"center",verticalAlign:"middle",color:`var(--correct-answer-toggle-label-color, ${Jr()})`,fontWeight:"normal",...Lu})),Pu=Ou("div")(()=>({position:"absolute",width:"25px","&.enter":{opacity:"0"},"&.enter-active":{opacity:"1",transition:"opacity 0.3s ease-in"},"&.exit":{opacity:"1"},"&.exit-active":{opacity:"0",transition:"opacity 0.3s ease-in"}})),$u=Ou("div")(()=>({width:"25px",marginRight:"5px",display:"flex",alignItems:"center"}));class Fu extends Tu.Component{static __initStatic(){this.propTypes={onToggle:Du.func,toggled:Du.bool,show:Du.bool,hideMessage:Du.string,showMessage:Du.string,className:Du.string,language:Du.string}}static __initStatic2(){this.defaultProps={showMessage:"Show correct answer",hideMessage:"Hide correct answer",show:!1,toggled:!1}}constructor(e){super(e),this.state={show:e.show},this.openIconRef=Tu.createRef(),this.closedIconRef=Tu.createRef(),Fu.defaultProps={...Fu.defaultProps,showMessage:Nu.t("common:showCorrectAnswer",{lng:e.language}),hideMessage:Nu.t("common:hideCorrectAnswer",{lng:e.language})}}onClick(){this.props.onToggle(!this.props.toggled)}onTouch(e){e.preventDefault(),this.props.onToggle(!this.props.toggled)}UNSAFE_componentWillReceiveProps(e){this.setState({show:e.show}),e.language!==function(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}([this,"access",e=>e.props,"optionalAccess",e=>e.language])&&(Fu.defaultProps={...Fu.defaultProps,showMessage:Nu.t("common:showCorrectAnswer",{lng:e.language}),hideMessage:Nu.t("common:hideCorrectAnswer",{lng:e.language})})}render(){const{className:e,toggled:t,hideMessage:n,showMessage:r}=this.props;return Tu.createElement(ju,{className:e},Tu.createElement(Id,{show:this.state.show},Tu.createElement(Iu,{onClick:this.onClick.bind(this),onTouchEnd:this.onTouch.bind(this)},Tu.createElement($u,null,Tu.createElement(Tr,{nodeRef:this.openIconRef,timeout:400,in:t,exit:!t,classNames:{enter:"enter",enterActive:"enter-active",exit:"exit",exitActive:"exit-active"}},Tu.createElement(Pu,{ref:this.openIconRef},Tu.createElement(An,{open:t,key:"correct-open"}))),Tu.createElement(Tr,{nodeRef:this.closedIconRef,timeout:5e3,in:!t,exit:t,classNames:{enter:"enter",enterActive:"enter-active",exit:"exit",exitActive:"exit-active"}},Tu.createElement(Pu,{ref:this.closedIconRef},Tu.createElement(An,{open:t,key:"correct-closed"})))),Tu.createElement(li,{false:!0},Tu.createElement(Mu,{"aria-hidden":!this.state.show},t?n:r)))))}}Fu.__initStatic(),Fu.__initStatic2();const Bu=t,zu=e,{styled:Uu}=n,{Tooltip:Wu}=i,Hu=r,{mq:qu}=p,{HorizontalKeypad:Ku}=p,{updateSpans:Vu}=p,{registerEmbed:Yu}=p,{applyStaticMath:Ju}=p,{renderMath:Gu}=u;function Xu(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 Qu=Uu(Fo)({color:Jr(),backgroundColor:Zr(),display:"inline-block"}),Zu=Uu("div")({width:"100%",position:"relative",backgroundColor:Zr(),color:Jr()}),ep=Uu("div")(({theme:e})=>({marginBottom:e.spacing(2)})),tp=Uu("div")(({theme:e})=>({marginBottom:e.spacing(2)})),np=Uu("div")({position:"relative","& > div > div":{display:"flex",alignItems:"baseline",flexWrap:"wrap"},"& .mq-overarrow-inner":{border:"none !important",padding:"0 !important"},"& .mq-overarrow-inner-right":{display:"none !important"},"& .mq-overarrow-inner-left":{display:"none !important"},"& .mq-overarrow.mq-arrow-both":{minWidth:"1.23em","& *":{lineHeight:"1 !important"},"&:before":{top:"-0.4em",left:"-1px"},"&:after":{top:"-2.4em",right:"-1px"},"&.mq-empty:after":{top:"-0.45em"}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:"-0.4em",right:"-1px"}},"& .mq-longdiv-inner":{borderTop:"1px solid !important",paddingTop:"1.5px !important"},"& .mq-parallelogram":{lineHeight:.85}}),rp=Uu("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Xr()} !important`},...n&&{borderColor:`${Gr()} !important`},...r&&{border:"2px solid"},...o&&{padding:e.spacing(1),letterSpacing:"0.5px"},"& > .mq-math-mode":{"& > .mq-root-block":{"& > .mq-editable-field":{minWidth:"10px",padding:e.spacing(.25)}},"& sup":{top:0}}})),op=Uu(qu.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Jr()}}}),ip=Uu("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),sp=Uu("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),ap=Uu("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),lp=Uu("div")(({theme:e})=>({marginBottom:e.spacing(2)})),cp=Uu(Fu)(({theme:e})=>({color:Jr(),marginBottom:e.spacing(2)}));if("undefined"!=typeof document){const e="math-templated-main-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`\n .block-container {\n margin: 8px !important;\n display: inline-flex;\n border: 2px solid grey !important;\n }\n .block-response {\n flex: 2;\n color: grey;\n background: rgba(0, 0, 0, 0.04);\n font-size: 0.8rem !important;\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 2px solid #bdbdbd !important;\n }\n .block-math {\n color: ${Jr()};\n background-color: ${Zr()};\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 8;\n }\n .block-math > .mq-math-mode > .mq-hasCursor > .mq-cursor {\n display: none;\n }\n .correct {\n border-color: ${Gr()} !important;\n }\n .incorrect {\n border-color: ${Xr()} !important;\n }\n `,document.head.appendChild(t)}}let dp=!1;const up=/(\{\{\d+\}\})/gm,pp=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function hp(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function fp(e,t){const{responses:n,disabled:r,markup:o,printMode:i,alwaysShowCorrect:s}=e||{};if(o){if(t.showCorrect)return Object.keys(n||{}).reduce((e,t)=>(e[t]=Xu([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});const e=function(e){return e.split(up).filter(e=>e)}(o);return e.reduce((e,n)=>{if(n.match(up)){const o=mp.getResponseKey(n),a=t.session.answers[`r${o}`];if(i&&!s){const t="\\ \\ ".repeat(30)+"\\embed{newLine}[] ";return{...e,[o]:`\\MathQuillMathField[r${o}]{${t.repeat(3)}}`}}return r?{...e,[o]:`\\embed{answerBlock}[r${o}]`}:{...e,[o]:`\\MathQuillMathField[r${o}]{${a&&a.value||""}}`}}return e},{})}}const gp={name:"smartHorizontalPlacement",enabled:!0,phase:"main",requires:["popperOffsets"],fn:({state:e})=>{const t=e.modifiersData.popperOffsets;if(!t)return;const n=window.innerWidth||document.documentElement.clientWidth,r=e.rects.popper.width,o=e.elements.reference.getBoundingClientRect().left,i=Xu([e,"access",e=>e.elements,"access",e=>e.popper,"optionalAccess",e=>e.offsetParent]),s=Xu([i,"optionalAccess",e=>e.getBoundingClientRect,"optionalCall",e=>e()])||{left:0},a=Xu([i,"optionalAccess",e=>e.scrollLeft])||0,l=o-s.left+a,c=l-o,d=c+8,u=c+n-r-8;t.x=o+r<=n?l:l-r,t.x=u<d?d:Math.min(Math.max(t.x,d),u)}};class mp extends Bu.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:zu.object.isRequired,onSessionChange:zu.func,model:zu.object.isRequired}}constructor(e){super(e),mp.prototype.__init.call(this),mp.prototype.__init2.call(this),mp.prototype.__init3.call(this),mp.prototype.__init4.call(this),mp.prototype.__init5.call(this),mp.prototype.__init6.call(this),mp.prototype.__init7.call(this),mp.prototype.__init8.call(this),mp.prototype.__init9.call(this),mp.prototype.__init10.call(this),mp.prototype.__init11.call(this),mp.prototype.__init12.call(this),mp.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:s}=r||{};o&&(o||"").replace(up,e=>{const n=mp.getResponseKey(e),r=s&&s[`r${n}`];t[`r${n}`]={value:Xu([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:Bu.createRef()}}UNSAFE_componentWillMount(){"undefined"!=typeof window&&(dp||(Yu("answerBlock",e=>({htmlString:`<div class="block-container">\n <div class="block-response" id="${e}Index">R</div>\n <div class="block-math">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`})),dp=!0))}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:n}=this.state,r=t.answers;this.root&&e.disabled&&!n&&Object.keys(r).forEach(t=>{const n=this.root.querySelector(`#${t}`),o=this.root.querySelector(`#${t}Index`);if(n){const i=r[t];Ju(n,i&&i.value||""),e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),o.textContent="R"}}),Gu(this.root)}}UNSAFE_componentWillReceiveProps(e){const{model:t}=this.props,{model:n={}}=e||{},{markup:r="",env:o={}}=t||{},{markup:i="",env:s={},alwaysShowCorrect:a=!1}=n,l=e=>e&&"evaluate"===e.mode;l(o)&&l(s)||this.setState(e=>({...e.session,showCorrect:!1})),a&&this.setState({showCorrect:!0});const c=r.match(up),d=i.match(up);if(!en(c,d)){const e={},t=this.state.session.answers;(d||[]).forEach(n=>{const r=mp.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:Xu([o,"optionalAccess",e=>e.value])||""}}),this.setState(t=>({session:{...t.session,answers:e}}),()=>{this.props.onSessionChange(this.state.session),this.handleAnswerBlockDomUpdate()})}}shouldComponentUpdate(e,t){const n=en(this.props.model,e.model),r=en(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>Gu(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{const t=Array.from(Xu([this,"access",e=>e.root,"optionalAccess",e=>e.querySelectorAll,"call",e=>e(".mq-editable-field")])||[]).map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),n=()=>{t.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n})};this.setState({activeAnswerBlock:e},()=>{n(),requestAnimationFrame(n),setTimeout(n,0)})}}__init3(){this.toNodeData=e=>{if(!e)return;const{type:t,value:n}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===n?{type:"clear"}:{type:"write",value:n}}}__init4(){this.setInput=e=>{this.input=e}}__init5(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value);const n=[];let r=Xu([this,"access",e=>e.input,"optionalAccess",e=>e.el,"optionalCall",e=>e()])||this.root;for(;r&&r!==document.body&&r!==document.documentElement;){(r.scrollWidth>r.clientWidth||r.scrollHeight>r.clientHeight)&&n.push(r),r=r.parentElement}document.scrollingElement&&n.push(document.scrollingElement);const o=n.map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),i={x:window.scrollX,y:window.scrollY},s=()=>{o.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n}),window.scrollTo(i.x,i.y)};this.input.focus(),s(),requestAnimationFrame(s),setTimeout(s,0)}}__init6(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init7(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init8(){this.subFieldChanged=(e,t)=>{Vu(),e&&this.setState(n=>({session:{...n.session,answers:{...n.session.answers,[e]:{value:t}}}}),this.callOnSessionChange)}}__init9(){this.getFieldName=(e,t)=>{const{answers:n}=this.state.session;if(Object.keys(n||{}).length){return Object.keys(n).find(n=>{const r=t[n];return r&&r.id==e.id})}}}__init10(){this.onBlur=e=>{const{relatedTarget:t,currentTarget:n}=e||{};const r=function e(t,n=0){if(!t||n>=16)return null;const r=t.offsetParent;return r?"tooltip"===r.getAttribute("role")?r:e(r,n+1):null}(t),o=r?function e(t,n=0){if(!t||n>=4)return null;const r=Xu([t,"optionalAccess",e=>e.children,"optionalAccess",e=>e[0]]);return r?r.attributes&&r.attributes["data-keypad"]?r:e(r,n+1):null}(r):null;t&&n&&Xu([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&pp){const e=document.querySelector("[role='tooltip']");if(e){e.firstChild.setAttribute("tabindex","-1")}}},1)}__init11(){this.renderTeacherInstructions=()=>{const{model:e}=this.props,{teacherInstructions:t,animationsDisabled:n}=e||{},r=t&&(ui(t)||hi(t)),o=Bu.createElement(ii,{defaultClassName:"teacher-instructions",prompt:t});return r&&Bu.createElement(tp,null,n?o:Bu.createElement(Ro,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=Bu.createElement(ii,{prompt:t});return t&&(ui(t)||hi(t))&&Bu.createElement(tp,null,n?r:Bu.createElement(Ro,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},r))}}__init13(){this.renderPlayerContent=()=>{const{model:e}=this.props,{activeAnswerBlock:t,showCorrect:n,session:r,tooltipContainerRef:o}=this.state,{correctness:i,disabled:s,view:a,responses:l,equationEditor:c,customKeys:d,feedback:u,env:{mode:p}={},printMode:h,alwaysShowCorrect:f}=e||{},g=Zt(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(d),v=fp(e,this.state)||"",b=h&&!f;return Bu.createElement(np,null,Bu.createElement(sd,{disabled:s,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&u&&u[e],d=Bu.createElement(op,{ref:e=>{this.mqStatic=e||this.mqStatic},latex:v[e],onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur});return Bu.createElement(rp,{ref:o,$incorrect:!g&&!l&&!n,$correct:!g&&(l||n),$showCorrectness:!g&&s&&i&&!a,$correctAnswerShown:n},Bu.createElement(Wu,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:Xu([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-start",sx:{backgroundColor:"transparent",width:"auto",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:[{name:"preventOverflow",enabled:!1},{name:"flip",enabled:!1},gp]},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"auto",maxWidth:"none",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||s)&&Bu.createElement(ip,{"data-keypad":!0,key:e,style:{width:hp(m,c)}},Bu.createElement(Ku,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?Bu.createElement(sp,null,d):Bu.createElement("div",null,d)))}}))}}render(){const{model:e}=this.props,{showCorrect:t}=this.state,{prompt:n,env:{mode:r,role:o}={},extraCSSRules:i,correctness:s,responses:a,language:l,showNote:c,note:d}=e||{},u=!Zt(a)&&s&&"correct"!==s.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&d;return Bu.createElement(Qu,{extraCSSRules:i,ref:e=>{const t=Hu.findDOMNode(e);this.root=t||this.root}},Bu.createElement(Zu,null,"gather"===r&&Bu.createElement(ap,null,"Math Equation Response Question"),Bu.createElement(Zu,null,u&&Bu.createElement(cp,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&Bu.createElement(ep,null,Bu.createElement(ii,{prompt:n})),Bu.createElement(li,{false:!0},this.renderPlayerContent()),p&&Bu.createElement(lp,{className:"note",dangerouslySetInnerHTML:{__html:d}}),this.renderRationale()))}}mp.__initStatic(),mp.__initStatic2();const vp=t,{createRoot:bp}=d,yp=s,{renderMath:xp}=u,Ep=yp("pie-element:math-templated:print");class wp extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Xt(()=>{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.showTeacherInstructions=n,e.alwaysShowCorrect=n,e.printMode=!0,e.feedback=void 0,e.markup=e.markup||"{{0}}",{...e,disabled:!0,env:{mode:n?"evaluate":e.mode,role:t.role}}})(this._model,this._options),t=this._options&&vp.createElement(mp,{model:e,session:{}});this._root||(this._root=bp(this)),this._root.render(t),queueMicrotask(()=>{Ep("render complete - render math"),xp(this)})}else Ep("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{wp as default};
1
+ import{_dll_debug as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material_styles as r,_dll_react_dom as o,_dll_mui__material as i,_dll_pie_lib__render_ui as a,_dll_mui__material_colors as s,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as u,_dll_react_dom_client as d}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";import{_dll_pie_lib__math_rendering as p}from"../../../@pie-lib/math-rendering-module@^5.0.4/module/index.js";import{_dll_pie_lib__math_input as h}from"../../../@pie-lib/math-edit-module@^4.1.1/module/index.js";import{_dll_pie_lib__drag as f}from"../../../@pie-lib/drag-module@^4.0.4/module/index.js";var g="object"==typeof global&&global&&global.Object===Object&&global,m="object"==typeof self&&self&&self.Object===Object&&self,v=g||m||Function("return this")(),b=v.Symbol,y=Object.prototype,w=y.hasOwnProperty,x=y.toString,_=b?b.toStringTag:void 0;var C=Object.prototype.toString;var E=b?b.toStringTag:void 0;function k(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?function(e){var t=w.call(e,_),n=e[_];try{e[_]=void 0;var r=!0}catch(e){}var o=x.call(e);return r&&(t?e[_]=n:delete e[_]),o}(e):function(e){return C.call(e)}(e)}function S(e){return null!=e&&"object"==typeof e}function A(e){return"symbol"==typeof e||S(e)&&"[object Symbol]"==k(e)}var R=Array.isArray,D=b?b.prototype:void 0,j=D?D.toString:void 0;function O(e){if("string"==typeof e)return e;if(R(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,O)+"";if(A(e))return j?j.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var T=/\s/;var M=/^\s+/;function N(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&T.test(e.charAt(t)););return t}(e)+1).replace(M,""):e}function I(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var $=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,W=/^0o[0-7]+$/i,P=parseInt;function B(e){if("number"==typeof e)return e;if(A(e))return NaN;if(I(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=I(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=N(e);var n=L.test(e);return n||W.test(e)?P(e.slice(2),n?2:8):$.test(e)?NaN:+e}function z(e){return e}function F(e){if(!I(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var H,q=v["__core-js_shared__"],U=(H=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var K=Function.prototype.toString;function V(e){if(null!=e){try{return K.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Y=/^\[object .+?Constructor\]$/,X=Function.prototype,J=Object.prototype,Q=X.toString,G=J.hasOwnProperty,Z=RegExp("^"+Q.call(G).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ee(e){return!(!I(e)||(t=e,U&&U in t))&&(F(e)?Z:Y).test(V(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)&&!F(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 S(e)&&"[object Arguments]"==k(e)}var de=Object.prototype,pe=de.hasOwnProperty,he=de.propertyIsEnumerable,fe=ue(function(){return arguments}())?ue:function(e){return S(e)&&pe.call(e,"callee")&&!he.call(e,"callee")};var ge="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=ge&&"object"==typeof module&&module&&!module.nodeType&&module,ve=me&&me.exports===ge?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 we,xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,_e=xe&&"object"==typeof module&&module&&!module.nodeType&&module,Ce=_e&&_e.exports===xe&&g.process,Ee=function(){try{var e=_e&&_e.require&&_e.require("util").types;return e||Ce&&Ce.binding&&Ce.binding("util")}catch(e){}}(),ke=Ee&&Ee.isTypedArray,Se=ke?(we=ke,function(e){return we(e)}):function(e){return S(e)&&ae(e.length)&&!!ye[k(e)]},Ae=Object.prototype.hasOwnProperty;function Re(e,t){var n=R(e),r=!n&&fe(e),o=!n&&!r&&be(e),i=!n&&!r&&!o&&Se(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&&!Ae.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 De=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),je=De,Oe=Object.prototype.hasOwnProperty;function Te(e){if(!ce(e))return je(e);var t=[];for(var n in Object(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Me(e){return se(e)?Re(e):Te(e)}var Ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/;function $e(e,t){if(R(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!A(e))||(Ie.test(e)||!Ne.test(e)||null!=t&&e in Object(t))}var Le=te(Object,"create");var We=Object.prototype.hasOwnProperty;var Pe=Object.prototype.hasOwnProperty;function Be(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 ze(e,t){for(var n=e.length;n--;)if(ie(e[n][0],t))return n;return-1}Be.prototype.clear=function(){this.__data__=Le?Le(null):{},this.size=0},Be.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Be.prototype.get=function(e){var t=this.__data__;if(Le){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return We.call(t,e)?t[e]:void 0},Be.prototype.has=function(e){var t=this.__data__;return Le?void 0!==t[e]:Pe.call(t,e)},Be.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Le&&void 0===t?"__lodash_hash_undefined__":t,this};var Fe=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=ze(t,e);return!(n<0)&&(n==t.length-1?t.pop():Fe.call(t,n,1),--this.size,!0)},He.prototype.get=function(e){var t=this.__data__,n=ze(t,e);return n<0?void 0:t[n][1]},He.prototype.has=function(e){return ze(this.__data__,e)>-1},He.prototype.set=function(e,t){var n=this.__data__,r=ze(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var qe=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 Be,map:new(qe||He),string:new Be}},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 Ve(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(Ve.Cache||Ke),n}Ve.Cache=Ke;var Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/\\(\\)?/g,Je=function(e){var t=Ve(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(Xe,"$1"):n||e)}),t}),Qe=Je;function Ge(e,t){return R(e)?e:$e(e,t)?[e]:Qe(function(e){return null==e?"":O(e)}(e))}function Ze(e){if("string"==typeof e||A(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(!qe||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 R(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,Me,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]",ft="[object DataView]",gt=V(st),mt=V(qe),vt=V(lt),bt=V(ct),yt=V(ne),wt=k;(st&&wt(new st(new ArrayBuffer(1)))!=ft||qe&&wt(new qe)!=ut||lt&&wt(lt.resolve())!=dt||ct&&wt(new ct)!=pt||ne&&wt(new ne)!=ht)&&(wt=function(e){var t=k(e),n="[object Object]"==t?e.constructor:void 0,r=n?V(n):"";if(r)switch(r){case gt:return ft;case mt:return ut;case vt:return dt;case bt:return pt;case yt:return ht}return t});var xt=wt,_t=v.Uint8Array;function Ct(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ke;++t<n;)this.add(e[t])}function Et(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 kt(e,t){return e.has(t)}Ct.prototype.add=Ct.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ct.prototype.has=function(e){return this.__data__.has(e)};function St(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 Ct:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var f=e[d],g=t[d];if(r)var m=a?r(g,f,d,t,e,i):r(f,g,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Et(t,function(e,t){if(!kt(h,t)&&(f===e||o(f,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(f!==g&&!o(f,g,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function At(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Rt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Dt=b?b.prototype:void 0,jt=Dt?Dt.valueOf:void 0;var Ot=Object.prototype.hasOwnProperty;var Tt="[object Arguments]",Mt="[object Array]",Nt="[object Object]",It=Object.prototype.hasOwnProperty;function $t(e,t,n,r,o,i){var a=R(e),s=R(t),l=a?Mt:xt(e),c=s?Mt:xt(t),u=(l=l==Tt?Nt:l)==Nt,d=(c=c==Tt?Nt:c)==Nt,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||Se(e)?St(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 _t(e),new _t(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=At;case"[object Set]":var l=1&r;if(s||(s=Rt),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=St(s(e),s(t),r,o,i,a);return a.delete(e),u;case"[object Symbol]":if(jt)return jt.call(e)==jt.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=u&&It.call(e,"__wrapped__"),f=d&&It.call(t,"__wrapped__");if(h||f){var g=h?e.value():e,m=f?t.value():t;return i||(i=new nt),o(g,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:Ot.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 f=a;++c<l;){var g=e[u=s[c]],m=t[u];if(r)var v=a?r(m,g,u,t,e,i):r(g,m,u,e,t,i);if(!(void 0===v?g===m||o(g,m,n,r,i):v)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){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 Lt(e,t,n,r,o){return e===t||(null==e||null==t||!S(e)&&!S(t)?e!=e&&t!=t:$t(e,t,n,r,Lt,o))}function Wt(e){return e==e&&!I(e)}function Pt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Bt(e){var t=function(e){for(var t=Me(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Wt(o)]}return t}(e);return 1==t.length&&t[0][2]?Pt(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?Lt(u,c,3,r,d):p))return!1}}return!0}(n,e,t)}}function zt(e,t){return null!=e&&t in Object(e)}function Ft(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)&&(R(e)||fe(e))}(e,t,zt)}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 qt(e){return"function"==typeof e?e:null==e?z:"object"==typeof e?R(e)?(t=e[0],n=e[1],$e(t)&&Wt(n)?Pt(Ze(t),n):function(e){var r=tt(e,t);return void 0===r&&r===n?Ft(e,t):Lt(n,r,3)}):Bt(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},Vt=Kt;function Yt(e,t){return e&&Vt(e,t,Me)}var Xt=function(){return v.Date.now()},Jt=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 f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function g(){var e=Xt();if(f(e))return m(e);s=setTimeout(g,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=Xt(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?h(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=B(t)||0,I(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Jt(B(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(Xt())},v}var Zt=Object.prototype.hasOwnProperty;function en(e){if(null==e)return!0;if(se(e)&&(R(e)||"string"==typeof e||"function"==typeof e.splice||be(e)||Se(e)||fe(e)))return!e.length;var t=xt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ce(e))return!Te(e).length;for(var n in e)if(Zt.call(e,n))return!1;return!0}function tn(e,t){return Lt(e,t)}var nn,rn,on,an={"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},sn={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},ln=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},cn=ln,un=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,dn="undefined"==typeof document?{}:document.documentElement.style,pn=(nn=function(){for(var e in dn)if(un.test(e))return e.match(un)[0];return"WebkitOpacity"in dn?"Webkit":"KhtmlOpacity"in dn?"Khtml":""}(),rn=nn.toLowerCase(),{style:nn,css:"-"+rn+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[nn]||cn(nn)}),hn=function(e,t){return t?t.toUpperCase():""},fn=/[-\s]+(.)?/g,gn=function(e){return e?e.replace(fn,hn):""},mn=/::/g,vn=/([A-Z]+)([A-Z][a-z])/g,bn=/([a-z\d])([A-Z])/g,yn=/_/g,wn=function(e,t){return e?e.replace(mn,"/").replace(vn,"$1_$2").replace(bn,"$1_$2").replace(yn,t||"-"):""},xn=function(e){return wn(e).toLowerCase()},_n=gn,Cn=xn,En=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},kn=ln,Sn=pn,An=an,Rn="undefined"==typeof document?{}:document.documentElement.style,Dn=function(e,t){t=t||{};var n=En(_n(e)),r=Cn(e),o=on?n:r,i=Sn.style?on?Sn.style:Sn.css:"";if(n in Rn)return t.asString?o:[o];var a=o,s=An[r],l=[];if(on&&(a=kn(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return on?En(_n(e)):Cn(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},jn=Object.prototype.hasOwnProperty,On=function(e,t){return jn.call(e,t)},Tn=Object.prototype.toString,Mn=Object.prototype.toString,Nn=Dn,In=xn,$n=gn,Ln=On,Wn=function(e){return!!e&&"[object Object]"===Tn.call(e)},Pn=function(e){return"[object Function]"===Mn.apply(e)},Bn=function(e,t,n,r){Nn(t).forEach(function(t){e[r?r(t):t]=n})},zn={cssUnitless:sn},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,f=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},g=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?$n:In;for(a in e)if(Ln(e,a)){if(s=e[a],i=In(n?n+a:a),o=!1,d=!1,Pn(s)&&(u=s.call(p||e,s,a,i,e),Wn(u)&&null!=u.value?(s=u.value,d=u.prefix,i=u.name?In(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 f)?s+g: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?Bn(r,e,s,v):r[v(e)]=s});continue}d?Bn(r,i,s,v):r[v(i)]=s}else Fn(s,t,i+"-",r)}return r},Hn=Fn,qn=On,Un={prefixProperties:an,cssUnitless:sn,object:Fn,string:function(e,t){e=Hn(e,t);var n,r=[];for(n in e)qn(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Kn=e("@pie-lib:mask-markup:serialization"),Vn=["span"],Yn=["em","strong","u"],Xn=(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),Un.object(r,{camelize:!0,addUnits:!1});var r},Jn=["border","class","style"],Qn={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},Gn=(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=Qn[r];if(o){Kn("[deserialize] mark: ",o);return{_flatten:!0,nodes:Zn(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=Jn.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=Xn(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=>Vn.includes(e)?"inline":Yn.includes(e)?"mark":"block")(r),l=Zn(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},Zn=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=Gn(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},er=t,tr=n,{styled:nr}=r,{renderMath:rr}=p;const or=nr("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),ir=nr("span")(()=>({display:"inline-block",width:".75em"})),ar=["tbody","tr"],sr=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,i)=>{const s=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return a.push(er.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const o=r(e,t,n);if(o){const t="blank"===function(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}([e,"access",e=>e.data,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.component]);return t&&a.push(er.createElement(ir,{key:`spacer-${i}`})),a.push(o),void(t&&a.push(er.createElement(ir,{key:`spacer-${i}`})))}}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&&ar.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 Qn)if(Qn[e]===n.type){const n=e;a.push(er.createElement(n,{key:s},t));break}}else t.length>0&&a.push(t)}else{const o=sr(e,t,n,r,e);if("p"===e.type||"paragraph"===e.type)a.push(er.createElement(or,{key:s},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(er.createElement(t,{key:s,...e.data.attributes},o)):a.push(er.createElement(t,{key:s,...e.data.attributes}))}}}),a},lr=nr("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class cr extends er.Component{constructor(e){super(e),cr.prototype.__init.call(this),this.internalContainerRef=er.createRef()}static __initStatic(){this.propTypes={renderChildren:tr.func,layout:tr.object,value:tr.object,onChange:tr.func,elementType:tr.string,containerRef:tr.oneOfType([tr.func,tr.shape({current:tr.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof rr&&rr(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=sr(t,e,this.handleChange,this.props.renderChildren,null),i=r||this.internalContainerRef;return er.createElement(lr,{ref:i},o)}}cr.__initStatic();const ur=/\{\{(\d+)\}\}/g;const dr=t,pr=n;var hr;const fr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(ur,(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=Zn(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)=>((hr=class extends dr.Component{static __initStatic(){this.propTypes={markup:pr.string,layout:pr.object,value:pr.object,onChange:pr.func,customMarkMarkupComponent:pr.func,elementType:pr.string}}constructor(e){super(e),this.containerRef=dr.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||fr(n,e);return dr.createElement(cr,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),hr),{useMemo:mr}=t,{useLayoutEffect:vr}=t,{useEffect:br}=t,{useRef:yr}=t,{useCallback:wr}=t,xr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function _r(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Cr(e){return"nodeType"in e}function Er(e){var t,n;return e?_r(e)?e:Cr(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function kr(e){const{Document:t}=Er(e);return e instanceof t}function Sr(e){return!_r(e)&&e instanceof Er(e).HTMLElement}function Ar(e){return e instanceof Er(e).SVGElement}function Rr(e){return e?_r(e)?e.document:Cr(e)?kr(e)?e:Sr(e)||Ar(e)?e.ownerDocument:document:document:document}const Dr=xr?vr:br;function jr(e){const t=yr(e);return Dr(()=>{t.current=e}),wr(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 Or(e,t){void 0===t&&(t=[e]);const n=yr(e);return Dr(()=>{n.current!==e&&(n.current=e)},t),n}function Tr(e,t){const n=yr();return mr(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Mr(e){const t=jr(e),n=yr(null),r=wr(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Nr(e){const t=yr();return br(()=>{t.current=e},[e]),t.current}let Ir={};function $r(e,t){return mr(()=>{if(t)return t;const n=null==Ir[e]?0:Ir[e]+1;return Ir[e]=n,e+"-"+n},[e,t])}function Lr(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 Wr=Lr(1),Pr=Lr(-1);function Br(e){if(!e)return!1;const{KeyboardEvent:t}=Er(e.target);return t&&e instanceof t}function zr(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Er(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 Fr=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[Fr.Translate.toString(e),Fr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Hr="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qr(e){return e.matches(Hr)?e:e.querySelector(Hr)}const Ur=t,{useState:Kr}=t,{useCallback:Vr}=t,Yr={display:"none"};function Xr(e){let{id:t,value:n}=e;return Ur.createElement("div",{id:t,style:Yr},n)}function Jr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Ur.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 Qr=t,{createContext:Gr}=t,{useContext:Zr}=t,{useEffect:eo}=t,{useState:to}=t,{useCallback:no}=t,{useMemo:ro}=t,{useRef:oo}=t,{memo:io}=t,{useReducer:ao}=t,{cloneElement:so}=t,{forwardRef:lo}=t,{createPortal:co}=o,{unstable_batchedUpdates:uo}=o,po=Gr(null);const ho={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 "},fo={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=fo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ho}=e;const{announce:i,announcement:a}=function(){const[e,t]=Kr("");return{announce:Vr(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=$r("DndLiveRegion"),[l,c]=to(!1);if(eo(()=>{c(!0)},[]),function(e){const t=Zr(po);eo(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(ro(()=>({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=Qr.createElement(Qr.Fragment,null,Qr.createElement(Xr,{id:r,value:o.draggable}),Qr.createElement(Jr,{id:s,announcement:a}));return n?co(u,n):u}var mo;function vo(){}!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"}(mo||(mo={}));const bo=Object.freeze({x:0,y:0});function yo(e,t){const n=zr(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function wo(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 _o=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(wo)};function Co(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:bo}const Eo=(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 So(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 Ao={ignoreTransform:!1};function Ro(e,t){void 0===t&&(t=Ao);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Er(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=So(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 Do(e){return Ro(e,{ignoreTransform:!0})}function jo(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(!Sr(o)||Ar(o))return n;if(n.includes(o))return n;const i=Er(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Er(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=Er(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Oo(e){const[t]=jo(e,1);return null!=t?t:null}function To(e){return xr&&e?_r(e)?e:Cr(e)?kr(e)||e===Rr(e).scrollingElement?window:Sr(e)?e:null:null:null}function Mo(e){return _r(e)?e.scrollX:e.scrollLeft}function No(e){return _r(e)?e.scrollY:e.scrollTop}function Io(e){return{x:Mo(e),y:No(e)}}var $o;function Lo(e){return!(!xr||!e)&&e===document.scrollingElement}function Wo(e){const t={x:0,y:0},n=Lo(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"}($o||($o={}));const Po={x:.2,y:.2};function Bo(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=Po);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=Wo(e),h={x:0,y:0},f={x:0,y:0},g=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+g?(h.y=$o.Backward,f.y=r*Math.abs((t.top+g-i)/g)):!u&&l>=t.bottom-g&&(h.y=$o.Forward,f.y=r*Math.abs((t.bottom-g-l)/g)),!p&&s>=t.right-m?(h.x=$o.Forward,f.x=r*Math.abs((t.right-m-s)/m)):!d&&a<=t.left+m&&(h.x=$o.Backward,f.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:f}}function zo(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 Fo(e){return e.reduce((e,t)=>Wr(e,Io(t)),bo)}function Ho(e,t){if(void 0===t&&(t=Ro),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Oo(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const qo=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Mo(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+No(t),0)}]];class Uo{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=jo(t),r=Fo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of qo)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 Ko{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 Vo(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 Yo,Xo;function Jo(e){e.preventDefault()}function Qo(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"}(Yo||(Yo={})),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"}(Xo||(Xo={}));const Go={start:[Xo.Space,Xo.Enter],cancel:[Xo.Esc],end:[Xo.Space,Xo.Enter,Xo.Tab]},Zo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xo.Right:return{...n,x:n.x+25};case Xo.Left:return{...n,x:n.x-25};case Xo.Down:return{...n,y:n.y+25};case Xo.Up:return{...n,y:n.y-25}}};class ei{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 Ko(Rr(t)),this.windowListeners=new Ko(Er(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Yo.Resize,this.handleCancel),this.windowListeners.add(Yo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Yo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Ho(n),t(bo)}handleKeyDown(e){if(Br(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Go,coordinateGetter:i=Zo,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}:bo;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=Pr(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}=Wo(n),h=zo(n),f={x:Math.min(o===Xo.Right?h.right-h.width/2:h.right,Math.max(o===Xo.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(o===Xo.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Xo.Down?h.top:h.top+h.height/2,u.y))},g=o===Xo.Right&&!s||o===Xo.Left&&!l,m=o===Xo.Down&&!c||o===Xo.Up&&!i;if(g&&f.x!==u.x){const e=n.scrollLeft+t.x,i=o===Xo.Right&&e<=d.x||o===Xo.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Xo.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&f.y!==u.y){const e=n.scrollTop+t.y,i=o===Xo.Down&&e<=d.y||o===Xo.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Xo.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Wr(Pr(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 ti(e){return Boolean(e&&"distance"in e)}function ni(e){return Boolean(e&&"delay"in e)}ei.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Go,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 ri{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Er(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 Ko(this.document),this.listeners=new Ko(n),this.windowListeners=new Ko(Er(i)),this.initialCoordinates=null!=(r=zr(o))?r:bo,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(Yo.Resize,this.handleCancel),this.windowListeners.add(Yo.DragStart,Jo),this.windowListeners.add(Yo.VisibilityChange,this.handleCancel),this.windowListeners.add(Yo.ContextMenu,Jo),this.documentListeners.add(Yo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ni(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ti(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(Yo.Click,Qo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Yo.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=zr(e))?t:bo,l=Pr(r,s);if(!n&&a){if(ti(a)){if(null!=a.tolerance&&Vo(l,a.tolerance))return this.handleCancel();if(Vo(l,a.distance))return this.handleStart()}return ni(a)&&Vo(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===Xo.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const oi={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ii extends ri{constructor(e){const{event:t}=e,n=Rr(t.target);super(e,oi,n)}}ii.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 ai={move:{name:"mousemove"},end:{name:"mouseup"}};var si;!function(e){e[e.RightClick=2]="RightClick"}(si||(si={}));(class extends ri{constructor(e){super(e,ai,Rr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==si.RightClick&&(null==r||r({event:n}),!0)}}];const li={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var ci,ui;function di(e){let{acceleration:t,activator:n=ci.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=ui.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 Tr(e=>{if(n||!r||!e)return pi;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[$o.Backward]:e.x[$o.Backward]||-1===o.x,[$o.Forward]:e.x[$o.Forward]||1===o.x},y:{[$o.Backward]:e.y[$o.Backward]||-1===o.y,[$o.Forward]:e.y[$o.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!i}),[f,g]=function(){const e=yr(null);return[wr((t,n)=>{e.current=setInterval(t,n)},[]),wr(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=oo({x:0,y:0}),v=oo({x:0,y:0}),b=ro(()=>{switch(n){case ci.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ci.DraggableRect:return o}},[n,o,l]),y=oo(null),w=no(()=>{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)},[]),x=ro(()=>s===ui.TreeOrder?[...c].reverse():c,[s,c]);eo(()=>{if(i&&c.length&&b){for(const e of x){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}=Bo(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 g(),y.current=e,f(w,a),m.current=s,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,w,r,g,i,a,JSON.stringify(b),JSON.stringify(h),f,c,x,u,JSON.stringify(p)])}(class extends ri{constructor(e){super(e,li)}static setup(){return window.addEventListener(li.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(li.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"}(ci||(ci={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ui||(ui={}));const pi={x:{[$o.Backward]:!1,[$o.Forward]:!1},y:{[$o.Backward]:!1,[$o.Forward]:!1}};var hi,fi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(hi||(hi={})),function(e){e.Optimized="optimized"}(fi||(fi={}));const gi=new Map;function mi(e,t){return Tr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function vi(e){let{callback:t,disabled:n}=e;const r=jr(t),o=ro(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return eo(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function bi(e){return new Uo(Ro(e),e)}function yi(e,t,n){void 0===t&&(t=bi);const[r,o]=to(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=jr(t),o=ro(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return eo(()=>()=>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=vi({callback:i});return Dr(()=>{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 wi=[];function xi(e,t){void 0===t&&(t=[]);const n=oo(null);return eo(()=>{n.current=null},t),eo(()=>{const t=e!==bo;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Pr(e,n.current):bo}function _i(e){return ro(()=>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 Ei(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Sr(t)?t:e}const ki=[{sensor:ii,options:{}},{sensor:ei,options:{}}],Si={current:{}},Ai={draggable:{measure:Do},droppable:{measure:Do,strategy:hi.WhileDragging,frequency:fi.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 Di={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:vo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ai,measureDroppableContainers:vo,windowRect:null,measuringScheduled:!1},ji={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:vo,draggableNodes:new Map,over:null,measureDroppableContainers:vo},Oi=Gr(ji),Ti=Gr(Di);function Mi(){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 mo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case mo.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 mo.DragEnd:case mo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case mo.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 mo.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 mo.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 Ii(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=Zr(Oi),i=Nr(r),a=Nr(null==n?void 0:n.id);return eo(()=>{if(!t&&!r&&i&&null!=a){if(!Br(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=qr(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function $i(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Li=Gr({...bo,scaleX:1,scaleY:1});var Wi;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Wi||(Wi={})),io(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=ki,collisionDetection:u=_o,measuring:d,modifiers:p,...h}=e;const f=ao(Ni,void 0,Mi),[g,m]=f,[v,b]=function(){const[e]=to(()=>new Set),t=no(t=>(e.add(t),()=>e.delete(t)),[e]);return[no(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,w]=to(Wi.Uninitialized),x=y===Wi.Initialized,{draggable:{active:_,nodes:C,translate:E},droppable:{containers:k}}=g,S=null!=_?C.get(_):null,A=oo({initial:null,translated:null}),R=ro(()=>{var e;return null!=_?{id:_,data:null!=(e=null==S?void 0:S.data)?e:Si,rect:A}:null},[_,S]),D=oo(null),[j,O]=to(null),[T,M]=to(null),N=Or(h,Object.values(h)),I=$r("DndDescribedBy",i),$=ro(()=>k.getEnabled(),[k]),L=ro(()=>({draggable:{...Ai.draggable,...null==W?void 0:W.draggable},droppable:{...Ai.droppable,...null==W?void 0:W.droppable},dragOverlay:{...Ai.dragOverlay,...null==W?void 0:W.dragOverlay}}),[null==(W=d)?void 0:W.draggable,null==W?void 0:W.droppable,null==W?void 0:W.dragOverlay]);var W;const{droppableRects:P,measureDroppableContainers:B,measuringScheduled:z}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=to(null),{frequency:s,measure:l,strategy:c}=o,u=oo(e),d=function(){switch(c){case hi.Always:return!1;case hi.BeforeDragging:return n;default:return!n}}(),p=Or(d),h=no(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),f=oo(null),g=Tr(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 Uo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,l]);return eo(()=>{u.current=e},[e]),eo(()=>{d||h()},[n,d]),eo(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),eo(()=>{d||"number"!=typeof s||null!==f.current||(f.current=setTimeout(()=>{h(),f.current=null},s))},[s,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}($,{dragging:x,dependencies:[E.x,E.y],config:L.droppable}),F=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Tr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,_),H=ro(()=>T?zr(T):null,[T]),q=function(){const e=!1===(null==j?void 0:j.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=x&&!e&&!t;if("object"==typeof s)return{...s,enabled:n};return{enabled:n}}(),U=function(e,t){return mi(e,t)}(F,L.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=oo(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;Dr(()=>{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=Oo(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=_?C.get(_):null,config:q.layoutShiftCompensation,initialRect:U,measure:L.draggable.measure});const K=yi(F,L.draggable.measure,U),V=yi(F?F.parentElement:null),Y=oo({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=k.getNodeFor(null==(t=Y.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=to(null),o=vi({callback:no(e=>{for(const{target:n}of e)if(Sr(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=no(e=>{const n=Ei(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Mr(i);return ro(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:L.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:F,G=x?null!=(r=J.rect)?r:K:null,Z=Boolean(J.nodeRef.current&&J.rect),ee=Co(te=Z?null:K,mi(te));var te;const ne=_i(Q?Er(Q):null),re=function(e){const t=oo(e),n=Tr(n=>e?n&&n!==wi&&e&&t.current&&e.parentNode===t.current.parentNode?n:jo(e):wi,[e]);return eo(()=>{t.current=e},[e]),n}(x?null!=X?X:F:null),oe=function(e,t){void 0===t&&(t=Ro);const[n]=e,r=_i(n?Er(n):null),[o,i]=to(Ci);function a(){i(()=>e.length?e.map(e=>Lo(e)?r:new Uo(t(e),e)):Ci)}const s=vi({callback:a});return Dr(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=$i(p,{transform:{x:E.x-ee.x,y:E.y-ee.y,scaleX:1,scaleY:1},activatorEvent:T,active:R,activeNodeRect:K,containerNodeRect:V,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:J.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=H?Wr(H,E):null,se=function(e){const[t,n]=to(null),r=oo(e),o=no(e=>{const t=To(e.target);t&&n(e=>e?(e.set(t,Io(t)),new Map(e)):null)},[]);return eo(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=To(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Io(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=To(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),ro(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Wr(e,t),bo):Fo(e):bo,[e,t])}(re),le=xi(se),ce=xi(se,[K]),ue=Wr(ie,le),de=G?Eo(G,ie):null,pe=R&&de?u({active:R,collisionRect:de,droppableRects:P,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"),[fe,ge]=to(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:Wr(ie,ce),null!=(o=null==fe?void 0:fe.rect)?o:null,K),ve=oo(null),be=no((e,t)=>{let{sensor:n,options:r}=t;if(null==D.current)return;const o=C.get(D.current);if(!o)return;const i=e.nativeEvent,a=new n({active:D.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!C.get(e))return;const{onDragAbort:t}=N.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!C.get(e))return;const{onDragPending:o}=N.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=D.current;if(null==t)return;const n=C.get(t);if(!n)return;const{onDragStart:r}=N.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:A}};uo(()=>{null==r||r(o),w(Wi.Initializing),m({type:mo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),O(ve.current),M(i)})},onMove(e){m({type:mo.DragMove,coordinates:e})},onEnd:s(mo.DragEnd),onCancel:s(mo.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}=N.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===mo.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=mo.DragCancel)}}D.current=null,uo(()=>{m({type:e}),w(Wi.Uninitialized),ge(null),O(null),M(null),ve.current=null;const t=e===mo.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=N.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[C]),ye=no((e,t)=>(n,r)=>{const o=n.nativeEvent,i=C.get(r);if(null!==D.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},D.current=r,be(n,t))},[C,be]),we=function(e,t){return ro(()=>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){eo(()=>{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),Dr(()=>{K&&y===Wi.Initializing&&w(Wi.Initialized)},[K,y]),eo(()=>{const{onDragMove:e}=N.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};uo(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ue.x,ue.y]),eo(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==D.current||!t||!o)return;const{onDragOver:i}=N.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};uo(()=>{ge(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),Dr(()=>{Y.current={activatorEvent:T,active:R,activeNode:F,collisionRect:de,collisions:pe,droppableRects:P,draggableNodes:C,draggingNode:Q,draggingNodeRect:G,droppableContainers:k,over:fe,scrollableAncestors:re,scrollAdjustedTranslate:ue},A.current={initial:G,translated:de}},[R,F,pe,de,C,Q,G,P,k,fe,re,ue]),di({...q,delta:E,draggingRect:de,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const xe=ro(()=>({active:R,activeNode:F,activeNodeRect:K,activatorEvent:T,collisions:pe,containerNodeRect:V,dragOverlay:J,draggableNodes:C,droppableContainers:k,droppableRects:P,over:fe,measureDroppableContainers:B,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:L,measuringScheduled:z,windowRect:ne}),[R,F,K,T,pe,V,J,C,k,P,fe,B,re,oe,L,z,ne]),_e=ro(()=>({activatorEvent:T,activators:we,active:R,activeNodeRect:K,ariaDescribedById:{draggable:I},dispatch:m,draggableNodes:C,over:fe,measureDroppableContainers:B}),[T,we,R,K,m,I,C,fe,B]);return Qr.createElement(po.Provider,{value:b},Qr.createElement(Oi.Provider,{value:_e},Qr.createElement(Ti.Provider,{value:xe},Qr.createElement(Li.Provider,{value:me},l)),Qr.createElement(Ii,{disabled:!1===(null==a?void 0:a.restoreFocus)})),Qr.createElement(go,{...a,hiddenTextDescribedById:I}))});const Pi=Gr(null),Bi="button";function zi(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$r("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=Zr(Oi),{role:h=Bi,roleDescription:f="draggable",tabIndex:g=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=Zr(m?Li:Pi),[b,y]=Mr(),[w,x]=Mr(),_=function(e,t){return ro(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),C=Or(n);Dr(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:w,data:C}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:ro(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!m||h!==Bi)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[r,h,g,m,f,u.draggable]),isDragging:m,listeners:r?void 0:_,node:b,over:p,setNodeRef:y,setActivatorNodeRef:x,transform:v}}const Fi={timeout:25};function Hi(e){let{animation:t,children:n}=e;const[r,o]=to(null),[i,a]=to(null),s=Nr(n);return n||r||!s||o(s),Dr(()=>{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]),Qr.createElement(Qr.Fragment,null,n,r?so(r,{ref:a}):null)}const qi={x:0,y:0,scaleX:1,scaleY:1};function Ui(e){let{children:t}=e;return Qr.createElement(Oi.Provider,{value:ji},Qr.createElement(Li.Provider,{value:qi},t))}const Ki={position:"fixed",touchAction:"none"},Vi=e=>Br(e)?"transform 250ms ease":void 0,Yi=lo((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:u=Vi}=e;if(!s)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Ki,width:s.width,height:s.height,top:s.top,left:s.left,transform:Fr.Transform.toString(d),transformOrigin:o&&r?yo(r,s):void 0,transition:"function"==typeof u?u(r):u,...l};return Qr.createElement(n,{className:a,style:p,ref:t},i)}),Xi={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Fr.Transform.toString(t)},{transform:Fr.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 Qi(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return jr((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Ei(i);if(!l)return;const{transform:c}=Er(i).getComputedStyle(i),u=So(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Xi,...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,f=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(f))return;const g=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==g||g(),e()}})}}(t);return Ho(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 Gi=0;function Zi(e){return ro(()=>{if(null!=e)return Gi++,Gi},[e])}const ea=Qr.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:f,droppableContainers:g,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:w,windowRect:x}=Zr(Ti),_=Zr(Li),C=Zi(null==d?void 0:d.id),E=$i(a,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:w,transform:_,windowRect:x}),k=mi(p),S=Qi({config:r,draggableNodes:f,droppableContainers:g,measuringConfiguration:b}),A=k?m.setRef:void 0;return Qr.createElement(Ui,null,Qr.createElement(Hi,{animation:S},d&&C?Qr.createElement(Yi,{key:C,id:d.id,ref:A,as:s,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:k,style:{zIndex:c,...o},transform:E},n):null))}),ta=t,{useEffect:na}=t,{useRef:ra}=t,oa=n,{styled:ia}=r,{Chip:aa}=i,{color:sa}=a,{renderMath:la}=p;function ca(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 ua=ia("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&&{}})),da=ia(aa)(()=>({backgroundColor:sa.white(),border:`1px solid ${sa.text()}`,color:sa.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}})),pa=ia("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function ha({choice:e,disabled:t,instanceId:n}){const r=ra(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=zi({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return na(()=>{la(r.current)},[e.value]),ta.createElement(ua,{ref:a,style:s?{width:ca([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:ca([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},ta.createElement(da,{clickable:!1,disabled:t,ref:r,label:ta.createElement(pa,{dangerouslySetInnerHTML:{__html:e.value}})}))}ha.propTypes={choice:oa.object.isRequired,disabled:oa.bool,instanceId:oa.oneOfType([oa.string,oa.number])};const fa=t,ga=n,{DragDroppablePlaceholder:ma}=f;class va extends fa.Component{constructor(...e){super(...e),va.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,qt(t=>t===e.id));return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return fa.createElement("div",{style:a},fa.createElement(ma,{disabled:e,instanceId:o},i.map((t,n)=>fa.createElement(ha,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}va.__initStatic();const ba=t,{useEffect:ya}=t,{useRef:wa}=t,{useState:xa}=t,_a=n,Ca=e,{styled:Ea}=r,{Chip:ka}=i,Sa=l,{color:Aa}=a,{grey:Ra}=s,{renderMath:Da}=p;function ja(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 Oa=Ea("span")(({dragged:e,over:t})=>({border:`solid 0px ${Aa.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),Ta=Ea(ka)(()=>({backgroundColor:Aa.background(),border:`2px dashed ${Aa.text()}`,touchAction:"none",color:Aa.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ra[500]}`,backgroundColor:`${Ra[300]}`},"&.correct":{border:`solid 1px ${Aa.correct()}`},"&.incorrect":{border:`solid 1px ${Aa.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Ma=Ea("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 Na({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=wa(null),c=wa(null),u=wa(null),[d,p]=xa({height:0,width:0}),h=()=>{g()},f=()=>{const e=ja([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{g()},300)},g=()=>{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`}};ya(()=>{f()},[]),ya(()=>{l.current&&Da(l.current)},[n,ja([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),ya(()=>{t?f():p({height:0,width:0})},[t]),ya(()=>{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:ja([u,"access",e=>e.current,"optionalAccess",e=>e.width]),height:ja([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 ba.createElement(Ta,{clickable:!1,disabled:e,ref:l,component:"span",label:ba.createElement(ba.Fragment,null,ba.createElement(Ma,{ref:c,draggable:!0,className:Sa({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&ba.createElement(Ma,{draggable:!0,className:Sa({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Sa({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function Ia({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}=zi({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:f,isOver:g,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$r("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=Zr(Oi),u=oo({disabled:n}),d=oo(!1),p=oo(null),h=oo(null),{disabled:f,updateMeasurementsFor:g,timeout:m}={...Fi,...o},v=Or(null!=g?g:r),b=vi({callback:no(()=>{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:f||!a}),y=no((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))},[b]),[w,x]=Mr(y),_=Or(t);return eo(()=>{b&&w.current&&(b.disconnect(),d.current=!1,b.observe(w.current))},[w,b]),eo(()=>(s({type:mo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:_}}),()=>s({type:mo.UnregisterDroppable,key:i,id:r})),[r]),eo(()=>{n!==u.current.disabled&&(s({type:mo.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:w,over:l,setNodeRef:x}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Fr.Translate.toString(p)};return ba.createElement(Oa,{ref:e=>{d(e),f(e)},style:v,dragged:h,over:g,...c,...u},ba.createElement(Na,{id:e,disabled:t,duplicates:n,choice:r,isOver:g,dragItem:ja([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}Na.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Na.propTypes={id:_a.oneOfType([_a.string,_a.number]),disabled:_a.bool,duplicates:_a.bool,choice:_a.object,isOver:_a.bool,dragItem:_a.object,correct:_a.bool,onChange:_a.func,emptyResponseAreaWidth:_a.oneOfType([_a.string,_a.number]),emptyResponseAreaHeight:_a.oneOfType([_a.string,_a.number]),instanceId:_a.string},Ia.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Ia.propTypes={id:_a.oneOfType([_a.string,_a.number]),disabled:_a.bool,duplicates:_a.bool,choice:_a.object,correct:_a.bool,onChange:_a.func,emptyResponseAreaWidth:_a.oneOfType([_a.string,_a.number]),emptyResponseAreaHeight:_a.oneOfType([_a.string,_a.number]),instanceId:_a.string};const $a=t,La=n,{DragProvider:Wa}=f;function Pa(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 Ba=gr("blank",e=>(t,n,r)=>{const o=Pa([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,f=c?s[o.id]:n[o.id],g=f&&e.choices.find(e=>e.id===f);return $a.createElement(Ia,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:g,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 $a.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:La.string,layout:La.object,choicesPosition:La.string,choices:La.array,value:La.object,onChange:La.func,duplicates:La.bool,disabled:La.bool,feedback:La.object,correctResponse:La.object,showCorrectAnswer:La.bool,emptyResponseAreaWidth:La.oneOfType([La.string,La.number]),emptyResponseAreaHeight:La.oneOfType([La.string,La.number]),instanceId:La.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;Pa([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?$a.createElement(ha,{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=Pa([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=Pa([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===Pa([i,"optionalAccess",e=>e.type])&&Pa([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,f=o||"below",g={display:"flex",minWidth:"100px",...this.getPositionDirection(f)};return $a.createElement(Wa,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:_o},$a.createElement("div",{ref:e=>this.rootRef=e,style:g},$a.createElement(va,{choicePosition:f,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),$a.createElement(Ba,{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}),$a.createElement(ea,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}za.__initStatic(),za.__initStatic2();const Fa=t,{styled:Ha}=r,qa=l,{color:Ua}=a;function Ka(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 Va,Ya;"undefined"!=typeof window&&(Va=require("@pie-lib/editable-html-tip-tap").default,Ya=Ha(Va)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Ua.black()}`,"&.correct":{border:`1px solid ${Ua.correct()}`},"&.incorrect":{border:`1px solid ${Ua.incorrect()}`}})));gr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:u}=e,d=Ka([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]||"",f=s&&s[d.id],g=i&&i[d.id],m=a||"correct"===g,v=!a&&"incorrect"===g,b=e=>{const t={...n,[d.id]:e};u(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return Fa.createElement(Ya,{id:d.id,key:`${t.type}-input-${d.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?f:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Ka([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:qa({correct:m,incorrect:v})})}});var Xa=gr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Ja=t,Qa=n,{Button:Ga}=i,{InputLabel:Za}=i,{Menu:es}=i,{MenuItem:ts}=i,{ArrowDropDown:ns}=c,{ArrowDropUp:rs}=c,{Close:os}=c,{Check:is}=c,{styled:as}=r,{color:ss}=a,{renderMath:ls}=p,cs=as(Ga)(()=>({color:ss.text(),border:`1px solid ${ss.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:ss.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:ss.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${ss.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:ss.correct(),color:`${ss.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:ss.incorrectWithIcon(),color:`${ss.text()} !important`}})),us=as(es)(()=>({backgroundColor:ss.background(),border:`1px solid ${ss.correct()} !important`,"&:hover":{border:`1px solid ${ss.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${ss.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),ds=as(ts)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:ss.text(),backgroundColor:ss.background(),"&.Mui-focusVisible":{outline:`3px solid ${ss.tertiary()}`,outlineOffset:"-1px",color:ss.text(),backgroundColor:ss.background()},"&:hover":{color:ss.text(),backgroundColor:ss.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${ss.text()} !important`,backgroundColor:`${ss.background()} !important`,"&:hover":{color:ss.text(),backgroundColor:`${ss.dropdownBackground()} !important`}}})),ps=as("span")(()=>({fontSize:"max(1rem, 14px)"})),hs=as("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),fs=as(Za)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),gs=as(is)(()=>({color:`${ss.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ss.correct()},"&.incorrect":{backgroundColor:ss.incorrectWithIcon()}})),ms=as(os)(()=>({color:`${ss.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ss.correct()},"&.incorrect":{backgroundColor:ss.incorrectWithIcon()}}));class vs extends Ja.Component{static __initStatic(){this.propTypes={id:Qa.string,value:Qa.string,disabled:Qa.bool,onChange:Qa.func,correct:Qa.bool,choices:Qa.arrayOf(Qa.shape({value:Qa.string,label:Qa.string})),showCorrectAnswer:Qa.bool,singleQuery:Qa.bool,correctValue:Qa.string}}constructor(e){super(e),vs.prototype.__init.call(this),vs.prototype.__init2.call(this),vs.prototype.__init3.call(this),vs.prototype.__init4.call(this),vs.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Ja.createRef(),this.buttonRef=Ja.createRef(),this.previewRef=Ja.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||ls(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&ls(e)}),ls(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 f=parseInt(e,10)+1,g=a?"Query-label":`Query-label-${f}`,m=a?"Query":`Query ${f}`;let v=null;return n&&void 0!==t&&(v=t||i?Ja.createElement(gs,{className:"correct"}):Ja.createElement(ms,{className:"incorrect"})),Ja.createElement(Ja.Fragment,null,Ja.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Ja.createElement(ds,{key:t,tabIndex:-1,"aria-hidden":"true"},Ja.createElement(ps,{dangerouslySetInnerHTML:{__html:e.label}})))),Ja.createElement(fs,{id:g,tabIndex:-1,"aria-hidden":"true"},m),Ja.createElement(cs,{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,Ja.createElement(ps,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Ja.createElement(rs,null):Ja.createElement(ns,null)),Ja.createElement(us,{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 Ja.createElement(ds,{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)},Ja.createElement(ps,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Ja.createElement(hs,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}vs.__initStatic();const bs=t;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 bs.createElement(vs,{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=t,ws=n,{styled:xs}=r,{Tooltip:_s}=i,{color:Cs}=a,{Collapsible:Es}=a,{Readable:ks}=a,{hasText:Ss}=a,{hasMedia:As}=a,{PreviewPrompt:Rs}=a,{UiLayout:Ds}=a,js=u,Os=o,{mq:Ts}=h,{HorizontalKeypad:Ms}=h,{updateSpans:Ns}=h,{registerEmbed:Is}=h,{applyStaticMath:$s}=h,{renderMath:Ls}=p;function Ws(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 Ps=xs(Ds)({color:Cs.text(),backgroundColor:Cs.background(),display:"inline-block"}),Bs=xs("div")({width:"100%",position:"relative",backgroundColor:Cs.background(),color:Cs.text()}),zs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Fs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Hs=xs("div")({position:"relative","& > div > div":{display:"flex",alignItems:"baseline",flexWrap:"wrap"},"& .mq-overarrow-inner":{border:"none !important",padding:"0 !important"},"& .mq-overarrow-inner-right":{display:"none !important"},"& .mq-overarrow-inner-left":{display:"none !important"},"& .mq-overarrow.mq-arrow-both":{minWidth:"1.23em","& *":{lineHeight:"1 !important"},"&:before":{top:"-0.4em",left:"-1px"},"&:after":{top:"-2.4em",right:"-1px"},"&.mq-empty:after":{top:"-0.45em"}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:"-0.4em",right:"-1px"}},"& .mq-longdiv-inner":{borderTop:"1px solid !important",paddingTop:"1.5px !important"},"& .mq-parallelogram":{lineHeight:.85}}),qs=xs("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Cs.incorrect()} !important`},...n&&{borderColor:`${Cs.correct()} !important`},...r&&{border:"2px solid"},...o&&{padding:e.spacing(1),letterSpacing:"0.5px"},"& > .mq-math-mode":{"& > .mq-root-block":{"& > .mq-editable-field":{minWidth:"10px",padding:e.spacing(.25)}},"& sup":{top:0}}})),Us=xs(Ts.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Cs.text()}}}),Ks=xs("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),Vs=xs("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),Ys=xs("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Xs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Js=xs(js)(({theme:e})=>({color:Cs.text(),marginBottom:e.spacing(2)}));if("undefined"!=typeof document){const e="math-templated-main-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`\n .block-container {\n margin: 8px !important;\n display: inline-flex;\n border: 2px solid grey !important;\n }\n .block-response {\n flex: 2;\n color: grey;\n background: rgba(0, 0, 0, 0.04);\n font-size: 0.8rem !important;\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 2px solid #bdbdbd !important;\n }\n .block-math {\n color: ${Cs.text()};\n background-color: ${Cs.background()};\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 8;\n }\n .block-math > .mq-math-mode > .mq-hasCursor > .mq-cursor {\n display: none;\n }\n .correct {\n border-color: ${Cs.correct()} !important;\n }\n .incorrect {\n border-color: ${Cs.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let Qs=!1;const Gs=/(\{\{\d+\}\})/gm,Zs=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function el(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function tl(e,t){const{responses:n,disabled:r,markup:o,printMode:i,alwaysShowCorrect:a}=e||{};if(o){if(t.showCorrect)return Object.keys(n||{}).reduce((e,t)=>(e[t]=Ws([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(Gs).filter(e=>e).reduce((e,n)=>{if(n.match(Gs)){const o=rl.getResponseKey(n),s=t.session.answers[`r${o}`];if(i&&!a){const t="\\ \\ ".repeat(30)+"\\embed{newLine}[] ";return{...e,[o]:`\\MathQuillMathField[r${o}]{${t.repeat(3)}}`}}return r?{...e,[o]:`\\embed{answerBlock}[r${o}]`}:{...e,[o]:`\\MathQuillMathField[r${o}]{${s&&s.value||""}}`}}return e},{})}}const nl={name:"smartHorizontalPlacement",enabled:!0,phase:"main",requires:["popperOffsets"],fn:({state:e})=>{const t=e.modifiersData.popperOffsets;if(!t)return;const n=window.innerWidth||document.documentElement.clientWidth,r=e.rects.popper.width,o=e.elements.reference.getBoundingClientRect().left,i=Ws([e,"access",e=>e.elements,"access",e=>e.popper,"optionalAccess",e=>e.offsetParent]),a=Ws([i,"optionalAccess",e=>e.getBoundingClientRect,"optionalCall",e=>e()])||{left:0},s=Ws([i,"optionalAccess",e=>e.scrollLeft])||0,l=o-a.left+s,c=l-o,u=c+8,d=c+n-r-8;t.x=o+r<=n?l:l-r,t.x=d<u?u:Math.min(Math.max(t.x,u),d)}};class rl extends ys.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:ws.object.isRequired,onSessionChange:ws.func,model:ws.object.isRequired}}constructor(e){super(e),rl.prototype.__init.call(this),rl.prototype.__init2.call(this),rl.prototype.__init3.call(this),rl.prototype.__init4.call(this),rl.prototype.__init5.call(this),rl.prototype.__init6.call(this),rl.prototype.__init7.call(this),rl.prototype.__init8.call(this),rl.prototype.__init9.call(this),rl.prototype.__init10.call(this),rl.prototype.__init11.call(this),rl.prototype.__init12.call(this),rl.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(Gs,e=>{const n=rl.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:Ws([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:ys.createRef()}}UNSAFE_componentWillMount(){"undefined"!=typeof window&&(Qs||(Is("answerBlock",e=>({htmlString:`<div class="block-container">\n <div class="block-response" id="${e}Index">R</div>\n <div class="block-math">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`})),Qs=!0))}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:n}=this.state,r=t.answers;this.root&&e.disabled&&!n&&Object.keys(r).forEach(t=>{const n=this.root.querySelector(`#${t}`),o=this.root.querySelector(`#${t}Index`);if(n){const i=r[t];$s(n,i&&i.value||""),e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),o.textContent="R"}}),Ls(this.root)}}UNSAFE_componentWillReceiveProps(e){const{model:t}=this.props,{model:n={}}=e||{},{markup:r="",env:o={}}=t||{},{markup:i="",env:a={},alwaysShowCorrect:s=!1}=n,l=e=>e&&"evaluate"===e.mode;l(o)&&l(a)||this.setState(e=>({...e.session,showCorrect:!1})),s&&this.setState({showCorrect:!0});const c=r.match(Gs),u=i.match(Gs);if(!tn(c,u)){const e={},t=this.state.session.answers;(u||[]).forEach(n=>{const r=rl.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:Ws([o,"optionalAccess",e=>e.value])||""}}),this.setState(t=>({session:{...t.session,answers:e}}),()=>{this.props.onSessionChange(this.state.session),this.handleAnswerBlockDomUpdate()})}}shouldComponentUpdate(e,t){const n=tn(this.props.model,e.model),r=tn(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>Ls(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{const t=Array.from(Ws([this,"access",e=>e.root,"optionalAccess",e=>e.querySelectorAll,"call",e=>e(".mq-editable-field")])||[]).map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),n=()=>{t.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n})};this.setState({activeAnswerBlock:e},()=>{n(),requestAnimationFrame(n),setTimeout(n,0)})}}__init3(){this.toNodeData=e=>{if(!e)return;const{type:t,value:n}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===n?{type:"clear"}:{type:"write",value:n}}}__init4(){this.setInput=e=>{this.input=e}}__init5(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value);const n=[];let r=Ws([this,"access",e=>e.input,"optionalAccess",e=>e.el,"optionalCall",e=>e()])||this.root;for(;r&&r!==document.body&&r!==document.documentElement;){(r.scrollWidth>r.clientWidth||r.scrollHeight>r.clientHeight)&&n.push(r),r=r.parentElement}document.scrollingElement&&n.push(document.scrollingElement);const o=n.map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),i={x:window.scrollX,y:window.scrollY},a=()=>{o.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n}),window.scrollTo(i.x,i.y)};this.input.focus(),a(),requestAnimationFrame(a),setTimeout(a,0)}}__init6(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init7(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init8(){this.subFieldChanged=(e,t)=>{Ns(),e&&this.setState(n=>({session:{...n.session,answers:{...n.session.answers,[e]:{value:t}}}}),this.callOnSessionChange)}}__init9(){this.getFieldName=(e,t)=>{const{answers:n}=this.state.session;if(Object.keys(n||{}).length){return Object.keys(n).find(n=>{const r=t[n];return r&&r.id==e.id})}}}__init10(){this.onBlur=e=>{const{relatedTarget:t,currentTarget:n}=e||{};const r=function e(t,n=0){if(!t||n>=16)return null;const r=t.offsetParent;return r?"tooltip"===r.getAttribute("role")?r:e(r,n+1):null}(t),o=r?function e(t,n=0){if(!t||n>=4)return null;const r=Ws([t,"optionalAccess",e=>e.children,"optionalAccess",e=>e[0]]);return r?r.attributes&&r.attributes["data-keypad"]?r:e(r,n+1):null}(r):null;t&&n&&Ws([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Zs){const e=document.querySelector("[role='tooltip']");if(e){e.firstChild.setAttribute("tabindex","-1")}}},1)}__init11(){this.renderTeacherInstructions=()=>{const{model:e}=this.props,{teacherInstructions:t,animationsDisabled:n}=e||{},r=t&&(Ss(t)||As(t)),o=ys.createElement(Rs,{defaultClassName:"teacher-instructions",prompt:t});return r&&ys.createElement(Fs,null,n?o:ys.createElement(Es,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=ys.createElement(Rs,{prompt:t});return t&&(Ss(t)||As(t))&&ys.createElement(Fs,null,n?r:ys.createElement(Es,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},r))}}__init13(){this.renderPlayerContent=()=>{const{model:e}=this.props,{activeAnswerBlock:t,showCorrect:n,session:r,tooltipContainerRef:o}=this.state,{correctness:i,disabled:a,view:s,responses:l,equationEditor:c,customKeys:u,feedback:d,env:{mode:p}={},printMode:h,alwaysShowCorrect:f}=e||{},g=en(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(u),v=tl(e,this.state)||"",b=h&&!f;return ys.createElement(Hs,null,ys.createElement(Xa,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&d&&d[e],u=ys.createElement(Us,{ref:e=>{this.mqStatic=e||this.mqStatic},latex:v[e],onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur});return ys.createElement(qs,{ref:o,$incorrect:!g&&!l&&!n,$correct:!g&&(l||n),$showCorrectness:!g&&a&&i&&!s,$correctAnswerShown:n},ys.createElement(_s,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:Ws([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-start",sx:{backgroundColor:"transparent",width:"auto",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:[{name:"preventOverflow",enabled:!1},{name:"flip",enabled:!1},nl]},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"auto",maxWidth:"none",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||a)&&ys.createElement(Ks,{"data-keypad":!0,key:e,style:{width:el(m,c)}},ys.createElement(Ms,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?ys.createElement(Vs,null,u):ys.createElement("div",null,u)))}}))}}render(){const{model:e}=this.props,{showCorrect:t}=this.state,{prompt:n,env:{mode:r,role:o}={},extraCSSRules:i,correctness:a,responses:s,language:l,showNote:c,note:u}=e||{},d=!en(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&u;return ys.createElement(Ps,{extraCSSRules:i,ref:e=>{const t=Os.findDOMNode(e);this.root=t||this.root}},ys.createElement(Bs,null,"gather"===r&&ys.createElement(Ys,null,"Math Equation Response Question"),ys.createElement(Bs,null,d&&ys.createElement(Js,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&ys.createElement(zs,null,ys.createElement(Rs,{prompt:n})),ys.createElement(ks,{false:!0},this.renderPlayerContent()),p&&ys.createElement(Xs,{className:"note",dangerouslySetInnerHTML:{__html:u}}),this.renderRationale()))}}rl.__initStatic(),rl.__initStatic2();const ol=t,{createRoot:il}=d,al=e,{renderMath:sl}=p,ll=al("pie-element:math-templated:print");class cl 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.showTeacherInstructions=n,e.alwaysShowCorrect=n,e.printMode=!0,e.feedback=void 0,e.markup=e.markup||"{{0}}",{...e,disabled:!0,env:{mode:n?"evaluate":e.mode,role:t.role}}})(this._model,this._options),t=this._options&&ol.createElement(rl,{model:e,session:{}});this._root||(this._root=il(this)),this._root.render(t),queueMicrotask(()=>{ll("render complete - render math"),sl(this)})}else ll("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{cl as default};