|
|
!(function(){var Ho=Math.pow;var Es=(er,ft,x)=>new Promise((A,J)=>{var he=q=>{try{U(x.next(q))}catch(ce){J(ce)}},ue=q=>{try{U(x.throw(q))}catch(ce){J(ce)}},U=q=>q.done?A(q.value):Promise.resolve(q.value).then(he,ue);U((x=x.apply(er,ft)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[11581],{42922:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return ce}});var A=x(87462),J=x(67294),he={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},ue=he,U=x(84089),q=function(v,De){return J.createElement(U.Z,(0,A.Z)({},v,{ref:De,icon:ue}))},ce=J.forwardRef(q)},25877:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return ce}});var A=x(87462),J=x(67294),he={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},ue=he,U=x(84089),q=function(v,De){return J.createElement(U.Z,(0,A.Z)({},v,{ref:De,icon:ue}))},ce=J.forwardRef(q)},22751:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return ce}});var A=x(87462),J=x(67294),he={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},ue=he,U=x(84089),q=function(v,De){return J.createElement(U.Z,(0,A.Z)({},v,{ref:De,icon:ue}))},ce=J.forwardRef(q)},38308:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return ce}});var A=x(87462),J=x(67294),he={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},ue=he,U=x(84089),q=function(v,De){return J.createElement(U.Z,(0,A.Z)({},v,{ref:De,icon:ue}))},ce=J.forwardRef(q)},91034:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return ce}});var A=x(87462),J=x(67294),he={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},ue=he,U=x(84089),q=function(v,De){return J.createElement(U.Z,(0,A.Z)({},v,{ref:De,icon:ue}))},ce=J.forwardRef(q)},53978:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return ce}});var A=x(87462),J=x(67294),he={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},ue=he,U=x(84089),q=function(v,De){return J.createElement(U.Z,(0,A.Z)({},v,{ref:De,icon:ue}))},ce=J.forwardRef(q)},71736:function(er,ft){"use strict";ft.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},96670:function(er,ft,x){"use strict";x.d(ft,{t:function(){return L}});var A=x(67294),J=x(71577),he={buttonFixed:"buttonFixed___vyq30",button:"button___hxmYv",buttonWrap:"buttonWrap___uK8dl"},ue=x(94184),U=x.n(ue),q=Object.defineProperty,ce=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,De=(Le,Re,pt)=>Re in Le?q(Le,Re,{enumerable:!0,configurable:!0,writable:!0,value:pt}):Le[Re]=pt,Ne=(Le,Re)=>{for(var pt in Re||(Re={}))_.call(Re,pt)&&De(Le,pt,Re[pt]);if(ce)for(var pt of ce(Re))v.call(Re,pt)&&De(Le,pt,Re[pt]);return Le};const L=({cancelText:Le="\u53D6\u6D88",okText:Re="\u786E\u5B9A",loading:pt=!1,hasOkBtn:lt=!0,hasCancelBtn:Z=!0,okButtonProps:Ie={},onCancel:Ht=()=>{},onOk:Se=()=>{},className:pe=""})=>A.createElement("div",{className:U()(he.buttonFixed,pe)},A.createElement("div",{className:he.buttonWrap},Z&&A.createElement(J.ZP,{size:"middle",className:`${he.button} mr20`,onClick:Ht},Le),lt&&A.createElement(J.ZP,Ne({size:"middle",type:"primary",className:`${he.button} mr20`,loading:pt,onClick:Se},Ie),Re)))},35713:function(er,ft,x){"use strict";var A=x(67294),J=x(71736),he=x(84279),ue=x(36527),U=x(14446),q=x(67294);const ce=(0,A.forwardRef)(({callback:_,width:v,onChange:De,disabled:Ne,readOnly:L,type:Le="",value:Re="",style:pt={}},lt)=>{const Z=(0,A.useRef)(),Ie=(0,A.useRef)(),[Ht,Se]=(0,A.useState)(0),[pe,T]=(0,A.useState)(0),[F,ie]=(0,A.useState)(!1),j=()=>{var gt=document.createElement("div");gt.innerHTML=Z.current.getValue();var Me=gt.innerText;return _&&_(Me),Me};(0,A.useImperativeHandle)(lt,()=>({getData:j}));const ze=gt=>{gt.preventDefault();const Me=gt.clientX-Ht,_e=gt.clientY-pe;document.body.onmousemove=Je=>{let re=Je.clientX-Me,Ue=Je.clientY-_e;const rt=document.getElementsByClassName("markdown-popup-form")[0],ge=window.innerWidth-rt.offsetWidth,Ae=window.innerHeight-rt.offsetHeight;re=Math.max(0,Math.min(re,ge)),Ue=Math.max(0,Math.min(Ue,Ae)),tt(Je.clientX,Je.clientY,Me,_e)&&(Se(re),T(Ue))},document.body.onmouseup=function(){document.body.onmousemove=null}},tt=(gt,Me,_e,Je)=>{const re=document.body.clientHeight,Ue=document.body.clientWidth;return gt<20&&_e>gt||gt>Ue-20&&_e<gt||Me<20&&Je>Me||Me>re-20&&Je<Me?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,A.useEffect)(()=>{F&&setTimeout(()=>{const gt=document.getElementsByClassName("markdown-popup-form")[0],Me=window.innerWidth/2-gt.offsetWidth/2,_e=window.innerHeight/2-gt.offsetHeight/2;Se(Me),T(_e)},0)},[F]);const Nt=()=>{Ne||L||ie(!0)};return q.createElement("div",{style:pt},q.createElement("div",{style:{width:v||"100%",position:"relative"},className:`${J.Z.mathFillWrap} ${Ne||L?"cursorDefault":""}`,onClick:()=>Nt()},q.createElement("math-field",{disabled:Ne,locale:"zh_cn",class:`${J.Z.mathField} ${Le}`,readOnly:L,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:Z,style:{width:"100%",fontSize:Re?18:14},value:Re||""})),q.createElement(U.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:Ht,top:pe},title:q.createElement("div",{style:{cursor:"move"},onMouseDown:ze},"\u8F93\u5165\u516C\u5F0F"),open:F,onOk:()=>{const gt=Ie.current.getData();Z.current.setValue(gt),De(gt),ie(!1)},onCancel:()=>{ie(!1)},destroyOnClose:!0,className:"markdown-popup-form"},q.createElement(ue.Z,{value:Re,ref:Ie,onChange:De,showSaveButton:!1})))});ft.Z=ce},36527:function(er,ft,x){"use strict";var A=x(67294),J=x(71230),he=x(15746),ue=x(66368),U=x(71577),q=x(35598),ce=x(71736),_=x(84279),v=x(67294);const De=(0,A.forwardRef)(({callback:Ne,showSaveButton:L,value:Le=""},Re)=>{const pt=(0,A.useRef)(),lt=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],Z=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
|
|
|
x=a + r\\text{cos}\\theta \\ \r
|
|
|
y=b + r\\text{sin}\\theta \r
|
|
|
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
|
|
|
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
|
|
|
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
|
|
|
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
|
|
|
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
|
|
|
\\end{array} `},{value:`\\begin{array}{l} \r
|
|
|
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
|
|
|
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
|
|
|
\\left\\{\\begin{matrix} \r
|
|
|
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
|
|
|
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
|
|
|
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
|
|
|
\\end{matrix}\\right. \r
|
|
|
\\end{array} `},{value:`\\begin{array}{l} \r
|
|
|
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
|
|
|
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
|
|
|
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
|
|
|
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
|
|
|
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
|
|
|
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
|
|
|
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
|
|
|
a \\perp \\alpha \\ \r
|
|
|
b \\perp \\alpha \r
|
|
|
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
|
|
|
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
|
|
|
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
|
|
|
a \\parallel \\partial ,b \\parallel \\partial \r
|
|
|
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
|
|
|
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
|
|
|
a \\perp m,a \\perp n \r
|
|
|
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
|
|
|
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
|
|
|
a^{2}+b^{2}=c^{2} \r
|
|
|
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
|
|
|
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
|
|
|
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
|
|
|
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
|
|
|
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
|
|
|
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
|
|
|
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
|
|
|
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
|
|
|
a,b \\in R^{+} \\ \r
|
|
|
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
|
|
|
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
|
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
|
a,b \\in R \\ \r
|
|
|
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
|
|
|
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
|
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
|
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
|
|
|
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
|
|
|
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
|
|
|
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
|
|
|
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
|
|
|
P \\left( \\emptyset \\right) =0 \\\\ \r
|
|
|
P \\left( S \\right) =1 \r
|
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
|
\\forall A \\in S \\\\ \r
|
|
|
P \\left( A \\right) \\ge 0 \r
|
|
|
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
|
|
|
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
|
|
|
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
|
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
|
P_{n}=n! \\\\ \r
|
|
|
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
|
|
|
\\end{array}`}]}]}],Ie=pe=>{pt.current.setValue(pt.current.getValue()+" "+pe.value+" ")},Ht=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:v.createElement(J.Z,{className:ce.Z.lists,gutter:[10,10]},lt.map((pe,T)=>v.createElement(he.Z,{flex:"110px",className:ce.Z.item},v.createElement("div",null,v.createElement(q.Z,{value:`$$${pe.value}$$`}),pe.name),v.createElement("div",{className:ce.Z.children},pe.children.map((F,ie)=>v.createElement("div",{key:ie},v.createElement("h1",null,F.name),v.createElement(J.Z,{gutter:[10,10]},F.data.map((j,ze)=>v.createElement(he.Z,{key:ze,onClick:()=>Ie(j),className:ce.Z.diamond},v.createElement(q.Z,{value:"`$$"+j.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:v.createElement(J.Z,{className:ce.Z.lists,gutter:[10,10]},Z.map((pe,T)=>v.createElement(he.Z,{flex:"110px",className:ce.Z.item},v.createElement("div",null,v.createElement(q.Z,{value:"`$$"+pe.value+"$$`"}),pe.name),v.createElement("div",{className:ce.Z.children},pe.children.map((F,ie)=>v.createElement("div",{key:ie},F.name&&v.createElement("h1",null,F.name),v.createElement(J.Z,{gutter:[10,10]},F.data.map((j,ze)=>v.createElement(he.Z,{key:ze,onClick:()=>Ie(j),className:ce.Z.diamond},v.createElement(q.Z,{value:"`$$"+j.value+"$$`"}))))))))))}],Se=()=>{var pe=document.createElement("div");pe.innerHTML=pt.current.getValue();var T=pe.innerText;return Ne&&Ne(T),T};return(0,A.useImperativeHandle)(Re,()=>({getData:Se})),v.createElement("div",{className:ce.Z.mathWrap},v.createElement(ue.default,{defaultActiveKey:"1",items:Ht}),v.createElement("math-field",{locale:"zh_cn",className:ce.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:pt,style:{width:800,marginTop:30,fontSize:18}},Le||""),L&&v.createElement("div",{className:ce.Z.button},v.createElement(U.ZP,{size:"large",onClick:Se,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});ft.Z=De},89740:function(er,ft,x){"use strict";x.r(ft),x.d(ft,{default:function(){return rt},formatTypeNameToDefaultScore:function(){return re}});var A=x(67294),J=x(35973),he=x(14446),ue=x(31795),U=x(85673),q=x(66012),ce=x(78045),_=x(35598),v={flexRow:"flexRow____Sm4b",flexColumn:"flexColumn___mQNZs",action:"action___QUVEn",setScore:"setScore___yZ0Yb",delete:"delete___e4taL",content:"content___jR4Y6",titleWrap:"titleWrap___zsXYY",titleNumber:"titleNumber___p60vi",score:"score___DbCHw",titleHtml:"titleHtml___FALbj",answerWrap:"answerWrap___uPjYq",answer:"answer___pfiPk",answerText:"answerText___K3TNr"},De=x(19575),Ne=x(35713),L=x(67294);const Le=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],Re=[{type:"single",name:"\u5355\u9009\u9898"},{type:"multiple",name:"\u591A\u9009\u9898"},{type:"judgement",name:"\u5224\u65AD\u9898"},{type:"completion",name:"\u586B\u7A7A\u9898"},{type:"subjective",name:"\u7B80\u7B54\u9898"}];var lt=({index:ge,typeName:Ae,type:ve,data:fe={},inMouseId:ot,isshow:Ze,onSetScore:Oe=()=>{},onDelete:xe=()=>{},onMouseEnter:yt=()=>{},showAnswer:ht=!1})=>{var Ut;const[Gt,cr]=(0,A.useState)(!1),ur=()=>{var te;return L.createElement("div",{className:v.answerWrap},(te=fe==null?void 0:fe.choices)==null?void 0:te.map((ne,Ke)=>L.createElement("div",{className:`${v.flexRow} mt15`,key:Ke},L.createElement("div",{style:{lineHeight:"24px",flexShrink:0}},Le[Ke]),L.createElement("div",{className:`${v.answer} ml5`},L.createElement(_.Z,{value:ne==null?void 0:ne.choice_text})))),ht&&L.createElement("div",{className:`mt10 ${v.answerText}`},"\u53C2\u8003\u7B54\u6848\uFF1A",fe==null?void 0:fe.standard_answer_show))},rr=()=>{var te;return L.createElement("div",{className:v.answerWrap},L.createElement("div",{className:`${v.flexRow} mt15`},(te=fe==null?void 0:fe.choices)==null?void 0:te.map((ne,Ke)=>L.createElement(ce.ZP,{disabled:!0,key:Ke},ne==null?void 0:ne.choice_text))),ht&&L.createElement("div",{className:`mt10 ${v.answerText}`},"\u53C2\u8003\u7B54\u6848\uFF1A",fe==null?void 0:fe.standard_answer_show))},ar=()=>{var te;return L.createElement("div",{className:v.answerWrap},L.createElement("div",{className:`${v.flexRow} mt15`},L.createElement(_.Z,{value:(te=fe==null?void 0:fe.program_attr)==null?void 0:te.description})),ht&&L.createElement("div",{className:"mt15"},L.createElement("div",{className:v.answerText},"\u53C2\u8003\u7B54\u6848\uFF1A",!(fe!=null&&fe.answer_text)&&"\u6682\u65E0"),L.createElement(_.Z,{value:(fe==null?void 0:fe.answer_text)||""})))},ut=()=>{var te;return L.createElement("div",{className:v.answerWrap},ht&&L.createElement("div",{className:`${v.flexColumn} mt15`},(te=fe==null?void 0:fe.standard_answer)==null?void 0:te.map((ne,Ke)=>L.createElement("div",null,(ne==null?void 0:ne.model)===1?L.createElement(_.Z,{key:Ke,value:`\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A${ne.position}\uFF09\uFF1A${ne.answer_text.join("\u3001")}`,className:v.answerText}):L.createElement("span",{style:{display:"inline-flex",alignItems:"center",marginBottom:5}},"\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A ",ne.position,"\uFF09\uFF1A",L.createElement(Ne.Z,{disabled:!0,width:"180px",value:ne.answer_text.join("\u3001")}))))))},be=()=>{var te;return L.createElement("div",{className:v.answerWrap},ht&&L.createElement("div",{className:"mt15"},L.createElement("div",{className:v.answerText},"\u53C2\u8003\u7B54\u6848\uFF1A"),L.createElement(_.Z,{value:(te=fe==null?void 0:fe.answer_texts)==null?void 0:te[0],className:v.answerText})))},ae=()=>{var te,ne;return L.createElement("div",{className:v.answerWrap,style:{marginTop:10}},L.createElement(_.Z,{showProgramFill:!0,disabledFill:!0,value:De.Base64.decode((te=fe==null?void 0:fe.program_attr)==null?void 0:te.code)}),ht&&L.createElement("div",{className:`${v.flexColumn} mt15`},(ne=fe==null?void 0:fe.standard_answer)==null?void 0:ne.map((Ke,Fe)=>L.createElement(_.Z,{key:Fe,value:`\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A${Ke.position}\uFF09\uFF1A${Ke.answer_text}`}))))},Q=()=>{var te;return L.createElement("div",{className:v.answerWrap},L.createElement("div",{className:"mt10"},"\u9636\u6BB5\u6210\u7EE9"),(te=fe==null?void 0:fe.shixun)==null?void 0:te.map((ne,Ke)=>{var Fe,Ce;return L.createElement("div",null,L.createElement("div",{className:"mt10 font14",key:Ke},"\u7B2C",Ke+1,"\u5173 ",ne==null?void 0:ne.challenge_name," \uFF08",ne.challenge_score,"\u5206\uFF09"),ht&&L.createElement("div",null,L.createElement("div",{className:v.answerText},"\u53C2\u8003\u7B54\u6848\uFF1A",((Fe=ne.challenge_answers)==null?void 0:Fe.length)===0?"\u6682\u65E0":""),(Ce=ne.challenge_answers)==null?void 0:Ce.map((kt,$t)=>L.createElement("div",{className:"mt15"},L.createElement("div",null,"\u7EA7\u522B",$t+1,"\uFF1A",kt.name),L.createElement(_.Z,{value:(kt==null?void 0:kt.contents)||"",className:v.answerText})))))}))},V=()=>{var te;return L.createElement("div",{className:v.answerWrap,style:{display:Gt&&"none"}},(te=fe==null?void 0:fe.sub_questions)==null?void 0:te.map((ne,Ke)=>{var Fe,Ce,kt,$t,G;const nt=`<span style="margin-right: 10px">${ge+1}.${Ke+1}</span><span>\uFF08${(Fe=Re.find(dt=>dt.type==ne.item_type))==null?void 0:Fe.name}\uFF09</span><span class="c-grey-999">\uFF08${ne.score}\u5206\uFF09</span>`;return L.createElement(A.Fragment,{key:ne==null?void 0:ne.id},L.createElement("div",{className:v.titleWrap,style:{marginTop:16}},L.createElement(_.Z,{className:v.titleHtml,value:nt+ne.name})),(ne.item_type=="single"||ne.item_type=="multiple")&&L.createElement(L.Fragment,null,(Ce=ne==null?void 0:ne.choices)==null?void 0:Ce.map((dt,qt)=>L.createElement("div",{className:`${v.flexRow} mt15`,key:qt},L.createElement("div",{style:{lineHeight:"24px",flexShrink:0}},Le[qt]),L.createElement("div",{className:`${v.answer} ml5`},L.createElement(_.Z,{value:dt==null?void 0:dt.choice_text})))),ht&&L.createElement("div",{className:`mt10 ${v.answerText}`},"\u53C2\u8003\u7B54\u6848\uFF1A",ne==null?void 0:ne.standard_answer_show)),ne.item_type=="judgement"&&L.createElement("div",{className:v.answerWrap},L.createElement("div",{className:`${v.flexRow} mt15`},(kt=ne==null?void 0:ne.choices)==null?void 0:kt.map((dt,qt)=>L.createElement(ce.ZP,{disabled:!0,key:qt},dt==null?void 0:dt.choice_text))),ht&&L.createElement("div",{className:`mt10 ${v.answerText}`},"\u53C2\u8003\u7B54\u6848\uFF1A",ne==null?void 0:ne.standard_answer_show)),ne.item_type=="completion"&&L.createElement("div",{className:v.answerWrap},ht&&L.createElement("div",{className:`${v.flexColumn} mt15`},($t=ne==null?void 0:ne.standard_answer)==null?void 0:$t.map((dt,qt)=>L.createElement("div",null,(dt==null?void 0:dt.model)===1?L.createElement(_.Z,{key:qt,value:`\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A${dt.position}\uFF09\uFF1A${dt.answer_text.join("\u3001")}`,className:v.answerText}):L.createElement("span",null,"\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A$",dt.position,"\uFF09\uFF1A",L.createElement(Ne.Z,{value:dt.answer_text.join("\u3001")})))))),ne.item_type=="subjective"&&L.createElement("div",{className:v.answerWrap},ht&&L.createElement("div",{className:"mt15"},L.createElement("div",{className:v.answerText},"\u53C2\u8003\u7B54\u6848\uFF1A"),L.createElement(_.Z,{value:(G=ne==null?void 0:ne.answer_texts)==null?void 0:G[0],className:v.answerText}))))}))},Y=()=>{const te={SINGLE:ur,MULTIPLE:ur,JUDGMENT:rr,PROGRAM:ar,COMPLETION:ut,SUBJECTIVE:be,PRACTICAL:Q,COMBINATION:V,BPROGRAM:ae};return te[ve]?te[ve]():null},ye=(te,ne)=>{var Ke;return`<span style="margin-right: -10px">${ne+1}\u3001</span><span class="c-grey-999">\uFF08${(te==null?void 0:te.item_type)==="combination"?`\u5171${(Ke=te==null?void 0:te.sub_questions)==null?void 0:Ke.length}\u5C0F\u9898\uFF0C`:""}${te.score}\u5206\uFF09</span> `};return L.createElement("div",{onMouseEnter:()=>yt(fe.id)},ot===fe.id&&L.createElement("div",{className:v.action},L.createElement("div",{className:v.setScore,onClick:()=>Oe(fe.id,Ae,fe==null?void 0:fe.shixun,fe.score,fe)},"\u8BBE\u7F6E\u5F97\u5206"),L.createElement("div",{className:v.delete,onClick:()=>xe(fe.id)},"\u5220\u9664")),L.createElement("div",{className:v.content},L.createElement("div",{className:v.titleWrap,style:{justifyContent:"space-between"}},(fe==null?void 0:fe.item_type)==="bprogram"?L.createElement(_.Z,{className:v.titleHtml,value:ye(fe,ge)+((Ut=fe==null?void 0:fe.program_attr)==null?void 0:Ut.description)}):L.createElement(_.Z,{className:v.titleHtml,value:ye(fe,ge)+((fe==null?void 0:fe.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+(fe.name||(fe==null?void 0:fe.shixun_name))}),(fe==null?void 0:fe.item_type)==="combination"&&!Ze&&L.createElement("span",{onClick:te=>{cr(!Gt)},style:{textAlign:"end",flexShrink:0,cursor:"pointer"}},Gt?"\u5C55\u5F00":"\u6536\u8D77")),Y()))},Z={bg:"bg___uBTSf",wrap:"wrap___u47s7",flexRow:"flexRow___QK3mq",flexColumn:"flexColumn___IEH4c",flexJustifyBetween:"flexJustifyBetween___VROqY",relative:"relative___iGg_n",questionNumber:"questionNumber___CYWUo",score:"score___pHhZR",selectTopicButton:"selectTopicButton___aNhaw",line:"line___zzL1y",dragTip:"dragTip___eJpug",typeActive:"typeActive___cHbxQ",mouseTypeActive:"mouseTypeActive___THFkb",typeName:"typeName___PsYTO",typeNumber:"typeNumber___IW6t9",typeAction:"typeAction___gdIEg",setScore:"setScore___ftbgZ",delete:"delete___d1fFi",modal:"modal___COzbG",modalColumn:"modalColumn___Z8nDu",shixunModal:"shixunModal___xxSWV",shixunScore:"shixunScore___zrpkw"},Ie=x(96670),Ht=x(96486),Se=x.n(Ht),pe=x(38244),T=Object.defineProperty,F=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,j=Object.getOwnPropertySymbols,ze=Object.prototype.hasOwnProperty,tt=Object.prototype.propertyIsEnumerable,Nt=(ge,Ae,ve)=>Ae in ge?T(ge,Ae,{enumerable:!0,configurable:!0,writable:!0,value:ve}):ge[Ae]=ve,gt=(ge,Ae)=>{for(var ve in Ae||(Ae={}))ze.call(Ae,ve)&&Nt(ge,ve,Ae[ve]);if(j)for(var ve of j(Ae))tt.call(Ae,ve)&&Nt(ge,ve,Ae[ve]);return ge},Me=(ge,Ae)=>F(ge,ie(Ae)),_e=(ge,Ae)=>{var ve={};for(var fe in ge)ze.call(ge,fe)&&Ae.indexOf(fe)<0&&(ve[fe]=ge[fe]);if(ge!=null&&j)for(var fe of j(ge))Ae.indexOf(fe)<0&&tt.call(ge,fe)&&(ve[fe]=ge[fe]);return ve},Je=(ge,Ae,ve)=>new Promise((fe,ot)=>{var Ze=yt=>{try{xe(ve.next(yt))}catch(ht){ot(ht)}},Oe=yt=>{try{xe(ve.throw(yt))}catch(ht){ot(ht)}},xe=yt=>yt.done?fe(yt.value):Promise.resolve(yt.value).then(Ze,Oe);xe((ve=ve.apply(ge,Ae)).next())});const re=ge=>({\u5355\u9009\u9898:2,\u591A\u9009\u9898:5,\u586B\u7A7A\u9898:2,\u5224\u65AD\u9898:2,\u7B80\u7B54\u9898:10,\u7F16\u7A0B\u9898:10,\u5B9E\u8BAD\u9898:5,\u7EC4\u5408\u9898:10})[ge]||0,Ue=ge=>{var Ae=ge,{problemsetPreview:ve,user:fe,globalSetting:ot,loading:Ze,dispatch:Oe}=Ae,xe=_e(Ae,["problemsetPreview","user","globalSetting","loading","dispatch"]),yt,ht,Ut,Gt;const[cr,ur]=(0,A.useState)(),[rr,ar]=(0,A.useState)(),ut=(0,A.useRef)();console.log(ve,"problemsetPreview"),(0,A.useEffect)(()=>(Oe({type:"globalSetting/footerToggle",payload:!1}),()=>{Oe({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,A.useEffect)(()=>{be()},[]);const be=()=>{Oe({type:"problemsetPreview/getPaperData"})},ae=(te,ne,Ke=[],Fe,Ce)=>{var kt;const $t=Se().cloneDeep(Ce),G=Se().cloneDeep(Ke).map(nt=>Me(gt({},nt),{challenge_score:nt.challenge_score||5}));if(ut.current=Fe||re(ne),ne==="\u5B9E\u8BAD\u9898")return he.default.confirm({centered:!0,width:530,title:"\u8BBE\u7F6E\u5206\u6570",content:A.createElement("div",{className:Z.shixunModal},A.createElement("div",null,"\u5173\u5361\uFF1A"),G==null?void 0:G.map((nt,dt)=>A.createElement("div",{className:Z.shixunScore},dt+1,"\u3001",nt.challenge_name,A.createElement("div",{style:{minWidth:"130px"}},A.createElement(ue.Z,{defaultValue:nt.challenge_score,min:1,onChange:qt=>{nt.challenge_score=qt}}),A.createElement("span",{className:"ml5"},"\u5206/\u9898"))))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Je(void 0,null,function*(){yield(0,pe.Cc)({id:te,challenge_scores:G.map(nt=>({challenge_id:nt.challenge_id,score:nt.challenge_score}))}),ut.current=null,be()})});if(ne==="\u7EC4\u5408\u9898")return he.default.confirm({centered:!0,width:530,title:"\u8BBE\u7F6E\u5206\u6570",content:A.createElement("div",{className:Z.shixunModal,style:{maxHeight:200,overflow:"auto"}},(kt=$t==null?void 0:$t.sub_questions)==null?void 0:kt.map((nt,dt)=>A.createElement("div",{className:Z.shixunScore},"\u7B2C",dt+1,"\u5C0F\u9898",A.createElement("div",{style:{minWidth:"130px"}},A.createElement(ue.Z,{defaultValue:nt.score,min:1,onChange:qt=>{nt.score=qt}}),A.createElement("span",{className:"ml5"},"\u5206"))))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Je(void 0,null,function*(){var nt;yield(0,pe.Vl)({id:te,subs:(nt=$t==null?void 0:$t.sub_questions)==null?void 0:nt.map(dt=>({basket_id:dt.basket_id,score:dt.score}))}),ut.current=null,be()})});he.default.confirm({centered:!0,title:"\u8BBE\u7F6E\u5206\u6570",content:A.createElement("div",{className:""},A.createElement("span",null,"\u672C\u9898\u5206\u503C\uFF1A"),A.createElement(ue.Z,{min:1,defaultValue:ut.current,onChange:nt=>{ut.current=nt}}),A.createElement("span",{className:"ml5"},"\u5206/\u9898"),A.createElement("br",null),ne==="\u586B\u7A7A\u9898"&&A.createElement("div",{style:{color:"rgb(255, 0, 0)"}},"\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Je(void 0,null,function*(){yield Oe({type:"problemsetPreview/setScore",payload:{id:te,score:ut.current}}),ut.current=null,be()})})},Q=te=>{he.default.confirm({centered:!0,title:"\u63D0\u793A",content:A.createElement("div",{className:Z.modal},"\u786E\u8BA4\u5220\u9664\u8BE5\u8BD5\u9898\uFF1F"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Je(void 0,null,function*(){yield Oe({type:"problemsetPreview/handleDelete",payload:{id:te}}),be()})})},V=(te,ne)=>{ut.current=re(ne),he.default.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:A.createElement("div",{className:""},A.createElement("span",null,ne==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":ne,"\uFF1A"),A.createElement(ue.Z,{min:1,defaultValue:ut.current,onChange:Ke=>{ut.current=Ke}}),A.createElement("span",{className:"ml5"},"\u5206/\u9898"),A.createElement("br",null),ne==="\u586B\u7A7A\u9898"&&A.createElement("div",{style:{color:"rgb(255, 0, 0)"}},"\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Je(void 0,null,function*(){yield Oe({type:"problemsetPreview/batchSetScore",payload:{item_type:te,score:ut.current}}),ut.current=null,be()})})},Y=te=>{he.default.confirm({centered:!0,title:"\u63D0\u793A",content:A.createElement("div",{className:Z.modalColumn},A.createElement("p",null,"\u5220\u9664\u5927\u9898\uFF0C\u5C06\u5220\u9664\u8BE5\u5927\u9898\u4E0B\u6240\u6709\u5C0F\u9898"),A.createElement("p",null,"\u786E\u8BA4\u5220\u9664\u8BE5\u5927\u9898\uFF1F")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Je(void 0,null,function*(){yield Oe({type:"problemsetPreview/batchDelete",payload:{item_type:te}}),be()})})},ye=(te,ne)=>Je(void 0,null,function*(){if(!te.destination||!te.source)return;const Ke=ne.questions[te.source.index].id,Fe=te.destination.index+1;(yield Oe({type:"problemsetPreview/adjustPosition",payload:{id:Ke,position:Fe}})).status!==-1&&be()});return A.createElement("section",{className:Z.bg},A.createElement(U.Z,{className:"mt30",separator:">"},A.createElement(U.Z.Item,null,"\u8BD5\u9898\u5E93"),A.createElement(U.Z.Item,{href:"/problemset"},"\u4EBA\u5DE5\u7EC4\u5377"),A.createElement(U.Z.Item,null,"\u8BD5\u5377\u9884\u89C8")),A.createElement("div",{className:Z.wrap},A.createElement("div",{className:"pt20 pb20"},A.createElement("div",{className:`${Z.flexRow} ${Z.flexJustifyBetween}`},A.createElement("div",null,A.createElement("span",{className:Z.questionNumber},"\u9898\u6570\uFF1A",(yt=ve.paperData)==null?void 0:yt.all_questions_count),A.createElement("span",{className:Z.score},"\u603B\u5206\uFF1A",(ht=ve.paperData)==null?void 0:ht.all_score)),A.createElement("div",{className:Z.selectTopicButton,onClick:()=>J.history.push("/problemset/preview_select")},"\u7EE7\u7EED\u9009\u9898")),A.createElement("div",{className:Z.line}),A.createElement("div",{className:Z.dragTip},"\u5C0F\u9898\u4E4B\u95F4\u53EF\u4EE5\u62D6\u52A8\u6392\u5E8F"),(Gt=(Ut=ve.paperData)==null?void 0:Ut.questionList)==null?void 0:Gt.map((te,ne)=>{const Ke=te.type===rr;return console.log(te,"paperItem"),A.createElement("div",{className:`${Z.relative} mt20 mb20`,key:ne},A.createElement("div",{className:`${Z.typeActive} ${Ke?Z.mouseTypeActive:""}`,onMouseEnter:()=>{ar(te.type),ur(null)}},A.createElement("span",{className:`${Z.typeName} ${Ke?"ml20":""}`},te.number,"\u3001",te.name),A.createElement("span",{className:Z.typeNumber},"\uFF08\u5171",te.questions_count,"\u9898\uFF0C",(te==null?void 0:te.type)==="COMBINATION"?`\u5305\u542B${te==null?void 0:te.sub_questions_count}\u5C0F\u9898\uFF0C`:"","\u5171",te.questions_score,"\u5206\uFF09")),Ke&&A.createElement("div",{className:`${Z.typeAction} ${Z.flexRow}`},te.type!=="PRACTICAL"&&A.createElement("div",{className:Z.setScore,onClick:()=>V(te.type,te.name)},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206"),A.createElement("div",{className:Z.delete,onClick:()=>Y(te.type)},"\u5220\u9664")),A.createElement(q.Z5,{onDragEnd:Fe=>ye(Fe,te)},A.createElement(q.bK,{droppableId:ne.toString()},(Fe,Ce)=>{var kt;return A.createElement("div",Me(gt({className:"mt20",ref:Fe.innerRef},Fe.droppableProps),{onScroll:()=>{}}),(kt=te.questions)==null?void 0:kt.map(($t,G)=>A.createElement(q._l,{draggableId:$t.id.toString(),index:G,key:$t.id},nt=>A.createElement("div",gt(gt({ref:nt.innerRef},nt.draggableProps),nt.dragHandleProps),A.createElement(lt,{index:G,typeName:te.name,type:te.type,data:$t,inMouseId:cr,onSetScore:ae,onDelete:Q,onMouseEnter:dt=>{ur(dt),ar(null)}})))))})))}))),A.createElement(Ie.t,{okText:"\u4FDD\u5B58\u8BD5\u5377",onCancel:()=>J.history.replace("/problemset"),onOk:()=>J.history.push("/problemset/preview_new")}))};var rt=(0,J.connect)(({problemsetPreview:ge,user:Ae,loading:ve,globalSetting:fe})=>({problemsetPreview:ge,user:Ae,globalSetting:fe,loading:ve.effects}))(Ue)},9708:function(er,ft,x){"use strict";x.d(ft,{F:function(){return U},Z:function(){return ue}});var A=x(94184),J=x.n(A);const he=null;function ue(q,ce,_){return J()({[`${q}-status-success`]:ce==="success",[`${q}-status-warning`]:ce==="warning",[`${q}-status-error`]:ce==="error",[`${q}-status-validating`]:ce==="validating",[`${q}-has-feedback`]:_})}const U=(q,ce)=>ce||q},85673:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return Je}});var A=x(94184),J=x.n(A),he=x(37419),ue=x(1337),U=x(67294),q=x(96159),ce=x(53124),_=x(42922),v=x(35874);const De=re=>{let{children:Ue}=re;const{getPrefixCls:rt}=U.useContext(ce.E_),ge=rt("breadcrumb");return U.createElement("li",{className:`${ge}-separator`,"aria-hidden":"true"},Ue===""?Ue:Ue||"/")};De.__ANT_BREADCRUMB_SEPARATOR=!0;var Ne=De,L=function(re,Ue){var rt={};for(var ge in re)Object.prototype.hasOwnProperty.call(re,ge)&&Ue.indexOf(ge)<0&&(rt[ge]=re[ge]);if(re!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ae=0,ge=Object.getOwnPropertySymbols(re);Ae<ge.length;Ae++)Ue.indexOf(ge[Ae])<0&&Object.prototype.propertyIsEnumerable.call(re,ge[Ae])&&(rt[ge[Ae]]=re[ge[Ae]]);return rt};function Le(re,Ue){if(re.title===void 0||re.title===null)return null;const rt=Object.keys(Ue).join("|");return typeof re.title=="object"?re.title:String(re.title).replace(new RegExp(`:(${rt})`,"g"),(ge,Ae)=>Ue[Ae]||ge)}function Re(re,Ue,rt,ge){if(rt==null)return null;const{className:Ae,onClick:ve}=Ue,fe=L(Ue,["className","onClick"]),ot=Object.assign(Object.assign({},(0,ue.Z)(fe,{data:!0,aria:!0})),{onClick:ve});return ge!==void 0?U.createElement("a",Object.assign({},ot,{className:J()(`${re}-link`,Ae),href:ge}),rt):U.createElement("span",Object.assign({},ot,{className:J()(`${re}-link`,Ae)}),rt)}function pt(re,Ue){return(ge,Ae,ve,fe,ot)=>{if(Ue)return Ue(ge,Ae,ve,fe);const Ze=Le(ge,Ae);return Re(re,ge,Ze,ot)}}var lt=function(re,Ue){var rt={};for(var ge in re)Object.prototype.hasOwnProperty.call(re,ge)&&Ue.indexOf(ge)<0&&(rt[ge]=re[ge]);if(re!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ae=0,ge=Object.getOwnPropertySymbols(re);Ae<ge.length;Ae++)Ue.indexOf(ge[Ae])<0&&Object.prototype.propertyIsEnumerable.call(re,ge[Ae])&&(rt[ge[Ae]]=re[ge[Ae]]);return rt};const Z=re=>{const{prefixCls:Ue,separator:rt="/",children:ge,menu:Ae,overlay:ve,dropdownProps:fe,href:ot}=re,Oe=(xe=>{if(Ae||ve){const yt=Object.assign({},fe);if(Ae){const ht=Ae||{},{items:Ut}=ht,Gt=lt(ht,["items"]);yt.menu=Object.assign(Object.assign({},Gt),{items:Ut==null?void 0:Ut.map((cr,ur)=>{var{key:rr,title:ar,label:ut,path:be}=cr,ae=lt(cr,["key","title","label","path"]);let Q=ut!=null?ut:ar;return be&&(Q=U.createElement("a",{href:`${ot}${be}`},Q)),Object.assign(Object.assign({},ae),{key:rr!=null?rr:ur,label:Q})})})}else ve&&(yt.overlay=ve);return U.createElement(v.Z,Object.assign({placement:"bottom"},yt),U.createElement("span",{className:`${Ue}-overlay-link`},xe,U.createElement(_.Z,null)))}return xe})(ge);return Oe!=null?U.createElement(U.Fragment,null,U.createElement("li",null,Oe),rt&&U.createElement(Ne,null,rt)):null},Ie=re=>{const{prefixCls:Ue,children:rt,href:ge}=re,Ae=lt(re,["prefixCls","children","href"]),{getPrefixCls:ve}=U.useContext(ce.E_),fe=ve("breadcrumb",Ue);return U.createElement(Z,Object.assign({},Ae,{prefixCls:fe}),Re(fe,Ae,rt,ge))};Ie.__ANT_BREADCRUMB_ITEM=!0;var Ht=Ie,Se=x(14747),pe=x(67968),T=x(45503);const F=re=>{const{componentCls:Ue,iconCls:rt}=re;return{[Ue]:Object.assign(Object.assign({},(0,Se.Wf)(re)),{color:re.itemColor,fontSize:re.fontSize,[rt]:{fontSize:re.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:re.linkColor,transition:`color ${re.motionDurationMid}`,padding:`0 ${re.paddingXXS}px`,borderRadius:re.borderRadiusSM,height:re.lineHeight*re.fontSize,display:"inline-block",marginInline:-re.marginXXS,"&:hover":{color:re.linkHoverColor,backgroundColor:re.colorBgTextHover}},(0,Se.Qy)(re)),"li:last-child":{color:re.lastItemColor},[`${Ue}-separator`]:{marginInline:re.separatorMargin,color:re.separatorColor},[`${Ue}-link`]:{[`
|
|
|
> ${rt} + span,
|
|
|
> ${rt} + a
|
|
|
`]:{marginInlineStart:re.marginXXS}},[`${Ue}-overlay-link`]:{borderRadius:re.borderRadiusSM,height:re.lineHeight*re.fontSize,display:"inline-block",padding:`0 ${re.paddingXXS}px`,marginInline:-re.marginXXS,[`> ${rt}`]:{marginInlineStart:re.marginXXS,fontSize:re.fontSizeIcon},"&:hover":{color:re.linkHoverColor,backgroundColor:re.colorBgTextHover,a:{color:re.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${re.componentCls}-rtl`]:{direction:"rtl"}})}};var ie=(0,pe.Z)("Breadcrumb",re=>{const Ue=(0,T.TS)(re,{});return[F(Ue)]},re=>({itemColor:re.colorTextDescription,lastItemColor:re.colorText,iconFontSize:re.fontSize,linkColor:re.colorTextDescription,linkHoverColor:re.colorText,separatorColor:re.colorTextDescription,separatorMargin:re.marginXS})),j=function(re,Ue){var rt={};for(var ge in re)Object.prototype.hasOwnProperty.call(re,ge)&&Ue.indexOf(ge)<0&&(rt[ge]=re[ge]);if(re!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ae=0,ge=Object.getOwnPropertySymbols(re);Ae<ge.length;Ae++)Ue.indexOf(ge[Ae])<0&&Object.prototype.propertyIsEnumerable.call(re,ge[Ae])&&(rt[ge[Ae]]=re[ge[Ae]]);return rt};function ze(re){const{breadcrumbName:Ue,children:rt}=re,ge=j(re,["breadcrumbName","children"]),Ae=Object.assign({title:Ue},ge);return rt&&(Ae.menu={items:rt.map(ve=>{var{breadcrumbName:fe}=ve,ot=j(ve,["breadcrumbName"]);return Object.assign(Object.assign({},ot),{title:fe})})}),Ae}function tt(re,Ue){return(0,U.useMemo)(()=>re||(Ue?Ue.map(ze):null),[re,Ue])}var Nt=function(re,Ue){var rt={};for(var ge in re)Object.prototype.hasOwnProperty.call(re,ge)&&Ue.indexOf(ge)<0&&(rt[ge]=re[ge]);if(re!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ae=0,ge=Object.getOwnPropertySymbols(re);Ae<ge.length;Ae++)Ue.indexOf(ge[Ae])<0&&Object.prototype.propertyIsEnumerable.call(re,ge[Ae])&&(rt[ge[Ae]]=re[ge[Ae]]);return rt};const gt=(re,Ue)=>{if(Ue===void 0)return Ue;let rt=(Ue||"").replace(/^\//,"");return Object.keys(re).forEach(ge=>{rt=rt.replace(`:${ge}`,re[ge])}),rt},Me=re=>{const{prefixCls:Ue,separator:rt="/",style:ge,className:Ae,rootClassName:ve,routes:fe,items:ot,children:Ze,itemRender:Oe,params:xe={}}=re,yt=Nt(re,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:ht,direction:Ut,breadcrumb:Gt}=U.useContext(ce.E_);let cr;const ur=ht("breadcrumb",Ue),[rr,ar]=ie(ur),ut=tt(ot,fe),be=pt(ur,Oe);if(ut&&ut.length>0){const V=[],Y=ot||fe;cr=ut.map((ye,te)=>{const{path:ne,key:Ke,type:Fe,menu:Ce,overlay:kt,onClick:$t,className:G,separator:nt,dropdownProps:dt}=ye,qt=gt(xe,ne);qt!==void 0&&V.push(qt);const vr=Ke!=null?Ke:te;if(Fe==="separator")return U.createElement(Ne,{key:vr},nt);const or={},tn=te===ut.length-1;Ce?or.menu=Ce:kt&&(or.overlay=kt);let{href:Vt}=ye;return V.length&&qt!==void 0&&(Vt=`#/${V.join("/")}`),U.createElement(Z,Object.assign({key:vr},or,(0,ue.Z)(ye,{data:!0,aria:!0}),{className:G,dropdownProps:dt,href:Vt,separator:tn?"":rt,onClick:$t,prefixCls:ur}),be(ye,xe,Y,V,Vt))})}else if(Ze){const V=(0,he.Z)(Ze).length;cr=(0,he.Z)(Ze).map((Y,ye)=>{if(!Y)return Y;const te=ye===V-1;return(0,q.Tm)(Y,{separator:te?"":rt,key:ye})})}const ae=J()(ur,Gt==null?void 0:Gt.className,{[`${ur}-rtl`]:Ut==="rtl"},Ae,ve,ar),Q=Object.assign(Object.assign({},Gt==null?void 0:Gt.style),ge);return rr(U.createElement("nav",Object.assign({className:ae,style:Q},yt),U.createElement("ol",null,cr)))};Me.Item=Ht,Me.Separator=Ne;var _e=Me,Je=_e},35874:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return Q}});var A=x(67294),J=x(91034),he=x(94184),ue=x.n(he),U=x(87462),q=x(4942),ce=x(97685),_=x(45987),v=x(62709),De=x(71002),Ne=x(12060);function L(V,Y,ye){var te=React.useRef({});return(!("value"in te.current)||ye(te.current.condition,Y))&&(te.current.value=V(),te.current.condition=Y),te.current.value}function Le(V,Y){typeof V=="function"?V(Y):(0,De.Z)(V)==="object"&&V&&"current"in V&&(V.current=Y)}function Re(){for(var V=arguments.length,Y=new Array(V),ye=0;ye<V;ye++)Y[ye]=arguments[ye];var te=Y.filter(function(ne){return ne});return te.length<=1?te[0]:function(ne){Y.forEach(function(Ke){Le(Ke,ne)})}}function pt(){for(var V=arguments.length,Y=new Array(V),ye=0;ye<V;ye++)Y[ye]=arguments[ye];return useMemo(function(){return Re.apply(void 0,Y)},Y,function(te,ne){return te.length===ne.length&&te.every(function(Ke,Fe){return Ke===ne[Fe]})})}function lt(V){var Y,ye,te=(0,Ne.isMemo)(V)?V.type.type:V.type;return!(typeof te=="function"&&!((Y=te.prototype)!==null&&Y!==void 0&&Y.render)||typeof V=="function"&&!((ye=V.prototype)!==null&&ye!==void 0&&ye.render))}var Z={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Y){var ye=Y.keyCode;if(Y.altKey&&!Y.ctrlKey||Y.metaKey||ye>=Z.F1&&ye<=Z.F12)return!1;switch(ye){case Z.ALT:case Z.CAPS_LOCK:case Z.CONTEXT_MENU:case Z.CTRL:case Z.DOWN:case Z.END:case Z.ESC:case Z.HOME:case Z.INSERT:case Z.LEFT:case Z.MAC_FF_META:case Z.META:case Z.NUMLOCK:case Z.NUM_CENTER:case Z.PAGE_DOWN:case Z.PAGE_UP:case Z.PAUSE:case Z.PRINT_SCREEN:case Z.RIGHT:case Z.SHIFT:case Z.UP:case Z.WIN_KEY:case Z.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Y){if(Y>=Z.ZERO&&Y<=Z.NINE||Y>=Z.NUM_ZERO&&Y<=Z.NUM_MULTIPLY||Y>=Z.A&&Y<=Z.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Y===0)return!0;switch(Y){case Z.SPACE:case Z.QUESTION_MARK:case Z.NUM_PLUS:case Z.NUM_MINUS:case Z.NUM_PERIOD:case Z.NUM_DIVISION:case Z.SEMICOLON:case Z.DASH:case Z.EQUALS:case Z.COMMA:case Z.PERIOD:case Z.SLASH:case Z.APOSTROPHE:case Z.SINGLE_QUOTE:case Z.OPEN_SQUARE_BRACKET:case Z.BACKSLASH:case Z.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Ie=Z,Ht=function(Y){return+setTimeout(Y,16)},Se=function(Y){return clearTimeout(Y)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ht=function(Y){return window.requestAnimationFrame(Y)},Se=function(Y){return window.cancelAnimationFrame(Y)});var pe=0,T=new Map;function F(V){T.delete(V)}var ie=function(Y){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;pe+=1;var te=pe;function ne(Ke){if(Ke===0)F(te),Y();else{var Fe=Ht(function(){ne(Ke-1)});T.set(te,Fe)}}return ne(ye),te};ie.cancel=function(V){var Y=T.get(V);return F(Y),Se(Y)};var j=ie,ze=Ie.ESC,tt=Ie.TAB;function Nt(V){var Y=V.visible,ye=V.triggerRef,te=V.onVisibleChange,ne=V.autoFocus,Ke=V.overlayRef,Fe=A.useRef(!1),Ce=function(){if(Y){var nt,dt;(nt=ye.current)===null||nt===void 0||(dt=nt.focus)===null||dt===void 0||dt.call(nt),te==null||te(!1)}},kt=function(){var nt;return(nt=Ke.current)!==null&&nt!==void 0&&nt.focus?(Ke.current.focus(),Fe.current=!0,!0):!1},$t=function(nt){switch(nt.keyCode){case ze:Ce();break;case tt:{var dt=!1;Fe.current||(dt=kt()),dt?nt.preventDefault():Ce();break}}};A.useEffect(function(){return Y?(window.addEventListener("keydown",$t),ne&&j(kt,3),function(){window.removeEventListener("keydown",$t),Fe.current=!1}):function(){Fe.current=!1}},[Y])}var gt=(0,A.forwardRef)(function(V,Y){var ye=V.overlay,te=V.arrow,ne=V.prefixCls,Ke=(0,A.useMemo)(function(){var Ce;return typeof ye=="function"?Ce=ye():Ce=ye,Ce},[ye]),Fe=Re(Y,Ke==null?void 0:Ke.ref);return A.createElement(A.Fragment,null,te&&A.createElement("div",{className:"".concat(ne,"-arrow")}),A.cloneElement(Ke,{ref:lt(Ke)?Fe:void 0}))}),Me=gt,_e={adjustX:1,adjustY:1},Je=[0,0],re={topLeft:{points:["bl","tl"],overflow:_e,offset:[0,-4],targetOffset:Je},top:{points:["bc","tc"],overflow:_e,offset:[0,-4],targetOffset:Je},topRight:{points:["br","tr"],overflow:_e,offset:[0,-4],targetOffset:Je},bottomLeft:{points:["tl","bl"],overflow:_e,offset:[0,4],targetOffset:Je},bottom:{points:["tc","bc"],overflow:_e,offset:[0,4],targetOffset:Je},bottomRight:{points:["tr","br"],overflow:_e,offset:[0,4],targetOffset:Je}},Ue=re,rt=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function ge(V,Y){var ye,te=V.arrow,ne=te===void 0?!1:te,Ke=V.prefixCls,Fe=Ke===void 0?"rc-dropdown":Ke,Ce=V.transitionName,kt=V.animation,$t=V.align,G=V.placement,nt=G===void 0?"bottomLeft":G,dt=V.placements,qt=dt===void 0?Ue:dt,vr=V.getPopupContainer,or=V.showAction,tn=V.hideAction,Vt=V.overlayClassName,ct=V.overlayStyle,rn=V.visible,nn=V.trigger,br=nn===void 0?["hover"]:nn,dr=V.autoFocus,Xr=V.overlay,It=V.children,$n=V.onVisibleChange,dn=(0,_.Z)(V,rt),wn=A.useState(),jr=(0,ce.Z)(wn,2),Lr=jr[0],At=jr[1],Fr="visible"in V?rn:Lr,vi=A.useRef(null),ni=A.useRef(null),li=A.useRef(null);A.useImperativeHandle(Y,function(){return vi.current});var hn=function(Qt){At(Qt),$n==null||$n(Qt)};Nt({visible:Fr,triggerRef:li,onVisibleChange:hn,autoFocus:dr,overlayRef:ni});var Di=function(Qt){var Jt=V.onOverlayClick;At(!1),Jt&&Jt(Qt)},Sn=function(){return A.createElement(Me,{ref:ni,overlay:Xr,prefixCls:Fe,arrow:ne})},K=function(){return typeof Xr=="function"?Sn:Sn()},X=function(){var Qt=V.minOverlayWidthMatchTrigger,Jt=V.alignPoint;return"minOverlayWidthMatchTrigger"in V?Qt:!Jt},me=function(){var Qt=V.openClassName;return Qt!==void 0?Qt:"".concat(Fe,"-open")},Ee=A.cloneElement(It,{className:ue()((ye=It.props)===null||ye===void 0?void 0:ye.className,Fr&&me()),ref:lt(It)?Re(li,It.ref):void 0}),at=tn;return!at&&br.indexOf("contextMenu")!==-1&&(at=["click"]),A.createElement(v.Z,(0,U.Z)({builtinPlacements:qt},dn,{prefixCls:Fe,ref:vi,popupClassName:ue()(Vt,(0,q.Z)({},"".concat(Fe,"-show-arrow"),ne)),popupStyle:ct,action:br,showAction:or,hideAction:at,popupPlacement:nt,popupAlign:$t,popupTransitionName:Ce,popupAnimation:kt,popupVisible:Fr,stretch:X()?"minWidth":"",popup:K(),onPopupVisibleChange:hn,onPopupClick:Di,getPopupContainer:vr}),Ee)}var Ae=A.forwardRef(ge),ve=Ae,fe=x(60276),ot=x(5663),Ze=x(10366),Oe=x(80636),xe=x(8745),yt=x(96159),ht=x(53124),Ut=x(68508),Gt=x(76529),cr=x(29691),ur=x(66748);const rr=null,ar=V=>{const{menu:Y,arrow:ye,prefixCls:te,children:ne,trigger:Ke,disabled:Fe,dropdownRender:Ce,getPopupContainer:kt,overlayClassName:$t,rootClassName:G,open:nt,onOpenChange:dt,visible:qt,onVisibleChange:vr,mouseEnterDelay:or=.15,mouseLeaveDelay:tn=.1,autoAdjustOverflow:Vt=!0,placement:ct="",overlay:rn,transitionName:nn}=V,{getPopupContainer:br,getPrefixCls:dr,direction:Xr}=A.useContext(ht.E_),It=A.useMemo(()=>{const Ee=dr();return nn!==void 0?nn:ct.includes("top")?`${Ee}-slide-down`:`${Ee}-slide-up`},[dr,ct,nn]),$n=A.useMemo(()=>ct?ct.includes("Center")?ct.slice(0,ct.indexOf("Center")):ct:Xr==="rtl"?"bottomRight":"bottomLeft",[ct,Xr]),dn=dr("dropdown",te),[wn,jr]=(0,ur.Z)(dn),[,Lr]=(0,cr.Z)(),At=A.Children.only(ne),Fr=(0,yt.Tm)(At,{className:ue()(`${dn}-trigger`,{[`${dn}-rtl`]:Xr==="rtl"},At.props.className),disabled:Fe}),vi=Fe?[]:Ke;let ni;vi&&vi.includes("contextMenu")&&(ni=!0);const[li,hn]=(0,ot.Z)(!1,{value:nt!=null?nt:qt}),Di=(0,fe.useEvent)(Ee=>{dt==null||dt(Ee),vr==null||vr(Ee),hn(Ee)}),Sn=ue()($t,G,jr,{[`${dn}-rtl`]:Xr==="rtl"}),K=(0,Oe.Z)({arrowPointAtCenter:typeof ye=="object"&&ye.pointAtCenter,autoAdjustOverflow:Vt,offset:Lr.marginXXS,arrowWidth:ye?Lr.sizePopupArrow:0,borderRadius:Lr.borderRadius}),X=A.useCallback(()=>{hn(!1)},[]),me=()=>{let Ee;return Y!=null&&Y.items?Ee=A.createElement(Ut.default,Object.assign({},Y)):typeof rn=="function"?Ee=rn():Ee=rn,Ce&&(Ee=Ce(Ee)),Ee=A.Children.only(typeof Ee=="string"?A.createElement("span",null,Ee):Ee),A.createElement(Gt.J,{prefixCls:`${dn}-menu`,expandIcon:A.createElement("span",{className:`${dn}-menu-submenu-arrow`},A.createElement(J.Z,{className:`${dn}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:X,validator:at=>{let{mode:Mt}=at}},Ee)};return wn(A.createElement(ve,Object.assign({alignPoint:ni},(0,Ze.Z)(V,["rootClassName"]),{mouseEnterDelay:or,mouseLeaveDelay:tn,visible:li,builtinPlacements:K,arrow:!!ye,overlayClassName:Sn,prefixCls:dn,getPopupContainer:kt||br,transitionName:It,trigger:vi,overlay:me,placement:$n,onVisibleChange:Di}),Fr))};function ut(V){return Object.assign(Object.assign({},V),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const be=(0,xe.Z)(ar,"dropdown",V=>V,ut),ae=V=>A.createElement(be,Object.assign({},V),A.createElement("span",null));ar._InternalPanelDoNotUseOrYouWillBeFired=ae;var Q=ar},66748:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return Ne}});var A=x(14747),J=x(67771),he=x(33297),ue=x(50438),U=x(97414),q=x(67968),ce=x(45503),v=L=>{const{componentCls:Le,menuCls:Re,colorError:pt,colorTextLightSolid:lt}=L,Z=`${Re}-item`;return{[`${Le}, ${Le}-menu-submenu`]:{[`${Re} ${Z}`]:{[`&${Z}-danger:not(${Z}-disabled)`]:{color:pt,"&:hover":{color:lt,backgroundColor:pt}}}}}};const De=L=>{const{componentCls:Le,menuCls:Re,zIndexPopup:pt,dropdownArrowDistance:lt,sizePopupArrow:Z,antCls:Ie,iconCls:Ht,motionDurationMid:Se,dropdownPaddingVertical:pe,fontSize:T,dropdownEdgeChildPadding:F,colorTextDisabled:ie,fontSizeIcon:j,controlPaddingHorizontal:ze,colorBgElevated:tt}=L;return[{[Le]:Object.assign(Object.assign({},(0,A.Wf)(L)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:pt,display:"block","&::before":{position:"absolute",insetBlock:-lt+Z/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${Ie}-btn`]:{[`& > ${Ht}-down, & > ${Ie}-btn-icon > ${Ht}-down`]:{fontSize:j}},[`${Le}-wrap`]:{position:"relative",[`${Ie}-btn > ${Ht}-down`]:{fontSize:j},[`${Ht}-down::before`]:{transition:`transform ${Se}`}},[`${Le}-wrap-open`]:{[`${Ht}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${Ie}-slide-down-enter${Ie}-slide-down-enter-active${Le}-placement-bottomLeft,
|
|
|
&${Ie}-slide-down-appear${Ie}-slide-down-appear-active${Le}-placement-bottomLeft,
|
|
|
&${Ie}-slide-down-enter${Ie}-slide-down-enter-active${Le}-placement-bottom,
|
|
|
&${Ie}-slide-down-appear${Ie}-slide-down-appear-active${Le}-placement-bottom,
|
|
|
&${Ie}-slide-down-enter${Ie}-slide-down-enter-active${Le}-placement-bottomRight,
|
|
|
&${Ie}-slide-down-appear${Ie}-slide-down-appear-active${Le}-placement-bottomRight`]:{animationName:J.fJ},[`&${Ie}-slide-up-enter${Ie}-slide-up-enter-active${Le}-placement-topLeft,
|
|
|
&${Ie}-slide-up-appear${Ie}-slide-up-appear-active${Le}-placement-topLeft,
|
|
|
&${Ie}-slide-up-enter${Ie}-slide-up-enter-active${Le}-placement-top,
|
|
|
&${Ie}-slide-up-appear${Ie}-slide-up-appear-active${Le}-placement-top,
|
|
|
&${Ie}-slide-up-enter${Ie}-slide-up-enter-active${Le}-placement-topRight,
|
|
|
&${Ie}-slide-up-appear${Ie}-slide-up-appear-active${Le}-placement-topRight`]:{animationName:J.Qt},[`&${Ie}-slide-down-leave${Ie}-slide-down-leave-active${Le}-placement-bottomLeft,
|
|
|
&${Ie}-slide-down-leave${Ie}-slide-down-leave-active${Le}-placement-bottom,
|
|
|
&${Ie}-slide-down-leave${Ie}-slide-down-leave-active${Le}-placement-bottomRight`]:{animationName:J.Uw},[`&${Ie}-slide-up-leave${Ie}-slide-up-leave-active${Le}-placement-topLeft,
|
|
|
&${Ie}-slide-up-leave${Ie}-slide-up-leave-active${Le}-placement-top,
|
|
|
&${Ie}-slide-up-leave${Ie}-slide-up-leave-active${Le}-placement-topRight`]:{animationName:J.ly}})},(0,U.ZP)(L,{colorBg:tt,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${Le} ${Re}`]:{position:"relative",margin:0},[`${Re}-submenu-popup`]:{position:"absolute",zIndex:pt,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${Le}, ${Le}-menu-submenu`]:{[Re]:Object.assign(Object.assign({padding:F,listStyleType:"none",backgroundColor:tt,backgroundClip:"padding-box",borderRadius:L.borderRadiusLG,outline:"none",boxShadow:L.boxShadowSecondary},(0,A.Qy)(L)),{[`${Re}-item-group-title`]:{padding:`${pe}px ${ze}px`,color:L.colorTextDescription,transition:`all ${Se}`},[`${Re}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${Re}-item-icon`]:{minWidth:T,marginInlineEnd:L.marginXS,fontSize:L.fontSizeSM},[`${Re}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${Se}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${Re}-item, ${Re}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${pe}px ${ze}px`,color:L.colorText,fontWeight:"normal",fontSize:T,lineHeight:L.lineHeight,cursor:"pointer",transition:`all ${Se}`,borderRadius:L.borderRadiusSM,"&:hover, &-active":{backgroundColor:L.controlItemBgHover}},(0,A.Qy)(L)),{"&-selected":{color:L.colorPrimary,backgroundColor:L.controlItemBgActive,"&:hover, &-active":{backgroundColor:L.controlItemBgActiveHover}},"&-disabled":{color:ie,cursor:"not-allowed","&:hover":{color:ie,backgroundColor:tt,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${L.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:L.colorSplit},[`${Le}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:L.paddingXS,[`${Le}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:L.colorTextDescription,fontSize:j,fontStyle:"normal"}}}),[`${Re}-item-group-list`]:{margin:`0 ${L.marginXS}px`,padding:0,listStyle:"none"},[`${Re}-submenu-title`]:{paddingInlineEnd:ze+L.fontSizeSM},[`${Re}-submenu-vertical`]:{position:"relative"},[`${Re}-submenu${Re}-submenu-disabled ${Le}-menu-submenu-title`]:{[`&, ${Le}-menu-submenu-arrow-icon`]:{color:ie,backgroundColor:tt,cursor:"not-allowed"}},[`${Re}-submenu-selected ${Le}-menu-submenu-title`]:{color:L.colorPrimary}})}},[(0,J.oN)(L,"slide-up"),(0,J.oN)(L,"slide-down"),(0,he.Fm)(L,"move-up"),(0,he.Fm)(L,"move-down"),(0,ue._y)(L,"zoom-big")]]};var Ne=(0,q.Z)("Dropdown",(L,Le)=>{let{rootPrefixCls:Re}=Le;const{marginXXS:pt,sizePopupArrow:lt,controlHeight:Z,fontSize:Ie,lineHeight:Ht,paddingXXS:Se,componentCls:pe,borderRadiusLG:T}=L,F=(Z-Ie*Ht)/2,{dropdownArrowOffset:ie}=(0,U.fS)({contentRadius:T}),j=(0,ce.TS)(L,{menuCls:`${pe}-menu`,rootPrefixCls:Re,dropdownArrowDistance:lt/2+pt,dropdownArrowOffset:ie,dropdownPaddingVertical:F,dropdownEdgeChildPadding:Se});return[De(j),v(j)]},L=>({zIndexPopup:L.zIndexPopupBase+50}))},31795:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return Sn}});var A=x(42922),J=x(53978),he=x(94184),ue=x.n(he),U=x(87462),q=x(4942),ce=x(71002),_=x(97685),v=x(45987),De=x(15671),Ne=x(43144);function L(){return typeof BigInt=="function"}function Le(K){return!K&&K!==0&&!Number.isNaN(K)||!String(K).trim()}function Re(K){var X=K.trim(),me=X.startsWith("-");me&&(X=X.slice(1)),X=X.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),X.startsWith(".")&&(X="0".concat(X));var Ee=X||"0",at=Ee.split("."),Mt=at[0]||"0",Qt=at[1]||"0";Mt==="0"&&Qt==="0"&&(me=!1);var Jt=me?"-":"";return{negative:me,negativeStr:Jt,trimStr:Ee,integerStr:Mt,decimalStr:Qt,fullStr:"".concat(Jt).concat(Ee)}}function pt(K){var X=String(K);return!Number.isNaN(Number(X))&&X.includes("e")}function lt(K){var X=String(K);if(pt(K)){var me=Number(X.slice(X.indexOf("e-")+2)),Ee=X.match(/\.(\d+)/);return Ee!=null&&Ee[1]&&(me+=Ee[1].length),me}return X.includes(".")&&Ie(X)?X.length-X.indexOf(".")-1:0}function Z(K){var X=String(K);if(pt(K)){if(K>Number.MAX_SAFE_INTEGER)return String(L()?BigInt(K).toString():Number.MAX_SAFE_INTEGER);if(K<Number.MIN_SAFE_INTEGER)return String(L()?BigInt(K).toString():Number.MIN_SAFE_INTEGER);X=K.toFixed(lt(X))}return Re(X).fullStr}function Ie(K){return typeof K=="number"?!Number.isNaN(K):K?/^\s*-?\d+(\.\d+)?\s*$/.test(K)||/^\s*-?\d+\.\s*$/.test(K)||/^\s*-?\.\d+\s*$/.test(K):!1}var Ht=function(){function K(X){if((0,De.Z)(this,K),(0,q.Z)(this,"origin",""),(0,q.Z)(this,"negative",void 0),(0,q.Z)(this,"integer",void 0),(0,q.Z)(this,"decimal",void 0),(0,q.Z)(this,"decimalLen",void 0),(0,q.Z)(this,"empty",void 0),(0,q.Z)(this,"nan",void 0),Le(X)){this.empty=!0;return}if(this.origin=String(X),X==="-"||Number.isNaN(X)){this.nan=!0;return}var me=X;if(pt(me)&&(me=Number(me)),me=typeof me=="string"?me:Z(me),Ie(me)){var Ee=Re(me);this.negative=Ee.negative;var at=Ee.trimStr.split(".");this.integer=BigInt(at[0]);var Mt=at[1]||"0";this.decimal=BigInt(Mt),this.decimalLen=Mt.length}else this.nan=!0}return(0,Ne.Z)(K,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(me){var Ee="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(me,"0"));return BigInt(Ee)}},{key:"negate",value:function(){var me=new K(this.toString());return me.negative=!me.negative,me}},{key:"cal",value:function(me,Ee,at){var Mt=Math.max(this.getDecimalStr().length,me.getDecimalStr().length),Qt=this.alignDecimal(Mt),Jt=me.alignDecimal(Mt),zr=Ee(Qt,Jt).toString(),Ir=at(Mt),nr=Re(zr),Yr=nr.negativeStr,hr=nr.trimStr,_r="".concat(Yr).concat(hr.padStart(Ir+1,"0"));return new K("".concat(_r.slice(0,-Ir),".").concat(_r.slice(-Ir)))}},{key:"add",value:function(me){if(this.isInvalidate())return new K(me);var Ee=new K(me);return Ee.isInvalidate()?this:this.cal(Ee,function(at,Mt){return at+Mt},function(at){return at})}},{key:"multi",value:function(me){var Ee=new K(me);return this.isInvalidate()||Ee.isInvalidate()?new K(NaN):this.cal(Ee,function(at,Mt){return at*Mt},function(at){return at*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(me){return this.toString()===(me==null?void 0:me.toString())}},{key:"lessEquals",value:function(me){return this.add(me.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return me?this.isInvalidate()?"":Re("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),K}(),Se=function(){function K(X){if((0,De.Z)(this,K),(0,q.Z)(this,"origin",""),(0,q.Z)(this,"number",void 0),(0,q.Z)(this,"empty",void 0),Le(X)){this.empty=!0;return}this.origin=String(X),this.number=Number(X)}return(0,Ne.Z)(K,[{key:"negate",value:function(){return new K(-this.toNumber())}},{key:"add",value:function(me){if(this.isInvalidate())return new K(me);var Ee=Number(me);if(Number.isNaN(Ee))return this;var at=this.number+Ee;if(at>Number.MAX_SAFE_INTEGER)return new K(Number.MAX_SAFE_INTEGER);if(at<Number.MIN_SAFE_INTEGER)return new K(Number.MIN_SAFE_INTEGER);var Mt=Math.max(lt(this.number),lt(Ee));return new K(at.toFixed(Mt))}},{key:"multi",value:function(me){var Ee=Number(me);if(this.isInvalidate()||Number.isNaN(Ee))return new K(NaN);var at=this.number*Ee;if(at>Number.MAX_SAFE_INTEGER)return new K(Number.MAX_SAFE_INTEGER);if(at<Number.MIN_SAFE_INTEGER)return new K(Number.MIN_SAFE_INTEGER);var Mt=Math.max(lt(this.number),lt(Ee));return new K(at.toFixed(Mt))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(me){return this.toNumber()===(me==null?void 0:me.toNumber())}},{key:"lessEquals",value:function(me){return this.add(me.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return me?this.isInvalidate()?"":Z(this.number):this.origin}}]),K}();function pe(K){return L()?new Ht(K):new Se(K)}function T(K,X,me){var Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(K==="")return"";var at=Re(K),Mt=at.negativeStr,Qt=at.integerStr,Jt=at.decimalStr,zr="".concat(X).concat(Jt),Ir="".concat(Mt).concat(Qt);if(me>=0){var nr=Number(Jt[me]);if(nr>=5&&!Ee){var Yr=pe(K).add("".concat(Mt,"0.").concat("0".repeat(me)).concat(10-nr));return T(Yr.toString(),X,me,Ee)}return me===0?Ir:"".concat(Ir).concat(X).concat(Jt.padEnd(me,"0").slice(0,me))}return zr===".0"?Ir:"".concat(Ir).concat(zr)}var F=pe,ie=x(67656),j=x(67294);function ze(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var tt=ze()?j.useLayoutEffect:j.useEffect,Nt=function(X,me){var Ee=j.useRef(!0);tt(function(){return X(Ee.current)},me),tt(function(){return Ee.current=!1,function(){Ee.current=!0}},[])},gt=function(X,me){Nt(function(Ee){if(!Ee)return X()},me)},Me=Nt,_e=x(27183);function Je(K,X,me){var Ee=React.useRef({});return(!("value"in Ee.current)||me(Ee.current.condition,X))&&(Ee.current.value=K(),Ee.current.condition=X),Ee.current.value}function re(K,X){typeof K=="function"?K(X):(0,ce.Z)(K)==="object"&&K&&"current"in K&&(K.current=X)}function Ue(){for(var K=arguments.length,X=new Array(K),me=0;me<K;me++)X[me]=arguments[me];var Ee=X.filter(function(at){return at});return Ee.length<=1?Ee[0]:function(at){X.forEach(function(Mt){re(Mt,at)})}}function rt(){for(var K=arguments.length,X=new Array(K),me=0;me<K;me++)X[me]=arguments[me];return useMemo(function(){return Ue.apply(void 0,X)},X,function(Ee,at){return Ee.length!==at.length||Ee.every(function(Mt,Qt){return Mt!==at[Qt]})})}function ge(K){var X,me,Ee=isMemo(K)?K.type.type:K.type;return!(typeof Ee=="function"&&!((X=Ee.prototype)!==null&&X!==void 0&&X.render)||typeof K=="function"&&!((me=K.prototype)!==null&&me!==void 0&&me.render))}function Ae(K){return!isValidElement(K)||isFragment(K)?!1:ge(K)}var ve={},fe=[],ot=function(X){fe.push(X)};function Ze(K,X){if(0)var me}function Oe(K,X){if(0)var me}function xe(){ve={}}function yt(K,X,me){!X&&!ve[me]&&(K(!1,me),ve[me]=!0)}function ht(K,X){yt(Ze,K,X)}function Ut(K,X){yt(Oe,K,X)}ht.preMessage=ot,ht.resetWarned=xe,ht.noteOnce=Ut;var Gt=ht;function cr(K,X){var me=(0,j.useRef)(null);function Ee(){try{var Mt=K.selectionStart,Qt=K.selectionEnd,Jt=K.value,zr=Jt.substring(0,Mt),Ir=Jt.substring(Qt);me.current={start:Mt,end:Qt,value:Jt,beforeTxt:zr,afterTxt:Ir}}catch(nr){}}function at(){if(K&&me.current&&X)try{var Mt=K.value,Qt=me.current,Jt=Qt.beforeTxt,zr=Qt.afterTxt,Ir=Qt.start,nr=Mt.length;if(Mt.endsWith(zr))nr=Mt.length-me.current.afterTxt.length;else if(Mt.startsWith(Jt))nr=Jt.length;else{var Yr=Jt[Ir-1],hr=Mt.indexOf(Yr,Ir-1);hr!==-1&&(nr=hr+1)}K.setSelectionRange(nr,nr)}catch(_r){Gt(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(_r.message))}}return[Ee,at]}var ur=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var K=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(K)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(K==null?void 0:K.substr(0,4))},rr=function(){var X=(0,j.useState)(!1),me=(0,_.Z)(X,2),Ee=me[0],at=me[1];return Me(function(){at(ur())},[]),Ee},ar=rr,ut=function(X){return+setTimeout(X,16)},be=function(X){return clearTimeout(X)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ut=function(X){return window.requestAnimationFrame(X)},be=function(X){return window.cancelAnimationFrame(X)});var ae=0,Q=new Map;function V(K){Q.delete(K)}var Y=function(X){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;ae+=1;var Ee=ae;function at(Mt){if(Mt===0)V(Ee),X();else{var Qt=ut(function(){at(Mt-1)});Q.set(Ee,Qt)}}return at(me),Ee};Y.cancel=function(K){var X=Q.get(K);return V(X),be(X)};var ye=Y,te=200,ne=600;function Ke(K){var X=K.prefixCls,me=K.upNode,Ee=K.downNode,at=K.upDisabled,Mt=K.downDisabled,Qt=K.onStep,Jt=j.useRef(),zr=j.useRef([]),Ir=j.useRef();Ir.current=Qt;var nr=function(){clearTimeout(Jt.current)},Yr=function(Pe,Zn){Pe.preventDefault(),nr(),Ir.current(Zn);function bi(){Ir.current(Zn),Jt.current=setTimeout(bi,te)}Jt.current=setTimeout(bi,ne)};j.useEffect(function(){return function(){nr(),zr.current.forEach(function(jt){return ye.cancel(jt)})}},[]);var hr=ar();if(hr)return null;var _r="".concat(X,"-handler"),Fn=ue()(_r,"".concat(_r,"-up"),(0,q.Z)({},"".concat(_r,"-up-disabled"),at)),Pr=ue()(_r,"".concat(_r,"-down"),(0,q.Z)({},"".concat(_r,"-down-disabled"),Mt)),Kr=function(){return zr.current.push(ye(nr))},Pn={unselectable:"on",role:"button",onMouseUp:Kr,onMouseLeave:Kr};return j.createElement("div",{className:"".concat(_r,"-wrap")},j.createElement("span",(0,U.Z)({},Pn,{onMouseDown:function(Pe){Yr(Pe,!0)},"aria-label":"Increase Value","aria-disabled":at,className:Fn}),me||j.createElement("span",{unselectable:"on",className:"".concat(X,"-handler-up-inner")})),j.createElement("span",(0,U.Z)({},Pn,{onMouseDown:function(Pe){Yr(Pe,!1)},"aria-label":"Decrease Value","aria-disabled":Mt,className:Pr}),Ee||j.createElement("span",{unselectable:"on",className:"".concat(X,"-handler-down-inner")})))}function Fe(K){var X=typeof K=="number"?Z(K):Re(K).fullStr,me=X.includes(".");return me?Re(X.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:K+"0"}var Ce=x(87887),kt=function(){var K=(0,j.useRef)(0),X=function(){ye.cancel(K.current)};return(0,j.useEffect)(function(){return X},[]),function(me){X(),K.current=ye(function(){me()})}},$t=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],G=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],nt=function(X,me){return X||me.isEmpty()?me.toString():me.toNumber()},dt=function(X){var me=F(X);return me.isInvalidate()?null:me},qt=j.forwardRef(function(K,X){var me,Ee=K.prefixCls,at=Ee===void 0?"rc-input-number":Ee,Mt=K.className,Qt=K.style,Jt=K.min,zr=K.max,Ir=K.step,nr=Ir===void 0?1:Ir,Yr=K.defaultValue,hr=K.value,_r=K.disabled,Fn=K.readOnly,Pr=K.upHandler,Kr=K.downHandler,Pn=K.keyboard,jt=K.controls,Pe=jt===void 0?!0:jt,Zn=K.classNames,bi=K.stringMode,Rn=K.parser,yi=K.formatter,xi=K.precision,jn=K.decimalSeparator,Ji=K.onChange,ga=K.onInput,Yi=K.onPressEnter,Ki=K.onStep,an=(0,v.Z)(K,$t),Ar="".concat(at,"-input"),kn=j.useRef(null),Jr=j.useState(!1),Hi=(0,_.Z)(Jr,2),Li=Hi[0],ua=Hi[1],ci=j.useRef(!1),Ii=j.useRef(!1),Na=j.useRef(!1),Aa=j.useState(function(){return F(hr!=null?hr:Yr)}),Fa=(0,_.Z)(Aa,2),Rr=Fa[0],lo=Fa[1];function bo(qe){hr===void 0&&lo(qe)}var Qi=j.useCallback(function(qe,He){if(!He)return xi>=0?xi:Math.max(lt(qe),lt(nr))},[xi,nr]),Wi=j.useCallback(function(qe){var He=String(qe);if(Rn)return Rn(He);var et=He;return jn&&(et=et.replace(jn,".")),et.replace(/[^\w.-]+/g,"")},[Rn,jn]),Gn=j.useRef(""),va=j.useCallback(function(qe,He){if(yi)return yi(qe,{userTyping:He,input:String(Gn.current)});var et=typeof qe=="number"?Z(qe):qe;if(!He){var Ye=Qi(et,He);if(Ie(et)&&(jn||Ye>=0)){var wt=jn||".";et=T(et,wt,Ye)}}return et},[yi,Qi,jn]),ba=j.useState(function(){var qe=Yr!=null?Yr:hr;return Rr.isInvalidate()&&["string","number"].includes((0,ce.Z)(qe))?Number.isNaN(qe)?"":qe:va(Rr.toString(),!1)}),ea=(0,_.Z)(ba,2),qn=ea[0],Vi=ea[1];Gn.current=qn;function Bi(qe,He){Vi(va(qe.isInvalidate()?qe.toString(!1):qe.toString(!He),He))}var ui=j.useMemo(function(){return dt(zr)},[zr,xi]),ii=j.useMemo(function(){return dt(Jt)},[Jt,xi]),da=j.useMemo(function(){return!ui||!Rr||Rr.isInvalidate()?!1:ui.lessEquals(Rr)},[ui,Rr]),ta=j.useMemo(function(){return!ii||!Rr||Rr.isInvalidate()?!1:Rr.lessEquals(ii)},[ii,Rr]),Ui=cr(kn.current,Li),b=(0,_.Z)(Ui,2),M=b[0],C=b[1],k=function(He){return ui&&!He.lessEquals(ui)?ui:ii&&!ii.lessEquals(He)?ii:null},R=function(He){return!k(He)},z=function(He,et){var Ye=He,wt=R(Ye)||Ye.isEmpty();if(!Ye.isEmpty()&&!et&&(Ye=k(Ye)||Ye,wt=!0),!Fn&&!_r&&wt){var mt=Ye.toString(),Pt=Qi(mt,et);return Pt>=0&&(Ye=F(T(mt,".",Pt)),R(Ye)||(Ye=F(T(mt,".",Pt,!0)))),Ye.equals(Rr)||(bo(Ye),Ji==null||Ji(Ye.isEmpty()?null:nt(bi,Ye)),hr===void 0&&Bi(Ye,et)),Ye}return Rr},H=kt(),ee=function qe(He){if(M(),Gn.current=He,Vi(He),!Ii.current){var et=Wi(He),Ye=F(et);Ye.isNaN()||z(Ye,!0)}ga==null||ga(He),H(function(){var wt=He;Rn||(wt=He.replace(/。/g,".")),wt!==He&&qe(wt)})},le=function(){Ii.current=!0},Te=function(){Ii.current=!1,ee(kn.current.value)},st=function(He){ee(He.target.value)},Be=function(He){var et;if(!(He&&da||!He&&ta)){ci.current=!1;var Ye=F(Na.current?Fe(nr):nr);He||(Ye=Ye.negate());var wt=(Rr||F(0)).add(Ye.toString()),mt=z(wt,!1);Ki==null||Ki(nt(bi,mt),{offset:Na.current?Fe(nr):nr,type:He?"up":"down"}),(et=kn.current)===null||et===void 0||et.focus()}},vt=function(He){var et=F(Wi(qn)),Ye=et;et.isNaN()?Ye=z(Rr,He):Ye=z(et,He),hr!==void 0?Bi(Rr,!1):Ye.isNaN()||Bi(Ye,!1)},bt=function(){ci.current=!0},Dt=function(He){var et=He.key,Ye=He.shiftKey;ci.current=!0,Na.current=Ye,et==="Enter"&&(Ii.current||(ci.current=!1),vt(!1),Yi==null||Yi(He)),Pn!==!1&&!Ii.current&&["Up","ArrowUp","Down","ArrowDown"].includes(et)&&(Be(et==="Up"||et==="ArrowUp"),He.preventDefault())},Wt=function(){ci.current=!1,Na.current=!1},Ct=function(){vt(!1),ua(!1),ci.current=!1};return gt(function(){Rr.isInvalidate()||Bi(Rr,!1)},[xi]),gt(function(){var qe=F(hr);lo(qe);var He=F(Wi(qn));(!qe.equals(He)||!ci.current||yi)&&Bi(qe,ci.current)},[hr]),gt(function(){yi&&C()},[qn]),j.createElement("div",{className:ue()(at,Zn==null?void 0:Zn.input,Mt,(me={},(0,q.Z)(me,"".concat(at,"-focused"),Li),(0,q.Z)(me,"".concat(at,"-disabled"),_r),(0,q.Z)(me,"".concat(at,"-readonly"),Fn),(0,q.Z)(me,"".concat(at,"-not-a-number"),Rr.isNaN()),(0,q.Z)(me,"".concat(at,"-out-of-range"),!Rr.isInvalidate()&&!R(Rr)),me)),style:Qt,onFocus:function(){ua(!0)},onBlur:Ct,onKeyDown:Dt,onKeyUp:Wt,onCompositionStart:le,onCompositionEnd:Te,onBeforeInput:bt},Pe&&j.createElement(Ke,{prefixCls:at,upNode:Pr,downNode:Kr,upDisabled:da,downDisabled:ta,onStep:Be}),j.createElement("div",{className:"".concat(Ar,"-wrap")},j.createElement("input",(0,U.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":Jt,"aria-valuemax":zr,"aria-valuenow":Rr.isInvalidate()?null:Rr.toString(),step:nr},an,{ref:Ue(kn,X),className:Ar,value:qn,onChange:st,disabled:_r,readOnly:Fn}))))}),vr=j.forwardRef(function(K,X){var me=K.disabled,Ee=K.style,at=K.prefixCls,Mt=K.value,Qt=K.prefix,Jt=K.suffix,zr=K.addonBefore,Ir=K.addonAfter,nr=K.classes,Yr=K.className,hr=K.classNames,_r=(0,v.Z)(K,G),Fn=j.useRef(null),Pr=function(Pn){Fn.current&&(0,Ce.nH)(Fn.current,Pn)};return j.createElement(ie.BaseInput,{inputElement:j.createElement(qt,(0,U.Z)({prefixCls:at,disabled:me,classNames:hr,ref:Ue(Fn,X)},_r)),className:Yr,triggerFocus:Pr,prefixCls:at,value:Mt,disabled:me,style:Ee,prefix:Qt,suffix:Jt,addonAfter:Ir,addonBefore:zr,classes:nr,classNames:hr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});vr.displayName="InputNumber";var or=vr,tn=or,Vt=x(9708),ct=x(53124),rn=x(46735),nn=x(98866),br=x(98675),dr=x(65223),Xr=x(4173),It=x(47673),$n=x(14747),dn=x(80110),wn=x(67968),jr=x(45503);const Lr=(K,X)=>{let{componentCls:me,borderRadiusSM:Ee,borderRadiusLG:at}=K;const Mt=X==="lg"?at:Ee;return{[`&-${X}`]:{[`${me}-handler-wrap`]:{borderStartEndRadius:Mt,borderEndEndRadius:Mt},[`${me}-handler-up`]:{borderStartEndRadius:Mt},[`${me}-handler-down`]:{borderEndEndRadius:Mt}}}},At=K=>{const{componentCls:X,lineWidth:me,lineType:Ee,colorBorder:at,borderRadius:Mt,fontSizeLG:Qt,controlHeightLG:Jt,controlHeightSM:zr,colorError:Ir,paddingInlineSM:nr,colorTextDescription:Yr,motionDurationMid:hr,handleHoverColor:_r,paddingInline:Fn,paddingBlock:Pr,handleBg:Kr,handleActiveBg:Pn,colorTextDisabled:jt,borderRadiusSM:Pe,borderRadiusLG:Zn,controlWidth:bi,handleVisible:Rn,handleBorderColor:yi}=K;return[{[X]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,$n.Wf)(K)),(0,It.ik)(K)),(0,It.bi)(K,X)),{display:"inline-block",width:bi,margin:0,padding:0,border:`${me}px ${Ee} ${at}`,borderRadius:Mt,"&-rtl":{direction:"rtl",[`${X}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:Qt,borderRadius:Zn,[`input${X}-input`]:{height:Jt-2*me}},"&-sm":{padding:0,borderRadius:Pe,[`input${X}-input`]:{height:zr-2*me,padding:`0 ${nr}px`}},"&:hover":Object.assign({},(0,It.pU)(K)),"&-focused":Object.assign({},(0,It.M1)(K)),"&-out-of-range":{[`${X}-input-wrap`]:{input:{color:Ir}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,$n.Wf)(K)),(0,It.s7)(K)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${X}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${X}-group-addon`]:{borderRadius:Zn,fontSize:K.fontSizeLG}},"&-sm":{[`${X}-group-addon`]:{borderRadius:Pe}},[`${X}-wrapper-disabled > ${X}-group-addon`]:Object.assign({},(0,It.Xy)(K))}}),[`&-disabled ${X}-input`]:{cursor:"not-allowed"},[X]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,$n.Wf)(K)),{width:"100%",padding:`${Pr}px ${Fn}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:Mt,outline:0,transition:`all ${hr} linear`,appearance:"textfield",fontSize:"inherit"}),(0,It.nz)(K.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[X]:Object.assign(Object.assign(Object.assign({[`&:hover ${X}-handler-wrap, &-focused ${X}-handler-wrap`]:{opacity:1},[`${X}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:K.handleWidth,height:"100%",background:Kr,borderStartStartRadius:0,borderStartEndRadius:Mt,borderEndEndRadius:Mt,borderEndStartRadius:0,opacity:Rn===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${hr} linear ${hr}`,[`${X}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
|
|
|
${X}-handler-up-inner,
|
|
|
${X}-handler-down-inner
|
|
|
`]:{marginInlineEnd:0,fontSize:K.handleFontSize}}},[`${X}-handler`]:{height:"50%",overflow:"hidden",color:Yr,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${me}px ${Ee} ${yi}`,transition:`all ${hr} linear`,"&:active":{background:Pn},"&:hover":{height:"60%",[`
|
|
|
${X}-handler-up-inner,
|
|
|
${X}-handler-down-inner
|
|
|
`]:{color:_r}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,$n.Ro)()),{color:Yr,transition:`all ${hr} linear`,userSelect:"none"})},[`${X}-handler-up`]:{borderStartEndRadius:Mt},[`${X}-handler-down`]:{borderBlockStart:`${me}px ${Ee} ${yi}`,borderEndEndRadius:Mt}},Lr(K,"lg")),Lr(K,"sm")),{"&-disabled, &-readonly":{[`${X}-handler-wrap`]:{display:"none"},[`${X}-input`]:{color:"inherit"}},[`
|
|
|
${X}-handler-up-disabled,
|
|
|
${X}-handler-down-disabled
|
|
|
`]:{cursor:"not-allowed"},[`
|
|
|
${X}-handler-up-disabled:hover &-handler-up-inner,
|
|
|
${X}-handler-down-disabled:hover &-handler-down-inner
|
|
|
`]:{color:jt}})},{[`${X}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${X}-handler-down`]:{borderBlockStartWidth:0}}}]},Fr=K=>{const{componentCls:X,paddingBlock:me,paddingInline:Ee,inputAffixPadding:at,controlWidth:Mt,borderRadiusLG:Qt,borderRadiusSM:Jt}=K;return{[`${X}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,It.ik)(K)),(0,It.bi)(K,`${X}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:Mt,padding:0,paddingInlineStart:Ee,"&-lg":{borderRadius:Qt},"&-sm":{borderRadius:Jt},[`&:not(${X}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,It.pU)(K)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${X}-disabled`]:{background:"transparent"},[`> div${X}`]:{width:"100%",border:"none",outline:"none",[`&${X}-focused`]:{boxShadow:"none !important"}},[`input${X}-input`]:{padding:`${me}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${X}-handler-wrap`]:{zIndex:2},[X]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:at},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Ee,marginInlineStart:at}}})}};var vi=(0,wn.Z)("InputNumber",K=>{const X=(0,jr.TS)(K,(0,It.e5)(K));return[At(X),Fr(X),(0,dn.c)(X)]},K=>Object.assign(Object.assign({},(0,It.TM)(K)),{controlWidth:90,handleWidth:K.controlHeightSM-K.lineWidth*2,handleFontSize:K.fontSize/2,handleVisible:"auto",handleActiveBg:K.colorFillAlter,handleBg:K.colorBgContainer,handleHoverColor:K.colorPrimary,handleBorderColor:K.colorBorder})),ni=function(K,X){var me={};for(var Ee in K)Object.prototype.hasOwnProperty.call(K,Ee)&&X.indexOf(Ee)<0&&(me[Ee]=K[Ee]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function")for(var at=0,Ee=Object.getOwnPropertySymbols(K);at<Ee.length;at++)X.indexOf(Ee[at])<0&&Object.prototype.propertyIsEnumerable.call(K,Ee[at])&&(me[Ee[at]]=K[Ee[at]]);return me};const li=j.forwardRef((K,X)=>{const{getPrefixCls:me,direction:Ee}=j.useContext(ct.E_),at=j.useRef(null);j.useImperativeHandle(X,()=>at.current);const{className:Mt,rootClassName:Qt,size:Jt,disabled:zr,prefixCls:Ir,addonBefore:nr,addonAfter:Yr,prefix:hr,bordered:_r=!0,readOnly:Fn,status:Pr,controls:Kr}=K,Pn=ni(K,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),jt=me("input-number",Ir),[Pe,Zn]=vi(jt),{compactSize:bi,compactItemClassnames:Rn}=(0,Xr.ri)(jt,Ee);let yi=j.createElement(J.Z,{className:`${jt}-handler-up-inner`}),xi=j.createElement(A.Z,{className:`${jt}-handler-down-inner`});const jn=typeof Kr=="boolean"?Kr:void 0;typeof Kr=="object"&&(yi=typeof Kr.upIcon=="undefined"?yi:j.createElement("span",{className:`${jt}-handler-up-inner`},Kr.upIcon),xi=typeof Kr.downIcon=="undefined"?xi:j.createElement("span",{className:`${jt}-handler-down-inner`},Kr.downIcon));const{hasFeedback:Ji,status:ga,isFormItemInput:Yi,feedbackIcon:Ki}=j.useContext(dr.aM),an=(0,Vt.F)(ga,Pr),Ar=(0,br.Z)(ci=>{var Ii;return(Ii=Jt!=null?Jt:bi)!==null&&Ii!==void 0?Ii:ci}),kn=j.useContext(nn.Z),Jr=zr!=null?zr:kn,Hi=ue()({[`${jt}-lg`]:Ar==="large",[`${jt}-sm`]:Ar==="small",[`${jt}-rtl`]:Ee==="rtl",[`${jt}-borderless`]:!_r,[`${jt}-in-form-item`]:Yi},(0,Vt.Z)(jt,an),Rn,Zn),Li=`${jt}-group`,ua=j.createElement(tn,Object.assign({ref:at,disabled:Jr,className:ue()(Mt,Qt),upHandler:yi,downHandler:xi,prefixCls:jt,readOnly:Fn,controls:jn,prefix:hr,suffix:Ji&&Ki,addonAfter:Yr&&j.createElement(Xr.BR,null,j.createElement(dr.Ux,{override:!0,status:!0},Yr)),addonBefore:nr&&j.createElement(Xr.BR,null,j.createElement(dr.Ux,{override:!0,status:!0},nr)),classNames:{input:Hi},classes:{affixWrapper:ue()((0,Vt.Z)(`${jt}-affix-wrapper`,an,Ji),{[`${jt}-affix-wrapper-sm`]:Ar==="small",[`${jt}-affix-wrapper-lg`]:Ar==="large",[`${jt}-affix-wrapper-rtl`]:Ee==="rtl",[`${jt}-affix-wrapper-borderless`]:!_r},Zn),wrapper:ue()({[`${Li}-rtl`]:Ee==="rtl",[`${jt}-wrapper-disabled`]:Jr},Zn),group:ue()({[`${jt}-group-wrapper-sm`]:Ar==="small",[`${jt}-group-wrapper-lg`]:Ar==="large",[`${jt}-group-wrapper-rtl`]:Ee==="rtl"},(0,Vt.Z)(`${jt}-group-wrapper`,an,Ji),Zn)}},Pn));return Pe(ua)}),hn=li,Di=K=>j.createElement(rn.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},j.createElement(li,Object.assign({},K)));hn._InternalPanelDoNotUseOrYouWillBeFired=Di;var Sn=hn},47673:function(er,ft,x){"use strict";x.d(ft,{M1:function(){return ce},TM:function(){return pe},Xy:function(){return _},bi:function(){return Ne},e5:function(){return Se},ik:function(){return L},nz:function(){return U},pU:function(){return q},s7:function(){return Le},x0:function(){return De}});var A=x(14747),J=x(80110),he=x(45503),ue=x(67968);const U=T=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:T,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),q=T=>({borderColor:T.hoverBorderColor}),ce=T=>({borderColor:T.activeBorderColor,boxShadow:T.activeShadow,outline:0}),_=T=>({color:T.colorTextDisabled,backgroundColor:T.colorBgContainerDisabled,borderColor:T.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},q((0,he.TS)(T,{hoverBorderColor:T.colorBorder})))}),v=T=>{const{paddingBlockLG:F,fontSizeLG:ie,lineHeightLG:j,borderRadiusLG:ze,paddingInlineLG:tt}=T;return{padding:`${F}px ${tt}px`,fontSize:ie,lineHeight:j,borderRadius:ze}},De=T=>({padding:`${T.paddingBlockSM}px ${T.paddingInlineSM}px`,borderRadius:T.borderRadiusSM}),Ne=(T,F)=>{const{componentCls:ie,colorError:j,colorWarning:ze,errorActiveShadow:tt,warningActiveShadow:Nt,colorErrorBorderHover:gt,colorWarningBorderHover:Me}=T;return{[`&-status-error:not(${F}-disabled):not(${F}-borderless)${F}`]:{borderColor:j,"&:hover":{borderColor:gt},"&:focus, &-focused":Object.assign({},ce((0,he.TS)(T,{activeBorderColor:j,activeShadow:tt}))),[`${ie}-prefix, ${ie}-suffix`]:{color:j}},[`&-status-warning:not(${F}-disabled):not(${F}-borderless)${F}`]:{borderColor:ze,"&:hover":{borderColor:Me},"&:focus, &-focused":Object.assign({},ce((0,he.TS)(T,{activeBorderColor:ze,activeShadow:Nt}))),[`${ie}-prefix, ${ie}-suffix`]:{color:ze}}}},L=T=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${T.paddingBlock}px ${T.paddingInline}px`,color:T.colorText,fontSize:T.fontSize,lineHeight:T.lineHeight,backgroundColor:T.colorBgContainer,backgroundImage:"none",borderWidth:T.lineWidth,borderStyle:T.lineType,borderColor:T.colorBorder,borderRadius:T.borderRadius,transition:`all ${T.motionDurationMid}`},U(T.colorTextPlaceholder)),{"&:hover":Object.assign({},q(T)),"&:focus, &-focused":Object.assign({},ce(T)),"&-disabled, &[disabled]":Object.assign({},_(T)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:T.controlHeight,lineHeight:T.lineHeight,verticalAlign:"bottom",transition:`all ${T.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},v(T)),"&-sm":Object.assign({},De(T)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),Le=T=>{const{componentCls:F,antCls:ie}=T;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:T.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${F}, &-lg > ${F}-group-addon`]:Object.assign({},v(T)),[`&-sm ${F}, &-sm > ${F}-group-addon`]:Object.assign({},De(T)),[`&-lg ${ie}-select-single ${ie}-select-selector`]:{height:T.controlHeightLG},[`&-sm ${ie}-select-single ${ie}-select-selector`]:{height:T.controlHeightSM},[`> ${F}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${F}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${T.paddingInline}px`,color:T.colorText,fontWeight:"normal",fontSize:T.fontSize,textAlign:"center",backgroundColor:T.colorFillAlter,border:`${T.lineWidth}px ${T.lineType} ${T.colorBorder}`,borderRadius:T.borderRadius,transition:`all ${T.motionDurationSlow}`,lineHeight:1,[`${ie}-select`]:{margin:`-${T.paddingBlock+1}px -${T.paddingInline}px`,[`&${ie}-select-single:not(${ie}-select-customize-input)`]:{[`${ie}-select-selector`]:{backgroundColor:"inherit",border:`${T.lineWidth}px ${T.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${ie}-select-selector`]:{color:T.colorPrimary}}},[`${ie}-cascader-picker`]:{margin:`-9px -${T.paddingInline}px`,backgroundColor:"transparent",[`${ie}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${F}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${F}-search-with-button &`]:{zIndex:0}}},[`> ${F}:first-child, ${F}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${ie}-select ${ie}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${F}-affix-wrapper`]:{[`&:not(:first-child) ${F}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${F}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${F}:last-child, ${F}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${ie}-select ${ie}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${F}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${F}-search &`]:{borderStartStartRadius:T.borderRadius,borderEndStartRadius:T.borderRadius}},[`&:not(:first-child), ${F}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${F}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,A.dF)()),{[`${F}-group-addon, ${F}-group-wrap, > ${F}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:T.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
|
& > ${F}-affix-wrapper,
|
|
|
& > ${F}-number-affix-wrapper,
|
|
|
& > ${ie}-picker-range
|
|
|
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-T.lineWidth,borderInlineEndWidth:T.lineWidth},[`${F}`]:{float:"none"},[`& > ${ie}-select > ${ie}-select-selector,
|
|
|
& > ${ie}-select-auto-complete ${F},
|
|
|
& > ${ie}-cascader-picker ${F},
|
|
|
& > ${F}-group-wrapper ${F}`]:{borderInlineEndWidth:T.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${ie}-select-focused`]:{zIndex:1},[`& > ${ie}-select > ${ie}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
|
& > ${ie}-select:first-child > ${ie}-select-selector,
|
|
|
& > ${ie}-select-auto-complete:first-child ${F},
|
|
|
& > ${ie}-cascader-picker:first-child ${F}`]:{borderStartStartRadius:T.borderRadius,borderEndStartRadius:T.borderRadius},[`& > *:last-child,
|
|
|
& > ${ie}-select:last-child > ${ie}-select-selector,
|
|
|
& > ${ie}-cascader-picker:last-child ${F},
|
|
|
& > ${ie}-cascader-picker-focused:last-child ${F}`]:{borderInlineEndWidth:T.lineWidth,borderStartEndRadius:T.borderRadius,borderEndEndRadius:T.borderRadius},[`& > ${ie}-select-auto-complete ${F}`]:{verticalAlign:"top"},[`${F}-group-wrapper + ${F}-group-wrapper`]:{marginInlineStart:-T.lineWidth,[`${F}-affix-wrapper`]:{borderRadius:0}},[`${F}-group-wrapper:not(:last-child)`]:{[`&${F}-search > ${F}-group`]:{[`& > ${F}-group-addon > ${F}-search-button`]:{borderRadius:0},[`& > ${F}`]:{borderStartStartRadius:T.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:T.borderRadius}}}})}},Re=T=>{const{componentCls:F,controlHeightSM:ie,lineWidth:j}=T,tt=(ie-j*2-16)/2;return{[F]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,A.Wf)(T)),L(T)),Ne(T,F)),{'&[type="color"]':{height:T.controlHeight,[`&${F}-lg`]:{height:T.controlHeightLG},[`&${F}-sm`]:{height:ie,paddingTop:tt,paddingBottom:tt}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},pt=T=>{const{componentCls:F}=T;return{[`${F}-clear-icon`]:{margin:0,color:T.colorTextQuaternary,fontSize:T.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${T.motionDurationSlow}`,"&:hover":{color:T.colorTextTertiary},"&:active":{color:T.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${T.inputAffixPadding}px`}}}},lt=T=>{const{componentCls:F,inputAffixPadding:ie,colorTextDescription:j,motionDurationSlow:ze,colorIcon:tt,colorIconHover:Nt,iconCls:gt}=T;return{[`${F}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},L(T)),{display:"inline-flex",[`&:not(${F}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},q(T)),{zIndex:1,[`${F}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${F}[disabled]`]:{background:"transparent"}},[`> input${F}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${F}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:T.paddingXS}},"&-show-count-suffix":{color:j},"&-show-count-has-suffix":{marginInlineEnd:T.paddingXXS},"&-prefix":{marginInlineEnd:ie},"&-suffix":{marginInlineStart:ie}}}),pt(T)),{[`${gt}${F}-password-icon`]:{color:tt,cursor:"pointer",transition:`all ${ze}`,"&:hover":{color:Nt}}}),Ne(T,`${F}-affix-wrapper`))}},Z=T=>{const{componentCls:F,colorError:ie,colorWarning:j,borderRadiusLG:ze,borderRadiusSM:tt}=T;return{[`${F}-group`]:Object.assign(Object.assign(Object.assign({},(0,A.Wf)(T)),Le(T)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${F}-group-addon`]:{borderRadius:ze,fontSize:T.fontSizeLG}},"&-sm":{[`${F}-group-addon`]:{borderRadius:tt}},"&-status-error":{[`${F}-group-addon`]:{color:ie,borderColor:ie}},"&-status-warning":{[`${F}-group-addon`]:{color:j,borderColor:j}},"&-disabled":{[`${F}-group-addon`]:Object.assign({},_(T))},[`&:not(${F}-compact-first-item):not(${F}-compact-last-item)${F}-compact-item`]:{[`${F}, ${F}-group-addon`]:{borderRadius:0}},[`&:not(${F}-compact-last-item)${F}-compact-first-item`]:{[`${F}, ${F}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${F}-compact-first-item)${F}-compact-last-item`]:{[`${F}, ${F}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},Ie=T=>{const{componentCls:F,antCls:ie}=T,j=`${F}-search`;return{[j]:{[`${F}`]:{"&:hover, &:focus":{borderColor:T.colorPrimaryHover,[`+ ${F}-group-addon ${j}-button:not(${ie}-btn-primary)`]:{borderInlineStartColor:T.colorPrimaryHover}}},[`${F}-affix-wrapper`]:{borderRadius:0},[`${F}-lg`]:{lineHeight:T.lineHeightLG-2e-4},[`> ${F}-group`]:{[`> ${F}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${j}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:T.borderRadius,borderEndEndRadius:T.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${j}-button:not(${ie}-btn-primary)`]:{color:T.colorTextDescription,"&:hover":{color:T.colorPrimaryHover},"&:active":{color:T.colorPrimaryActive},[`&${ie}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${j}-button`]:{height:T.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${j}-button`]:{height:T.controlHeightLG},[`&-small ${j}-button`]:{height:T.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${F}-compact-item`]:{[`&:not(${F}-compact-last-item)`]:{[`${F}-group-addon`]:{[`${F}-search-button`]:{marginInlineEnd:-T.lineWidth,borderRadius:0}}},[`&:not(${F}-compact-first-item)`]:{[`${F},${F}-affix-wrapper`]:{borderRadius:0}},[`> ${F}-group-addon ${F}-search-button,
|
|
|
> ${F},
|
|
|
${F}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${F}-affix-wrapper-focused`]:{zIndex:2}}}}},Ht=T=>{const{componentCls:F,paddingLG:ie}=T,j=`${F}-textarea`;return{[j]:{position:"relative","&-show-count":{[`> ${F}`]:{height:"100%"},[`${F}-data-count`]:{position:"absolute",bottom:-T.fontSize*T.lineHeight,insetInlineEnd:0,color:T.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${F}`]:{paddingInlineEnd:ie}},[`&-affix-wrapper${j}-has-feedback`]:{[`${F}`]:{paddingInlineEnd:ie}},[`&-affix-wrapper${F}-affix-wrapper`]:{padding:0,[`> textarea${F}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${F}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${F}-clear-icon`]:{position:"absolute",insetInlineEnd:T.paddingXS,insetBlockStart:T.paddingXS},[`${j}-suffix`]:{position:"absolute",top:0,insetInlineEnd:T.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function Se(T){return(0,he.TS)(T,{inputAffixPadding:T.paddingXXS})}const pe=T=>{const{controlHeight:F,fontSize:ie,lineHeight:j,lineWidth:ze,controlHeightSM:tt,controlHeightLG:Nt,fontSizeLG:gt,lineHeightLG:Me,paddingSM:_e,controlPaddingHorizontalSM:Je,controlPaddingHorizontal:re,colorFillAlter:Ue,colorPrimaryHover:rt,controlOutlineWidth:ge,controlOutline:Ae,colorErrorOutline:ve,colorWarningOutline:fe}=T;return{paddingBlock:Math.max(Math.round((F-ie*j)/2*10)/10-ze,3),paddingBlockSM:Math.max(Math.round((tt-ie*j)/2*10)/10-ze,0),paddingBlockLG:Math.ceil((Nt-gt*Me)/2*10)/10-ze,paddingInline:_e-ze,paddingInlineSM:Je-ze,paddingInlineLG:re-ze,addonBg:Ue,activeBorderColor:rt,hoverBorderColor:rt,activeShadow:`0 0 0 ${ge}px ${Ae}`,errorActiveShadow:`0 0 0 ${ge}px ${ve}`,warningActiveShadow:`0 0 0 ${ge}px ${fe}`}};ft.ZP=(0,ue.Z)("Input",T=>{const F=(0,he.TS)(T,Se(T));return[Re(F),Ht(F),lt(F),Z(F),Ie(F),(0,J.c)(F)]},pe)},71322:function(er,ft,x){"use strict";x.d(ft,{D:function(){return Ht},Z:function(){return T}});var A=x(87462),J=x(67294),he={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},ue=he,U=x(84089),q=function(ie,j){return J.createElement(U.Z,(0,A.Z)({},ie,{ref:j,icon:ue}))},ce=J.forwardRef(q),_=x(22751),v=x(91034),De=x(94184),Ne=x.n(De),L=x(10366),Re=F=>!isNaN(parseFloat(F))&&isFinite(F),pt=x(53124),lt=x(84321),Z=function(F,ie){var j={};for(var ze in F)Object.prototype.hasOwnProperty.call(F,ze)&&ie.indexOf(ze)<0&&(j[ze]=F[ze]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tt=0,ze=Object.getOwnPropertySymbols(F);tt<ze.length;tt++)ie.indexOf(ze[tt])<0&&Object.prototype.propertyIsEnumerable.call(F,ze[tt])&&(j[ze[tt]]=F[ze[tt]]);return j};const Ie={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},Ht=J.createContext({}),Se=(()=>{let F=0;return function(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return F+=1,`${ie}${F}`}})();var T=J.forwardRef((F,ie)=>{const{prefixCls:j,className:ze,trigger:tt,children:Nt,defaultCollapsed:gt=!1,theme:Me="dark",style:_e={},collapsible:Je=!1,reverseArrow:re=!1,width:Ue=200,collapsedWidth:rt=80,zeroWidthTriggerStyle:ge,breakpoint:Ae,onCollapse:ve,onBreakpoint:fe}=F,ot=Z(F,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:Ze}=(0,J.useContext)(lt.Gs),[Oe,xe]=(0,J.useState)("collapsed"in F?F.collapsed:gt),[yt,ht]=(0,J.useState)(!1);(0,J.useEffect)(()=>{"collapsed"in F&&xe(F.collapsed)},[F.collapsed]);const Ut=(ut,be)=>{"collapsed"in F||xe(ut),ve==null||ve(ut,be)},Gt=(0,J.useRef)();Gt.current=ut=>{ht(ut.matches),fe==null||fe(ut.matches),Oe!==ut.matches&&Ut(ut.matches,"responsive")},(0,J.useEffect)(()=>{function ut(ae){return Gt.current(ae)}let be;if(typeof window!="undefined"){const{matchMedia:ae}=window;if(ae&&Ae&&Ae in Ie){be=ae(`(max-width: ${Ie[Ae]})`);try{be.addEventListener("change",ut)}catch(Q){be.addListener(ut)}ut(be)}}return()=>{try{be==null||be.removeEventListener("change",ut)}catch(ae){be==null||be.removeListener(ut)}}},[Ae]),(0,J.useEffect)(()=>{const ut=Se("ant-sider-");return Ze.addSider(ut),()=>Ze.removeSider(ut)},[]);const cr=()=>{Ut(!Oe,"clickTrigger")},{getPrefixCls:ur}=(0,J.useContext)(pt.E_),rr=()=>{const ut=ur("layout-sider",j),be=(0,L.Z)(ot,["collapsed"]),ae=Oe?rt:Ue,Q=Re(ae)?`${ae}px`:String(ae),V=parseFloat(String(rt||0))===0?J.createElement("span",{onClick:cr,className:Ne()(`${ut}-zero-width-trigger`,`${ut}-zero-width-trigger-${re?"right":"left"}`),style:ge},tt||J.createElement(ce,null)):null,te={expanded:re?J.createElement(v.Z,null):J.createElement(_.Z,null),collapsed:re?J.createElement(_.Z,null):J.createElement(v.Z,null)}[Oe?"collapsed":"expanded"],ne=tt!==null?V||J.createElement("div",{className:`${ut}-trigger`,onClick:cr,style:{width:Q}},tt||te):null,Ke=Object.assign(Object.assign({},_e),{flex:`0 0 ${Q}`,maxWidth:Q,minWidth:Q,width:Q}),Fe=Ne()(ut,`${ut}-${Me}`,{[`${ut}-collapsed`]:!!Oe,[`${ut}-has-trigger`]:Je&&tt!==null&&!V,[`${ut}-below`]:!!yt,[`${ut}-zero-width`]:parseFloat(Q)===0},ze);return J.createElement("aside",Object.assign({className:Fe},be,{style:Ke,ref:ie}),J.createElement("div",{className:`${ut}-children`},Nt),Je||yt&&V?ne:null)},ar=J.useMemo(()=>({siderCollapsed:Oe}),[Oe]);return J.createElement(Ht.Provider,{value:ar},rr())})},84321:function(er,ft,x){"use strict";x.d(ft,{VY:function(){return Se},$_:function(){return Ht},h4:function(){return Ie},Gs:function(){return Le},ZP:function(){return pe}});var A=x(74902),J=x(94184),he=x.n(J),ue=x(10366),U=x(67294),q=x(53124),ce=x(67968),v=T=>{const{componentCls:F,bodyBg:ie,lightSiderBg:j,lightTriggerBg:ze,lightTriggerColor:tt}=T;return{[`${F}-sider-light`]:{background:j,[`${F}-sider-trigger`]:{color:tt,background:ze},[`${F}-sider-zero-width-trigger`]:{color:tt,background:ze,border:`1px solid ${ie}`,borderInlineStart:0}}}};const De=T=>{const{antCls:F,componentCls:ie,colorText:j,triggerColor:ze,footerBg:tt,triggerBg:Nt,headerHeight:gt,headerPadding:Me,headerColor:_e,footerPadding:Je,triggerHeight:re,zeroTriggerHeight:Ue,zeroTriggerWidth:rt,motionDurationMid:ge,motionDurationSlow:Ae,fontSize:ve,borderRadius:fe,bodyBg:ot,headerBg:Ze,siderBg:Oe}=T;return{[ie]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:ot,"&, *":{boxSizing:"border-box"},[`&${ie}-has-sider`]:{flexDirection:"row",[`> ${ie}, > ${ie}-content`]:{width:0}},[`${ie}-header, &${ie}-footer`]:{flex:"0 0 auto"},[`${ie}-sider`]:{position:"relative",minWidth:0,background:Oe,transition:`all ${ge}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${F}-menu${F}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:re},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:re,color:ze,lineHeight:`${re}px`,textAlign:"center",background:Nt,cursor:"pointer",transition:`all ${ge}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:gt,insetInlineEnd:-rt,zIndex:1,width:rt,height:Ue,color:ze,fontSize:T.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:Oe,borderStartStartRadius:0,borderStartEndRadius:fe,borderEndEndRadius:fe,borderEndStartRadius:0,cursor:"pointer",transition:`background ${Ae} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${Ae}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-rt,borderStartStartRadius:fe,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:fe}}}}},v(T)),{"&-rtl":{direction:"rtl"}}),[`${ie}-header`]:{height:gt,padding:Me,color:_e,lineHeight:`${gt}px`,background:Ze,[`${F}-menu`]:{lineHeight:"inherit"}},[`${ie}-footer`]:{padding:Je,color:j,fontSize:ve,background:tt},[`${ie}-content`]:{flex:"auto",minHeight:0}}};var Ne=(0,ce.Z)("Layout",T=>[De(T)],T=>{const{colorBgLayout:F,controlHeight:ie,controlHeightLG:j,colorText:ze,controlHeightSM:tt,marginXXS:Nt,colorTextLightSolid:gt,colorBgContainer:Me}=T,_e=j*1.25;return{colorBgHeader:"#001529",colorBgBody:F,colorBgTrigger:"#002140",bodyBg:F,headerBg:"#001529",headerHeight:ie*2,headerPadding:`0 ${_e}px`,headerColor:ze,footerPadding:`${tt}px ${_e}px`,footerBg:F,siderBg:"#001529",triggerHeight:j+Nt*2,triggerBg:"#002140",triggerColor:gt,zeroTriggerWidth:j,zeroTriggerHeight:j,lightSiderBg:Me,lightTriggerBg:Me,lightTriggerColor:ze}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),L=function(T,F){var ie={};for(var j in T)Object.prototype.hasOwnProperty.call(T,j)&&F.indexOf(j)<0&&(ie[j]=T[j]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ze=0,j=Object.getOwnPropertySymbols(T);ze<j.length;ze++)F.indexOf(j[ze])<0&&Object.prototype.propertyIsEnumerable.call(T,j[ze])&&(ie[j[ze]]=T[j[ze]]);return ie};const Le=U.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function Re(T){let{suffixCls:F,tagName:ie,displayName:j}=T;return ze=>U.forwardRef((Nt,gt)=>U.createElement(ze,Object.assign({ref:gt,suffixCls:F,tagName:ie},Nt)))}const pt=U.forwardRef((T,F)=>{const{prefixCls:ie,suffixCls:j,className:ze,tagName:tt}=T,Nt=L(T,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:gt}=U.useContext(q.E_),Me=gt("layout",ie),[_e,Je]=Ne(Me),re=j?`${Me}-${j}`:Me;return _e(U.createElement(tt,Object.assign({className:he()(ie||re,ze,Je),ref:F},Nt)))}),lt=U.forwardRef((T,F)=>{const{direction:ie}=U.useContext(q.E_),[j,ze]=U.useState([]),{prefixCls:tt,className:Nt,rootClassName:gt,children:Me,hasSider:_e,tagName:Je,style:re}=T,Ue=L(T,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),rt=(0,ue.Z)(Ue,["suffixCls"]),{getPrefixCls:ge,layout:Ae}=U.useContext(q.E_),ve=ge("layout",tt),[fe,ot]=Ne(ve),Ze=he()(ve,{[`${ve}-has-sider`]:typeof _e=="boolean"?_e:j.length>0,[`${ve}-rtl`]:ie==="rtl"},Ae==null?void 0:Ae.className,Nt,gt,ot),Oe=U.useMemo(()=>({siderHook:{addSider:xe=>{ze(yt=>[].concat((0,A.Z)(yt),[xe]))},removeSider:xe=>{ze(yt=>yt.filter(ht=>ht!==xe))}}}),[]);return fe(U.createElement(Le.Provider,{value:Oe},U.createElement(Je,Object.assign({ref:F,className:Ze,style:Object.assign(Object.assign({},Ae==null?void 0:Ae.style),re)},rt),Me)))}),Z=Re({tagName:"div",displayName:"Layout"})(lt),Ie=Re({suffixCls:"header",tagName:"header",displayName:"Header"})(pt),Ht=Re({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(pt),Se=Re({suffixCls:"content",tagName:"main",displayName:"Content"})(pt);var pe=Z},76529:function(er,ft,x){"use strict";x.d(ft,{J:function(){return q}});var A=x(67294),J=x(4173),he=x(60276),ue=function(ce,_){var v={};for(var De in ce)Object.prototype.hasOwnProperty.call(ce,De)&&_.indexOf(De)<0&&(v[De]=ce[De]);if(ce!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ne=0,De=Object.getOwnPropertySymbols(ce);Ne<De.length;Ne++)_.indexOf(De[Ne])<0&&Object.prototype.propertyIsEnumerable.call(ce,De[Ne])&&(v[De[Ne]]=ce[De[Ne]]);return v};const U=A.createContext(null),q=A.forwardRef((ce,_)=>{const{children:v}=ce,De=ue(ce,["children"]),Ne=A.useContext(U),L=A.useMemo(()=>Object.assign(Object.assign({},Ne),De),[Ne,De.prefixCls,De.mode,De.selectable]);return A.createElement(U.Provider,{value:L},A.createElement(J.BR,null,(0,he.supportNodeRef)(v)?A.cloneElement(v,{ref:_}):v))});ft.Z=U},68508:function(er,ft,x){"use strict";x.d(ft,{default:function(){return ut}});var A=x(78595),J=x(67294),he=x(71322),ue=x(94184),U=x.n(ue),q=x(53124),ce=function(be,ae){var Q={};for(var V in be)Object.prototype.hasOwnProperty.call(be,V)&&ae.indexOf(V)<0&&(Q[V]=be[V]);if(be!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Y=0,V=Object.getOwnPropertySymbols(be);Y<V.length;Y++)ae.indexOf(V[Y])<0&&Object.prototype.propertyIsEnumerable.call(be,V[Y])&&(Q[V[Y]]=be[V[Y]]);return Q},v=be=>{const{prefixCls:ae,className:Q,dashed:V}=be,Y=ce(be,["prefixCls","className","dashed"]),{getPrefixCls:ye}=J.useContext(q.E_),te=ye("menu",ae),ne=U()({[`${te}-item-divider-dashed`]:!!V},Q);return J.createElement(A.iz,Object.assign({className:ne},Y))},De=x(37419),Ne=x(10366),L=x(83062),Le=x(96159),pt=(0,J.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),Z=be=>{var ae;const{className:Q,children:V,icon:Y,title:ye,danger:te}=be,{prefixCls:ne,firstLevel:Ke,direction:Fe,disableMenuItemTitleTooltip:Ce,inlineCollapsed:kt}=J.useContext(pt),$t=or=>{const tn=J.createElement("span",{className:`${ne}-title-content`},V);return(!Y||(0,Le.l$)(V)&&V.type==="span")&&V&&or&&Ke&&typeof V=="string"?J.createElement("div",{className:`${ne}-inline-collapsed-noicon`},V.charAt(0)):tn},{siderCollapsed:G}=J.useContext(he.D);let nt=ye;typeof ye=="undefined"?nt=Ke?V:"":ye===!1&&(nt="");const dt={title:nt};!G&&!kt&&(dt.title=null,dt.open=!1);const qt=(0,De.Z)(V).length;let vr=J.createElement(A.ck,Object.assign({},(0,Ne.Z)(be,["title","icon","danger"]),{className:U()({[`${ne}-item-danger`]:te,[`${ne}-item-only-child`]:(Y?qt+1:qt)===1},Q),title:typeof ye=="string"?ye:void 0}),(0,Le.Tm)(Y,{className:U()((0,Le.l$)(Y)?(ae=Y.props)===null||ae===void 0?void 0:ae.className:"",`${ne}-item-icon`)}),$t(kt));return Ce||(vr=J.createElement(L.Z,Object.assign({},dt,{placement:Fe==="rtl"?"left":"right",overlayClassName:`${ne}-inline-collapsed-tooltip`}),vr)),vr},Ht=be=>{var ae;const{popupClassName:Q,icon:V,title:Y,theme:ye}=be,te=J.useContext(pt),{prefixCls:ne,inlineCollapsed:Ke,theme:Fe}=te,Ce=(0,A.Xl)();let kt;if(!V)kt=Ke&&!Ce.length&&Y&&typeof Y=="string"?J.createElement("div",{className:`${ne}-inline-collapsed-noicon`},Y.charAt(0)):J.createElement("span",{className:`${ne}-title-content`},Y);else{const G=(0,Le.l$)(Y)&&Y.type==="span";kt=J.createElement(J.Fragment,null,(0,Le.Tm)(V,{className:U()((0,Le.l$)(V)?(ae=V.props)===null||ae===void 0?void 0:ae.className:"",`${ne}-item-icon`)}),G?Y:J.createElement("span",{className:`${ne}-title-content`},Y))}const $t=J.useMemo(()=>Object.assign(Object.assign({},te),{firstLevel:!1}),[te]);return J.createElement(pt.Provider,{value:$t},J.createElement(A.Wd,Object.assign({},(0,Ne.Z)(be,["icon"]),{title:kt,popupClassName:U()(ne,Q,`${ne}-${ye||Fe}`)})))},Se=x(25877),pe=x(60276),T=x(33603),F=x(76529),ie=function(be,ae){var Q={};for(var V in be)Object.prototype.hasOwnProperty.call(be,V)&&ae.indexOf(V)<0&&(Q[V]=be[V]);if(be!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Y=0,V=Object.getOwnPropertySymbols(be);Y<V.length;Y++)ae.indexOf(V[Y])<0&&Object.prototype.propertyIsEnumerable.call(be,V[Y])&&(Q[V[Y]]=be[V[Y]]);return Q};function j(be){return(be||[]).map((ae,Q)=>{if(ae&&typeof ae=="object"){const V=ae,{label:Y,children:ye,key:te,type:ne}=V,Ke=ie(V,["label","children","key","type"]),Fe=te!=null?te:`tmp-${Q}`;return ye||ne==="group"?ne==="group"?J.createElement(A.BW,Object.assign({key:Fe},Ke,{title:Y}),j(ye)):J.createElement(Ht,Object.assign({key:Fe},Ke,{title:Y}),j(ye)):ne==="divider"?J.createElement(v,Object.assign({key:Fe},Ke)):J.createElement(Z,Object.assign({key:Fe},Ke),Y)}return null}).filter(ae=>ae)}function ze(be){return J.useMemo(()=>be&&j(be),[be])}var tt=x(84780),Nt=x(14747),gt=x(33507),Me=x(67771),_e=x(50438),Je=x(67968),re=x(45503),rt=be=>{const{componentCls:ae,motionDurationSlow:Q,horizontalLineHeight:V,colorSplit:Y,lineWidth:ye,lineType:te,itemPaddingInline:ne}=be;return{[`${ae}-horizontal`]:{lineHeight:V,border:0,borderBottom:`${ye}px ${te} ${Y}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${ae}-item, ${ae}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:ne},[`> ${ae}-item:hover,
|
|
|
> ${ae}-item-active,
|
|
|
> ${ae}-submenu ${ae}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${ae}-item, ${ae}-submenu-title`]:{transition:[`border-color ${Q}`,`background ${Q}`].join(",")},[`${ae}-submenu-arrow`]:{display:"none"}}}},Ae=be=>{let{componentCls:ae,menuArrowOffset:Q}=be;return{[`${ae}-rtl`]:{direction:"rtl"},[`${ae}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${ae}-rtl${ae}-vertical,
|
|
|
${ae}-submenu-rtl ${ae}-vertical`]:{[`${ae}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${Q})`},"&::after":{transform:`rotate(45deg) translateY(${Q})`}}}}};const ve=be=>Object.assign({},(0,Nt.oN)(be));var ot=(be,ae)=>{const{componentCls:Q,itemColor:V,itemSelectedColor:Y,groupTitleColor:ye,itemBg:te,subMenuItemBg:ne,itemSelectedBg:Ke,activeBarHeight:Fe,activeBarWidth:Ce,activeBarBorderWidth:kt,motionDurationSlow:$t,motionEaseInOut:G,motionEaseOut:nt,itemPaddingInline:dt,motionDurationMid:qt,itemHoverColor:vr,lineType:or,colorSplit:tn,itemDisabledColor:Vt,dangerItemColor:ct,dangerItemHoverColor:rn,dangerItemSelectedColor:nn,dangerItemActiveBg:br,dangerItemSelectedBg:dr,itemHoverBg:Xr,itemActiveBg:It,menuSubMenuBg:$n,horizontalItemSelectedColor:dn,horizontalItemSelectedBg:wn,horizontalItemBorderRadius:jr,horizontalItemHoverBg:Lr,popupBg:At}=be;return{[`${Q}-${ae}, ${Q}-${ae} > ${Q}`]:{color:V,background:te,[`&${Q}-root:focus-visible`]:Object.assign({},ve(be)),[`${Q}-item-group-title`]:{color:ye},[`${Q}-submenu-selected`]:{[`> ${Q}-submenu-title`]:{color:Y}},[`${Q}-item-disabled, ${Q}-submenu-disabled`]:{color:`${Vt} !important`},[`${Q}-item:not(${Q}-item-selected):not(${Q}-submenu-selected)`]:{[`&:hover, > ${Q}-submenu-title:hover`]:{color:vr}},[`&:not(${Q}-horizontal)`]:{[`${Q}-item:not(${Q}-item-selected)`]:{"&:hover":{backgroundColor:Xr},"&:active":{backgroundColor:It}},[`${Q}-submenu-title`]:{"&:hover":{backgroundColor:Xr},"&:active":{backgroundColor:It}}},[`${Q}-item-danger`]:{color:ct,[`&${Q}-item:hover`]:{[`&:not(${Q}-item-selected):not(${Q}-submenu-selected)`]:{color:rn}},[`&${Q}-item:active`]:{background:br}},[`${Q}-item a`]:{"&, &:hover":{color:"inherit"}},[`${Q}-item-selected`]:{color:Y,[`&${Q}-item-danger`]:{color:nn},"a, a:hover":{color:"inherit"}},[`& ${Q}-item-selected`]:{backgroundColor:Ke,[`&${Q}-item-danger`]:{backgroundColor:dr}},[`${Q}-item, ${Q}-submenu-title`]:{[`&:not(${Q}-item-disabled):focus-visible`]:Object.assign({},ve(be))},[`&${Q}-submenu > ${Q}`]:{backgroundColor:$n},[`&${Q}-popup > ${Q}`]:{backgroundColor:At},[`&${Q}-horizontal`]:Object.assign(Object.assign({},ae==="dark"?{borderBottom:0}:{}),{[`> ${Q}-item, > ${Q}-submenu`]:{top:kt,marginTop:-kt,marginBottom:0,borderRadius:jr,"&::after":{position:"absolute",insetInline:dt,bottom:0,borderBottom:`${Fe}px solid transparent`,transition:`border-color ${$t} ${G}`,content:'""'},"&:hover, &-active, &-open":{background:Lr,"&::after":{borderBottomWidth:Fe,borderBottomColor:dn}},"&-selected":{color:dn,backgroundColor:wn,"&:hover":{backgroundColor:wn},"&::after":{borderBottomWidth:Fe,borderBottomColor:dn}}}}),[`&${Q}-root`]:{[`&${Q}-inline, &${Q}-vertical`]:{borderInlineEnd:`${kt}px ${or} ${tn}`}},[`&${Q}-inline`]:{[`${Q}-sub${Q}-inline`]:{background:ne},[`${Q}-item, ${Q}-submenu-title`]:kt&&Ce?{width:`calc(100% + ${kt}px)`}:{},[`${Q}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${Ce}px solid ${Y}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${qt} ${nt}`,`opacity ${qt} ${nt}`].join(","),content:'""'},[`&${Q}-item-danger`]:{"&::after":{borderInlineEndColor:nn}}},[`${Q}-selected, ${Q}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${qt} ${G}`,`opacity ${qt} ${G}`].join(",")}}}}}};const Ze=be=>{const{componentCls:ae,itemHeight:Q,itemMarginInline:V,padding:Y,menuArrowSize:ye,marginXS:te,itemMarginBlock:ne}=be,Ke=Y+ye+te;return{[`${ae}-item`]:{position:"relative",overflow:"hidden"},[`${ae}-item, ${ae}-submenu-title`]:{height:Q,lineHeight:`${Q}px`,paddingInline:Y,overflow:"hidden",textOverflow:"ellipsis",marginInline:V,marginBlock:ne,width:`calc(100% - ${V*2}px)`},[`> ${ae}-item,
|
|
|
> ${ae}-submenu > ${ae}-submenu-title`]:{height:Q,lineHeight:`${Q}px`},[`${ae}-item-group-list ${ae}-submenu-title,
|
|
|
${ae}-submenu-title`]:{paddingInlineEnd:Ke}}};var xe=be=>{const{componentCls:ae,iconCls:Q,itemHeight:V,colorTextLightSolid:Y,dropdownWidth:ye,controlHeightLG:te,motionDurationMid:ne,motionEaseOut:Ke,paddingXL:Fe,itemMarginInline:Ce,fontSizeLG:kt,motionDurationSlow:$t,paddingXS:G,boxShadowSecondary:nt,collapsedWidth:dt,collapsedIconSize:qt}=be,vr={height:V,lineHeight:`${V}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[ae]:{"&-inline, &-vertical":Object.assign({[`&${ae}-root`]:{boxShadow:"none"}},Ze(be))},[`${ae}-submenu-popup`]:{[`${ae}-vertical`]:Object.assign(Object.assign({},Ze(be)),{boxShadow:nt})}},{[`${ae}-submenu-popup ${ae}-vertical${ae}-sub`]:{minWidth:ye,maxHeight:`calc(100vh - ${te*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${ae}-inline`]:{width:"100%",[`&${ae}-root`]:{[`${ae}-item, ${ae}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${$t}`,`background ${$t}`,`padding ${ne} ${Ke}`].join(","),[`> ${ae}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${ae}-sub${ae}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${ae}-submenu > ${ae}-submenu-title`]:vr,[`& ${ae}-item-group-title`]:{paddingInlineStart:Fe}},[`${ae}-item`]:vr}},{[`${ae}-inline-collapsed`]:{width:dt,[`&${ae}-root`]:{[`${ae}-item, ${ae}-submenu ${ae}-submenu-title`]:{[`> ${ae}-inline-collapsed-noicon`]:{fontSize:kt,textAlign:"center"}}},[`> ${ae}-item,
|
|
|
> ${ae}-item-group > ${ae}-item-group-list > ${ae}-item,
|
|
|
> ${ae}-item-group > ${ae}-item-group-list > ${ae}-submenu > ${ae}-submenu-title,
|
|
|
> ${ae}-submenu > ${ae}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${kt/2}px - ${Ce}px)`,textOverflow:"clip",[`
|
|
|
${ae}-submenu-arrow,
|
|
|
${ae}-submenu-expand-icon
|
|
|
`]:{opacity:0},[`${ae}-item-icon, ${Q}`]:{margin:0,fontSize:qt,lineHeight:`${V}px`,"+ span":{display:"inline-block",opacity:0}}},[`${ae}-item-icon, ${Q}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${ae}-item-icon, ${Q}`]:{display:"none"},"a, a:hover":{color:Y}},[`${ae}-item-group-title`]:Object.assign(Object.assign({},Nt.vS),{paddingInline:G})}}]};const yt=be=>{const{componentCls:ae,motionDurationSlow:Q,motionDurationMid:V,motionEaseInOut:Y,motionEaseOut:ye,iconCls:te,iconSize:ne,iconMarginInlineEnd:Ke}=be;return{[`${ae}-item, ${ae}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${Q}`,`background ${Q}`,`padding ${Q} ${Y}`].join(","),[`${ae}-item-icon, ${te}`]:{minWidth:ne,fontSize:ne,transition:[`font-size ${V} ${ye}`,`margin ${Q} ${Y}`,`color ${Q}`].join(","),"+ span":{marginInlineStart:Ke,opacity:1,transition:[`opacity ${Q} ${Y}`,`margin ${Q}`,`color ${Q}`].join(",")}},[`${ae}-item-icon`]:Object.assign({},(0,Nt.Ro)()),[`&${ae}-item-only-child`]:{[`> ${te}, > ${ae}-item-icon`]:{marginInlineEnd:0}}},[`${ae}-item-disabled, ${ae}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${ae}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},ht=be=>{const{componentCls:ae,motionDurationSlow:Q,motionEaseInOut:V,borderRadius:Y,menuArrowSize:ye,menuArrowOffset:te}=be;return{[`${ae}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:be.margin,width:ye,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${Q} ${V}, opacity ${Q}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:ye*.6,height:ye*.15,backgroundColor:"currentcolor",borderRadius:Y,transition:[`background ${Q} ${V}`,`transform ${Q} ${V}`,`top ${Q} ${V}`,`color ${Q} ${V}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${te})`},"&::after":{transform:`rotate(-45deg) translateY(${te})`}}}}},Ut=be=>{const{antCls:ae,componentCls:Q,fontSize:V,motionDurationSlow:Y,motionDurationMid:ye,motionEaseInOut:te,paddingXS:ne,padding:Ke,colorSplit:Fe,lineWidth:Ce,zIndexPopup:kt,borderRadiusLG:$t,subMenuItemBorderRadius:G,menuArrowSize:nt,menuArrowOffset:dt,lineType:qt,menuPanelMaskInset:vr,groupTitleLineHeight:or,groupTitleFontSize:tn}=be;return[{"":{[`${Q}`]:Object.assign(Object.assign({},(0,Nt.dF)()),{"&-hidden":{display:"none"}})},[`${Q}-submenu-hidden`]:{display:"none"}},{[Q]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,Nt.Wf)(be)),(0,Nt.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:V,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${Y} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${Q}-item`]:{flex:"none"}},[`${Q}-item, ${Q}-submenu, ${Q}-submenu-title`]:{borderRadius:be.itemBorderRadius},[`${Q}-item-group-title`]:{padding:`${ne}px ${Ke}px`,fontSize:tn,lineHeight:or,transition:`all ${Y}`},[`&-horizontal ${Q}-submenu`]:{transition:[`border-color ${Y} ${te}`,`background ${Y} ${te}`].join(",")},[`${Q}-submenu, ${Q}-submenu-inline`]:{transition:[`border-color ${Y} ${te}`,`background ${Y} ${te}`,`padding ${ye} ${te}`].join(",")},[`${Q}-submenu ${Q}-sub`]:{cursor:"initial",transition:[`background ${Y} ${te}`,`padding ${Y} ${te}`].join(",")},[`${Q}-title-content`]:{transition:`color ${Y}`},[`${Q}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${Q}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:Fe,borderStyle:qt,borderWidth:0,borderTopWidth:Ce,marginBlock:Ce,padding:0,"&-dashed":{borderStyle:"dashed"}}}),yt(be)),{[`${Q}-item-group`]:{[`${Q}-item-group-list`]:{margin:0,padding:0,[`${Q}-item, ${Q}-submenu-title`]:{paddingInline:`${V*2}px ${Ke}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:kt,borderRadius:$t,boxShadow:"none",transformOrigin:"0 0",[`&${Q}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${vr}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:vr},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:be.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:be.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:be.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:be.paddingXS},[`> ${Q}`]:Object.assign(Object.assign(Object.assign({borderRadius:$t},yt(be)),ht(be)),{[`${Q}-item, ${Q}-submenu > ${Q}-submenu-title`]:{borderRadius:G},[`${Q}-submenu-title::after`]:{transition:`transform ${Y} ${te}`}})}}),ht(be)),{[`&-inline-collapsed ${Q}-submenu-arrow,
|
|
|
&-inline ${Q}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${dt})`},"&::after":{transform:`rotate(45deg) translateX(-${dt})`}},[`${Q}-submenu-open${Q}-submenu-inline > ${Q}-submenu-title > ${Q}-submenu-arrow`]:{transform:`translateY(-${nt*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${dt})`},"&::before":{transform:`rotate(45deg) translateX(${dt})`}}})},{[`${ae}-layout-header`]:{[Q]:{lineHeight:"inherit"}}}]};var Gt=(be,ae)=>(0,Je.Z)("Menu",V=>{if(ae===!1)return[];const{colorBgElevated:Y,colorPrimary:ye,colorTextLightSolid:te,controlHeightLG:ne,fontSize:Ke,darkItemColor:Fe,darkDangerItemColor:Ce,darkItemBg:kt,darkSubMenuItemBg:$t,darkItemSelectedColor:G,darkItemSelectedBg:nt,darkDangerItemSelectedBg:dt,darkItemHoverBg:qt,darkGroupTitleColor:vr,darkItemHoverColor:or,darkItemDisabledColor:tn,darkDangerItemHoverColor:Vt,darkDangerItemSelectedColor:ct,darkDangerItemActiveBg:rn}=V,nn=Ke/7*5,br=(0,re.TS)(V,{menuArrowSize:nn,menuHorizontalHeight:ne*1.15,menuArrowOffset:`${nn*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:Y}),dr=(0,re.TS)(br,{itemColor:Fe,itemHoverColor:or,groupTitleColor:vr,itemSelectedColor:G,itemBg:kt,popupBg:kt,subMenuItemBg:$t,itemActiveBg:"transparent",itemSelectedBg:nt,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:qt,itemDisabledColor:tn,dangerItemColor:Ce,dangerItemHoverColor:Vt,dangerItemSelectedColor:ct,dangerItemActiveBg:rn,dangerItemSelectedBg:dt,menuSubMenuBg:$t,horizontalItemSelectedColor:te,horizontalItemSelectedBg:ye});return[Ut(br),rt(br),xe(br),ot(br,"light"),ot(dr,"dark"),Ae(br),(0,gt.Z)(br),(0,Me.oN)(br,"slide-up"),(0,Me.oN)(br,"slide-down"),(0,_e._y)(br,"zoom-big")]},V=>{const{colorPrimary:Y,colorError:ye,colorTextDisabled:te,colorErrorBg:ne,colorText:Ke,colorTextDescription:Fe,colorBgContainer:Ce,colorFillAlter:kt,colorFillContent:$t,lineWidth:G,lineWidthBold:nt,controlItemBgActive:dt,colorBgTextHover:qt,controlHeightLG:vr,lineHeight:or,colorBgElevated:tn,marginXXS:Vt,padding:ct,fontSize:rn,controlHeightSM:nn,fontSizeLG:br,colorTextLightSolid:dr,colorErrorHover:Xr}=V,It=new tt.C(dr).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:V.zIndexPopupBase+50,radiusItem:V.borderRadiusLG,itemBorderRadius:V.borderRadiusLG,radiusSubMenuItem:V.borderRadiusSM,subMenuItemBorderRadius:V.borderRadiusSM,colorItemText:Ke,itemColor:Ke,colorItemTextHover:Ke,itemHoverColor:Ke,colorItemTextHoverHorizontal:Y,horizontalItemHoverColor:Y,colorGroupTitle:Fe,groupTitleColor:Fe,colorItemTextSelected:Y,itemSelectedColor:Y,colorItemTextSelectedHorizontal:Y,horizontalItemSelectedColor:Y,colorItemBg:Ce,itemBg:Ce,colorItemBgHover:qt,itemHoverBg:qt,colorItemBgActive:$t,itemActiveBg:dt,colorSubItemBg:kt,subMenuItemBg:kt,colorItemBgSelected:dt,itemSelectedBg:dt,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:nt,activeBarHeight:nt,colorActiveBarBorderSize:G,activeBarBorderWidth:G,colorItemTextDisabled:te,itemDisabledColor:te,colorDangerItemText:ye,dangerItemColor:ye,colorDangerItemTextHover:ye,dangerItemHoverColor:ye,colorDangerItemTextSelected:ye,dangerItemSelectedColor:ye,colorDangerItemBgActive:ne,dangerItemActiveBg:ne,colorDangerItemBgSelected:ne,dangerItemSelectedBg:ne,itemMarginInline:V.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:vr,groupTitleLineHeight:or,collapsedWidth:vr*2,popupBg:tn,itemMarginBlock:Vt,itemPaddingInline:ct,horizontalLineHeight:`${vr*1.15}px`,iconSize:rn,iconMarginInlineEnd:nn-rn,collapsedIconSize:br,groupTitleFontSize:rn,darkItemDisabledColor:new tt.C(dr).setAlpha(.25).toRgbString(),darkItemColor:It,darkDangerItemColor:ye,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:dr,darkItemSelectedBg:Y,darkDangerItemSelectedBg:ye,darkItemHoverBg:"transparent",darkGroupTitleColor:It,darkItemHoverColor:dr,darkDangerItemHoverColor:Xr,darkDangerItemSelectedColor:dr,darkDangerItemActiveBg:ye}},{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]]})(be),cr=function(be,ae){var Q={};for(var V in be)Object.prototype.hasOwnProperty.call(be,V)&&ae.indexOf(V)<0&&(Q[V]=be[V]);if(be!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Y=0,V=Object.getOwnPropertySymbols(be);Y<V.length;Y++)ae.indexOf(V[Y])<0&&Object.prototype.propertyIsEnumerable.call(be,V[Y])&&(Q[V[Y]]=be[V[Y]]);return Q},rr=(0,J.forwardRef)((be,ae)=>{var Q,V;const Y=J.useContext(F.Z),ye=Y||{},{getPrefixCls:te,getPopupContainer:ne,direction:Ke,menu:Fe}=J.useContext(q.E_),Ce=te(),{prefixCls:kt,className:$t,style:G,theme:nt="light",expandIcon:dt,_internalDisableMenuItemTitleTooltip:qt,inlineCollapsed:vr,siderCollapsed:or,items:tn,children:Vt,rootClassName:ct,mode:rn,selectable:nn,onClick:br,overflowedIndicatorPopupClassName:dr}=be,Xr=cr(be,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),It=(0,Ne.Z)(Xr,["collapsedWidth"]),$n=ze(tn)||Vt;(Q=ye.validator)===null||Q===void 0||Q.call(ye,{mode:rn});const dn=(0,pe.useEvent)(function(){var Sn;br==null||br.apply(void 0,arguments),(Sn=ye.onClick)===null||Sn===void 0||Sn.call(ye)}),wn=ye.mode||rn,jr=nn!=null?nn:ye.selectable,Lr=J.useMemo(()=>or!==void 0?or:vr,[vr,or]),At={horizontal:{motionName:`${Ce}-slide-up`},inline:(0,T.Z)(Ce),other:{motionName:`${Ce}-zoom-big`}},Fr=te("menu",kt||ye.prefixCls),[vi,ni]=Gt(Fr,!Y),li=U()(`${Fr}-${nt}`,Fe==null?void 0:Fe.className,$t);let hn;if(typeof dt=="function")hn=dt;else if(dt===null||dt===!1)hn=null;else if(ye.expandIcon===null||ye.expandIcon===!1)hn=null;else{const Sn=dt!=null?dt:ye.expandIcon;hn=(0,Le.Tm)(Sn,{className:U()(`${Fr}-submenu-expand-icon`,(0,Le.l$)(Sn)?(V=Sn.props)===null||V===void 0?void 0:V.className:"")})}const Di=J.useMemo(()=>({prefixCls:Fr,inlineCollapsed:Lr||!1,direction:Ke,firstLevel:!0,theme:nt,mode:wn,disableMenuItemTitleTooltip:qt}),[Fr,Lr,Ke,qt,nt]);return vi(J.createElement(F.Z.Provider,{value:null},J.createElement(pt.Provider,{value:Di},J.createElement(A.ZP,Object.assign({getPopupContainer:ne,overflowedIndicator:J.createElement(Se.Z,null),overflowedIndicatorPopupClassName:U()(Fr,`${Fr}-${nt}`,dr),mode:wn,selectable:jr,onClick:dn},It,{inlineCollapsed:Lr,style:Object.assign(Object.assign({},Fe==null?void 0:Fe.style),G),className:li,prefixCls:Fr,direction:Ke,defaultMotions:At,expandIcon:hn,ref:ae,rootClassName:U()(ct,ni)}),$n))))});const ar=(0,J.forwardRef)((be,ae)=>{const Q=(0,J.useRef)(null),V=J.useContext(he.D);return(0,J.useImperativeHandle)(ae,()=>({menu:Q.current,focus:Y=>{var ye;(ye=Q.current)===null||ye===void 0||ye.focus(Y)}})),J.createElement(rr,Object.assign({ref:Q},be,V))});ar.Item=Z,ar.SubMenu=Ht,ar.Divider=v,ar.ItemGroup=A.BW;var ut=ar},78045:function(er,ft,x){"use strict";x.d(ft,{ZP:function(){return Ae}});var A=x(94184),J=x.n(A),he=x(5663),ue=x(1337),U=x(67294),q=x(53124),ce=x(98675);const _=U.createContext(null),v=_.Provider;var De=_;const Ne=U.createContext(null),L=Ne.Provider;var Le=x(95860),Re=x(17799),pt=x(98866),lt=x(65223),Z=x(14747),Ie=x(67968),Ht=x(45503);const Se=ve=>{const{componentCls:fe,antCls:ot}=ve,Ze=`${fe}-group`;return{[Ze]:Object.assign(Object.assign({},(0,Z.Wf)(ve)),{display:"inline-block",fontSize:0,[`&${Ze}-rtl`]:{direction:"rtl"},[`${ot}-badge ${ot}-badge-count`]:{zIndex:1},[`> ${ot}-badge:not(:first-child) > ${ot}-button-wrapper`]:{borderInlineStart:"none"}})}},pe=ve=>{const{componentCls:fe,wrapperMarginInlineEnd:ot,colorPrimary:Ze,radioSize:Oe,motionDurationSlow:xe,motionDurationMid:yt,motionEaseInOutCirc:ht,colorBgContainer:Ut,colorBorder:Gt,lineWidth:cr,dotSize:ur,colorBgContainerDisabled:rr,colorTextDisabled:ar,paddingXS:ut,dotColorDisabled:be,lineType:ae,radioDotDisabledSize:Q,wireframe:V,colorWhite:Y}=ve,ye=`${fe}-inner`;return{[`${fe}-wrapper`]:Object.assign(Object.assign({},(0,Z.Wf)(ve)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:ot,cursor:"pointer",[`&${fe}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:ve.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${fe}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${cr}px ${ae} ${Ze}`,borderRadius:"50%",visibility:"hidden",content:'""'},[fe]:Object.assign(Object.assign({},(0,Z.Wf)(ve)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${fe}-wrapper:hover &,
|
|
|
&:hover ${ye}`]:{borderColor:Ze},[`${fe}-input:focus-visible + ${ye}`]:Object.assign({},(0,Z.oN)(ve)),[`${fe}:hover::after, ${fe}-wrapper:hover &::after`]:{visibility:"visible"},[`${fe}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:Oe,height:Oe,marginBlockStart:Oe/-2,marginInlineStart:Oe/-2,backgroundColor:V?Ze:Y,borderBlockStart:0,borderInlineStart:0,borderRadius:Oe,transform:"scale(0)",opacity:0,transition:`all ${xe} ${ht}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:Oe,height:Oe,backgroundColor:Ut,borderColor:Gt,borderStyle:"solid",borderWidth:cr,borderRadius:"50%",transition:`all ${yt}`},[`${fe}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${fe}-checked`]:{[ye]:{borderColor:Ze,backgroundColor:V?Ut:Ze,"&::after":{transform:`scale(${ur/Oe})`,opacity:1,transition:`all ${xe} ${ht}`}}},[`${fe}-disabled`]:{cursor:"not-allowed",[ye]:{backgroundColor:rr,borderColor:Gt,cursor:"not-allowed","&::after":{backgroundColor:be}},[`${fe}-input`]:{cursor:"not-allowed"},[`${fe}-disabled + span`]:{color:ar,cursor:"not-allowed"},[`&${fe}-checked`]:{[ye]:{"&::after":{transform:`scale(${Q/Oe})`}}}},[`span${fe} + *`]:{paddingInlineStart:ut,paddingInlineEnd:ut}})}},T=ve=>{const{buttonColor:fe,controlHeight:ot,componentCls:Ze,lineWidth:Oe,lineType:xe,colorBorder:yt,motionDurationSlow:ht,motionDurationMid:Ut,buttonPaddingInline:Gt,fontSize:cr,buttonBg:ur,fontSizeLG:rr,controlHeightLG:ar,controlHeightSM:ut,paddingXS:be,borderRadius:ae,borderRadiusSM:Q,borderRadiusLG:V,buttonCheckedBg:Y,buttonSolidCheckedColor:ye,colorTextDisabled:te,colorBgContainerDisabled:ne,buttonCheckedBgDisabled:Ke,buttonCheckedColorDisabled:Fe,colorPrimary:Ce,colorPrimaryHover:kt,colorPrimaryActive:$t,buttonSolidCheckedBg:G,buttonSolidCheckedHoverBg:nt,buttonSolidCheckedActiveBg:dt}=ve;return{[`${Ze}-button-wrapper`]:{position:"relative",display:"inline-block",height:ot,margin:0,paddingInline:Gt,paddingBlock:0,color:fe,fontSize:cr,lineHeight:`${ot-Oe*2}px`,background:ur,border:`${Oe}px ${xe} ${yt}`,borderBlockStartWidth:Oe+.02,borderInlineStartWidth:0,borderInlineEndWidth:Oe,cursor:"pointer",transition:[`color ${Ut}`,`background ${Ut}`,`box-shadow ${Ut}`].join(","),a:{color:fe},[`> ${Ze}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-Oe,insetInlineStart:-Oe,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:Oe,paddingInline:0,backgroundColor:yt,transition:`background-color ${ht}`,content:'""'}},"&:first-child":{borderInlineStart:`${Oe}px ${xe} ${yt}`,borderStartStartRadius:ae,borderEndStartRadius:ae},"&:last-child":{borderStartEndRadius:ae,borderEndEndRadius:ae},"&:first-child:last-child":{borderRadius:ae},[`${Ze}-group-large &`]:{height:ar,fontSize:rr,lineHeight:`${ar-Oe*2}px`,"&:first-child":{borderStartStartRadius:V,borderEndStartRadius:V},"&:last-child":{borderStartEndRadius:V,borderEndEndRadius:V}},[`${Ze}-group-small &`]:{height:ut,paddingInline:be-Oe,paddingBlock:0,lineHeight:`${ut-Oe*2}px`,"&:first-child":{borderStartStartRadius:Q,borderEndStartRadius:Q},"&:last-child":{borderStartEndRadius:Q,borderEndEndRadius:Q}},"&:hover":{position:"relative",color:Ce},"&:has(:focus-visible)":Object.assign({},(0,Z.oN)(ve)),[`${Ze}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Ze}-button-wrapper-disabled)`]:{zIndex:1,color:Ce,background:Y,borderColor:Ce,"&::before":{backgroundColor:Ce},"&:first-child":{borderColor:Ce},"&:hover":{color:kt,borderColor:kt,"&::before":{backgroundColor:kt}},"&:active":{color:$t,borderColor:$t,"&::before":{backgroundColor:$t}}},[`${Ze}-group-solid &-checked:not(${Ze}-button-wrapper-disabled)`]:{color:ye,background:G,borderColor:G,"&:hover":{color:ye,background:nt,borderColor:nt},"&:active":{color:ye,background:dt,borderColor:dt}},"&-disabled":{color:te,backgroundColor:ne,borderColor:yt,cursor:"not-allowed","&:first-child, &:hover":{color:te,backgroundColor:ne,borderColor:yt}},[`&-disabled${Ze}-button-wrapper-checked`]:{color:Fe,backgroundColor:Ke,borderColor:yt,boxShadow:"none"}}}},F=ve=>ve-4*2;var ie=(0,Ie.Z)("Radio",ve=>{const{controlOutline:fe,controlOutlineWidth:ot,radioSize:Ze}=ve,Oe=`0 0 0 ${ot}px ${fe}`,xe=Oe,yt=F(Ze),ht=(0,Ht.TS)(ve,{radioDotDisabledSize:yt,radioFocusShadow:Oe,radioButtonFocusShadow:xe});return[Se(ht),pe(ht),T(ht)]},ve=>{const{wireframe:fe,padding:ot,marginXS:Ze,lineWidth:Oe,fontSizeLG:xe,colorText:yt,colorBgContainer:ht,colorTextDisabled:Ut,controlItemBgActiveDisabled:Gt,colorTextLightSolid:cr,colorPrimary:ur,colorPrimaryHover:rr,colorPrimaryActive:ar}=ve,ut=4,be=xe,ae=fe?F(be):be-(ut+Oe)*2;return{radioSize:be,dotSize:ae,dotColorDisabled:Ut,buttonSolidCheckedColor:cr,buttonSolidCheckedBg:ur,buttonSolidCheckedHoverBg:rr,buttonSolidCheckedActiveBg:ar,buttonBg:ht,buttonCheckedBg:ht,buttonColor:yt,buttonCheckedBgDisabled:Gt,buttonCheckedColorDisabled:Ut,buttonPaddingInline:ot-Oe,wrapperMarginInlineEnd:Ze}}),j=x(45353),ze=x(92429),tt=function(ve,fe){var ot={};for(var Ze in ve)Object.prototype.hasOwnProperty.call(ve,Ze)&&fe.indexOf(Ze)<0&&(ot[Ze]=ve[Ze]);if(ve!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,Ze=Object.getOwnPropertySymbols(ve);Oe<Ze.length;Oe++)fe.indexOf(Ze[Oe])<0&&Object.prototype.propertyIsEnumerable.call(ve,Ze[Oe])&&(ot[Ze[Oe]]=ve[Ze[Oe]]);return ot};const Nt=(ve,fe)=>{var ot,Ze;const Oe=U.useContext(De),xe=U.useContext(Ne),{getPrefixCls:yt,direction:ht,radio:Ut}=U.useContext(q.E_),Gt=U.useRef(null),cr=(0,Re.sQ)(fe,Gt),{isFormItemInput:ur}=U.useContext(lt.aM),rr=$t=>{var G,nt;(G=ve.onChange)===null||G===void 0||G.call(ve,$t),(nt=Oe==null?void 0:Oe.onChange)===null||nt===void 0||nt.call(Oe,$t)},{prefixCls:ar,className:ut,rootClassName:be,children:ae,style:Q}=ve,V=tt(ve,["prefixCls","className","rootClassName","children","style"]),Y=yt("radio",ar),ye=((Oe==null?void 0:Oe.optionType)||xe)==="button",te=ye?`${Y}-button`:Y,[ne,Ke]=ie(Y),Fe=Object.assign({},V),Ce=U.useContext(pt.Z);Oe&&(Fe.name=Oe.name,Fe.onChange=rr,Fe.checked=ve.value===Oe.value,Fe.disabled=(ot=Fe.disabled)!==null&&ot!==void 0?ot:Oe.disabled),Fe.disabled=(Ze=Fe.disabled)!==null&&Ze!==void 0?Ze:Ce;const kt=J()(`${te}-wrapper`,{[`${te}-wrapper-checked`]:Fe.checked,[`${te}-wrapper-disabled`]:Fe.disabled,[`${te}-wrapper-rtl`]:ht==="rtl",[`${te}-wrapper-in-form-item`]:ur},Ut==null?void 0:Ut.className,ut,be,Ke);return ne(U.createElement(j.Z,{component:"Radio",disabled:Fe.disabled},U.createElement("label",{className:kt,style:Object.assign(Object.assign({},Ut==null?void 0:Ut.style),Q),onMouseEnter:ve.onMouseEnter,onMouseLeave:ve.onMouseLeave},U.createElement(Le.Z,Object.assign({},Fe,{className:J()(Fe.className,!ye&&ze.A),type:"radio",prefixCls:te,ref:cr})),ae!==void 0?U.createElement("span",null,ae):null)))};var Me=U.forwardRef(Nt);const _e=U.forwardRef((ve,fe)=>{const{getPrefixCls:ot,direction:Ze}=U.useContext(q.E_),[Oe,xe]=(0,he.Z)(ve.defaultValue,{value:ve.value}),yt=G=>{const nt=Oe,dt=G.target.value;"value"in ve||xe(dt);const{onChange:qt}=ve;qt&&dt!==nt&&qt(G)},{prefixCls:ht,className:Ut,rootClassName:Gt,options:cr,buttonStyle:ur="outline",disabled:rr,children:ar,size:ut,style:be,id:ae,onMouseEnter:Q,onMouseLeave:V,onFocus:Y,onBlur:ye}=ve,te=ot("radio",ht),ne=`${te}-group`,[Ke,Fe]=ie(te);let Ce=ar;cr&&cr.length>0&&(Ce=cr.map(G=>typeof G=="string"||typeof G=="number"?U.createElement(Me,{key:G.toString(),prefixCls:te,disabled:rr,value:G,checked:Oe===G},G):U.createElement(Me,{key:`radio-group-value-options-${G.value}`,prefixCls:te,disabled:G.disabled||rr,value:G.value,checked:Oe===G.value,title:G.title,style:G.style},G.label)));const kt=(0,ce.Z)(ut),$t=J()(ne,`${ne}-${ur}`,{[`${ne}-${kt}`]:kt,[`${ne}-rtl`]:Ze==="rtl"},Ut,Gt,Fe);return Ke(U.createElement("div",Object.assign({},(0,ue.Z)(ve,{aria:!0,data:!0}),{className:$t,style:be,onMouseEnter:Q,onMouseLeave:V,onFocus:Y,onBlur:ye,id:ae,ref:fe}),U.createElement(v,{value:{onChange:yt,value:Oe,disabled:ve.disabled,name:ve.name,optionType:ve.optionType}},Ce)))});var Je=U.memo(_e),re=function(ve,fe){var ot={};for(var Ze in ve)Object.prototype.hasOwnProperty.call(ve,Ze)&&fe.indexOf(Ze)<0&&(ot[Ze]=ve[Ze]);if(ve!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,Ze=Object.getOwnPropertySymbols(ve);Oe<Ze.length;Oe++)fe.indexOf(Ze[Oe])<0&&Object.prototype.propertyIsEnumerable.call(ve,Ze[Oe])&&(ot[Ze[Oe]]=ve[Ze[Oe]]);return ot};const Ue=(ve,fe)=>{const{getPrefixCls:ot}=U.useContext(q.E_),{prefixCls:Ze}=ve,Oe=re(ve,["prefixCls"]),xe=ot("radio",Ze);return U.createElement(L,{value:"button"},U.createElement(Me,Object.assign({prefixCls:xe},Oe,{type:"radio",ref:fe})))};var rt=U.forwardRef(Ue);const ge=Me;ge.Button=rt,ge.Group=Je,ge.__ANT_RADIO=!0;var Ae=ge},33507:function(er,ft){"use strict";const x=A=>({[A.componentCls]:{[`${A.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${A.motionDurationMid} ${A.motionEaseInOut},
|
|
|
opacity ${A.motionDurationMid} ${A.motionEaseInOut} !important`}},[`${A.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${A.motionDurationMid} ${A.motionEaseInOut},
|
|
|
opacity ${A.motionDurationMid} ${A.motionEaseInOut} !important`}}});ft.Z=x},33297:function(er,ft,x){"use strict";x.d(ft,{Fm:function(){return L}});var A=x(34367),J=x(93590);const he=new A.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ue=new A.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),U=new A.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),q=new A.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),ce=new A.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),_=new A.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),v=new A.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),De=new A.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),Ne={"move-up":{inKeyframes:v,outKeyframes:De},"move-down":{inKeyframes:he,outKeyframes:ue},"move-left":{inKeyframes:U,outKeyframes:q},"move-right":{inKeyframes:ce,outKeyframes:_}},L=(Le,Re)=>{const{antCls:pt}=Le,lt=`${pt}-${Re}`,{inKeyframes:Z,outKeyframes:Ie}=Ne[Re];return[(0,J.R)(lt,Z,Ie,Le.motionDurationMid),{[`
|
|
|
${lt}-enter,
|
|
|
${lt}-appear
|
|
|
`]:{opacity:0,animationTimingFunction:Le.motionEaseOutCirc},[`${lt}-leave`]:{animationTimingFunction:Le.motionEaseInOutCirc}}]}},67771:function(er,ft,x){"use strict";x.d(ft,{Qt:function(){return U},Uw:function(){return ue},fJ:function(){return he},ly:function(){return q},oN:function(){return L}});var A=x(34367),J=x(93590);const he=new A.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ue=new A.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),U=new A.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),q=new A.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),ce=new A.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),_=new A.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),v=new A.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),De=new A.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),Ne={"slide-up":{inKeyframes:he,outKeyframes:ue},"slide-down":{inKeyframes:U,outKeyframes:q},"slide-left":{inKeyframes:ce,outKeyframes:_},"slide-right":{inKeyframes:v,outKeyframes:De}},L=(Le,Re)=>{const{antCls:pt}=Le,lt=`${pt}-${Re}`,{inKeyframes:Z,outKeyframes:Ie}=Ne[Re];return[(0,J.R)(lt,Z,Ie,Le.motionDurationMid),{[`
|
|
|
${lt}-enter,
|
|
|
${lt}-appear
|
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:Le.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${lt}-leave`]:{animationTimingFunction:Le.motionEaseInQuint}}]}},66368:function(er,ft,x){"use strict";x.d(ft,{default:function(){return Ui}});var A=x(73475),J=x(25877),he=x(38308),ue=x(94184),U=x.n(ue),q=x(87462),ce=x(4942),_=x(1413),v=x(97685),De=x(71002),Ne=x(45987),L=x(67294),Le=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var b=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(b)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(b==null?void 0:b.substr(0,4))};function Re(b){var M=L.useRef();M.current=b;var C=L.useCallback(function(){for(var k,R=arguments.length,z=new Array(R),H=0;H<R;H++)z[H]=arguments[H];return(k=M.current)===null||k===void 0?void 0:k.call.apply(k,[M].concat(z))},[]);return C}function pt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var lt=pt()?L.useLayoutEffect:L.useEffect,Z=function(M,C){var k=L.useRef(!0);lt(function(){return M(k.current)},C),lt(function(){return k.current=!1,function(){k.current=!0}},[])},Ie=function(M,C){Z(function(k){if(!k)return M()},C)},Ht=null;function Se(b){var M=L.useRef(!1),C=L.useState(b),k=(0,v.Z)(C,2),R=k[0],z=k[1];L.useEffect(function(){return M.current=!1,function(){M.current=!0}},[]);function H(ee,le){le&&M.current||z(ee)}return[R,H]}function pe(b){return b!==void 0}function T(b,M){var C=M||{},k=C.defaultValue,R=C.value,z=C.onChange,H=C.postState,ee=Se(function(){return pe(R)?R:pe(k)?typeof k=="function"?k():k:typeof b=="function"?b():b}),le=(0,v.Z)(ee,2),Te=le[0],st=le[1],Be=R!==void 0?R:Te,vt=H?H(Be):Be,bt=Re(z),Dt=Se([Be]),Wt=(0,v.Z)(Dt,2),Ct=Wt[0],qe=Wt[1];Ie(function(){var et=Ct[0];Te!==et&&bt(Te,et)},[Ct]),Ie(function(){pe(R)||st(R)},[R]);var He=Re(function(et,Ye){st(et,Ye),qe([Be],Ye)});return[vt,He]}var F=x(62874),ie=(0,L.createContext)(null),j=L.forwardRef(function(b,M){var C=b.prefixCls,k=b.className,R=b.style,z=b.id,H=b.active,ee=b.tabKey,le=b.children;return L.createElement("div",{id:z&&"".concat(z,"-panel-").concat(ee),role:"tabpanel",tabIndex:H?0:-1,"aria-labelledby":z&&"".concat(z,"-tab-").concat(ee),"aria-hidden":!H,style:R,className:U()(C,H&&"".concat(C,"-active"),k),ref:M},le)}),ze=j,tt=["key","forceRender","style","className"];function Nt(b){var M=b.id,C=b.activeKey,k=b.animated,R=b.tabPosition,z=b.destroyInactiveTabPane,H=L.useContext(ie),ee=H.prefixCls,le=H.tabs,Te=k.tabPane,st="".concat(ee,"-tabpane");return L.createElement("div",{className:U()("".concat(ee,"-content-holder"))},L.createElement("div",{className:U()("".concat(ee,"-content"),"".concat(ee,"-content-").concat(R),(0,ce.Z)({},"".concat(ee,"-content-animated"),Te))},le.map(function(Be){var vt=Be.key,bt=Be.forceRender,Dt=Be.style,Wt=Be.className,Ct=(0,Ne.Z)(Be,tt),qe=vt===C;return L.createElement(F.Z,(0,q.Z)({key:vt,visible:qe,forceRender:bt,removeOnLeave:!!z,leavedClassName:"".concat(st,"-hidden")},k.tabPaneMotion),function(He,et){var Ye=He.style,wt=He.className;return L.createElement(ze,(0,q.Z)({},Ct,{prefixCls:st,id:M,tabKey:vt,animated:Te,active:qe,style:(0,_.Z)((0,_.Z)({},Dt),Ye),className:U()(Wt,wt),ref:et}))})})))}var gt=x(74902),Me=x(48555),_e=x(59864);function Je(b,M,C){var k=L.useRef({});return(!("value"in k.current)||C(k.current.condition,M))&&(k.current.value=b(),k.current.condition=M),k.current.value}function re(b,M){typeof b=="function"?b(M):(0,De.Z)(b)==="object"&&b&&"current"in b&&(b.current=M)}function Ue(){for(var b=arguments.length,M=new Array(b),C=0;C<b;C++)M[C]=arguments[C];var k=M.filter(function(R){return R});return k.length<=1?k[0]:function(R){M.forEach(function(z){re(z,R)})}}function rt(){for(var b=arguments.length,M=new Array(b),C=0;C<b;C++)M[C]=arguments[C];return Je(function(){return Ue.apply(void 0,M)},M,function(k,R){return k.length===R.length&&k.every(function(z,H){return z===R[H]})})}function ge(b){var M,C,k=isMemo(b)?b.type.type:b.type;return!(typeof k=="function"&&!((M=k.prototype)!==null&&M!==void 0&&M.render)||typeof b=="function"&&!((C=b.prototype)!==null&&C!==void 0&&C.render))}var Ae={width:0,height:0,left:0,top:0};function ve(b,M,C){return(0,L.useMemo)(function(){for(var k,R=new Map,z=M.get((k=b[0])===null||k===void 0?void 0:k.key)||Ae,H=z.left+z.width,ee=0;ee<b.length;ee+=1){var le=b[ee].key,Te=M.get(le);if(!Te){var st;Te=M.get((st=b[ee-1])===null||st===void 0?void 0:st.key)||Ae}var Be=R.get(le)||(0,_.Z)({},Te);Be.right=H-Be.left-Be.width,R.set(le,Be)}return R},[b.map(function(k){return k.key}).join("_"),M,C])}function fe(b,M){var C=L.useRef(b),k=L.useState({}),R=(0,v.Z)(k,2),z=R[1];function H(ee){var le=typeof ee=="function"?ee(C.current):ee;le!==C.current&&M(le,C.current),C.current=le,z({})}return[C.current,H]}var ot=.1,Ze=.01,Oe=20,xe=Math.pow(.995,Oe);function yt(b,M){var C=(0,L.useState)(),k=(0,v.Z)(C,2),R=k[0],z=k[1],H=(0,L.useState)(0),ee=(0,v.Z)(H,2),le=ee[0],Te=ee[1],st=(0,L.useState)(0),Be=(0,v.Z)(st,2),vt=Be[0],bt=Be[1],Dt=(0,L.useState)(),Wt=(0,v.Z)(Dt,2),Ct=Wt[0],qe=Wt[1],He=(0,L.useRef)();function et(Ot){var Bt=Ot.touches[0],sr=Bt.screenX,Et=Bt.screenY;z({x:sr,y:Et}),window.clearInterval(He.current)}function Ye(Ot){if(R){Ot.preventDefault();var Bt=Ot.touches[0],sr=Bt.screenX,Et=Bt.screenY;z({x:sr,y:Et});var tr=sr-R.x,Zt=Et-R.y;M(tr,Zt);var Xt=Date.now();Te(Xt),bt(Xt-le),qe({x:tr,y:Zt})}}function wt(){if(R&&(z(null),qe(null),Ct)){var Ot=Ct.x/vt,Bt=Ct.y/vt,sr=Math.abs(Ot),Et=Math.abs(Bt);if(Math.max(sr,Et)<ot)return;var tr=Ot,Zt=Bt;He.current=window.setInterval(function(){if(Math.abs(tr)<Ze&&Math.abs(Zt)<Ze){window.clearInterval(He.current);return}tr*=xe,Zt*=xe,M(tr*Oe,Zt*Oe)},Oe)}}var mt=(0,L.useRef)();function Pt(Ot){var Bt=Ot.deltaX,sr=Ot.deltaY,Et=0,tr=Math.abs(Bt),Zt=Math.abs(sr);tr===Zt?Et=mt.current==="x"?Bt:sr:tr>Zt?(Et=Bt,mt.current="x"):(Et=sr,mt.current="y"),M(-Et,-Et)&&Ot.preventDefault()}var zt=(0,L.useRef)(null);zt.current={onTouchStart:et,onTouchMove:Ye,onTouchEnd:wt,onWheel:Pt},L.useEffect(function(){function Ot(tr){zt.current.onTouchStart(tr)}function Bt(tr){zt.current.onTouchMove(tr)}function sr(tr){zt.current.onTouchEnd(tr)}function Et(tr){zt.current.onWheel(tr)}return document.addEventListener("touchmove",Bt,{passive:!1}),document.addEventListener("touchend",sr,{passive:!1}),b.current.addEventListener("touchstart",Ot,{passive:!1}),b.current.addEventListener("wheel",Et),function(){document.removeEventListener("touchmove",Bt),document.removeEventListener("touchend",sr)}},[])}function ht(b){var M=(0,L.useState)(0),C=(0,v.Z)(M,2),k=C[0],R=C[1],z=(0,L.useRef)(0),H=(0,L.useRef)();return H.current=b,Ie(function(){var ee;(ee=H.current)===null||ee===void 0||ee.call(H)},[k]),function(){z.current===k&&(z.current+=1,R(z.current))}}function Ut(b){var M=(0,L.useRef)([]),C=(0,L.useState)({}),k=(0,v.Z)(C,2),R=k[1],z=(0,L.useRef)(typeof b=="function"?b():b),H=ht(function(){var le=z.current;M.current.forEach(function(Te){le=Te(le)}),M.current=[],z.current=le,R({})});function ee(le){M.current.push(le),H()}return[z.current,ee]}var Gt={width:0,height:0,left:0,top:0,right:0};function cr(b,M,C,k,R,z,H){var ee=H.tabs,le=H.tabPosition,Te=H.rtl,st,Be,vt;return["top","bottom"].includes(le)?(st="width",Be=Te?"right":"left",vt=Math.abs(C)):(st="height",Be="top",vt=-C),(0,L.useMemo)(function(){if(!ee.length)return[0,0];for(var bt=ee.length,Dt=bt,Wt=0;Wt<bt;Wt+=1){var Ct=b.get(ee[Wt].key)||Gt;if(Ct[Be]+Ct[st]>vt+M){Dt=Wt-1;break}}for(var qe=0,He=bt-1;He>=0;He-=1){var et=b.get(ee[He].key)||Gt;if(et[Be]<vt){qe=He+1;break}}return qe>=Dt?[0,0]:[qe,Dt]},[b,M,k,R,z,vt,le,ee.map(function(bt){return bt.key}).join("_"),Te])}function ur(b){var M;return b instanceof Map?(M={},b.forEach(function(C,k){M[k]=C})):M=b,JSON.stringify(M)}var rr="TABS_DQ";function ar(b){return String(b).replace(/"/g,rr)}function ut(b,M,C,k){return!(!C||k||b===!1||b===void 0&&(M===!1||M===null))}function be(b,M){var C=b.prefixCls,k=b.editable,R=b.locale,z=b.style;return!k||k.showAdd===!1?null:L.createElement("button",{ref:M,type:"button",className:"".concat(C,"-nav-add"),style:z,"aria-label":(R==null?void 0:R.addAriaLabel)||"Add tab",onClick:function(ee){k.onEdit("add",{event:ee})}},k.addIcon||"+")}var ae=L.forwardRef(be),Q=L.forwardRef(function(b,M){var C=b.position,k=b.prefixCls,R=b.extra;if(!R)return null;var z,H={};return(0,De.Z)(R)==="object"&&!L.isValidElement(R)?H=R:H.right=R,C==="right"&&(z=H.right),C==="left"&&(z=H.left),z?L.createElement("div",{className:"".concat(k,"-extra-content"),ref:M},z):null}),V=Q,Y=x(62709);function ye(b,M,C){var k=React.useRef({});return(!("value"in k.current)||C(k.current.condition,M))&&(k.current.value=b(),k.current.condition=M),k.current.value}function te(b,M){typeof b=="function"?b(M):(0,De.Z)(b)==="object"&&b&&"current"in b&&(b.current=M)}function ne(){for(var b=arguments.length,M=new Array(b),C=0;C<b;C++)M[C]=arguments[C];var k=M.filter(function(R){return R});return k.length<=1?k[0]:function(R){M.forEach(function(z){te(z,R)})}}function Ke(){for(var b=arguments.length,M=new Array(b),C=0;C<b;C++)M[C]=arguments[C];return useMemo(function(){return ne.apply(void 0,M)},M,function(k,R){return k.length===R.length&&k.every(function(z,H){return z===R[H]})})}function Fe(b){var M,C,k=(0,_e.isMemo)(b)?b.type.type:b.type;return!(typeof k=="function"&&!((M=k.prototype)!==null&&M!==void 0&&M.render)||typeof b=="function"&&!((C=b.prototype)!==null&&C!==void 0&&C.render))}var Ce={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(M){var C=M.keyCode;if(M.altKey&&!M.ctrlKey||M.metaKey||C>=Ce.F1&&C<=Ce.F12)return!1;switch(C){case Ce.ALT:case Ce.CAPS_LOCK:case Ce.CONTEXT_MENU:case Ce.CTRL:case Ce.DOWN:case Ce.END:case Ce.ESC:case Ce.HOME:case Ce.INSERT:case Ce.LEFT:case Ce.MAC_FF_META:case Ce.META:case Ce.NUMLOCK:case Ce.NUM_CENTER:case Ce.PAGE_DOWN:case Ce.PAGE_UP:case Ce.PAUSE:case Ce.PRINT_SCREEN:case Ce.RIGHT:case Ce.SHIFT:case Ce.UP:case Ce.WIN_KEY:case Ce.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(M){if(M>=Ce.ZERO&&M<=Ce.NINE||M>=Ce.NUM_ZERO&&M<=Ce.NUM_MULTIPLY||M>=Ce.A&&M<=Ce.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&M===0)return!0;switch(M){case Ce.SPACE:case Ce.QUESTION_MARK:case Ce.NUM_PLUS:case Ce.NUM_MINUS:case Ce.NUM_PERIOD:case Ce.NUM_DIVISION:case Ce.SEMICOLON:case Ce.DASH:case Ce.EQUALS:case Ce.COMMA:case Ce.PERIOD:case Ce.SLASH:case Ce.APOSTROPHE:case Ce.SINGLE_QUOTE:case Ce.OPEN_SQUARE_BRACKET:case Ce.BACKSLASH:case Ce.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},kt=Ce,$t=function(M){return+setTimeout(M,16)},G=function(M){return clearTimeout(M)};typeof window!="undefined"&&"requestAnimationFrame"in window&&($t=function(M){return window.requestAnimationFrame(M)},G=function(M){return window.cancelAnimationFrame(M)});var nt=0,dt=new Map;function qt(b){dt.delete(b)}var vr=function(M){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;nt+=1;var k=nt;function R(z){if(z===0)qt(k),M();else{var H=$t(function(){R(z-1)});dt.set(k,H)}}return R(C),k};vr.cancel=function(b){var M=dt.get(b);return qt(M),G(M)};var or=vr,tn=kt.ESC,Vt=kt.TAB;function ct(b){var M=b.visible,C=b.triggerRef,k=b.onVisibleChange,R=b.autoFocus,z=b.overlayRef,H=L.useRef(!1),ee=function(){if(M){var Be,vt;(Be=C.current)===null||Be===void 0||(vt=Be.focus)===null||vt===void 0||vt.call(Be),k==null||k(!1)}},le=function(){var Be;return(Be=z.current)!==null&&Be!==void 0&&Be.focus?(z.current.focus(),H.current=!0,!0):!1},Te=function(Be){switch(Be.keyCode){case tn:ee();break;case Vt:{var vt=!1;H.current||(vt=le()),vt?Be.preventDefault():ee();break}}};L.useEffect(function(){return M?(window.addEventListener("keydown",Te),R&&or(le,3),function(){window.removeEventListener("keydown",Te),H.current=!1}):function(){H.current=!1}},[M])}var rn=(0,L.forwardRef)(function(b,M){var C=b.overlay,k=b.arrow,R=b.prefixCls,z=(0,L.useMemo)(function(){var ee;return typeof C=="function"?ee=C():ee=C,ee},[C]),H=ne(M,z==null?void 0:z.ref);return L.createElement(L.Fragment,null,k&&L.createElement("div",{className:"".concat(R,"-arrow")}),L.cloneElement(z,{ref:Fe(z)?H:void 0}))}),nn=rn,br={adjustX:1,adjustY:1},dr=[0,0],Xr={topLeft:{points:["bl","tl"],overflow:br,offset:[0,-4],targetOffset:dr},top:{points:["bc","tc"],overflow:br,offset:[0,-4],targetOffset:dr},topRight:{points:["br","tr"],overflow:br,offset:[0,-4],targetOffset:dr},bottomLeft:{points:["tl","bl"],overflow:br,offset:[0,4],targetOffset:dr},bottom:{points:["tc","bc"],overflow:br,offset:[0,4],targetOffset:dr},bottomRight:{points:["tr","br"],overflow:br,offset:[0,4],targetOffset:dr}},It=Xr,$n=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function dn(b,M){var C,k=b.arrow,R=k===void 0?!1:k,z=b.prefixCls,H=z===void 0?"rc-dropdown":z,ee=b.transitionName,le=b.animation,Te=b.align,st=b.placement,Be=st===void 0?"bottomLeft":st,vt=b.placements,bt=vt===void 0?It:vt,Dt=b.getPopupContainer,Wt=b.showAction,Ct=b.hideAction,qe=b.overlayClassName,He=b.overlayStyle,et=b.visible,Ye=b.trigger,wt=Ye===void 0?["hover"]:Ye,mt=b.autoFocus,Pt=b.overlay,zt=b.children,Ot=b.onVisibleChange,Bt=(0,Ne.Z)(b,$n),sr=L.useState(),Et=(0,v.Z)(sr,2),tr=Et[0],Zt=Et[1],Xt="visible"in b?et:tr,Hr=L.useRef(null),Br=L.useRef(null),Or=L.useRef(null);L.useImperativeHandle(M,function(){return Hr.current});var yr=function(xr){Zt(xr),Ot==null||Ot(xr)};ct({visible:Xt,triggerRef:Or,onVisibleChange:yr,autoFocus:mt,overlayRef:Br});var mn=function(xr){var pn=b.onOverlayClick;Zt(!1),pn&&pn(xr)},Yn=function(){return L.createElement(nn,{ref:Br,overlay:Pt,prefixCls:H,arrow:R})},fr=function(){return typeof Pt=="function"?Yn:Yn()},Dr=function(){var xr=b.minOverlayWidthMatchTrigger,pn=b.alignPoint;return"minOverlayWidthMatchTrigger"in b?xr:!pn},fn=function(){var xr=b.openClassName;return xr!==void 0?xr:"".concat(H,"-open")},Wr=L.cloneElement(zt,{className:U()((C=zt.props)===null||C===void 0?void 0:C.className,Xt&&fn()),ref:Fe(zt)?ne(Or,zt.ref):void 0}),Mr=Ct;return!Mr&&wt.indexOf("contextMenu")!==-1&&(Mr=["click"]),L.createElement(Y.Z,(0,q.Z)({builtinPlacements:bt},Bt,{prefixCls:H,ref:Hr,popupClassName:U()(qe,(0,ce.Z)({},"".concat(H,"-show-arrow"),R)),popupStyle:He,action:wt,showAction:Wt,hideAction:Mr,popupPlacement:Be,popupAlign:Te,popupTransitionName:ee,popupAnimation:le,popupVisible:Xt,stretch:Dr()?"minWidth":"",popup:fr(),onPopupVisibleChange:yr,onPopupClick:mn,getPopupContainer:Dt}),Wr)}var wn=L.forwardRef(dn),jr=wn,Lr=x(78595),At={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(M){var C=M.keyCode;if(M.altKey&&!M.ctrlKey||M.metaKey||C>=At.F1&&C<=At.F12)return!1;switch(C){case At.ALT:case At.CAPS_LOCK:case At.CONTEXT_MENU:case At.CTRL:case At.DOWN:case At.END:case At.ESC:case At.HOME:case At.INSERT:case At.LEFT:case At.MAC_FF_META:case At.META:case At.NUMLOCK:case At.NUM_CENTER:case At.PAGE_DOWN:case At.PAGE_UP:case At.PAUSE:case At.PRINT_SCREEN:case At.RIGHT:case At.SHIFT:case At.UP:case At.WIN_KEY:case At.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(M){if(M>=At.ZERO&&M<=At.NINE||M>=At.NUM_ZERO&&M<=At.NUM_MULTIPLY||M>=At.A&&M<=At.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&M===0)return!0;switch(M){case At.SPACE:case At.QUESTION_MARK:case At.NUM_PLUS:case At.NUM_MINUS:case At.NUM_PERIOD:case At.NUM_DIVISION:case At.SEMICOLON:case At.DASH:case At.EQUALS:case At.COMMA:case At.PERIOD:case At.SLASH:case At.APOSTROPHE:case At.SINGLE_QUOTE:case At.OPEN_SQUARE_BRACKET:case At.BACKSLASH:case At.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Fr=At;function vi(b,M){var C=b.prefixCls,k=b.id,R=b.tabs,z=b.locale,H=b.mobile,ee=b.moreIcon,le=ee===void 0?"More":ee,Te=b.moreTransitionName,st=b.style,Be=b.className,vt=b.editable,bt=b.tabBarGutter,Dt=b.rtl,Wt=b.removeAriaLabel,Ct=b.onTabClick,qe=b.getPopupContainer,He=b.popupClassName,et=(0,L.useState)(!1),Ye=(0,v.Z)(et,2),wt=Ye[0],mt=Ye[1],Pt=(0,L.useState)(null),zt=(0,v.Z)(Pt,2),Ot=zt[0],Bt=zt[1],sr="".concat(k,"-more-popup"),Et="".concat(C,"-dropdown"),tr=Ot!==null?"".concat(sr,"-").concat(Ot):null,Zt=z==null?void 0:z.dropdownAriaLabel;function Xt(fr,Dr){fr.preventDefault(),fr.stopPropagation(),vt.onEdit("remove",{key:Dr,event:fr})}var Hr=L.createElement(Lr.ZP,{onClick:function(Dr){var fn=Dr.key,Wr=Dr.domEvent;Ct(fn,Wr),mt(!1)},prefixCls:"".concat(Et,"-menu"),id:sr,tabIndex:-1,role:"listbox","aria-activedescendant":tr,selectedKeys:[Ot],"aria-label":Zt!==void 0?Zt:"expanded dropdown"},R.map(function(fr){var Dr=fr.closable,fn=fr.disabled,Wr=fr.closeIcon,Mr=fr.key,Qr=fr.label,xr=ut(Dr,Wr,vt,fn);return L.createElement(Lr.sN,{key:Mr,id:"".concat(sr,"-").concat(Mr),role:"option","aria-controls":k&&"".concat(k,"-panel-").concat(Mr),disabled:fn},L.createElement("span",null,Qr),xr&&L.createElement("button",{type:"button","aria-label":Wt||"remove",tabIndex:0,className:"".concat(Et,"-menu-item-remove"),onClick:function(zn){zn.stopPropagation(),Xt(zn,Mr)}},Wr||vt.removeIcon||"\xD7"))}));function Br(fr){for(var Dr=R.filter(function(xr){return!xr.disabled}),fn=Dr.findIndex(function(xr){return xr.key===Ot})||0,Wr=Dr.length,Mr=0;Mr<Wr;Mr+=1){fn=(fn+fr+Wr)%Wr;var Qr=Dr[fn];if(!Qr.disabled){Bt(Qr.key);return}}}function Or(fr){var Dr=fr.which;if(!wt){[Fr.DOWN,Fr.SPACE,Fr.ENTER].includes(Dr)&&(mt(!0),fr.preventDefault());return}switch(Dr){case Fr.UP:Br(-1),fr.preventDefault();break;case Fr.DOWN:Br(1),fr.preventDefault();break;case Fr.ESC:mt(!1);break;case Fr.SPACE:case Fr.ENTER:Ot!==null&&Ct(Ot,fr);break}}(0,L.useEffect)(function(){var fr=document.getElementById(tr);fr&&fr.scrollIntoView&&fr.scrollIntoView(!1)},[Ot]),(0,L.useEffect)(function(){wt||Bt(null)},[wt]);var yr=(0,ce.Z)({},Dt?"marginRight":"marginLeft",bt);R.length||(yr.visibility="hidden",yr.order=1);var mn=U()((0,ce.Z)({},"".concat(Et,"-rtl"),Dt)),Yn=H?null:L.createElement(jr,{prefixCls:Et,overlay:Hr,trigger:["hover"],visible:R.length?wt:!1,transitionName:Te,onVisibleChange:mt,overlayClassName:U()(mn,He),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:qe},L.createElement("button",{type:"button",className:"".concat(C,"-nav-more"),style:yr,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":sr,id:"".concat(k,"-more"),"aria-expanded":wt,onKeyDown:Or},le));return L.createElement("div",{className:U()("".concat(C,"-nav-operations"),Be),style:st,ref:M},Yn,L.createElement(ae,{prefixCls:C,locale:z,editable:vt}))}var ni=L.memo(L.forwardRef(vi),function(b,M){return M.tabMoving});function li(b){var M,C=b.prefixCls,k=b.id,R=b.active,z=b.tab,H=z.key,ee=z.label,le=z.disabled,Te=z.closeIcon,st=b.closable,Be=b.renderWrapper,vt=b.removeAriaLabel,bt=b.editable,Dt=b.onClick,Wt=b.onFocus,Ct=b.style,qe="".concat(C,"-tab"),He=ut(st,Te,bt,le);function et(mt){le||Dt(mt)}function Ye(mt){mt.preventDefault(),mt.stopPropagation(),bt.onEdit("remove",{key:H,event:mt})}var wt=L.createElement("div",{key:H,"data-node-key":ar(H),className:U()(qe,(M={},(0,ce.Z)(M,"".concat(qe,"-with-remove"),He),(0,ce.Z)(M,"".concat(qe,"-active"),R),(0,ce.Z)(M,"".concat(qe,"-disabled"),le),M)),style:Ct,onClick:et},L.createElement("div",{role:"tab","aria-selected":R,id:k&&"".concat(k,"-tab-").concat(H),className:"".concat(qe,"-btn"),"aria-controls":k&&"".concat(k,"-panel-").concat(H),"aria-disabled":le,tabIndex:le?null:0,onClick:function(Pt){Pt.stopPropagation(),et(Pt)},onKeyDown:function(Pt){[Fr.SPACE,Fr.ENTER].includes(Pt.which)&&(Pt.preventDefault(),et(Pt))},onFocus:Wt},ee),He&&L.createElement("button",{type:"button","aria-label":vt||"remove",tabIndex:0,className:"".concat(qe,"-remove"),onClick:function(Pt){Pt.stopPropagation(),Ye(Pt)}},Te||bt.removeIcon||"\xD7"));return Be?Be(wt):wt}var hn=li,Di=function(M){return+setTimeout(M,16)},Sn=function(M){return clearTimeout(M)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Di=function(M){return window.requestAnimationFrame(M)},Sn=function(M){return window.cancelAnimationFrame(M)});var K=0,X=new Map;function me(b){X.delete(b)}var Ee=function(M){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;K+=1;var k=K;function R(z){if(z===0)me(k),M();else{var H=Di(function(){R(z-1)});X.set(k,H)}}return R(C),k};Ee.cancel=function(b){var M=X.get(b);return me(M),Sn(M)};var at=Ee,Mt=function(M){var C=M.activeTabOffset,k=M.horizontal,R=M.rtl,z=M.indicatorSize,H=(0,L.useState)(),ee=(0,v.Z)(H,2),le=ee[0],Te=ee[1],st=(0,L.useRef)(),Be=function(Dt){return typeof z=="function"?z(Dt):typeof z=="number"?z:Dt};function vt(){at.cancel(st.current)}return(0,L.useEffect)(function(){var bt={};return C&&(k?(R?(bt.right=C.right+C.width/2,bt.transform="translateX(50%)"):(bt.left=C.left+C.width/2,bt.transform="translateX(-50%)"),bt.width=Be(C.width)):(bt.top=C.top+C.height/2,bt.transform="translateY(-50%)",bt.height=Be(C.height))),vt(),st.current=at(function(){Te(bt)}),vt},[C,k,R,z]),{style:le}},Qt=Mt,Jt=function(M){var C=M.current||{},k=C.offsetWidth,R=k===void 0?0:k,z=C.offsetHeight,H=z===void 0?0:z;return[R,H]},zr=function(M,C){return M[C?0:1]};function Ir(b,M){var C,k=L.useContext(ie),R=k.prefixCls,z=k.tabs,H=b.className,ee=b.style,le=b.id,Te=b.animated,st=b.activeKey,Be=b.rtl,vt=b.extra,bt=b.editable,Dt=b.locale,Wt=b.tabPosition,Ct=b.tabBarGutter,qe=b.children,He=b.onTabClick,et=b.onTabScroll,Ye=b.indicatorSize,wt=(0,L.useRef)(),mt=(0,L.useRef)(),Pt=(0,L.useRef)(),zt=(0,L.useRef)(),Ot=(0,L.useRef)(),Bt=(0,L.useRef)(),sr=(0,L.useRef)(),Et=Wt==="top"||Wt==="bottom",tr=fe(0,function(Gr,pr){Et&&et&&et({direction:Gr>pr?"left":"right"})}),Zt=(0,v.Z)(tr,2),Xt=Zt[0],Hr=Zt[1],Br=fe(0,function(Gr,pr){!Et&&et&&et({direction:Gr>pr?"top":"bottom"})}),Or=(0,v.Z)(Br,2),yr=Or[0],mn=Or[1],Yn=(0,L.useState)([0,0]),fr=(0,v.Z)(Yn,2),Dr=fr[0],fn=fr[1],Wr=(0,L.useState)([0,0]),Mr=(0,v.Z)(Wr,2),Qr=Mr[0],xr=Mr[1],pn=(0,L.useState)([0,0]),zn=(0,v.Z)(pn,2),wi=zn[0],Ti=zn[1],An=(0,L.useState)([0,0]),Tr=(0,v.Z)(An,2),Si=Tr[0],Vr=Tr[1],gn=Ut(new Map),_n=(0,v.Z)(gn,2),On=_n[0],di=_n[1],fi=ve(z,On,Qr[0]),pi=zr(Dr,Et),ra=zr(Qr,Et),Zi=zr(wi,Et),vn=zr(Si,Et),Mn=pi<ra+Zi,wr=Mn?pi-vn:pi-Zi,Kn="".concat(R,"-nav-operations-hidden"),Dn=0,Hn=0;Et&&Be?(Dn=0,Hn=Math.max(0,ra-wr)):(Dn=Math.min(0,wr-ra),Hn=0);function ai(Gr){return Gr<Dn?Dn:Gr>Hn?Hn:Gr}var na=(0,L.useRef)(),Ln=(0,L.useState)(),ia=(0,v.Z)(Ln,2),In=ia[0],aa=ia[1];function $i(){aa(Date.now())}function hi(){window.clearTimeout(na.current)}yt(zt,function(Gr,pr){function Bn(Qn,sa){Qn(function(gi){var ss=ai(gi+sa);return ss})}return Mn?(Et?Bn(Hr,Gr):Bn(mn,pr),hi(),$i(),!0):!1}),(0,L.useEffect)(function(){return hi(),In&&(na.current=window.setTimeout(function(){aa(0)},100)),hi},[In]);var oi=cr(fi,wr,Et?Xt:yr,ra,Zi,vn,(0,_.Z)((0,_.Z)({},b),{},{tabs:z})),fa=(0,v.Z)(oi,2),qa=fa[0],ji=fa[1],ya=Re(function(){var Gr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:st,pr=fi.get(Gr)||{width:0,height:0,left:0,right:0,top:0};if(Et){var Bn=Xt;Be?pr.right<Xt?Bn=pr.right:pr.right+pr.width>Xt+wr&&(Bn=pr.right+pr.width-wr):pr.left<-Xt?Bn=-pr.left:pr.left+pr.width>-Xt+wr&&(Bn=-(pr.left+pr.width-wr)),mn(0),Hr(ai(Bn))}else{var Qn=yr;pr.top<-yr?Qn=-pr.top:pr.top+pr.height>-yr+wr&&(Qn=-(pr.top+pr.height-wr)),Hr(0),mn(ai(Qn))}}),xa={};Wt==="top"||Wt==="bottom"?xa[Be?"marginRight":"marginLeft"]=Ct:xa.marginTop=Ct;var mi=z.map(function(Gr,pr){var Bn=Gr.key;return L.createElement(hn,{id:le,prefixCls:R,key:Bn,tab:Gr,style:pr===0?void 0:xa,closable:Gr.closable,editable:bt,active:Bn===st,renderWrapper:qe,removeAriaLabel:Dt==null?void 0:Dt.removeAriaLabel,onClick:function(sa){He(Bn,sa)},onFocus:function(){ya(Bn),$i(),zt.current&&(Be||(zt.current.scrollLeft=0),zt.current.scrollTop=0)}})}),Da=function(){return di(function(){var pr=new Map;return z.forEach(function(Bn){var Qn,sa=Bn.key,gi=(Qn=Ot.current)===null||Qn===void 0?void 0:Qn.querySelector('[data-node-key="'.concat(ar(sa),'"]'));gi&&pr.set(sa,{width:gi.offsetWidth,height:gi.offsetHeight,left:gi.offsetLeft,top:gi.offsetTop})}),pr})};(0,L.useEffect)(function(){Da()},[z.map(function(Gr){return Gr.key}).join("_")]);var oa=ht(function(){var Gr=Jt(wt),pr=Jt(mt),Bn=Jt(Pt);fn([Gr[0]-pr[0]-Bn[0],Gr[1]-pr[1]-Bn[1]]);var Qn=Jt(sr);Ti(Qn);var sa=Jt(Bt);Vr(sa);var gi=Jt(Ot);xr([gi[0]-Qn[0],gi[1]-Qn[1]]),Da()}),La=z.slice(0,qa),lr=z.slice(ji+1),ir=[].concat((0,gt.Z)(La),(0,gt.Z)(lr)),on=fi.get(st),Pi=Qt({activeTabOffset:on,horizontal:Et,rtl:Be,indicatorSize:Ye}),Ri=Pi.style;(0,L.useEffect)(function(){ya()},[st,Dn,Hn,ur(on),ur(fi),Et]),(0,L.useEffect)(function(){oa()},[Be]);var Oi=!!ir.length,Ia="".concat(R,"-nav-wrap"),Xa,co,Ba,uo;return Et?Be?(co=Xt>0,Xa=Xt!==Hn):(Xa=Xt<0,co=Xt!==Dn):(Ba=yr<0,uo=yr!==Dn),L.createElement(Me.Z,{onResize:oa},L.createElement("div",{ref:rt(M,wt),role:"tablist",className:U()("".concat(R,"-nav"),H),style:ee,onKeyDown:function(){$i()}},L.createElement(V,{ref:mt,position:"left",extra:vt,prefixCls:R}),L.createElement(Me.Z,{onResize:oa},L.createElement("div",{className:U()(Ia,(C={},(0,ce.Z)(C,"".concat(Ia,"-ping-left"),Xa),(0,ce.Z)(C,"".concat(Ia,"-ping-right"),co),(0,ce.Z)(C,"".concat(Ia,"-ping-top"),Ba),(0,ce.Z)(C,"".concat(Ia,"-ping-bottom"),uo),C)),ref:zt},L.createElement(Me.Z,{onResize:oa},L.createElement("div",{ref:Ot,className:"".concat(R,"-nav-list"),style:{transform:"translate(".concat(Xt,"px, ").concat(yr,"px)"),transition:In?"none":void 0}},mi,L.createElement(ae,{ref:sr,prefixCls:R,locale:Dt,editable:bt,style:(0,_.Z)((0,_.Z)({},mi.length===0?void 0:xa),{},{visibility:Oi?"hidden":null})}),L.createElement("div",{className:U()("".concat(R,"-ink-bar"),(0,ce.Z)({},"".concat(R,"-ink-bar-animated"),Te.inkBar)),style:Ri}))))),L.createElement(ni,(0,q.Z)({},b,{removeAriaLabel:Dt==null?void 0:Dt.removeAriaLabel,ref:Bt,prefixCls:R,tabs:ir,className:!Oi&&Kn,tabMoving:!!In})),L.createElement(V,{ref:Pt,position:"right",extra:vt,prefixCls:R})))}var nr=L.forwardRef(Ir),Yr=["renderTabBar"],hr=["label","key"];function _r(b){var M=b.renderTabBar,C=(0,Ne.Z)(b,Yr),k=L.useContext(ie),R=k.tabs;if(M){var z=(0,_.Z)((0,_.Z)({},C),{},{panes:R.map(function(H){var ee=H.label,le=H.key,Te=(0,Ne.Z)(H,hr);return L.createElement(ze,(0,q.Z)({tab:ee,key:le,tabKey:le},Te))})});return M(z,nr)}return L.createElement(nr,C)}var Fn={},Pr=[],Kr=function(M){Pr.push(M)};function Pn(b,M){if(0)var C}function jt(b,M){if(0)var C}function Pe(){Fn={}}function Zn(b,M,C){!M&&!Fn[C]&&(b(!1,C),Fn[C]=!0)}function bi(b,M){Zn(Pn,b,M)}function Rn(b,M){Zn(jt,b,M)}bi.preMessage=Kr,bi.resetWarned=Pe,bi.noteOnce=Rn;var yi=null;function xi(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},M;return b===!1?M={inkBar:!1,tabPane:!1}:b===!0?M={inkBar:!0,tabPane:!1}:M=(0,_.Z)({inkBar:!0},(0,De.Z)(b)==="object"?b:{}),M.tabPaneMotion&&M.tabPane===void 0&&(M.tabPane=!0),!M.tabPaneMotion&&M.tabPane&&(M.tabPane=!1),M}var jn=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Ji=0;function ga(b,M){var C,k=b.id,R=b.prefixCls,z=R===void 0?"rc-tabs":R,H=b.className,ee=b.items,le=b.direction,Te=b.activeKey,st=b.defaultActiveKey,Be=b.editable,vt=b.animated,bt=b.tabPosition,Dt=bt===void 0?"top":bt,Wt=b.tabBarGutter,Ct=b.tabBarStyle,qe=b.tabBarExtraContent,He=b.locale,et=b.moreIcon,Ye=b.moreTransitionName,wt=b.destroyInactiveTabPane,mt=b.renderTabBar,Pt=b.onChange,zt=b.onTabClick,Ot=b.onTabScroll,Bt=b.getPopupContainer,sr=b.popupClassName,Et=b.indicatorSize,tr=(0,Ne.Z)(b,jn),Zt=L.useMemo(function(){return(ee||[]).filter(function(Vr){return Vr&&(0,De.Z)(Vr)==="object"&&"key"in Vr})},[ee]),Xt=le==="rtl",Hr=xi(vt),Br=(0,L.useState)(!1),Or=(0,v.Z)(Br,2),yr=Or[0],mn=Or[1];(0,L.useEffect)(function(){mn(Le())},[]);var Yn=T(function(){var Vr;return(Vr=Zt[0])===null||Vr===void 0?void 0:Vr.key},{value:Te,defaultValue:st}),fr=(0,v.Z)(Yn,2),Dr=fr[0],fn=fr[1],Wr=(0,L.useState)(function(){return Zt.findIndex(function(Vr){return Vr.key===Dr})}),Mr=(0,v.Z)(Wr,2),Qr=Mr[0],xr=Mr[1];(0,L.useEffect)(function(){var Vr=Zt.findIndex(function(_n){return _n.key===Dr});if(Vr===-1){var gn;Vr=Math.max(0,Math.min(Qr,Zt.length-1)),fn((gn=Zt[Vr])===null||gn===void 0?void 0:gn.key)}xr(Vr)},[Zt.map(function(Vr){return Vr.key}).join("_"),Dr,Qr]);var pn=T(null,{value:k}),zn=(0,v.Z)(pn,2),wi=zn[0],Ti=zn[1];(0,L.useEffect)(function(){k||(Ti("rc-tabs-".concat(Ji)),Ji+=1)},[]);function An(Vr,gn){zt==null||zt(Vr,gn);var _n=Vr!==Dr;fn(Vr),_n&&(Pt==null||Pt(Vr))}var Tr={id:wi,activeKey:Dr,animated:Hr,tabPosition:Dt,rtl:Xt,mobile:yr},Si=(0,_.Z)((0,_.Z)({},Tr),{},{editable:Be,locale:He,moreIcon:et,moreTransitionName:Ye,tabBarGutter:Wt,onTabClick:An,onTabScroll:Ot,extra:qe,style:Ct,panes:null,getPopupContainer:Bt,popupClassName:sr,indicatorSize:Et});return L.createElement(ie.Provider,{value:{tabs:Zt,prefixCls:z}},L.createElement("div",(0,q.Z)({ref:M,id:k,className:U()(z,"".concat(z,"-").concat(Dt),(C={},(0,ce.Z)(C,"".concat(z,"-mobile"),yr),(0,ce.Z)(C,"".concat(z,"-editable"),Be),(0,ce.Z)(C,"".concat(z,"-rtl"),Xt),C),H)},tr),L.createElement(_r,(0,q.Z)({},Si,{renderTabBar:mt})),L.createElement(Nt,(0,q.Z)({destroyInactiveTabPane:wt},Tr,{animated:Hr}))))}var Yi=L.forwardRef(ga),Ki=Yi,an=Ki,Ar=x(53124),kn=x(98675),Hi=()=>null,Li=x(33603);const ua={motionAppear:!1,motionEnter:!0,motionLeave:!0};function ci(b){let M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},C;return M===!1?C={inkBar:!1,tabPane:!1}:M===!0?C={inkBar:!0,tabPane:!0}:C=Object.assign({inkBar:!0},typeof M=="object"?M:{}),C.tabPane&&(C.tabPaneMotion=Object.assign(Object.assign({},ua),{motionName:(0,Li.m)(b,"switch")})),C}var Ii=x(37419),Na=function(b,M){var C={};for(var k in b)Object.prototype.hasOwnProperty.call(b,k)&&M.indexOf(k)<0&&(C[k]=b[k]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var R=0,k=Object.getOwnPropertySymbols(b);R<k.length;R++)M.indexOf(k[R])<0&&Object.prototype.propertyIsEnumerable.call(b,k[R])&&(C[k[R]]=b[k[R]]);return C};function Aa(b){return b.filter(M=>M)}function Fa(b,M){if(b)return b;const C=(0,Ii.Z)(M).map(k=>{if(L.isValidElement(k)){const{key:R,props:z}=k,H=z||{},{tab:ee}=H,le=Na(H,["tab"]);return Object.assign(Object.assign({key:String(R)},le),{label:ee})}return null});return Aa(C)}var Rr=x(14747),lo=x(67968),bo=x(45503),Qi=x(67771),Gn=b=>{const{componentCls:M,motionDurationSlow:C}=b;return[{[M]:{[`${M}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${C}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${C}`}}}}},[(0,Qi.oN)(b,"slide-up"),(0,Qi.oN)(b,"slide-down")]]};const va=b=>{const{componentCls:M,tabsCardPadding:C,cardBg:k,cardGutter:R,colorBorderSecondary:z,itemSelectedColor:H}=b;return{[`${M}-card`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-tab`]:{margin:0,padding:C,background:k,border:`${b.lineWidth}px ${b.lineType} ${z}`,transition:`all ${b.motionDurationSlow} ${b.motionEaseInOut}`},[`${M}-tab-active`]:{color:H,background:b.colorBgContainer},[`${M}-ink-bar`]:{visibility:"hidden"}},[`&${M}-top, &${M}-bottom`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-tab + ${M}-tab`]:{marginLeft:{_skip_check_:!0,value:`${R}px`}}}},[`&${M}-top`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-tab`]:{borderRadius:`${b.borderRadiusLG}px ${b.borderRadiusLG}px 0 0`},[`${M}-tab-active`]:{borderBottomColor:b.colorBgContainer}}},[`&${M}-bottom`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-tab`]:{borderRadius:`0 0 ${b.borderRadiusLG}px ${b.borderRadiusLG}px`},[`${M}-tab-active`]:{borderTopColor:b.colorBgContainer}}},[`&${M}-left, &${M}-right`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-tab + ${M}-tab`]:{marginTop:`${R}px`}}},[`&${M}-left`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-tab`]:{borderRadius:{_skip_check_:!0,value:`${b.borderRadiusLG}px 0 0 ${b.borderRadiusLG}px`}},[`${M}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:b.colorBgContainer}}}},[`&${M}-right`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${b.borderRadiusLG}px ${b.borderRadiusLG}px 0`}},[`${M}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:b.colorBgContainer}}}}}}},ba=b=>{const{componentCls:M,itemHoverColor:C,dropdownEdgeChildVerticalPadding:k}=b;return{[`${M}-dropdown`]:Object.assign(Object.assign({},(0,Rr.Wf)(b)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:b.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${M}-dropdown-menu`]:{maxHeight:b.tabsDropdownHeight,margin:0,padding:`${k}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:b.colorBgContainer,backgroundClip:"padding-box",borderRadius:b.borderRadiusLG,outline:"none",boxShadow:b.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Rr.vS),{display:"flex",alignItems:"center",minWidth:b.tabsDropdownWidth,margin:0,padding:`${b.paddingXXS}px ${b.paddingSM}px`,color:b.colorText,fontWeight:"normal",fontSize:b.fontSize,lineHeight:b.lineHeight,cursor:"pointer",transition:`all ${b.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:b.marginSM},color:b.colorTextDescription,fontSize:b.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:C}},"&:hover":{background:b.controlItemBgHover},"&-disabled":{"&, &:hover":{color:b.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},ea=b=>{const{componentCls:M,margin:C,colorBorderSecondary:k,horizontalMargin:R,verticalItemPadding:z,verticalItemMargin:H}=b;return{[`${M}-top, ${M}-bottom`]:{flexDirection:"column",[`> ${M}-nav, > div > ${M}-nav`]:{margin:R,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${b.lineWidth}px ${b.lineType} ${k}`,content:"''"},[`${M}-ink-bar`]:{height:b.lineWidthBold,"&-animated":{transition:`width ${b.motionDurationSlow}, left ${b.motionDurationSlow},
|
|
|
right ${b.motionDurationSlow}`}},[`${M}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:b.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:b.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:b.boxShadowTabsOverflowRight},[`&${M}-nav-wrap-ping-left::before`]:{opacity:1},[`&${M}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${M}-top`]:{[`> ${M}-nav,
|
|
|
> div > ${M}-nav`]:{"&::before":{bottom:0},[`${M}-ink-bar`]:{bottom:0}}},[`${M}-bottom`]:{[`> ${M}-nav, > div > ${M}-nav`]:{order:1,marginTop:`${C}px`,marginBottom:0,"&::before":{top:0},[`${M}-ink-bar`]:{top:0}},[`> ${M}-content-holder, > div > ${M}-content-holder`]:{order:0}},[`${M}-left, ${M}-right`]:{[`> ${M}-nav, > div > ${M}-nav`]:{flexDirection:"column",minWidth:b.controlHeight*1.25,[`${M}-tab`]:{padding:z,textAlign:"center"},[`${M}-tab + ${M}-tab`]:{margin:H},[`${M}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:b.controlHeight},"&::before":{top:0,boxShadow:b.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:b.boxShadowTabsOverflowBottom},[`&${M}-nav-wrap-ping-top::before`]:{opacity:1},[`&${M}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${M}-ink-bar`]:{width:b.lineWidthBold,"&-animated":{transition:`height ${b.motionDurationSlow}, top ${b.motionDurationSlow}`}},[`${M}-nav-list, ${M}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${M}-left`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${M}-content-holder, > div > ${M}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${b.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${b.lineWidth}px ${b.lineType} ${b.colorBorder}`},[`> ${M}-content > ${M}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:b.paddingLG}}}},[`${M}-right`]:{[`> ${M}-nav, > div > ${M}-nav`]:{order:1,[`${M}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${M}-content-holder, > div > ${M}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-b.lineWidth},borderRight:{_skip_check_:!0,value:`${b.lineWidth}px ${b.lineType} ${b.colorBorder}`},[`> ${M}-content > ${M}-tabpane`]:{paddingRight:{_skip_check_:!0,value:b.paddingLG}}}}}},qn=b=>{const{componentCls:M,cardPaddingSM:C,cardPaddingLG:k,horizontalItemPaddingSM:R,horizontalItemPaddingLG:z}=b;return{[M]:{"&-small":{[`> ${M}-nav`]:{[`${M}-tab`]:{padding:R,fontSize:b.titleFontSizeSM}}},"&-large":{[`> ${M}-nav`]:{[`${M}-tab`]:{padding:z,fontSize:b.titleFontSizeLG}}}},[`${M}-card`]:{[`&${M}-small`]:{[`> ${M}-nav`]:{[`${M}-tab`]:{padding:C}},[`&${M}-bottom`]:{[`> ${M}-nav ${M}-tab`]:{borderRadius:`0 0 ${b.borderRadius}px ${b.borderRadius}px`}},[`&${M}-top`]:{[`> ${M}-nav ${M}-tab`]:{borderRadius:`${b.borderRadius}px ${b.borderRadius}px 0 0`}},[`&${M}-right`]:{[`> ${M}-nav ${M}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${b.borderRadius}px ${b.borderRadius}px 0`}}},[`&${M}-left`]:{[`> ${M}-nav ${M}-tab`]:{borderRadius:{_skip_check_:!0,value:`${b.borderRadius}px 0 0 ${b.borderRadius}px`}}}},[`&${M}-large`]:{[`> ${M}-nav`]:{[`${M}-tab`]:{padding:k}}}}}},Vi=b=>{const{componentCls:M,itemActiveColor:C,itemHoverColor:k,iconCls:R,tabsHorizontalItemMargin:z,horizontalItemPadding:H,itemSelectedColor:ee,itemColor:le}=b,Te=`${M}-tab`;return{[Te]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:H,fontSize:b.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:le,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:C}},(0,Rr.Qy)(b)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-b.marginXXS},marginLeft:{_skip_check_:!0,value:b.marginXS},color:b.colorTextDescription,fontSize:b.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${b.motionDurationSlow}`,"&:hover":{color:b.colorTextHeading}},"&:hover":{color:k},[`&${Te}-active ${Te}-btn`]:{color:ee,textShadow:b.tabsActiveTextShadow},[`&${Te}-disabled`]:{color:b.colorTextDisabled,cursor:"not-allowed"},[`&${Te}-disabled ${Te}-btn, &${Te}-disabled ${M}-remove`]:{"&:focus, &:active":{color:b.colorTextDisabled}},[`& ${Te}-remove ${R}`]:{margin:0},[R]:{marginRight:{_skip_check_:!0,value:b.marginSM}}},[`${Te} + ${Te}`]:{margin:{_skip_check_:!0,value:z}}}},Bi=b=>{const{componentCls:M,tabsHorizontalItemMarginRTL:C,iconCls:k,cardGutter:R}=b;return{[`${M}-rtl`]:{direction:"rtl",[`${M}-nav`]:{[`${M}-tab`]:{margin:{_skip_check_:!0,value:C},[`${M}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[k]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${b.marginSM}px`}},[`${M}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${b.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${b.marginXXS}px`},[k]:{margin:0}}}},[`&${M}-left`]:{[`> ${M}-nav`]:{order:1},[`> ${M}-content-holder`]:{order:0}},[`&${M}-right`]:{[`> ${M}-nav`]:{order:0},[`> ${M}-content-holder`]:{order:1}},[`&${M}-card${M}-top, &${M}-card${M}-bottom`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-tab + ${M}-tab`]:{marginRight:{_skip_check_:!0,value:R},marginLeft:{_skip_check_:!0,value:0}}}}},[`${M}-dropdown-rtl`]:{direction:"rtl"},[`${M}-menu-item`]:{[`${M}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},ui=b=>{const{componentCls:M,tabsCardPadding:C,cardHeight:k,cardGutter:R,itemHoverColor:z,itemActiveColor:H,colorBorderSecondary:ee}=b;return{[M]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Rr.Wf)(b)),{display:"flex",[`> ${M}-nav, > div > ${M}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${M}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${b.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${M}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${b.motionDurationSlow}`},[`${M}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${M}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${M}-nav-more`]:{position:"relative",padding:C,background:"transparent",border:0,color:b.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:b.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${M}-nav-add`]:Object.assign({minWidth:k,marginLeft:{_skip_check_:!0,value:R},padding:`0 ${b.paddingXS}px`,background:"transparent",border:`${b.lineWidth}px ${b.lineType} ${ee}`,borderRadius:`${b.borderRadiusLG}px ${b.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:b.colorText,transition:`all ${b.motionDurationSlow} ${b.motionEaseInOut}`,"&:hover":{color:z},"&:active, &:focus:not(:focus-visible)":{color:H}},(0,Rr.Qy)(b))},[`${M}-extra-content`]:{flex:"none"},[`${M}-ink-bar`]:{position:"absolute",background:b.inkBarColor,pointerEvents:"none"}}),Vi(b)),{[`${M}-content`]:{position:"relative",width:"100%"},[`${M}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${M}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${M}-centered`]:{[`> ${M}-nav, > div > ${M}-nav`]:{[`${M}-nav-wrap`]:{[`&:not([class*='${M}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var ii=(0,lo.Z)("Tabs",b=>{const M=(0,bo.TS)(b,{tabsCardPadding:b.cardPadding||`${(b.cardHeight-Math.round(b.fontSize*b.lineHeight))/2-b.lineWidth}px ${b.padding}px`,dropdownEdgeChildVerticalPadding:b.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${b.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${b.horizontalItemGutter}px`});return[qn(M),Bi(M),ea(M),ba(M),va(M),ui(M),Gn(M)]},b=>{const M=b.controlHeightLG;return{zIndexPopup:b.zIndexPopupBase+50,cardBg:b.colorFillAlter,cardHeight:M,cardPadding:"",cardPaddingSM:`${b.paddingXXS*1.5}px ${b.padding}px`,cardPaddingLG:`${b.paddingXS}px ${b.padding}px ${b.paddingXXS*1.5}px`,titleFontSize:b.fontSize,titleFontSizeLG:b.fontSizeLG,titleFontSizeSM:b.fontSize,inkBarColor:b.colorPrimary,horizontalMargin:`0 0 ${b.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${b.paddingSM}px 0`,horizontalItemPaddingSM:`${b.paddingXS}px 0`,horizontalItemPaddingLG:`${b.padding}px 0`,verticalItemPadding:`${b.paddingXS}px ${b.paddingLG}px`,verticalItemMargin:`${b.margin}px 0 0 0`,itemColor:b.colorText,itemSelectedColor:b.colorPrimary,itemHoverColor:b.colorPrimaryHover,itemActiveColor:b.colorPrimaryActive,cardGutter:b.marginXXS/2}}),da=function(b,M){var C={};for(var k in b)Object.prototype.hasOwnProperty.call(b,k)&&M.indexOf(k)<0&&(C[k]=b[k]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var R=0,k=Object.getOwnPropertySymbols(b);R<k.length;R++)M.indexOf(k[R])<0&&Object.prototype.propertyIsEnumerable.call(b,k[R])&&(C[k[R]]=b[k[R]]);return C};const ta=b=>{const{type:M,className:C,rootClassName:k,size:R,onEdit:z,hideAdd:H,centered:ee,addIcon:le,popupClassName:Te,children:st,items:Be,animated:vt,style:bt,indicatorSize:Dt}=b,Wt=da(b,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Ct,moreIcon:qe=L.createElement(J.Z,null)}=Wt,{direction:He,tabs:et,getPrefixCls:Ye,getPopupContainer:wt}=L.useContext(Ar.E_),mt=Ye("tabs",Ct),[Pt,zt]=ii(mt);let Ot;M==="editable-card"&&(Ot={onEdit:(Xt,Hr)=>{let{key:Br,event:Or}=Hr;z==null||z(Xt==="add"?Or:Br,Xt)},removeIcon:L.createElement(A.Z,null),addIcon:le||L.createElement(he.Z,null),showAdd:H!==!0});const Bt=Ye(),sr=Fa(Be,st),Et=ci(mt,vt),tr=(0,kn.Z)(R),Zt=Object.assign(Object.assign({},et==null?void 0:et.style),bt);return Pt(L.createElement(an,Object.assign({direction:He,getPopupContainer:wt,moreTransitionName:`${Bt}-slide-up`},Wt,{items:sr,className:U()({[`${mt}-${tr}`]:tr,[`${mt}-card`]:["card","editable-card"].includes(M),[`${mt}-editable-card`]:M==="editable-card",[`${mt}-centered`]:ee},et==null?void 0:et.className,C,k,zt),popupClassName:U()(Te,zt),style:Zt,editable:Ot,moreIcon:qe,prefixCls:mt,animated:Et,indicatorSize:Dt!=null?Dt:et==null?void 0:et.indicatorSize})))};ta.TabPane=Hi;var Ui=ta},72665:function(er,ft){"use strict";var x;var A=typeof Symbol=="function"&&Symbol.for,J=A?Symbol.for("react.element"):60103,he=A?Symbol.for("react.portal"):60106,ue=A?Symbol.for("react.fragment"):60107,U=A?Symbol.for("react.strict_mode"):60108,q=A?Symbol.for("react.profiler"):60114,ce=A?Symbol.for("react.provider"):60109,_=A?Symbol.for("react.context"):60110,v=A?Symbol.for("react.async_mode"):60111,De=A?Symbol.for("react.concurrent_mode"):60111,Ne=A?Symbol.for("react.forward_ref"):60112,L=A?Symbol.for("react.suspense"):60113,Le=A?Symbol.for("react.suspense_list"):60120,Re=A?Symbol.for("react.memo"):60115,pt=A?Symbol.for("react.lazy"):60116,lt=A?Symbol.for("react.block"):60121,Z=A?Symbol.for("react.fundamental"):60117,Ie=A?Symbol.for("react.responder"):60118,Ht=A?Symbol.for("react.scope"):60119;function Se(T){if(typeof T=="object"&&T!==null){var F=T.$$typeof;switch(F){case J:switch(T=T.type,T){case v:case De:case ue:case q:case U:case L:return T;default:switch(T=T&&T.$$typeof,T){case _:case Ne:case pt:case Re:case ce:return T;default:return F}}case he:return F}}}function pe(T){return Se(T)===De}x=v,x=De,x=_,x=ce,x=J,x=Ne,x=ue,x=pt,x=Re,x=he,x=q,x=U,x=L,x=function(T){return pe(T)||Se(T)===v},x=pe,x=function(T){return Se(T)===_},x=function(T){return Se(T)===ce},x=function(T){return typeof T=="object"&&T!==null&&T.$$typeof===J},x=function(T){return Se(T)===Ne},x=function(T){return Se(T)===ue},x=function(T){return Se(T)===pt},ft.isMemo=function(T){return Se(T)===Re},x=function(T){return Se(T)===he},x=function(T){return Se(T)===q},x=function(T){return Se(T)===U},x=function(T){return Se(T)===L},x=function(T){return typeof T=="string"||typeof T=="function"||T===ue||T===De||T===q||T===U||T===L||T===Le||typeof T=="object"&&T!==null&&(T.$$typeof===pt||T.$$typeof===Re||T.$$typeof===ce||T.$$typeof===_||T.$$typeof===Ne||T.$$typeof===Z||T.$$typeof===Ie||T.$$typeof===Ht||T.$$typeof===lt)},x=Se},12060:function(er,ft,x){"use strict";er.exports=x(72665)},1337:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return _}});var A=x(1413),J=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,he=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,ue="".concat(J," ").concat(he).split(/[\s\n]+/),U="aria-",q="data-";function ce(v,De){return v.indexOf(De)===0}function _(v){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ne;De===!1?Ne={aria:!0,data:!0,attr:!0}:De===!0?Ne={aria:!0}:Ne=(0,A.Z)({},De);var L={};return Object.keys(v).forEach(function(Le){(Ne.aria&&(Le==="role"||ce(Le,U))||Ne.data&&ce(Le,q)||Ne.attr&&ue.includes(Le))&&(L[Le]=v[Le])}),L}},19575:function(er,ft,x){var A,J;(function(he,ue){er.exports=ue(he)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof x.g!="undefined"?x.g:this,function(he){"use strict";he=he||{};var ue=he.Base64,U="2.6.4",q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce=function(_e){for(var Je={},re=0,Ue=_e.length;re<Ue;re++)Je[_e.charAt(re)]=re;return Je}(q),_=String.fromCharCode,v=function(_e){if(_e.length<2){var Je=_e.charCodeAt(0);return Je<128?_e:Je<2048?_(192|Je>>>6)+_(128|Je&63):_(224|Je>>>12&15)+_(128|Je>>>6&63)+_(128|Je&63)}else{var Je=65536+(_e.charCodeAt(0)-55296)*1024+(_e.charCodeAt(1)-56320);return _(240|Je>>>18&7)+_(128|Je>>>12&63)+_(128|Je>>>6&63)+_(128|Je&63)}},De=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Ne=function(_e){return _e.replace(De,v)},L=function(_e){var Je=[0,2,1][_e.length%3],re=_e.charCodeAt(0)<<16|(_e.length>1?_e.charCodeAt(1):0)<<8|(_e.length>2?_e.charCodeAt(2):0),Ue=[q.charAt(re>>>18),q.charAt(re>>>12&63),Je>=2?"=":q.charAt(re>>>6&63),Je>=1?"=":q.charAt(re&63)];return Ue.join("")},Le=he.btoa&&typeof he.btoa=="function"?function(_e){return he.btoa(_e)}:function(_e){if(_e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return _e.replace(/[\s\S]{1,3}/g,L)},Re=function(_e){return Le(Ne(String(_e)))},pt=function(_e){return _e.replace(/[+\/]/g,function(Je){return Je=="+"?"-":"_"}).replace(/=/g,"")},lt=function(_e,Je){return Je?pt(Re(_e)):Re(_e)},Z=function(_e){return lt(_e,!0)},Ie;he.Uint8Array&&(Ie=function(_e,Je){for(var re="",Ue=0,rt=_e.length;Ue<rt;Ue+=3){var ge=_e[Ue],Ae=_e[Ue+1],ve=_e[Ue+2],fe=ge<<16|Ae<<8|ve;re+=q.charAt(fe>>>18)+q.charAt(fe>>>12&63)+(typeof Ae!="undefined"?q.charAt(fe>>>6&63):"=")+(typeof ve!="undefined"?q.charAt(fe&63):"=")}return Je?pt(re):re});var Ht=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Se=function(_e){switch(_e.length){case 4:var Je=(7&_e.charCodeAt(0))<<18|(63&_e.charCodeAt(1))<<12|(63&_e.charCodeAt(2))<<6|63&_e.charCodeAt(3),re=Je-65536;return _((re>>>10)+55296)+_((re&1023)+56320);case 3:return _((15&_e.charCodeAt(0))<<12|(63&_e.charCodeAt(1))<<6|63&_e.charCodeAt(2));default:return _((31&_e.charCodeAt(0))<<6|63&_e.charCodeAt(1))}},pe=function(_e){return _e.replace(Ht,Se)},T=function(_e){var Je=_e.length,re=Je%4,Ue=(Je>0?ce[_e.charAt(0)]<<18:0)|(Je>1?ce[_e.charAt(1)]<<12:0)|(Je>2?ce[_e.charAt(2)]<<6:0)|(Je>3?ce[_e.charAt(3)]:0),rt=[_(Ue>>>16),_(Ue>>>8&255),_(Ue&255)];return rt.length-=[0,0,2,1][re],rt.join("")},F=he.atob&&typeof he.atob=="function"?function(_e){return he.atob(_e)}:function(_e){return _e.replace(/\S{1,4}/g,T)},ie=function(_e){return F(String(_e).replace(/[^A-Za-z0-9\+\/]/g,""))},j=function(_e){return pe(F(_e))},ze=function(_e){return String(_e).replace(/[-_]/g,function(Je){return Je=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},tt=function(_e){return j(ze(_e))},Nt;he.Uint8Array&&(Nt=function(_e){return Uint8Array.from(ie(ze(_e)),function(Je){return Je.charCodeAt(0)})});var gt=function(){var _e=he.Base64;return he.Base64=ue,_e};if(he.Base64={VERSION:U,atob:ie,btoa:Le,fromBase64:tt,toBase64:lt,utob:Ne,encode:lt,encodeURI:Z,btou:pe,decode:tt,noConflict:gt,fromUint8Array:Ie,toUint8Array:Nt},typeof Object.defineProperty=="function"){var Me=function(_e){return{value:_e,enumerable:!1,writable:!0,configurable:!0}};he.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Me(function(){return tt(this)})),Object.defineProperty(String.prototype,"toBase64",Me(function(_e){return lt(this,_e)})),Object.defineProperty(String.prototype,"toBase64URI",Me(function(){return lt(this,!0)}))}}return he.Meteor&&(Base64=he.Base64),er.exports?er.exports.Base64=he.Base64:(A=[],J=function(){return he.Base64}.apply(ft,A),J!==void 0&&(er.exports=J)),{Base64:he.Base64}})},95860:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return Se}});var A=x(87462),J=x(1413),he=x(4942),ue=x(97685),U=x(45987),q=x(94184),ce=x.n(q),_=x(67294);function v(pe){var T=_.useRef();T.current=pe;var F=_.useCallback(function(){for(var ie,j=arguments.length,ze=new Array(j),tt=0;tt<j;tt++)ze[tt]=arguments[tt];return(ie=T.current)===null||ie===void 0?void 0:ie.call.apply(ie,[T].concat(ze))},[]);return F}function De(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ne=De()?_.useLayoutEffect:_.useEffect,L=function(T,F){var ie=_.useRef(!0);Ne(function(){return T(ie.current)},F),Ne(function(){return ie.current=!1,function(){ie.current=!0}},[])},Le=function(T,F){L(function(ie){if(!ie)return T()},F)},Re=null;function pt(pe){var T=_.useRef(!1),F=_.useState(pe),ie=(0,ue.Z)(F,2),j=ie[0],ze=ie[1];_.useEffect(function(){return T.current=!1,function(){T.current=!0}},[]);function tt(Nt,gt){gt&&T.current||ze(Nt)}return[j,tt]}function lt(pe){return pe!==void 0}function Z(pe,T){var F=T||{},ie=F.defaultValue,j=F.value,ze=F.onChange,tt=F.postState,Nt=pt(function(){return lt(j)?j:lt(ie)?typeof ie=="function"?ie():ie:typeof pe=="function"?pe():pe}),gt=(0,ue.Z)(Nt,2),Me=gt[0],_e=gt[1],Je=j!==void 0?j:Me,re=tt?tt(Je):Je,Ue=v(ze),rt=pt([Je]),ge=(0,ue.Z)(rt,2),Ae=ge[0],ve=ge[1];Le(function(){var ot=Ae[0];Me!==ot&&Ue(Me,ot)},[Ae]),Le(function(){lt(j)||_e(j)},[j]);var fe=v(function(ot,Ze){_e(ot,Ze),ve([Je],Ze)});return[re,fe]}var Ie=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],Ht=(0,_.forwardRef)(function(pe,T){var F,ie=pe.prefixCls,j=ie===void 0?"rc-checkbox":ie,ze=pe.className,tt=pe.style,Nt=pe.checked,gt=pe.disabled,Me=pe.defaultChecked,_e=Me===void 0?!1:Me,Je=pe.type,re=Je===void 0?"checkbox":Je,Ue=pe.title,rt=pe.onChange,ge=(0,U.Z)(pe,Ie),Ae=(0,_.useRef)(null),ve=Z(_e,{value:Nt}),fe=(0,ue.Z)(ve,2),ot=fe[0],Ze=fe[1];(0,_.useImperativeHandle)(T,function(){return{focus:function(){var ht;(ht=Ae.current)===null||ht===void 0||ht.focus()},blur:function(){var ht;(ht=Ae.current)===null||ht===void 0||ht.blur()},input:Ae.current}});var Oe=ce()(j,ze,(F={},(0,he.Z)(F,"".concat(j,"-checked"),ot),(0,he.Z)(F,"".concat(j,"-disabled"),gt),F)),xe=function(ht){gt||("checked"in pe||Ze(ht.target.checked),rt==null||rt({target:(0,J.Z)((0,J.Z)({},pe),{},{type:re,checked:ht.target.checked}),stopPropagation:function(){ht.stopPropagation()},preventDefault:function(){ht.preventDefault()},nativeEvent:ht.nativeEvent}))};return _.createElement("span",{className:Oe,title:Ue,style:tt},_.createElement("input",(0,A.Z)({},ge,{className:"".concat(j,"-input"),ref:Ae,onChange:xe,disabled:gt,checked:!!ot,type:re})),_.createElement("span",{className:"".concat(j,"-inner")}))}),Se=Ht},82523:function(er,ft){"use strict";var x;var A=Symbol.for("react.element"),J=Symbol.for("react.portal"),he=Symbol.for("react.fragment"),ue=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),ce=Symbol.for("react.context"),_=Symbol.for("react.server_context"),v=Symbol.for("react.forward_ref"),De=Symbol.for("react.suspense"),Ne=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),Le=Symbol.for("react.lazy"),Re=Symbol.for("react.offscreen"),pt;pt=Symbol.for("react.module.reference");function lt(Z){if(typeof Z=="object"&&Z!==null){var Ie=Z.$$typeof;switch(Ie){case A:switch(Z=Z.type,Z){case he:case U:case ue:case De:case Ne:return Z;default:switch(Z=Z&&Z.$$typeof,Z){case _:case ce:case v:case Le:case L:case q:return Z;default:return Ie}}case J:return Ie}}}x=ce,x=q,x=A,x=v,x=he,x=Le,x=L,x=J,x=U,x=ue,x=De,x=Ne,x=function(){return!1},x=function(){return!1},x=function(Z){return lt(Z)===ce},x=function(Z){return lt(Z)===q},x=function(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===A},x=function(Z){return lt(Z)===v},x=function(Z){return lt(Z)===he},x=function(Z){return lt(Z)===Le},x=function(Z){return lt(Z)===L},x=function(Z){return lt(Z)===J},x=function(Z){return lt(Z)===U},x=function(Z){return lt(Z)===ue},x=function(Z){return lt(Z)===De},x=function(Z){return lt(Z)===Ne},x=function(Z){return typeof Z=="string"||typeof Z=="function"||Z===he||Z===U||Z===ue||Z===De||Z===Ne||Z===Re||typeof Z=="object"&&Z!==null&&(Z.$$typeof===Le||Z.$$typeof===L||Z.$$typeof===q||Z.$$typeof===ce||Z.$$typeof===v||Z.$$typeof===pt||Z.getModuleId!==void 0)},x=lt},27183:function(er,ft,x){"use strict";x(82523)},67656:function(er,ft,x){"use strict";x.r(ft),x.d(ft,{BaseInput:function(){return De},default:function(){return Ht}});var A=x(87462),J=x(1413),he=x(4942),ue=x(71002),U=x(94184),q=x.n(U),ce=x(67294),_=x(87887),v=function(pe){var T,F,ie=pe.inputElement,j=pe.prefixCls,ze=pe.prefix,tt=pe.suffix,Nt=pe.addonBefore,gt=pe.addonAfter,Me=pe.className,_e=pe.style,Je=pe.disabled,re=pe.readOnly,Ue=pe.focused,rt=pe.triggerFocus,ge=pe.allowClear,Ae=pe.value,ve=pe.handleReset,fe=pe.hidden,ot=pe.classes,Ze=pe.classNames,Oe=pe.dataAttrs,xe=pe.styles,yt=pe.components,ht=(yt==null?void 0:yt.affixWrapper)||"span",Ut=(yt==null?void 0:yt.groupWrapper)||"span",Gt=(yt==null?void 0:yt.wrapper)||"span",cr=(yt==null?void 0:yt.groupAddon)||"span",ur=(0,ce.useRef)(null),rr=function(Fe){var Ce;(Ce=ur.current)!==null&&Ce!==void 0&&Ce.contains(Fe.target)&&(rt==null||rt())},ar=function(){var Fe;if(!ge)return null;var Ce=!Je&&!re&&Ae,kt="".concat(j,"-clear-icon"),$t=(0,ue.Z)(ge)==="object"&&ge!==null&&ge!==void 0&&ge.clearIcon?ge.clearIcon:"\u2716";return ce.createElement("span",{onClick:ve,onMouseDown:function(nt){return nt.preventDefault()},className:q()(kt,(Fe={},(0,he.Z)(Fe,"".concat(kt,"-hidden"),!Ce),(0,he.Z)(Fe,"".concat(kt,"-has-suffix"),!!tt),Fe)),role:"button",tabIndex:-1},$t)},ut=(0,ce.cloneElement)(ie,{value:Ae,hidden:fe,className:q()((T=ie.props)===null||T===void 0?void 0:T.className,!(0,_.X3)(pe)&&!(0,_.He)(pe)&&Me)||null,style:(0,J.Z)((0,J.Z)({},(F=ie.props)===null||F===void 0?void 0:F.style),!(0,_.X3)(pe)&&!(0,_.He)(pe)?_e:{})});if((0,_.X3)(pe)){var be,ae="".concat(j,"-affix-wrapper"),Q=q()(ae,(be={},(0,he.Z)(be,"".concat(ae,"-disabled"),Je),(0,he.Z)(be,"".concat(ae,"-focused"),Ue),(0,he.Z)(be,"".concat(ae,"-readonly"),re),(0,he.Z)(be,"".concat(ae,"-input-with-clear-btn"),tt&&ge&&Ae),be),!(0,_.He)(pe)&&Me,ot==null?void 0:ot.affixWrapper,Ze==null?void 0:Ze.affixWrapper),V=(tt||ge)&&ce.createElement("span",{className:q()("".concat(j,"-suffix"),Ze==null?void 0:Ze.suffix),style:xe==null?void 0:xe.suffix},ar(),tt);ut=ce.createElement(ht,(0,A.Z)({className:Q,style:(0,J.Z)((0,J.Z)({},(0,_.He)(pe)?void 0:_e),xe==null?void 0:xe.affixWrapper),hidden:!(0,_.He)(pe)&&fe,onClick:rr},Oe==null?void 0:Oe.affixWrapper,{ref:ur}),ze&&ce.createElement("span",{className:q()("".concat(j,"-prefix"),Ze==null?void 0:Ze.prefix),style:xe==null?void 0:xe.prefix},ze),(0,ce.cloneElement)(ie,{value:Ae,hidden:null}),V)}if((0,_.He)(pe)){var Y="".concat(j,"-group"),ye="".concat(Y,"-addon"),te=q()("".concat(j,"-wrapper"),Y,ot==null?void 0:ot.wrapper),ne=q()("".concat(j,"-group-wrapper"),Me,ot==null?void 0:ot.group);return ce.createElement(Ut,{className:ne,style:_e,hidden:fe},ce.createElement(Gt,{className:te},Nt&&ce.createElement(cr,{className:ye},Nt),(0,ce.cloneElement)(ut,{hidden:null}),gt&&ce.createElement(cr,{className:ye},gt)))}return ut},De=v,Ne=x(74902),L=x(97685),Le=x(45987),Re=x(21770),pt=x(98423),lt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],Z=(0,ce.forwardRef)(function(Se,pe){var T=Se.autoComplete,F=Se.onChange,ie=Se.onFocus,j=Se.onBlur,ze=Se.onPressEnter,tt=Se.onKeyDown,Nt=Se.prefixCls,gt=Nt===void 0?"rc-input":Nt,Me=Se.disabled,_e=Se.htmlSize,Je=Se.className,re=Se.maxLength,Ue=Se.suffix,rt=Se.showCount,ge=Se.type,Ae=ge===void 0?"text":ge,ve=Se.classes,fe=Se.classNames,ot=Se.styles,Ze=(0,Le.Z)(Se,lt),Oe=(0,Re.Z)(Se.defaultValue,{value:Se.value}),xe=(0,L.Z)(Oe,2),yt=xe[0],ht=xe[1],Ut=(0,ce.useState)(!1),Gt=(0,L.Z)(Ut,2),cr=Gt[0],ur=Gt[1],rr=(0,ce.useRef)(null),ar=function(ne){rr.current&&(0,_.nH)(rr.current,ne)};(0,ce.useImperativeHandle)(pe,function(){return{focus:ar,blur:function(){var ne;(ne=rr.current)===null||ne===void 0||ne.blur()},setSelectionRange:function(ne,Ke,Fe){var Ce;(Ce=rr.current)===null||Ce===void 0||Ce.setSelectionRange(ne,Ke,Fe)},select:function(){var ne;(ne=rr.current)===null||ne===void 0||ne.select()},input:rr.current}}),(0,ce.useEffect)(function(){ur(function(te){return te&&Me?!1:te})},[Me]);var ut=function(ne){Se.value===void 0&&ht(ne.target.value),rr.current&&(0,_.rJ)(rr.current,ne,F)},be=function(ne){ze&&ne.key==="Enter"&&ze(ne),tt==null||tt(ne)},ae=function(ne){ur(!0),ie==null||ie(ne)},Q=function(ne){ur(!1),j==null||j(ne)},V=function(ne){ht(""),ar(),rr.current&&(0,_.rJ)(rr.current,ne,F)},Y=function(){var ne=(0,pt.Z)(Se,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return ce.createElement("input",(0,A.Z)({autoComplete:T},ne,{onChange:ut,onFocus:ae,onBlur:Q,onKeyDown:be,className:q()(gt,(0,he.Z)({},"".concat(gt,"-disabled"),Me),fe==null?void 0:fe.input),style:ot==null?void 0:ot.input,ref:rr,size:_e,type:Ae}))},ye=function(){var ne=Number(re)>0;if(Ue||rt){var Ke=(0,_.D7)(yt),Fe=(0,Ne.Z)(Ke).length,Ce=(0,ue.Z)(rt)==="object"?rt.formatter({value:Ke,count:Fe,maxLength:re}):"".concat(Fe).concat(ne?" / ".concat(re):"");return ce.createElement(ce.Fragment,null,!!rt&&ce.createElement("span",{className:q()("".concat(gt,"-show-count-suffix"),(0,he.Z)({},"".concat(gt,"-show-count-has-suffix"),!!Ue),fe==null?void 0:fe.count),style:(0,J.Z)({},ot==null?void 0:ot.count)},Ce),Ue)}return null};return ce.createElement(De,(0,A.Z)({},Ze,{prefixCls:gt,className:Je,inputElement:Y(),handleReset:V,value:(0,_.D7)(yt),focused:cr,triggerFocus:ar,suffix:ye(),disabled:Me,classes:ve,classNames:fe,styles:ot}))}),Ie=Z,Ht=Ie},87887:function(er,ft,x){"use strict";x.d(ft,{D7:function(){return U},He:function(){return A},X3:function(){return J},nH:function(){return ue},rJ:function(){return he}});function A(q){return!!(q.addonBefore||q.addonAfter)}function J(q){return!!(q.prefix||q.suffix||q.allowClear)}function he(q,ce,_,v){if(_){var De=ce;if(ce.type==="click"){var Ne=q.cloneNode(!0);De=Object.create(ce,{target:{value:Ne},currentTarget:{value:Ne}}),Ne.value="",_(De);return}if(v!==void 0){De=Object.create(ce,{target:{value:q},currentTarget:{value:q}}),q.value=v,_(De);return}_(De)}}function ue(q,ce){if(q){q.focus(ce);var _=ce||{},v=_.cursor;if(v){var De=q.value.length;switch(v){case"start":q.setSelectionRange(0,0);break;case"end":q.setSelectionRange(De,De);break;default:q.setSelectionRange(0,De)}}}}function U(q){return typeof q=="undefined"||q===null?"":String(q)}},78595:function(er,ft,x){"use strict";x.d(ft,{iz:function(){return qn},ck:function(){return jn},BW:function(){return ea},sN:function(){return jn},Wd:function(){return Qi},ZP:function(){return M},Xl:function(){return Ce}});var A=x(87462),J=x(4942),he=x(1413),ue=x(74902),U=x(97685),q=x(45987),ce=x(94184),_=x.n(ce),v=x(67294),De=x(48555);function Ne(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var L=Ne()?v.useLayoutEffect:v.useEffect,Le=function(k,R){var z=v.useRef(!0);L(function(){return k(z.current)},R),L(function(){return z.current=!1,function(){z.current=!0}},[])},Re=function(k,R){Le(function(z){if(!z)return k()},R)},pt=Le,lt=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Z=void 0;function Ie(C,k){var R=C.prefixCls,z=C.invalidate,H=C.item,ee=C.renderItem,le=C.responsive,Te=C.responsiveDisabled,st=C.registerSize,Be=C.itemKey,vt=C.className,bt=C.style,Dt=C.children,Wt=C.display,Ct=C.order,qe=C.component,He=qe===void 0?"div":qe,et=(0,q.Z)(C,lt),Ye=le&&!Wt;function wt(Bt){st(Be,Bt)}v.useEffect(function(){return function(){wt(null)}},[]);var mt=ee&&H!==Z?ee(H):Dt,Pt;z||(Pt={opacity:Ye?0:1,height:Ye?0:Z,overflowY:Ye?"hidden":Z,order:le?Ct:Z,pointerEvents:Ye?"none":Z,position:Ye?"absolute":Z});var zt={};Ye&&(zt["aria-hidden"]=!0);var Ot=v.createElement(He,(0,A.Z)({className:_()(!z&&R,vt),style:(0,he.Z)((0,he.Z)({},Pt),bt)},zt,et,{ref:k}),mt);return le&&(Ot=v.createElement(De.Z,{onResize:function(sr){var Et=sr.offsetWidth;wt(Et)},disabled:Te},Ot)),Ot}var Ht=v.forwardRef(Ie);Ht.displayName="Item";var Se=Ht;function pe(C){var k=v.useRef();k.current=C;var R=v.useCallback(function(){for(var z,H=arguments.length,ee=new Array(H),le=0;le<H;le++)ee[le]=arguments[le];return(z=k.current)===null||z===void 0?void 0:z.call.apply(z,[k].concat(ee))},[]);return R}var T=x(73935),F=function(k){return+setTimeout(k,16)},ie=function(k){return clearTimeout(k)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(F=function(k){return window.requestAnimationFrame(k)},ie=function(k){return window.cancelAnimationFrame(k)});var j=0,ze=new Map;function tt(C){ze.delete(C)}var Nt=function(k){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;j+=1;var z=j;function H(ee){if(ee===0)tt(z),k();else{var le=F(function(){H(ee-1)});ze.set(z,le)}}return H(R),z};Nt.cancel=function(C){var k=ze.get(C);return tt(k),ie(k)};var gt=Nt;function Me(C){if(typeof MessageChannel=="undefined")gt(C);else{var k=new MessageChannel;k.port1.onmessage=function(){return C()},k.port2.postMessage(void 0)}}function _e(){var C=v.useRef(null),k=function(z){C.current||(C.current=[],Me(function(){(0,T.unstable_batchedUpdates)(function(){C.current.forEach(function(H){H()}),C.current=null})})),C.current.push(z)};return k}function Je(C,k){var R=v.useState(k),z=(0,U.Z)(R,2),H=z[0],ee=z[1],le=pe(function(Te){C(function(){ee(Te)})});return[H,le]}var re=v.createContext(null),Ue=["component"],rt=["className"],ge=["className"],Ae=function(k,R){var z=v.useContext(re);if(!z){var H=k.component,ee=H===void 0?"div":H,le=(0,q.Z)(k,Ue);return v.createElement(ee,(0,A.Z)({},le,{ref:R}))}var Te=z.className,st=(0,q.Z)(z,rt),Be=k.className,vt=(0,q.Z)(k,ge);return v.createElement(re.Provider,{value:null},v.createElement(Se,(0,A.Z)({ref:R,className:_()(Te,Be)},st,vt)))},ve=v.forwardRef(Ae);ve.displayName="RawItem";var fe=ve,ot=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Ze="responsive",Oe="invalidate";function xe(C){return"+ ".concat(C.length," ...")}function yt(C,k){var R=C.prefixCls,z=R===void 0?"rc-overflow":R,H=C.data,ee=H===void 0?[]:H,le=C.renderItem,Te=C.renderRawItem,st=C.itemKey,Be=C.itemWidth,vt=Be===void 0?10:Be,bt=C.ssr,Dt=C.style,Wt=C.className,Ct=C.maxCount,qe=C.renderRest,He=C.renderRawRest,et=C.suffix,Ye=C.component,wt=Ye===void 0?"div":Ye,mt=C.itemComponent,Pt=C.onVisibleChange,zt=(0,q.Z)(C,ot),Ot=bt==="full",Bt=_e(),sr=Je(Bt,null),Et=(0,U.Z)(sr,2),tr=Et[0],Zt=Et[1],Xt=tr||0,Hr=Je(Bt,new Map),Br=(0,U.Z)(Hr,2),Or=Br[0],yr=Br[1],mn=Je(Bt,0),Yn=(0,U.Z)(mn,2),fr=Yn[0],Dr=Yn[1],fn=Je(Bt,0),Wr=(0,U.Z)(fn,2),Mr=Wr[0],Qr=Wr[1],xr=Je(Bt,0),pn=(0,U.Z)(xr,2),zn=pn[0],wi=pn[1],Ti=(0,v.useState)(null),An=(0,U.Z)(Ti,2),Tr=An[0],Si=An[1],Vr=(0,v.useState)(null),gn=(0,U.Z)(Vr,2),_n=gn[0],On=gn[1],di=v.useMemo(function(){return _n===null&&Ot?Number.MAX_SAFE_INTEGER:_n||0},[_n,tr]),fi=(0,v.useState)(!1),pi=(0,U.Z)(fi,2),ra=pi[0],Zi=pi[1],vn="".concat(z,"-item"),Mn=Math.max(fr,Mr),wr=Ct===Ze,Kn=ee.length&&wr,Dn=Ct===Oe,Hn=Kn||typeof Ct=="number"&&ee.length>Ct,ai=(0,v.useMemo)(function(){var lr=ee;return Kn?tr===null&&Ot?lr=ee:lr=ee.slice(0,Math.min(ee.length,Xt/vt)):typeof Ct=="number"&&(lr=ee.slice(0,Ct)),lr},[ee,vt,tr,Ct,Kn]),na=(0,v.useMemo)(function(){return Kn?ee.slice(di+1):ee.slice(ai.length)},[ee,ai,Kn,di]),Ln=(0,v.useCallback)(function(lr,ir){var on;return typeof st=="function"?st(lr):(on=st&&(lr==null?void 0:lr[st]))!==null&&on!==void 0?on:ir},[st]),ia=(0,v.useCallback)(le||function(lr){return lr},[le]);function In(lr,ir,on){_n===lr&&(ir===void 0||ir===Tr)||(On(lr),on||(Zi(lr<ee.length-1),Pt==null||Pt(lr)),ir!==void 0&&Si(ir))}function aa(lr,ir){Zt(ir.clientWidth)}function $i(lr,ir){yr(function(on){var Pi=new Map(on);return ir===null?Pi.delete(lr):Pi.set(lr,ir),Pi})}function hi(lr,ir){Qr(ir),Dr(Mr)}function oi(lr,ir){wi(ir)}function fa(lr){return Or.get(Ln(ai[lr],lr))}pt(function(){if(Xt&&typeof Mn=="number"&&ai){var lr=zn,ir=ai.length,on=ir-1;if(!ir){In(0,null);return}for(var Pi=0;Pi<ir;Pi+=1){var Ri=fa(Pi);if(Ot&&(Ri=Ri||0),Ri===void 0){In(Pi-1,void 0,!0);break}if(lr+=Ri,on===0&&lr<=Xt||Pi===on-1&&lr+fa(on)<=Xt){In(on,null);break}else if(lr+Mn>Xt){In(Pi-1,lr-Ri-zn+Mr);break}}et&&fa(0)+zn>Xt&&Si(null)}},[Xt,Or,Mr,zn,Ln,ai]);var qa=ra&&!!na.length,ji={};Tr!==null&&Kn&&(ji={position:"absolute",left:Tr,top:0});var ya={prefixCls:vn,responsive:Kn,component:mt,invalidate:Dn},xa=Te?function(lr,ir){var on=Ln(lr,ir);return v.createElement(re.Provider,{key:on,value:(0,he.Z)((0,he.Z)({},ya),{},{order:ir,item:lr,itemKey:on,registerSize:$i,display:ir<=di})},Te(lr,ir))}:function(lr,ir){var on=Ln(lr,ir);return v.createElement(Se,(0,A.Z)({},ya,{order:ir,key:on,item:lr,renderItem:ia,itemKey:on,registerSize:$i,display:ir<=di}))},mi,Da={order:qa?di:Number.MAX_SAFE_INTEGER,className:"".concat(vn,"-rest"),registerSize:hi,display:qa};if(He)He&&(mi=v.createElement(re.Provider,{value:(0,he.Z)((0,he.Z)({},ya),Da)},He(na)));else{var oa=qe||xe;mi=v.createElement(Se,(0,A.Z)({},ya,Da),typeof oa=="function"?oa(na):oa)}var La=v.createElement(wt,(0,A.Z)({className:_()(!Dn&&z,Wt),style:Dt,ref:k},zt),ai.map(xa),Hn?mi:null,et&&v.createElement(Se,(0,A.Z)({},ya,{responsive:wr,responsiveDisabled:!Kn,order:di,className:"".concat(vn,"-suffix"),registerSize:oi,display:!0,style:ji}),et));return wr&&(La=v.createElement(De.Z,{onResize:aa,disabled:!Kn},La)),La}var ht=v.forwardRef(yt);ht.displayName="Overflow",ht.Item=fe,ht.RESPONSIVE=Ze,ht.INVALIDATE=Oe;var Ut=ht,Gt=Ut,cr=x(21770),ur=x(80334),rr=x(91881),ar=v.createContext(null);function ut(C,k){return C===void 0?null:"".concat(C,"-").concat(k)}function be(C){var k=v.useContext(ar);return ut(k,C)}var ae=x(56982),Q=["children","locked"],V=v.createContext(null);function Y(C,k){var R=(0,he.Z)({},C);return Object.keys(k).forEach(function(z){var H=k[z];H!==void 0&&(R[z]=H)}),R}function ye(C){var k=C.children,R=C.locked,z=(0,q.Z)(C,Q),H=v.useContext(V),ee=(0,ae.Z)(function(){return Y(H,z)},[H,z],function(le,Te){return!R&&(le[0]!==Te[0]||!(0,rr.Z)(le[1],Te[1],!0))});return v.createElement(V.Provider,{value:ee},k)}var te=[],ne=v.createContext(null);function Ke(){return v.useContext(ne)}var Fe=v.createContext(te);function Ce(C){var k=v.useContext(Fe);return v.useMemo(function(){return C!==void 0?[].concat((0,ue.Z)(k),[C]):k},[k,C])}var kt=v.createContext(null),$t=v.createContext({}),G=$t,nt=x(15105),dt=x(75164),qt=function(C){if(!C)return!1;if(C instanceof Element){if(C.offsetParent)return!0;if(C.getBBox){var k=C.getBBox(),R=k.width,z=k.height;if(R||z)return!0}if(C.getBoundingClientRect){var H=C.getBoundingClientRect(),ee=H.width,le=H.height;if(ee||le)return!0}}return!1};function vr(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(qt(C)){var R=C.nodeName.toLowerCase(),z=["input","select","textarea","button"].includes(R)||C.isContentEditable||R==="a"&&!!C.getAttribute("href"),H=C.getAttribute("tabindex"),ee=Number(H),le=null;return H&&!Number.isNaN(ee)?le=ee:z&&le===null&&(le=0),z&&C.disabled&&(le=null),le!==null&&(le>=0||k&&le<0)}return!1}function or(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=(0,ue.Z)(C.querySelectorAll("*")).filter(function(z){return vr(z,k)});return vr(C,k)&&R.unshift(C),R}var tn=null;function Vt(){tn=document.activeElement}function ct(){tn=null}function rn(){if(tn)try{tn.focus()}catch(C){}}function nn(C,k){if(k.keyCode===9){var R=or(C),z=R[k.shiftKey?0:R.length-1],H=z===document.activeElement||C===document.activeElement;if(H){var ee=R[k.shiftKey?R.length-1:0];ee.focus(),k.preventDefault()}}}var br=nt.Z.LEFT,dr=nt.Z.RIGHT,Xr=nt.Z.UP,It=nt.Z.DOWN,$n=nt.Z.ENTER,dn=nt.Z.ESC,wn=nt.Z.HOME,jr=nt.Z.END,Lr=[Xr,It,br,dr];function At(C,k,R,z){var H,ee,le,Te,st="prev",Be="next",vt="children",bt="parent";if(C==="inline"&&z===$n)return{inlineTrigger:!0};var Dt=(H={},(0,J.Z)(H,Xr,st),(0,J.Z)(H,It,Be),H),Wt=(ee={},(0,J.Z)(ee,br,R?Be:st),(0,J.Z)(ee,dr,R?st:Be),(0,J.Z)(ee,It,vt),(0,J.Z)(ee,$n,vt),ee),Ct=(le={},(0,J.Z)(le,Xr,st),(0,J.Z)(le,It,Be),(0,J.Z)(le,$n,vt),(0,J.Z)(le,dn,bt),(0,J.Z)(le,br,R?vt:bt),(0,J.Z)(le,dr,R?bt:vt),le),qe={inline:Dt,horizontal:Wt,vertical:Ct,inlineSub:Dt,horizontalSub:Ct,verticalSub:Ct},He=(Te=qe["".concat(C).concat(k?"":"Sub")])===null||Te===void 0?void 0:Te[z];switch(He){case st:return{offset:-1,sibling:!0};case Be:return{offset:1,sibling:!0};case bt:return{offset:-1,sibling:!1};case vt:return{offset:1,sibling:!1};default:return null}}function Fr(C){for(var k=C;k;){if(k.getAttribute("data-menu-list"))return k;k=k.parentElement}return null}function vi(C,k){for(var R=C||document.activeElement;R;){if(k.has(R))return R;R=R.parentElement}return null}function ni(C,k){var R=or(C,!0);return R.filter(function(z){return k.has(z)})}function li(C,k,R){var z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!C)return null;var H=ni(C,k),ee=H.length,le=H.findIndex(function(Te){return R===Te});return z<0?le===-1?le=ee-1:le-=1:z>0&&(le+=1),le=(le+ee)%ee,H[le]}function hn(C,k,R,z,H,ee,le,Te,st,Be){var vt=v.useRef(),bt=v.useRef();bt.current=k;var Dt=function(){dt.Z.cancel(vt.current)};return v.useEffect(function(){return function(){Dt()}},[]),function(Wt){var Ct=Wt.which;if([].concat(Lr,[$n,dn,wn,jr]).includes(Ct)){var qe,He,et,Ye=function(){qe=new Set,He=new Map,et=new Map;var Br=ee();return Br.forEach(function(Or){var yr=document.querySelector("[data-menu-id='".concat(ut(z,Or),"']"));yr&&(qe.add(yr),et.set(yr,Or),He.set(Or,yr))}),qe};Ye();var wt=He.get(k),mt=vi(wt,qe),Pt=et.get(mt),zt=At(C,le(Pt,!0).length===1,R,Ct);if(!zt&&Ct!==wn&&Ct!==jr)return;(Lr.includes(Ct)||[wn,jr].includes(Ct))&&Wt.preventDefault();var Ot=function(Br){if(Br){var Or=Br,yr=Br.querySelector("a");yr!=null&&yr.getAttribute("href")&&(Or=yr);var mn=et.get(Br);Te(mn),Dt(),vt.current=(0,dt.Z)(function(){bt.current===mn&&Or.focus()})}};if([wn,jr].includes(Ct)||zt.sibling||!mt){var Bt;!mt||C==="inline"?Bt=H.current:Bt=Fr(mt);var sr,Et=ni(Bt,qe);Ct===wn?sr=Et[0]:Ct===jr?sr=Et[Et.length-1]:sr=li(Bt,qe,mt,zt.offset),Ot(sr)}else if(zt.inlineTrigger)st(Pt);else if(zt.offset>0)st(Pt,!0),Dt(),vt.current=(0,dt.Z)(function(){Ye();var Hr=mt.getAttribute("aria-controls"),Br=document.getElementById(Hr),Or=li(Br,qe);Ot(Or)},5);else if(zt.offset<0){var tr=le(Pt,!0),Zt=tr[tr.length-2],Xt=He.get(Zt);st(Zt,!1),Ot(Xt)}}Be==null||Be(Wt)}}function Di(C){Promise.resolve().then(C)}var Sn="__RC_UTIL_PATH_SPLIT__",K=function(k){return k.join(Sn)},X=function(k){return k.split(Sn)},me="rc-menu-more";function Ee(){var C=v.useState({}),k=(0,U.Z)(C,2),R=k[1],z=(0,v.useRef)(new Map),H=(0,v.useRef)(new Map),ee=v.useState([]),le=(0,U.Z)(ee,2),Te=le[0],st=le[1],Be=(0,v.useRef)(0),vt=(0,v.useRef)(!1),bt=function(){vt.current||R({})},Dt=(0,v.useCallback)(function(wt,mt){var Pt=K(mt);H.current.set(Pt,wt),z.current.set(wt,Pt),Be.current+=1;var zt=Be.current;Di(function(){zt===Be.current&&bt()})},[]),Wt=(0,v.useCallback)(function(wt,mt){var Pt=K(mt);H.current.delete(Pt),z.current.delete(wt)},[]),Ct=(0,v.useCallback)(function(wt){st(wt)},[]),qe=(0,v.useCallback)(function(wt,mt){var Pt=z.current.get(wt)||"",zt=X(Pt);return mt&&Te.includes(zt[0])&&zt.unshift(me),zt},[Te]),He=(0,v.useCallback)(function(wt,mt){return wt.some(function(Pt){var zt=qe(Pt,!0);return zt.includes(mt)})},[qe]),et=function(){var mt=(0,ue.Z)(z.current.keys());return Te.length&&mt.push(me),mt},Ye=(0,v.useCallback)(function(wt){var mt="".concat(z.current.get(wt)).concat(Sn),Pt=new Set;return(0,ue.Z)(H.current.keys()).forEach(function(zt){zt.startsWith(mt)&&Pt.add(H.current.get(zt))}),Pt},[]);return v.useEffect(function(){return function(){vt.current=!0}},[]),{registerPath:Dt,unregisterPath:Wt,refreshOverflowKeys:Ct,isSubPathKey:He,getKeyPath:qe,getKeys:et,getSubPathKeys:Ye}}function at(C){var k=v.useRef(C);k.current=C;var R=v.useCallback(function(){for(var z,H=arguments.length,ee=new Array(H),le=0;le<H;le++)ee[le]=arguments[le];return(z=k.current)===null||z===void 0?void 0:z.call.apply(z,[k].concat(ee))},[]);return C?R:void 0}var Mt=Math.random().toFixed(5).toString().slice(2),Qt=0;function Jt(C){var k=(0,cr.Z)(C,{value:C}),R=(0,U.Z)(k,2),z=R[0],H=R[1];return v.useEffect(function(){Qt+=1;var ee="".concat(Mt,"-").concat(Qt);H("rc-menu-uuid-".concat(ee))},[]),z}var zr=x(15671),Ir=x(43144),nr=x(60136),Yr=x(51630),hr=x(98423),_r=x(42550);function Fn(C,k,R,z){var H=v.useContext(V),ee=H.activeKey,le=H.onActive,Te=H.onInactive,st={active:ee===C};return k||(st.onMouseEnter=function(Be){R==null||R({key:C,domEvent:Be}),le(C)},st.onMouseLeave=function(Be){z==null||z({key:C,domEvent:Be}),Te(C)}),st}function Pr(C){var k=v.useContext(V),R=k.mode,z=k.rtl,H=k.inlineIndent;if(R!=="inline")return null;var ee=C;return z?{paddingRight:ee*H}:{paddingLeft:ee*H}}function Kr(C){var k=C.icon,R=C.props,z=C.children,H;return k===null||k===!1?null:(typeof k=="function"?H=v.createElement(k,(0,he.Z)({},R)):typeof k!="boolean"&&(H=k),H||z||null)}var Pn=["item"];function jt(C){var k=C.item,R=(0,q.Z)(C,Pn);return Object.defineProperty(R,"item",{get:function(){return(0,ur.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),k}}),R}var Pe=["title","attribute","elementRef"],Zn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],bi=["active"],Rn=function(C){(0,nr.Z)(R,C);var k=(0,Yr.Z)(R);function R(){return(0,zr.Z)(this,R),k.apply(this,arguments)}return(0,Ir.Z)(R,[{key:"render",value:function(){var H=this.props,ee=H.title,le=H.attribute,Te=H.elementRef,st=(0,q.Z)(H,Pe),Be=(0,hr.Z)(st,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,ur.ZP)(!le,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),v.createElement(Gt.Item,(0,A.Z)({},le,{title:typeof ee=="string"?ee:void 0},Be,{ref:Te}))}}]),R}(v.Component),yi=v.forwardRef(function(C,k){var R,z=C.style,H=C.className,ee=C.eventKey,le=C.warnKey,Te=C.disabled,st=C.itemIcon,Be=C.children,vt=C.role,bt=C.onMouseEnter,Dt=C.onMouseLeave,Wt=C.onClick,Ct=C.onKeyDown,qe=C.onFocus,He=(0,q.Z)(C,Zn),et=be(ee),Ye=v.useContext(V),wt=Ye.prefixCls,mt=Ye.onItemClick,Pt=Ye.disabled,zt=Ye.overflowDisabled,Ot=Ye.itemIcon,Bt=Ye.selectedKeys,sr=Ye.onActive,Et=v.useContext(G),tr=Et._internalRenderMenuItem,Zt="".concat(wt,"-item"),Xt=v.useRef(),Hr=v.useRef(),Br=Pt||Te,Or=(0,_r.x1)(k,Hr),yr=Ce(ee),mn=function(An){return{key:ee,keyPath:(0,ue.Z)(yr).reverse(),item:Xt.current,domEvent:An}},Yn=st||Ot,fr=Fn(ee,Br,bt,Dt),Dr=fr.active,fn=(0,q.Z)(fr,bi),Wr=Bt.includes(ee),Mr=Pr(yr.length),Qr=function(An){if(!Br){var Tr=mn(An);Wt==null||Wt(jt(Tr)),mt(Tr)}},xr=function(An){if(Ct==null||Ct(An),An.which===nt.Z.ENTER){var Tr=mn(An);Wt==null||Wt(jt(Tr)),mt(Tr)}},pn=function(An){sr(ee),qe==null||qe(An)},zn={};C.role==="option"&&(zn["aria-selected"]=Wr);var wi=v.createElement(Rn,(0,A.Z)({ref:Xt,elementRef:Or,role:vt===null?"none":vt||"menuitem",tabIndex:Te?null:-1,"data-menu-id":zt&&et?null:et},He,fn,zn,{component:"li","aria-disabled":Te,style:(0,he.Z)((0,he.Z)({},Mr),z),className:_()(Zt,(R={},(0,J.Z)(R,"".concat(Zt,"-active"),Dr),(0,J.Z)(R,"".concat(Zt,"-selected"),Wr),(0,J.Z)(R,"".concat(Zt,"-disabled"),Br),R),H),onClick:Qr,onKeyDown:xr,onFocus:pn}),Be,v.createElement(Kr,{props:(0,he.Z)((0,he.Z)({},C),{},{isSelected:Wr}),icon:Yn}));return tr&&(wi=tr(wi,C,{selected:Wr})),wi});function xi(C,k){var R=C.eventKey,z=Ke(),H=Ce(R);return v.useEffect(function(){if(z)return z.registerPath(R,H),function(){z.unregisterPath(R,H)}},[H]),z?null:v.createElement(yi,(0,A.Z)({},C,{ref:k}))}var jn=v.forwardRef(xi),Ji=["className","children"],ga=function(k,R){var z=k.className,H=k.children,ee=(0,q.Z)(k,Ji),le=v.useContext(V),Te=le.prefixCls,st=le.mode,Be=le.rtl;return v.createElement("ul",(0,A.Z)({className:_()(Te,Be&&"".concat(Te,"-rtl"),"".concat(Te,"-sub"),"".concat(Te,"-").concat(st==="inline"?"inline":"vertical"),z),role:"menu"},ee,{"data-menu-list":!0,ref:R}),H)},Yi=v.forwardRef(ga);Yi.displayName="SubMenuList";var Ki=Yi,an=x(50344);function Ar(C,k){return(0,an.Z)(C).map(function(R,z){if(v.isValidElement(R)){var H,ee,le=R.key,Te=(H=(ee=R.props)===null||ee===void 0?void 0:ee.eventKey)!==null&&H!==void 0?H:le,st=Te==null;st&&(Te="tmp_key-".concat([].concat((0,ue.Z)(k),[z]).join("-")));var Be={key:Te,eventKey:Te};return v.cloneElement(R,Be)}return R})}var kn=x(62709),Jr={adjustX:1,adjustY:1},Hi={topLeft:{points:["bl","tl"],overflow:Jr},topRight:{points:["br","tr"],overflow:Jr},bottomLeft:{points:["tl","bl"],overflow:Jr},bottomRight:{points:["tr","br"],overflow:Jr},leftTop:{points:["tr","tl"],overflow:Jr},leftBottom:{points:["br","bl"],overflow:Jr},rightTop:{points:["tl","tr"],overflow:Jr},rightBottom:{points:["bl","br"],overflow:Jr}},Li={topLeft:{points:["bl","tl"],overflow:Jr},topRight:{points:["br","tr"],overflow:Jr},bottomLeft:{points:["tl","bl"],overflow:Jr},bottomRight:{points:["tr","br"],overflow:Jr},rightTop:{points:["tr","tl"],overflow:Jr},rightBottom:{points:["br","bl"],overflow:Jr},leftTop:{points:["tl","tr"],overflow:Jr},leftBottom:{points:["bl","br"],overflow:Jr}},ua=null;function ci(C,k,R){if(k)return k;if(R)return R[C]||R.other}var Ii={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Na(C){var k=C.prefixCls,R=C.visible,z=C.children,H=C.popup,ee=C.popupStyle,le=C.popupClassName,Te=C.popupOffset,st=C.disabled,Be=C.mode,vt=C.onVisibleChange,bt=v.useContext(V),Dt=bt.getPopupContainer,Wt=bt.rtl,Ct=bt.subMenuOpenDelay,qe=bt.subMenuCloseDelay,He=bt.builtinPlacements,et=bt.triggerSubMenuAction,Ye=bt.forceSubMenuRender,wt=bt.rootClassName,mt=bt.motion,Pt=bt.defaultMotions,zt=v.useState(!1),Ot=(0,U.Z)(zt,2),Bt=Ot[0],sr=Ot[1],Et=Wt?(0,he.Z)((0,he.Z)({},Li),He):(0,he.Z)((0,he.Z)({},Hi),He),tr=Ii[Be],Zt=ci(Be,mt,Pt),Xt=v.useRef(Zt);Be!=="inline"&&(Xt.current=Zt);var Hr=(0,he.Z)((0,he.Z)({},Xt.current),{},{leavedClassName:"".concat(k,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Br=v.useRef();return v.useEffect(function(){return Br.current=(0,dt.Z)(function(){sr(R)}),function(){dt.Z.cancel(Br.current)}},[R]),v.createElement(kn.Z,{prefixCls:k,popupClassName:_()("".concat(k,"-popup"),(0,J.Z)({},"".concat(k,"-rtl"),Wt),le,wt),stretch:Be==="horizontal"?"minWidth":null,getPopupContainer:Dt,builtinPlacements:Et,popupPlacement:tr,popupVisible:Bt,popup:H,popupStyle:ee,popupAlign:Te&&{offset:Te},action:st?[]:[et],mouseEnterDelay:Ct,mouseLeaveDelay:qe,onPopupVisibleChange:vt,forceRender:Ye,popupMotion:Hr,fresh:!0},z)}var Aa=x(62874);function Fa(C){var k=C.id,R=C.open,z=C.keyPath,H=C.children,ee="inline",le=v.useContext(V),Te=le.prefixCls,st=le.forceSubMenuRender,Be=le.motion,vt=le.defaultMotions,bt=le.mode,Dt=v.useRef(!1);Dt.current=bt===ee;var Wt=v.useState(!Dt.current),Ct=(0,U.Z)(Wt,2),qe=Ct[0],He=Ct[1],et=Dt.current?R:!1;v.useEffect(function(){Dt.current&&He(!1)},[bt]);var Ye=(0,he.Z)({},ci(ee,Be,vt));z.length>1&&(Ye.motionAppear=!1);var wt=Ye.onVisibleChanged;return Ye.onVisibleChanged=function(mt){return!Dt.current&&!mt&&He(!0),wt==null?void 0:wt(mt)},qe?null:v.createElement(ye,{mode:ee,locked:!Dt.current},v.createElement(Aa.Z,(0,A.Z)({visible:et},Ye,{forceRender:st,removeOnLeave:!1,leavedClassName:"".concat(Te,"-hidden")}),function(mt){var Pt=mt.className,zt=mt.style;return v.createElement(Ki,{id:k,className:Pt,style:zt},H)}))}var Rr=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],lo=["active"],bo=function(k){var R,z=k.style,H=k.className,ee=k.title,le=k.eventKey,Te=k.warnKey,st=k.disabled,Be=k.internalPopupClose,vt=k.children,bt=k.itemIcon,Dt=k.expandIcon,Wt=k.popupClassName,Ct=k.popupOffset,qe=k.popupStyle,He=k.onClick,et=k.onMouseEnter,Ye=k.onMouseLeave,wt=k.onTitleClick,mt=k.onTitleMouseEnter,Pt=k.onTitleMouseLeave,zt=(0,q.Z)(k,Rr),Ot=be(le),Bt=v.useContext(V),sr=Bt.prefixCls,Et=Bt.mode,tr=Bt.openKeys,Zt=Bt.disabled,Xt=Bt.overflowDisabled,Hr=Bt.activeKey,Br=Bt.selectedKeys,Or=Bt.itemIcon,yr=Bt.expandIcon,mn=Bt.onItemClick,Yn=Bt.onOpenChange,fr=Bt.onActive,Dr=v.useContext(G),fn=Dr._internalRenderSubMenuItem,Wr=v.useContext(kt),Mr=Wr.isSubPathKey,Qr=Ce(),xr="".concat(sr,"-submenu"),pn=Zt||st,zn=v.useRef(),wi=v.useRef(),Ti=bt!=null?bt:Or,An=Dt!=null?Dt:yr,Tr=tr.includes(le),Si=!Xt&&Tr,Vr=Mr(Br,le),gn=Fn(le,pn,mt,Pt),_n=gn.active,On=(0,q.Z)(gn,lo),di=v.useState(!1),fi=(0,U.Z)(di,2),pi=fi[0],ra=fi[1],Zi=function(oi){pn||ra(oi)},vn=function(oi){Zi(!0),et==null||et({key:le,domEvent:oi})},Mn=function(oi){Zi(!1),Ye==null||Ye({key:le,domEvent:oi})},wr=v.useMemo(function(){return _n||(Et!=="inline"?pi||Mr([Hr],le):!1)},[Et,_n,Hr,pi,le,Mr]),Kn=Pr(Qr.length),Dn=function(oi){pn||(wt==null||wt({key:le,domEvent:oi}),Et==="inline"&&Yn(le,!Tr))},Hn=at(function(hi){He==null||He(jt(hi)),mn(hi)}),ai=function(oi){Et!=="inline"&&Yn(le,oi)},na=function(){fr(le)},Ln=Ot&&"".concat(Ot,"-popup"),ia=v.createElement("div",(0,A.Z)({role:"menuitem",style:Kn,className:"".concat(xr,"-title"),tabIndex:pn?null:-1,ref:zn,title:typeof ee=="string"?ee:null,"data-menu-id":Xt&&Ot?null:Ot,"aria-expanded":Si,"aria-haspopup":!0,"aria-controls":Ln,"aria-disabled":pn,onClick:Dn,onFocus:na},On),ee,v.createElement(Kr,{icon:Et!=="horizontal"?An:void 0,props:(0,he.Z)((0,he.Z)({},k),{},{isOpen:Si,isSubMenu:!0})},v.createElement("i",{className:"".concat(xr,"-arrow")}))),In=v.useRef(Et);if(Et!=="inline"&&Qr.length>1?In.current="vertical":In.current=Et,!Xt){var aa=In.current;ia=v.createElement(Na,{mode:aa,prefixCls:xr,visible:!Be&&Si&&Et!=="inline",popupClassName:Wt,popupOffset:Ct,popupStyle:qe,popup:v.createElement(ye,{mode:aa==="horizontal"?"vertical":aa},v.createElement(Ki,{id:Ln,ref:wi},vt)),disabled:pn,onVisibleChange:ai},ia)}var $i=v.createElement(Gt.Item,(0,A.Z)({role:"none"},zt,{component:"li",style:z,className:_()(xr,"".concat(xr,"-").concat(Et),H,(R={},(0,J.Z)(R,"".concat(xr,"-open"),Si),(0,J.Z)(R,"".concat(xr,"-active"),wr),(0,J.Z)(R,"".concat(xr,"-selected"),Vr),(0,J.Z)(R,"".concat(xr,"-disabled"),pn),R)),onMouseEnter:vn,onMouseLeave:Mn}),ia,!Xt&&v.createElement(Fa,{id:Ln,open:Si,keyPath:Qr},vt));return fn&&($i=fn($i,k,{selected:Vr,active:wr,open:Si,disabled:pn})),v.createElement(ye,{onItemClick:Hn,mode:Et==="horizontal"?"vertical":Et,itemIcon:Ti,expandIcon:An},$i)};function Qi(C){var k=C.eventKey,R=C.children,z=Ce(k),H=Ar(R,z),ee=Ke();v.useEffect(function(){if(ee)return ee.registerPath(k,z),function(){ee.unregisterPath(k,z)}},[z]);var le;return ee?le=H:le=v.createElement(bo,C,H),v.createElement(Fe.Provider,{value:z},le)}var Wi=x(71002),Gn=["className","title","eventKey","children"],va=["children"],ba=function(k){var R=k.className,z=k.title,H=k.eventKey,ee=k.children,le=(0,q.Z)(k,Gn),Te=v.useContext(V),st=Te.prefixCls,Be="".concat(st,"-item-group");return v.createElement("li",(0,A.Z)({role:"presentation"},le,{onClick:function(bt){return bt.stopPropagation()},className:_()(Be,R)}),v.createElement("div",{role:"presentation",className:"".concat(Be,"-title"),title:typeof z=="string"?z:void 0},z),v.createElement("ul",{role:"group",className:"".concat(Be,"-list")},ee))};function ea(C){var k=C.children,R=(0,q.Z)(C,va),z=Ce(R.eventKey),H=Ar(k,z),ee=Ke();return ee?H:v.createElement(ba,(0,hr.Z)(R,["warnKey"]),H)}function qn(C){var k=C.className,R=C.style,z=v.useContext(V),H=z.prefixCls,ee=Ke();return ee?null:v.createElement("li",{role:"separator",className:_()("".concat(H,"-item-divider"),k),style:R})}var Vi=["label","children","key","type"];function Bi(C){return(C||[]).map(function(k,R){if(k&&(0,Wi.Z)(k)==="object"){var z=k,H=z.label,ee=z.children,le=z.key,Te=z.type,st=(0,q.Z)(z,Vi),Be=le!=null?le:"tmp-".concat(R);return ee||Te==="group"?Te==="group"?v.createElement(ea,(0,A.Z)({key:Be},st,{title:H}),Bi(ee)):v.createElement(Qi,(0,A.Z)({key:Be},st,{title:H}),Bi(ee)):Te==="divider"?v.createElement(qn,(0,A.Z)({key:Be},st)):v.createElement(jn,(0,A.Z)({key:Be},st),H)}return null}).filter(function(k){return k})}function ui(C,k,R){var z=C;return k&&(z=Bi(k)),Ar(z,R)}var ii=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],da=[],ta=v.forwardRef(function(C,k){var R,z,H=C,ee=H.prefixCls,le=ee===void 0?"rc-menu":ee,Te=H.rootClassName,st=H.style,Be=H.className,vt=H.tabIndex,bt=vt===void 0?0:vt,Dt=H.items,Wt=H.children,Ct=H.direction,qe=H.id,He=H.mode,et=He===void 0?"vertical":He,Ye=H.inlineCollapsed,wt=H.disabled,mt=H.disabledOverflow,Pt=H.subMenuOpenDelay,zt=Pt===void 0?.1:Pt,Ot=H.subMenuCloseDelay,Bt=Ot===void 0?.1:Ot,sr=H.forceSubMenuRender,Et=H.defaultOpenKeys,tr=H.openKeys,Zt=H.activeKey,Xt=H.defaultActiveFirst,Hr=H.selectable,Br=Hr===void 0?!0:Hr,Or=H.multiple,yr=Or===void 0?!1:Or,mn=H.defaultSelectedKeys,Yn=H.selectedKeys,fr=H.onSelect,Dr=H.onDeselect,fn=H.inlineIndent,Wr=fn===void 0?24:fn,Mr=H.motion,Qr=H.defaultMotions,xr=H.triggerSubMenuAction,pn=xr===void 0?"hover":xr,zn=H.builtinPlacements,wi=H.itemIcon,Ti=H.expandIcon,An=H.overflowedIndicator,Tr=An===void 0?"...":An,Si=H.overflowedIndicatorPopupClassName,Vr=H.getPopupContainer,gn=H.onClick,_n=H.onOpenChange,On=H.onKeyDown,di=H.openAnimation,fi=H.openTransitionName,pi=H._internalRenderMenuItem,ra=H._internalRenderSubMenuItem,Zi=(0,q.Z)(H,ii),vn=v.useMemo(function(){return ui(Wt,Dt,da)},[Wt,Dt]),Mn=v.useState(!1),wr=(0,U.Z)(Mn,2),Kn=wr[0],Dn=wr[1],Hn=v.useRef(),ai=Jt(qe),na=Ct==="rtl",Ln=(0,cr.Z)(Et,{value:tr,postState:function($r){return $r||da}}),ia=(0,U.Z)(Ln,2),In=ia[0],aa=ia[1],$i=function($r){var sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Wn(){aa($r),_n==null||_n($r)}sn?(0,T.flushSync)(Wn):Wn()},hi=v.useState(In),oi=(0,U.Z)(hi,2),fa=oi[0],qa=oi[1],ji=v.useRef(!1),ya=v.useMemo(function(){return(et==="inline"||et==="vertical")&&Ye?["vertical",Ye]:[et,!1]},[et,Ye]),xa=(0,U.Z)(ya,2),mi=xa[0],Da=xa[1],oa=mi==="inline",La=v.useState(mi),lr=(0,U.Z)(La,2),ir=lr[0],on=lr[1],Pi=v.useState(Da),Ri=(0,U.Z)(Pi,2),Oi=Ri[0],Ia=Ri[1];v.useEffect(function(){on(mi),Ia(Da),ji.current&&(oa?aa(fa):$i(da))},[mi,Da]);var Xa=v.useState(0),co=(0,U.Z)(Xa,2),Ba=co[0],uo=co[1],Gr=Ba>=vn.length-1||ir!=="horizontal"||mt;v.useEffect(function(){oa&&qa(In)},[In]),v.useEffect(function(){return ji.current=!0,function(){ji.current=!1}},[]);var pr=Ee(),Bn=pr.registerPath,Qn=pr.unregisterPath,sa=pr.refreshOverflowKeys,gi=pr.isSubPathKey,ss=pr.getKeyPath,al=pr.getKeys,ol=pr.getSubPathKeys,sl=v.useMemo(function(){return{registerPath:Bn,unregisterPath:Qn}},[Bn,Qn]),ll=v.useMemo(function(){return{isSubPathKey:gi}},[gi]);v.useEffect(function(){sa(Gr?da:vn.slice(Ba+1).map(function(bn){return bn.key}))},[Ba,Gr]);var cl=(0,cr.Z)(Zt||Xt&&((R=vn[0])===null||R===void 0?void 0:R.key),{value:Zt}),ls=(0,U.Z)(cl,2),za=ls[0],cs=ls[1],ul=at(function(bn){cs(bn)}),dl=at(function(){cs(void 0)});(0,v.useImperativeHandle)(k,function(){return{list:Hn.current,focus:function($r){var sn,Wn=za!=null?za:(sn=vn.find(function(Wo){return!Wo.props.disabled}))===null||sn===void 0?void 0:sn.key;if(Wn){var ei,$a,_i;(ei=Hn.current)===null||ei===void 0||($a=ei.querySelector("li[data-menu-id='".concat(ut(ai,Wn),"']")))===null||$a===void 0||(_i=$a.focus)===null||_i===void 0||_i.call($a,$r)}}}});var fl=(0,cr.Z)(mn||[],{value:Yn,postState:function($r){return Array.isArray($r)?$r:$r==null?da:[$r]}}),ks=(0,U.Z)(fl,2),Nn=ks[0],Ka=ks[1],Ta=function($r){if(Br){var sn=$r.key,Wn=Nn.includes(sn),ei;yr?Wn?ei=Nn.filter(function(_i){return _i!==sn}):ei=[].concat((0,ue.Z)(Nn),[sn]):ei=[sn],Ka(ei);var $a=(0,he.Z)((0,he.Z)({},$r),{},{selectedKeys:ei});Wn?Dr==null||Dr($a):fr==null||fr($a)}!yr&&In.length&&ir!=="inline"&&$i(da)},As=at(function(bn){gn==null||gn(jt(bn)),Ta(bn)}),us=at(function(bn,$r){var sn=In.filter(function(ei){return ei!==bn});if($r)sn.push(bn);else if(ir!=="inline"){var Wn=ol(bn);sn=sn.filter(function(ei){return!Wn.has(ei)})}(0,rr.Z)(In,sn,!0)||$i(sn,!0)}),Ds=function($r,sn){var Wn=sn!=null?sn:!In.includes($r);us($r,Wn)},vc=hn(ir,za,na,ai,Hn,al,ss,cs,Ds,On);v.useEffect(function(){Dn(!0)},[]);var Ls=v.useMemo(function(){return{_internalRenderMenuItem:pi,_internalRenderSubMenuItem:ra}},[pi,ra]),pl=ir!=="horizontal"||mt?vn:vn.map(function(bn,$r){return v.createElement(ye,{key:bn.key,overflowDisabled:$r>Ba},bn)}),hl=v.createElement(Gt,(0,A.Z)({id:qe,ref:Hn,prefixCls:"".concat(le,"-overflow"),component:"ul",itemComponent:jn,className:_()(le,"".concat(le,"-root"),"".concat(le,"-").concat(ir),Be,(z={},(0,J.Z)(z,"".concat(le,"-inline-collapsed"),Oi),(0,J.Z)(z,"".concat(le,"-rtl"),na),z),Te),dir:Ct,style:st,role:"menu",tabIndex:bt,data:pl,renderRawItem:function($r){return $r},renderRawRest:function($r){var sn=$r.length,Wn=sn?vn.slice(-sn):null;return v.createElement(Qi,{eventKey:me,title:Tr,disabled:Gr,internalPopupClose:sn===0,popupClassName:Si},Wn)},maxCount:ir!=="horizontal"||mt?Gt.INVALIDATE:Gt.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function($r){uo($r)},onKeyDown:vc},Zi));return v.createElement(G.Provider,{value:Ls},v.createElement(ar.Provider,{value:ai},v.createElement(ye,{prefixCls:le,rootClassName:Te,mode:ir,openKeys:In,rtl:na,disabled:wt,motion:Kn?Mr:null,defaultMotions:Kn?Qr:null,activeKey:za,onActive:ul,onInactive:dl,selectedKeys:Nn,inlineIndent:Wr,subMenuOpenDelay:zt,subMenuCloseDelay:Bt,forceSubMenuRender:sr,builtinPlacements:zn,triggerSubMenuAction:pn,getPopupContainer:Vr,itemIcon:wi,expandIcon:Ti,onItemClick:As,onOpenChange:us},v.createElement(kt.Provider,{value:ll},hl),v.createElement("div",{style:{display:"none"},"aria-hidden":!0},v.createElement(ne.Provider,{value:sl},vn)))))}),Ui=ta,b=Ui;b.Item=jn,b.SubMenu=Qi,b.ItemGroup=ea,b.Divider=qn;var M=b},66680:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return J}});var A=x(67294);function J(he){var ue=A.useRef();ue.current=he;var U=A.useCallback(function(){for(var q,ce=arguments.length,_=new Array(ce),v=0;v<ce;v++)_[v]=arguments[v];return(q=ue.current)===null||q===void 0?void 0:q.call.apply(q,[ue].concat(_))},[]);return U}},21770:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return q}});var A=x(97685),J=x(66680),he=x(8410),ue=x(63896);function U(ce){return ce!==void 0}function q(ce,_){var v=_||{},De=v.defaultValue,Ne=v.value,L=v.onChange,Le=v.postState,Re=(0,ue.Z)(function(){return U(Ne)?Ne:U(De)?typeof De=="function"?De():De:typeof ce=="function"?ce():ce}),pt=(0,A.Z)(Re,2),lt=pt[0],Z=pt[1],Ie=Ne!==void 0?Ne:lt,Ht=Le?Le(Ie):Ie,Se=(0,J.Z)(L),pe=(0,ue.Z)([Ie]),T=(0,A.Z)(pe,2),F=T[0],ie=T[1];(0,he.o)(function(){var ze=F[0];lt!==ze&&Se(lt,ze)},[F]),(0,he.o)(function(){U(Ne)||Z(Ne)},[Ne]);var j=(0,J.Z)(function(ze,tt){Z(ze,tt),ie([Ie],tt)});return[Ht,j]}},91881:function(er,ft,x){"use strict";var A=x(71002),J=x(80334);function he(ue,U){var q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ce=new Set;function _(v,De){var Ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=ce.has(v);if((0,J.ZP)(!L,"Warning: There may be circular references"),L)return!1;if(v===De)return!0;if(q&&Ne>1)return!1;ce.add(v);var Le=Ne+1;if(Array.isArray(v)){if(!Array.isArray(De)||v.length!==De.length)return!1;for(var Re=0;Re<v.length;Re++)if(!_(v[Re],De[Re],Le))return!1;return!0}if(v&&De&&(0,A.Z)(v)==="object"&&(0,A.Z)(De)==="object"){var pt=Object.keys(v);return pt.length!==Object.keys(De).length?!1:pt.every(function(lt){return _(v[lt],De[lt],Le)})}return!1}return _(ue,U)}ft.Z=he},98423:function(er,ft,x){"use strict";x.d(ft,{Z:function(){return J}});var A=x(1413);function J(he,ue){var U=(0,A.Z)({},he);return Array.isArray(ue)&&ue.forEach(function(q){delete U[q]}),U}},66012:function(er,ft,x){"use strict";x.d(ft,{Z5:function(){return L0},_l:function(){return qr},bK:function(){return Cn}});var A=x(67294),J=x(89611);function he(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,(0,J.Z)(o,l)}var ue=x(87462),U=x(14890),q=A.createContext(null),ce=null;function _(o){o()}var v=_,De=function(l){return v=l},Ne=function(){return v};function L(){var o=Ne(),l=null,c=null;return{clear:function(){l=null,c=null},notify:function(){o(function(){for(var m=l;m;)m.callback(),m=m.next})},get:function(){for(var m=[],g=l;g;)m.push(g),g=g.next;return m},subscribe:function(m){var g=!0,y=c={callback:m,next:null,prev:c};return y.prev?y.prev.next=y:l=y,function(){!g||l===null||(g=!1,y.next?y.next.prev=y.prev:c=y.prev,y.prev?y.prev.next=y.next:l=y.next)}}}}var Le={notify:function(){},get:function(){return[]}};function Re(o,l){var c,f=Le;function m(I){return B(),f.subscribe(I)}function g(){f.notify()}function y(){E.onStateChange&&E.onStateChange()}function w(){return!!c}function B(){c||(c=l?l.addNestedSub(y):o.subscribe(y),f=L())}function N(){c&&(c(),c=void 0,f.clear(),f=Le)}var E={addNestedSub:m,notifyNestedSubs:g,handleChangeWrapper:y,isSubscribed:w,trySubscribe:B,tryUnsubscribe:N,getListeners:function(){return f}};return E}var pt=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?A.useLayoutEffect:A.useEffect;function lt(o){var l=o.store,c=o.context,f=o.children,m=(0,A.useMemo)(function(){var w=Re(l);return{store:l,subscription:w}},[l]),g=(0,A.useMemo)(function(){return l.getState()},[l]);pt(function(){var w=m.subscription;return w.onStateChange=w.notifyNestedSubs,w.trySubscribe(),g!==l.getState()&&w.notifyNestedSubs(),function(){w.tryUnsubscribe(),w.onStateChange=null}},[m,g]);var y=c||q;return A.createElement(y.Provider,{value:m},f)}var Z=lt,Ie=x(63366),Ht=x(8679),Se=x.n(Ht),pe=x(72973),T=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],F=["reactReduxForwardedRef"],ie=[],j=[null,null],ze=function(l){try{return JSON.stringify(l)}catch(c){return String(l)}};function tt(o,l){var c=o[1];return[l.payload,c+1]}function Nt(o,l,c){pt(function(){return o.apply(void 0,l)},c)}function gt(o,l,c,f,m,g,y){o.current=f,l.current=m,c.current=!1,g.current&&(g.current=null,y())}function Me(o,l,c,f,m,g,y,w,B,N){if(o){var E=!1,I=null,$=function(){if(!E){var We=l.getState(),Ge,Qe;try{Ge=f(We,m.current)}catch(xt){Qe=xt,I=xt}Qe||(I=null),Ge===g.current?y.current||B():(g.current=Ge,w.current=Ge,y.current=!0,N({type:"STORE_UPDATED",payload:{error:Qe}}))}};c.onStateChange=$,c.trySubscribe(),$();var W=function(){if(E=!0,c.tryUnsubscribe(),c.onStateChange=null,I)throw I};return W}}var _e=function(){return[null,0]};function Je(o,l){l===void 0&&(l={});var c=l,f=c.getDisplayName,m=f===void 0?function(Ft){return"ConnectAdvanced("+Ft+")"}:f,g=c.methodName,y=g===void 0?"connectAdvanced":g,w=c.renderCountProp,B=w===void 0?void 0:w,N=c.shouldHandleStateChanges,E=N===void 0?!0:N,I=c.storeKey,$=I===void 0?"store":I,W=c.withRef,oe=W===void 0?!1:W,We=c.forwardRef,Ge=We===void 0?!1:We,Qe=c.context,xt=Qe===void 0?q:Qe,Lt=(0,Ie.Z)(c,T);if(0)var Rt;var Yt=xt;return function(mr){var Tn=mr.displayName||mr.name||"Component",gr=m(Tn),Ur=(0,ue.Z)({},Lt,{getDisplayName:m,methodName:y,renderCountProp:B,shouldHandleStateChanges:E,storeKey:$,displayName:gr,wrappedComponentName:Tn,WrappedComponent:mr}),Ci=Lt.pure;function ri(Fi){return o(Fi.dispatch,Ur)}var pa=Ci?A.useMemo:function(Fi){return Fi()};function Ra(Fi){var Lo=(0,A.useMemo)(function(){var Us=Fi.reactReduxForwardedRef,Zs=(0,Ie.Z)(Fi,F);return[Fi.context,Us,Zs]},[Fi]),no=Lo[0],mo=Lo[1],Wa=Lo[2],io=(0,A.useMemo)(function(){return no&&no.Consumer&&(0,pe.isContextConsumer)(A.createElement(no.Consumer,null))?no:Yt},[no,Yt]),Xi=(0,A.useContext)(io),ha=!!Fi.store&&!!Fi.store.getState&&!!Fi.store.dispatch,Gl=!!Xi&&!!Xi.store,Va=ha?Fi.store:Xi.store,rs=(0,A.useMemo)(function(){return ri(Va)},[Va]),Ws=(0,A.useMemo)(function(){if(!E)return j;var Us=Re(Va,ha?null:Xi.subscription),Zs=Us.notifyNestedSubs.bind(Us);return[Us,Zs]},[Va,ha,Xi]),ws=Ws[0],ql=Ws[1],Xl=(0,A.useMemo)(function(){return ha?Xi:(0,ue.Z)({},Xi,{subscription:ws})},[ha,Xi,ws]),Dd=(0,A.useReducer)(tt,ie,_e),J0=Dd[0],Vs=J0[0],Y0=Dd[1];if(Vs&&Vs.error)throw Vs.error;var Ld=(0,A.useRef)(),Jc=(0,A.useRef)(Wa),Jl=(0,A.useRef)(),Id=(0,A.useRef)(!1),Yl=pa(function(){return Jl.current&&Wa===Jc.current?Jl.current:rs(Va.getState(),Wa)},[Va,Vs,Wa]);Nt(gt,[Jc,Ld,Id,Wa,Yl,Jl,ql]),Nt(Me,[E,Va,ws,rs,Jc,Ld,Id,Jl,ql,Y0],[Va,ws,rs]);var Yc=(0,A.useMemo)(function(){return A.createElement(mr,(0,ue.Z)({},Yl,{ref:mo}))},[mo,mr,Yl]),Q0=(0,A.useMemo)(function(){return E?A.createElement(io.Provider,{value:Xl},Yc):Yc},[io,Yc,Xl]);return Q0}var Ma=Ci?A.memo(Ra):Ra;if(Ma.WrappedComponent=mr,Ma.displayName=Ra.displayName=gr,Ge){var Ca=A.forwardRef(function(Lo,no){return A.createElement(Ma,(0,ue.Z)({},Lo,{reactReduxForwardedRef:no}))});return Ca.displayName=gr,Ca.WrappedComponent=mr,Se()(Ca,mr)}return Se()(Ma,mr)}}function re(o,l){return o===l?o!==0||l!==0||1/o===1/l:o!==o&&l!==l}function Ue(o,l){if(re(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var c=Object.keys(o),f=Object.keys(l);if(c.length!==f.length)return!1;for(var m=0;m<c.length;m++)if(!Object.prototype.hasOwnProperty.call(l,c[m])||!re(o[c[m]],l[c[m]]))return!1;return!0}function rt(o,l){var c={},f=function(y){var w=o[y];typeof w=="function"&&(c[y]=function(){return l(w.apply(void 0,arguments))})};for(var m in o)f(m);return c}function ge(o){return function(c,f){var m=o(c,f);function g(){return m}return g.dependsOnOwnProps=!1,g}}function Ae(o){return o.dependsOnOwnProps!==null&&o.dependsOnOwnProps!==void 0?!!o.dependsOnOwnProps:o.length!==1}function ve(o,l){return function(f,m){var g=m.displayName,y=function(B,N){return y.dependsOnOwnProps?y.mapToProps(B,N):y.mapToProps(B)};return y.dependsOnOwnProps=!0,y.mapToProps=function(B,N){y.mapToProps=o,y.dependsOnOwnProps=Ae(o);var E=y(B,N);return typeof E=="function"&&(y.mapToProps=E,y.dependsOnOwnProps=Ae(E),E=y(B,N)),E},y}}function fe(o){return typeof o=="function"?ve(o,"mapDispatchToProps"):void 0}function ot(o){return o?void 0:ge(function(l){return{dispatch:l}})}function Ze(o){return o&&typeof o=="object"?ge(function(l){return rt(o,l)}):void 0}var Oe=[fe,ot,Ze];function xe(o){return typeof o=="function"?ve(o,"mapStateToProps"):void 0}function yt(o){return o?void 0:ge(function(){return{}})}var ht=[xe,yt];function Ut(o,l,c){return(0,ue.Z)({},c,o,l)}function Gt(o){return function(c,f){var m=f.displayName,g=f.pure,y=f.areMergedPropsEqual,w=!1,B;return function(E,I,$){var W=o(E,I,$);return w?(!g||!y(W,B))&&(B=W):(w=!0,B=W),B}}}function cr(o){return typeof o=="function"?Gt(o):void 0}function ur(o){return o?void 0:function(){return Ut}}var rr=[cr,ur],ar=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function ut(o,l,c,f){return function(g,y){return c(o(g,y),l(f,y),y)}}function be(o,l,c,f,m){var g=m.areStatesEqual,y=m.areOwnPropsEqual,w=m.areStatePropsEqual,B=!1,N,E,I,$,W;function oe(Lt,Rt){return N=Lt,E=Rt,I=o(N,E),$=l(f,E),W=c(I,$,E),B=!0,W}function We(){return I=o(N,E),l.dependsOnOwnProps&&($=l(f,E)),W=c(I,$,E),W}function Ge(){return o.dependsOnOwnProps&&(I=o(N,E)),l.dependsOnOwnProps&&($=l(f,E)),W=c(I,$,E),W}function Qe(){var Lt=o(N,E),Rt=!w(Lt,I);return I=Lt,Rt&&(W=c(I,$,E)),W}function xt(Lt,Rt){var Yt=!y(Rt,E),Ft=!g(Lt,N,Rt,E);return N=Lt,E=Rt,Yt&&Ft?We():Yt?Ge():Ft?Qe():W}return function(Rt,Yt){return B?xt(Rt,Yt):oe(Rt,Yt)}}function ae(o,l){var c=l.initMapStateToProps,f=l.initMapDispatchToProps,m=l.initMergeProps,g=(0,Ie.Z)(l,ar),y=c(o,g),w=f(o,g),B=m(o,g),N=g.pure?be:ut;return N(y,w,B,o,g)}var Q=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function V(o,l,c){for(var f=l.length-1;f>=0;f--){var m=l[f](o);if(m)return m}return function(g,y){throw new Error("Invalid value of type "+typeof o+" for "+c+" argument when connecting component "+y.wrappedComponentName+".")}}function Y(o,l){return o===l}function ye(o){var l=o===void 0?{}:o,c=l.connectHOC,f=c===void 0?Je:c,m=l.mapStateToPropsFactories,g=m===void 0?ht:m,y=l.mapDispatchToPropsFactories,w=y===void 0?Oe:y,B=l.mergePropsFactories,N=B===void 0?rr:B,E=l.selectorFactory,I=E===void 0?ae:E;return function(W,oe,We,Ge){Ge===void 0&&(Ge={});var Qe=Ge,xt=Qe.pure,Lt=xt===void 0?!0:xt,Rt=Qe.areStatesEqual,Yt=Rt===void 0?Y:Rt,Ft=Qe.areOwnPropsEqual,mr=Ft===void 0?Ue:Ft,Tn=Qe.areStatePropsEqual,gr=Tn===void 0?Ue:Tn,Ur=Qe.areMergedPropsEqual,Ci=Ur===void 0?Ue:Ur,ri=(0,Ie.Z)(Qe,Q),pa=V(W,g,"mapStateToProps"),Ra=V(oe,w,"mapDispatchToProps"),Ma=V(We,N,"mergeProps");return f(I,(0,ue.Z)({methodName:"connect",getDisplayName:function(Fi){return"Connect("+Fi+")"},shouldHandleStateChanges:!!W,initMapStateToProps:pa,initMapDispatchToProps:Ra,initMergeProps:Ma,pure:Lt,areStatesEqual:Yt,areOwnPropsEqual:mr,areStatePropsEqual:gr,areMergedPropsEqual:Ci},ri))}}var te=ye();function ne(){var o=useContext(ReactReduxContext);return o}function Ke(o){o===void 0&&(o=ReactReduxContext);var l=o===ReactReduxContext?useDefaultReduxContext:function(){return useContext(o)};return function(){var f=l(),m=f.store;return m}}var Fe=null;function Ce(o){o===void 0&&(o=ReactReduxContext);var l=o===ReactReduxContext?useDefaultStore:createStoreHook(o);return function(){var f=l();return f.dispatch}}var kt=null,$t=function(l,c){return l===c};function G(o,l,c,f){var m=useReducer(function(oe){return oe+1},0),g=m[1],y=useMemo(function(){return createSubscription(c,f)},[c,f]),w=useRef(),B=useRef(),N=useRef(),E=useRef(),I=c.getState(),$;try{if(o!==B.current||I!==N.current||w.current){var W=o(I);E.current===void 0||!l(W,E.current)?$=W:$=E.current}else $=E.current}catch(oe){throw w.current&&(oe.message+=`
|
|
|
The error may be correlated with this previous error:
|
|
|
`+w.current.stack+`
|
|
|
|
|
|
`),oe}return useIsomorphicLayoutEffect(function(){B.current=o,N.current=I,E.current=$,w.current=void 0}),useIsomorphicLayoutEffect(function(){function oe(){try{var We=c.getState();if(We===N.current)return;var Ge=B.current(We);if(l(Ge,E.current))return;E.current=Ge,N.current=We}catch(Qe){w.current=Qe}g()}return y.onStateChange=oe,y.trySubscribe(),oe(),function(){return y.tryUnsubscribe()}},[c,y]),$}function nt(o){o===void 0&&(o=ReactReduxContext);var l=o===ReactReduxContext?useDefaultReduxContext:function(){return useContext(o)};return function(f,m){m===void 0&&(m=$t);var g=l(),y=g.store,w=g.subscription,B=G(f,m,y,w);return useDebugValue(B),B}}var dt=null,qt=x(73935);De(qt.unstable_batchedUpdates);function vr(o,l){if(o.length!==l.length)return!1;for(var c=0;c<o.length;c++)if(o[c]!==l[c])return!1;return!0}function or(o,l){var c=(0,A.useState)(function(){return{inputs:l,result:o()}})[0],f=(0,A.useRef)(!0),m=(0,A.useRef)(c),g=f.current||!!(l&&m.current.inputs&&vr(l,m.current.inputs)),y=g?m.current:{inputs:l,result:o()};return(0,A.useEffect)(function(){f.current=!1,m.current=y},[y]),y.result}function tn(o,l){return or(function(){return o},l)}var Vt=or,ct=tn,rn=!0,nn="Invariant failed";function br(o,l){if(!o){if(rn)throw new Error(nn);var c=typeof l=="function"?l():l,f=c?"".concat(nn,": ").concat(c):nn;throw new Error(f)}}var dr=function(l){var c=l.top,f=l.right,m=l.bottom,g=l.left,y=f-g,w=m-c,B={top:c,right:f,bottom:m,left:g,width:y,height:w,x:g,y:c,center:{x:(f+g)/2,y:(m+c)/2}};return B},Xr=function(l,c){return{top:l.top-c.top,left:l.left-c.left,bottom:l.bottom+c.bottom,right:l.right+c.right}},It=function(l,c){return{top:l.top+c.top,left:l.left+c.left,bottom:l.bottom-c.bottom,right:l.right-c.right}},$n=function(l,c){return{top:l.top+c.y,left:l.left+c.x,bottom:l.bottom+c.y,right:l.right+c.x}},dn={top:0,right:0,bottom:0,left:0},wn=function(l){var c=l.borderBox,f=l.margin,m=f===void 0?dn:f,g=l.border,y=g===void 0?dn:g,w=l.padding,B=w===void 0?dn:w,N=dr(Xr(c,m)),E=dr(It(c,y)),I=dr(It(E,B));return{marginBox:N,borderBox:dr(c),paddingBox:E,contentBox:I,margin:m,border:y,padding:B}},jr=function(l){var c=l.slice(0,-2),f=l.slice(-2);if(f!=="px")return 0;var m=Number(c);return isNaN(m)&&br(!1),m},Lr=function(){return{x:window.pageXOffset,y:window.pageYOffset}},At=function(l,c){var f=l.borderBox,m=l.border,g=l.margin,y=l.padding,w=$n(f,c);return wn({borderBox:w,border:m,margin:g,padding:y})},Fr=function(l,c){return c===void 0&&(c=Lr()),At(l,c)},vi=function(l,c){var f={top:jr(c.marginTop),right:jr(c.marginRight),bottom:jr(c.marginBottom),left:jr(c.marginLeft)},m={top:jr(c.paddingTop),right:jr(c.paddingRight),bottom:jr(c.paddingBottom),left:jr(c.paddingLeft)},g={top:jr(c.borderTopWidth),right:jr(c.borderRightWidth),bottom:jr(c.borderBottomWidth),left:jr(c.borderLeftWidth)};return wn({borderBox:l,margin:f,padding:m,border:g})},ni=function(l){var c=l.getBoundingClientRect(),f=window.getComputedStyle(l);return vi(c,f)},li=Number.isNaN||function(l){return typeof l=="number"&&l!==l};function hn(o,l){return!!(o===l||li(o)&&li(l))}function Di(o,l){if(o.length!==l.length)return!1;for(var c=0;c<o.length;c++)if(!hn(o[c],l[c]))return!1;return!0}function Sn(o,l){l===void 0&&(l=Di);var c,f=[],m,g=!1;function y(){for(var w=[],B=0;B<arguments.length;B++)w[B]=arguments[B];return g&&c===this&&l(w,f)||(m=o.apply(this,w),g=!0,c=this,f=w),m}return y}var K=Sn,X=function(l){var c=[],f=null,m=function(){for(var y=arguments.length,w=new Array(y),B=0;B<y;B++)w[B]=arguments[B];c=w,!f&&(f=requestAnimationFrame(function(){f=null,l.apply(void 0,c)}))};return m.cancel=function(){f&&(cancelAnimationFrame(f),f=null)},m},me=X,Ee=!0,at=/[ \t]{2,}/g,Mt=/^[ \t]*/gm,Qt=function(l){return l.replace(at," ").replace(Mt,"").trim()},Jt=function(l){return Qt(`
|
|
|
%creact-beautiful-dnd
|
|
|
|
|
|
%c`+Qt(l)+`
|
|
|
|
|
|
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
|
|
|
`)},zr=function(l){return[Jt(l),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},Ir="__react-beautiful-dnd-disable-dev-warnings";function nr(o,l){var c;Ee||typeof window!="undefined"&&window[Ir]||(c=console)[o].apply(c,zr(l))}var Yr=nr.bind(null,"warn"),hr=nr.bind(null,"error");function _r(){}function Fn(o,l){return(0,ue.Z)({},o,{},l)}function Pr(o,l,c){var f=l.map(function(m){var g=Fn(c,m.options);return o.addEventListener(m.eventName,m.fn,g),function(){o.removeEventListener(m.eventName,m.fn,g)}});return function(){f.forEach(function(g){g()})}}var Kr=!0,Pn="Invariant failed";function jt(o){this.message=o}jt.prototype.toString=function(){return this.message};function Pe(o,l){if(!o)throw Kr?new jt(Pn):new jt(Pn+": "+(l||""))}var Zn=function(o){he(l,o);function l(){for(var f,m=arguments.length,g=new Array(m),y=0;y<m;y++)g[y]=arguments[y];return f=o.call.apply(o,[this].concat(g))||this,f.callbacks=null,f.unbind=_r,f.onWindowError=function(w){var B=f.getCallbacks();B.isDragging()&&B.tryAbort();var N=w.error;N instanceof jt&&w.preventDefault()},f.getCallbacks=function(){if(!f.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return f.callbacks},f.setCallbacks=function(w){f.callbacks=w},f}var c=l.prototype;return c.componentDidMount=function(){this.unbind=Pr(window,[{eventName:"error",fn:this.onWindowError}])},c.componentWillUnmount=function(){this.unbind()},c.componentDidCatch=function(m){if(m instanceof jt){this.setState({});return}throw m},c.render=function(){return this.props.children(this.setCallbacks)},l}(A.Component),bi=`
|
|
|
Press space bar to start a drag.
|
|
|
When dragging you can use the arrow keys to move the item around and escape to cancel.
|
|
|
Some screen readers may require you to be in focus mode or to use your pass through key
|
|
|
`,Rn=function(l){return l+1},yi=function(l){return`
|
|
|
You have lifted an item in position `+Rn(l.source.index)+`
|
|
|
`},xi=function(l,c){var f=l.droppableId===c.droppableId,m=Rn(l.index),g=Rn(c.index);return f?`
|
|
|
You have moved the item from position `+m+`
|
|
|
to position `+g+`
|
|
|
`:`
|
|
|
You have moved the item from position `+m+`
|
|
|
in list `+l.droppableId+`
|
|
|
to list `+c.droppableId+`
|
|
|
in position `+g+`
|
|
|
`},jn=function(l,c,f){var m=c.droppableId===f.droppableId;return m?`
|
|
|
The item `+l+`
|
|
|
has been combined with `+f.draggableId:`
|
|
|
The item `+l+`
|
|
|
in list `+c.droppableId+`
|
|
|
has been combined with `+f.draggableId+`
|
|
|
in list `+f.droppableId+`
|
|
|
`},Ji=function(l){var c=l.destination;if(c)return xi(l.source,c);var f=l.combine;return f?jn(l.draggableId,l.source,f):"You are over an area that cannot be dropped on"},ga=function(l){return`
|
|
|
The item has returned to its starting position
|
|
|
of `+Rn(l.index)+`
|
|
|
`},Yi=function(l){if(l.reason==="CANCEL")return`
|
|
|
Movement cancelled.
|
|
|
`+ga(l.source)+`
|
|
|
`;var c=l.destination,f=l.combine;return c?`
|
|
|
You have dropped the item.
|
|
|
`+xi(l.source,c)+`
|
|
|
`:f?`
|
|
|
You have dropped the item.
|
|
|
`+jn(l.draggableId,l.source,f)+`
|
|
|
`:`
|
|
|
The item has been dropped while not over a drop area.
|
|
|
`+ga(l.source)+`
|
|
|
`},Ki={dragHandleUsageInstructions:bi,onDragStart:yi,onDragUpdate:Ji,onDragEnd:Yi},an={x:0,y:0},Ar=function(l,c){return{x:l.x+c.x,y:l.y+c.y}},kn=function(l,c){return{x:l.x-c.x,y:l.y-c.y}},Jr=function(l,c){return l.x===c.x&&l.y===c.y},Hi=function(l){return{x:l.x!==0?-l.x:0,y:l.y!==0?-l.y:0}},Li=function(l,c,f){var m;return f===void 0&&(f=0),m={},m[l]=c,m[l==="x"?"y":"x"]=f,m},ua=function(l,c){return Math.sqrt(Math.pow(c.x-l.x,2)+Math.pow(c.y-l.y,2))},ci=function(l,c){return Math.min.apply(Math,c.map(function(f){return ua(l,f)}))},Ii=function(l){return function(c){return{x:l(c.x),y:l(c.y)}}},Na=function(o,l){var c=dr({top:Math.max(l.top,o.top),right:Math.min(l.right,o.right),bottom:Math.min(l.bottom,o.bottom),left:Math.max(l.left,o.left)});return c.width<=0||c.height<=0?null:c},Aa=function(l,c){return{top:l.top+c.y,left:l.left+c.x,bottom:l.bottom+c.y,right:l.right+c.x}},Fa=function(l){return[{x:l.left,y:l.top},{x:l.right,y:l.top},{x:l.left,y:l.bottom},{x:l.right,y:l.bottom}]},Rr={top:0,right:0,bottom:0,left:0},lo=function(l,c){return c?Aa(l,c.scroll.diff.displacement):l},bo=function(l,c,f){if(f&&f.increasedBy){var m;return(0,ue.Z)({},l,(m={},m[c.end]=l[c.end]+f.increasedBy[c.line],m))}return l},Qi=function(l,c){return c&&c.shouldClipSubject?Na(c.pageMarginBox,l):dr(l)},Wi=function(o){var l=o.page,c=o.withPlaceholder,f=o.axis,m=o.frame,g=lo(l.marginBox,m),y=bo(g,f,c),w=Qi(y,m);return{page:l,withPlaceholder:c,active:w}},Gn=function(o,l){o.frame||Pe(!1);var c=o.frame,f=kn(l,c.scroll.initial),m=Hi(f),g=(0,ue.Z)({},c,{scroll:{initial:c.scroll.initial,current:l,diff:{value:f,displacement:m},max:c.scroll.max}}),y=Wi({page:o.subject.page,withPlaceholder:o.subject.withPlaceholder,axis:o.axis,frame:g}),w=(0,ue.Z)({},o,{frame:g,subject:y});return w};function va(o){return Number.isInteger?Number.isInteger(o):typeof o=="number"&&isFinite(o)&&Math.floor(o)===o}function ba(o){return Object.values?Object.values(o):Object.keys(o).map(function(l){return o[l]})}function ea(o,l){if(o.findIndex)return o.findIndex(l);for(var c=0;c<o.length;c++)if(l(o[c]))return c;return-1}function qn(o,l){if(o.find)return o.find(l);var c=ea(o,l);if(c!==-1)return o[c]}function Vi(o){return Array.prototype.slice.call(o)}var Bi=K(function(o){return o.reduce(function(l,c){return l[c.descriptor.id]=c,l},{})}),ui=K(function(o){return o.reduce(function(l,c){return l[c.descriptor.id]=c,l},{})}),ii=K(function(o){return ba(o)}),da=K(function(o){return ba(o)}),ta=K(function(o,l){var c=da(l).filter(function(f){return o===f.descriptor.droppableId}).sort(function(f,m){return f.descriptor.index-m.descriptor.index});return c});function Ui(o){return o.at&&o.at.type==="REORDER"?o.at.destination:null}function b(o){return o.at&&o.at.type==="COMBINE"?o.at.combine:null}var M=K(function(o,l){return l.filter(function(c){return c.descriptor.id!==o.descriptor.id})}),C=function(o){var l=o.isMovingForward,c=o.draggable,f=o.destination,m=o.insideDestination,g=o.previousImpact;if(!f.isCombineEnabled)return null;var y=Ui(g);if(!y)return null;function w(We){var Ge={type:"COMBINE",combine:{draggableId:We,droppableId:f.descriptor.id}};return(0,ue.Z)({},g,{at:Ge})}var B=g.displaced.all,N=B.length?B[0]:null;if(l)return N?w(N):null;var E=M(c,m);if(!N){if(!E.length)return null;var I=E[E.length-1];return w(I.descriptor.id)}var $=ea(E,function(We){return We.descriptor.id===N});$===-1&&Pe(!1);var W=$-1;if(W<0)return null;var oe=E[W];return w(oe.descriptor.id)},k=function(o,l){return o.descriptor.droppableId===l.descriptor.id},R={point:an,value:0},z={invisible:{},visible:{},all:[]},H={displaced:z,displacedBy:R,at:null},ee=function(o,l){return function(c){return o<=c&&c<=l}},le=function(o){var l=ee(o.top,o.bottom),c=ee(o.left,o.right);return function(f){var m=l(f.top)&&l(f.bottom)&&c(f.left)&&c(f.right);if(m)return!0;var g=l(f.top)||l(f.bottom),y=c(f.left)||c(f.right),w=g&&y;if(w)return!0;var B=f.top<o.top&&f.bottom>o.bottom,N=f.left<o.left&&f.right>o.right,E=B&&N;if(E)return!0;var I=B&&y||N&&g;return I}},Te=function(o){var l=ee(o.top,o.bottom),c=ee(o.left,o.right);return function(f){var m=l(f.top)&&l(f.bottom)&&c(f.left)&&c(f.right);return m}},st={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Be={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},vt=function(o){return function(l){var c=ee(l.top,l.bottom),f=ee(l.left,l.right);return function(m){return o===st?c(m.top)&&c(m.bottom):f(m.left)&&f(m.right)}}},bt=function(l,c){var f=c.frame?c.frame.scroll.diff.displacement:an;return Aa(l,f)},Dt=function(l,c,f){return c.subject.active?f(c.subject.active)(l):!1},Wt=function(l,c,f){return f(c)(l)},Ct=function(l){var c=l.target,f=l.destination,m=l.viewport,g=l.withDroppableDisplacement,y=l.isVisibleThroughFrameFn,w=g?bt(c,f):c;return Dt(w,f,y)&&Wt(w,m,y)},qe=function(l){return Ct((0,ue.Z)({},l,{isVisibleThroughFrameFn:le}))},He=function(l){return Ct((0,ue.Z)({},l,{isVisibleThroughFrameFn:Te}))},et=function(l){return Ct((0,ue.Z)({},l,{isVisibleThroughFrameFn:vt(l.destination.axis)}))},Ye=function(l,c,f){if(typeof f=="boolean")return f;if(!c)return!0;var m=c.invisible,g=c.visible;if(m[l])return!1;var y=g[l];return y?y.shouldAnimate:!0};function wt(o,l){var c=o.page.marginBox,f={top:l.point.y,right:0,bottom:0,left:l.point.x};return dr(Xr(c,f))}function mt(o){var l=o.afterDragging,c=o.destination,f=o.displacedBy,m=o.viewport,g=o.forceShouldAnimate,y=o.last;return l.reduce(function(B,N){var E=wt(N,f),I=N.descriptor.id;B.all.push(I);var $=qe({target:E,destination:c,viewport:m,withDroppableDisplacement:!0});if(!$)return B.invisible[N.descriptor.id]=!0,B;var W=Ye(I,y,g),oe={draggableId:I,shouldAnimate:W};return B.visible[I]=oe,B},{all:[],visible:{},invisible:{}})}function Pt(o,l){if(!o.length)return 0;var c=o[o.length-1].descriptor.index;return l.inHomeList?c:c+1}function zt(o){var l=o.insideDestination,c=o.inHomeList,f=o.displacedBy,m=o.destination,g=Pt(l,{inHomeList:c});return{displaced:z,displacedBy:f,at:{type:"REORDER",destination:{droppableId:m.descriptor.id,index:g}}}}function Ot(o){var l=o.draggable,c=o.insideDestination,f=o.destination,m=o.viewport,g=o.displacedBy,y=o.last,w=o.index,B=o.forceShouldAnimate,N=k(l,f);if(w==null)return zt({insideDestination:c,inHomeList:N,displacedBy:g,destination:f});var E=qn(c,function(We){return We.descriptor.index===w});if(!E)return zt({insideDestination:c,inHomeList:N,displacedBy:g,destination:f});var I=M(l,c),$=c.indexOf(E),W=I.slice($),oe=mt({afterDragging:W,destination:f,displacedBy:g,last:y,viewport:m.frame,forceShouldAnimate:B});return{displaced:oe,displacedBy:g,at:{type:"REORDER",destination:{droppableId:f.descriptor.id,index:w}}}}function Bt(o,l){return!!l.effected[o]}var sr=function(o){var l=o.isMovingForward,c=o.destination,f=o.draggables,m=o.combine,g=o.afterCritical;if(!c.isCombineEnabled)return null;var y=m.draggableId,w=f[y],B=w.descriptor.index,N=Bt(y,g);return N?l?B:B-1:l?B+1:B},Et=function(o){var l=o.isMovingForward,c=o.isInHomeList,f=o.insideDestination,m=o.location;if(!f.length)return null;var g=m.index,y=l?g+1:g-1,w=f[0].descriptor.index,B=f[f.length-1].descriptor.index,N=c?B:B+1;return y<w||y>N?null:y},tr=function(o){var l=o.isMovingForward,c=o.isInHomeList,f=o.draggable,m=o.draggables,g=o.destination,y=o.insideDestination,w=o.previousImpact,B=o.viewport,N=o.afterCritical,E=w.at;if(E||Pe(!1),E.type==="REORDER"){var I=Et({isMovingForward:l,isInHomeList:c,location:E.destination,insideDestination:y});return I==null?null:Ot({draggable:f,insideDestination:y,destination:g,viewport:B,last:w.displaced,displacedBy:w.displacedBy,index:I})}var $=sr({isMovingForward:l,destination:g,displaced:w.displaced,draggables:m,combine:E.combine,afterCritical:N});return $==null?null:Ot({draggable:f,insideDestination:y,destination:g,viewport:B,last:w.displaced,displacedBy:w.displacedBy,index:$})},Zt=function(o){var l=o.displaced,c=o.afterCritical,f=o.combineWith,m=o.displacedBy,g=!!(l.visible[f]||l.invisible[f]);return Bt(f,c)?g?an:Hi(m.point):g?m.point:an},Xt=function(o){var l=o.afterCritical,c=o.impact,f=o.draggables,m=b(c);m||Pe(!1);var g=m.draggableId,y=f[g].page.borderBox.center,w=Zt({displaced:c.displaced,afterCritical:l,combineWith:g,displacedBy:c.displacedBy});return Ar(y,w)},Hr=function(l,c){return c.margin[l.start]+c.borderBox[l.size]/2},Br=function(l,c){return c.margin[l.end]+c.borderBox[l.size]/2},Or=function(l,c,f){return c[l.crossAxisStart]+f.margin[l.crossAxisStart]+f.borderBox[l.crossAxisSize]/2},yr=function(l){var c=l.axis,f=l.moveRelativeTo,m=l.isMoving;return Li(c.line,f.marginBox[c.end]+Hr(c,m),Or(c,f.marginBox,m))},mn=function(l){var c=l.axis,f=l.moveRelativeTo,m=l.isMoving;return Li(c.line,f.marginBox[c.start]-Br(c,m),Or(c,f.marginBox,m))},Yn=function(l){var c=l.axis,f=l.moveInto,m=l.isMoving;return Li(c.line,f.contentBox[c.start]+Hr(c,m),Or(c,f.contentBox,m))},fr=function(o){var l=o.impact,c=o.draggable,f=o.draggables,m=o.droppable,g=o.afterCritical,y=ta(m.descriptor.id,f),w=c.page,B=m.axis;if(!y.length)return Yn({axis:B,moveInto:m.page,isMoving:w});var N=l.displaced,E=l.displacedBy,I=N.all[0];if(I){var $=f[I];if(Bt(I,g))return mn({axis:B,moveRelativeTo:$.page,isMoving:w});var W=At($.page,E.point);return mn({axis:B,moveRelativeTo:W,isMoving:w})}var oe=y[y.length-1];if(oe.descriptor.id===c.descriptor.id)return w.borderBox.center;if(Bt(oe.descriptor.id,g)){var We=At(oe.page,Hi(g.displacedBy.point));return yr({axis:B,moveRelativeTo:We,isMoving:w})}return yr({axis:B,moveRelativeTo:oe.page,isMoving:w})},Dr=function(o,l){var c=o.frame;return c?Ar(l,c.scroll.diff.displacement):l},fn=function(l){var c=l.impact,f=l.draggable,m=l.droppable,g=l.draggables,y=l.afterCritical,w=f.page.borderBox.center,B=c.at;return!m||!B?w:B.type==="REORDER"?fr({impact:c,draggable:f,draggables:g,droppable:m,afterCritical:y}):Xt({impact:c,draggables:g,afterCritical:y})},Wr=function(o){var l=fn(o),c=o.droppable,f=c?Dr(c,l):l;return f},Mr=function(o,l){var c=kn(l,o.scroll.initial),f=Hi(c),m=dr({top:l.y,bottom:l.y+o.frame.height,left:l.x,right:l.x+o.frame.width}),g={frame:m,scroll:{initial:o.scroll.initial,max:o.scroll.max,current:l,diff:{value:c,displacement:f}}};return g};function Qr(o,l){return o.map(function(c){return l[c]})}function xr(o,l){for(var c=0;c<l.length;c++){var f=l[c].visible[o];if(f)return f}return null}var pn=function(o){var l=o.impact,c=o.viewport,f=o.destination,m=o.draggables,g=o.maxScrollChange,y=Mr(c,Ar(c.scroll.current,g)),w=f.frame?Gn(f,Ar(f.frame.scroll.current,g)):f,B=l.displaced,N=mt({afterDragging:Qr(B.all,m),destination:f,displacedBy:l.displacedBy,viewport:y.frame,last:B,forceShouldAnimate:!1}),E=mt({afterDragging:Qr(B.all,m),destination:w,displacedBy:l.displacedBy,viewport:c.frame,last:B,forceShouldAnimate:!1}),I={},$={},W=[B,N,E];B.all.forEach(function(We){var Ge=xr(We,W);if(Ge){$[We]=Ge;return}I[We]=!0});var oe=(0,ue.Z)({},l,{displaced:{all:B.all,invisible:I,visible:$}});return oe},zn=function(o,l){return Ar(o.scroll.diff.displacement,l)},wi=function(o){var l=o.pageBorderBoxCenter,c=o.draggable,f=o.viewport,m=zn(f,l),g=kn(m,c.page.borderBox.center);return Ar(c.client.borderBox.center,g)},Ti=function(o){var l=o.draggable,c=o.destination,f=o.newPageBorderBoxCenter,m=o.viewport,g=o.withDroppableDisplacement,y=o.onlyOnMainAxis,w=y===void 0?!1:y,B=kn(f,l.page.borderBox.center),N=Aa(l.page.borderBox,B),E={target:N,destination:c,withDroppableDisplacement:g,viewport:m};return w?et(E):He(E)},An=function(o){var l=o.isMovingForward,c=o.draggable,f=o.destination,m=o.draggables,g=o.previousImpact,y=o.viewport,w=o.previousPageBorderBoxCenter,B=o.previousClientSelection,N=o.afterCritical;if(!f.isEnabled)return null;var E=ta(f.descriptor.id,m),I=k(c,f),$=C({isMovingForward:l,draggable:c,destination:f,insideDestination:E,previousImpact:g})||tr({isMovingForward:l,isInHomeList:I,draggable:c,draggables:m,destination:f,insideDestination:E,previousImpact:g,viewport:y,afterCritical:N});if(!$)return null;var W=Wr({impact:$,draggable:c,droppable:f,draggables:m,afterCritical:N}),oe=Ti({draggable:c,destination:f,newPageBorderBoxCenter:W,viewport:y.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(oe){var We=wi({pageBorderBoxCenter:W,draggable:c,viewport:y});return{clientSelection:We,impact:$,scrollJumpRequest:null}}var Ge=kn(W,w),Qe=pn({impact:$,viewport:y,destination:f,draggables:m,maxScrollChange:Ge});return{clientSelection:B,impact:Qe,scrollJumpRequest:Ge}},Tr=function(l){var c=l.subject.active;return c||Pe(!1),c},Si=function(o){var l=o.isMovingForward,c=o.pageBorderBoxCenter,f=o.source,m=o.droppables,g=o.viewport,y=f.subject.active;if(!y)return null;var w=f.axis,B=ee(y[w.start],y[w.end]),N=ii(m).filter(function(I){return I!==f}).filter(function(I){return I.isEnabled}).filter(function(I){return!!I.subject.active}).filter(function(I){return le(g.frame)(Tr(I))}).filter(function(I){var $=Tr(I);return l?y[w.crossAxisEnd]<$[w.crossAxisEnd]:$[w.crossAxisStart]<y[w.crossAxisStart]}).filter(function(I){var $=Tr(I),W=ee($[w.start],$[w.end]);return B($[w.start])||B($[w.end])||W(y[w.start])||W(y[w.end])}).sort(function(I,$){var W=Tr(I)[w.crossAxisStart],oe=Tr($)[w.crossAxisStart];return l?W-oe:oe-W}).filter(function(I,$,W){return Tr(I)[w.crossAxisStart]===Tr(W[0])[w.crossAxisStart]});if(!N.length)return null;if(N.length===1)return N[0];var E=N.filter(function(I){var $=ee(Tr(I)[w.start],Tr(I)[w.end]);return $(c[w.line])});return E.length===1?E[0]:E.length>1?E.sort(function(I,$){return Tr(I)[w.start]-Tr($)[w.start]})[0]:N.sort(function(I,$){var W=ci(c,Fa(Tr(I))),oe=ci(c,Fa(Tr($)));return W!==oe?W-oe:Tr(I)[w.start]-Tr($)[w.start]})[0]},Vr=function(l,c){var f=l.page.borderBox.center;return Bt(l.descriptor.id,c)?kn(f,c.displacedBy.point):f},gn=function(l,c){var f=l.page.borderBox;return Bt(l.descriptor.id,c)?Aa(f,Hi(c.displacedBy.point)):f},_n=function(o){var l=o.pageBorderBoxCenter,c=o.viewport,f=o.destination,m=o.insideDestination,g=o.afterCritical,y=m.filter(function(w){return He({target:gn(w,g),destination:f,viewport:c.frame,withDroppableDisplacement:!0})}).sort(function(w,B){var N=ua(l,Dr(f,Vr(w,g))),E=ua(l,Dr(f,Vr(B,g)));return N<E?-1:E<N?1:w.descriptor.index-B.descriptor.index});return y[0]||null},On=K(function(l,c){var f=c[l.line];return{value:f,point:Li(l.line,f)}}),di=function(l,c,f){var m=l.axis;if(l.descriptor.mode==="virtual")return Li(m.line,c[m.line]);var g=l.subject.page.contentBox[m.size],y=ta(l.descriptor.id,f),w=y.reduce(function(E,I){return E+I.client.marginBox[m.size]},0),B=w+c[m.line],N=B-g;return N<=0?null:Li(m.line,N)},fi=function(l,c){return(0,ue.Z)({},l,{scroll:(0,ue.Z)({},l.scroll,{max:c})})},pi=function(l,c,f){var m=l.frame;k(c,l)&&Pe(!1),l.subject.withPlaceholder&&Pe(!1);var g=On(l.axis,c.displaceBy).point,y=di(l,g,f),w={placeholderSize:g,increasedBy:y,oldFrameMaxScroll:l.frame?l.frame.scroll.max:null};if(!m){var B=Wi({page:l.subject.page,withPlaceholder:w,axis:l.axis,frame:l.frame});return(0,ue.Z)({},l,{subject:B})}var N=y?Ar(m.scroll.max,y):m.scroll.max,E=fi(m,N),I=Wi({page:l.subject.page,withPlaceholder:w,axis:l.axis,frame:E});return(0,ue.Z)({},l,{subject:I,frame:E})},ra=function(l){var c=l.subject.withPlaceholder;c||Pe(!1);var f=l.frame;if(!f){var m=Wi({page:l.subject.page,axis:l.axis,frame:null,withPlaceholder:null});return(0,ue.Z)({},l,{subject:m})}var g=c.oldFrameMaxScroll;g||Pe(!1);var y=fi(f,g),w=Wi({page:l.subject.page,axis:l.axis,frame:y,withPlaceholder:null});return(0,ue.Z)({},l,{subject:w,frame:y})},Zi=function(o){var l=o.previousPageBorderBoxCenter,c=o.moveRelativeTo,f=o.insideDestination,m=o.draggable,g=o.draggables,y=o.destination,w=o.viewport,B=o.afterCritical;if(!c){if(f.length)return null;var N={displaced:z,displacedBy:R,at:{type:"REORDER",destination:{droppableId:y.descriptor.id,index:0}}},E=Wr({impact:N,draggable:m,droppable:y,draggables:g,afterCritical:B}),I=k(m,y)?y:pi(y,m,g),$=Ti({draggable:m,destination:I,newPageBorderBoxCenter:E,viewport:w.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return $?N:null}var W=l[y.axis.line]<=c.page.borderBox.center[y.axis.line],oe=function(){var Ge=c.descriptor.index;return c.descriptor.id===m.descriptor.id||W?Ge:Ge+1}(),We=On(y.axis,m.displaceBy);return Ot({draggable:m,insideDestination:f,destination:y,viewport:w,displacedBy:We,last:z,index:oe})},vn=function(o){var l=o.isMovingForward,c=o.previousPageBorderBoxCenter,f=o.draggable,m=o.isOver,g=o.draggables,y=o.droppables,w=o.viewport,B=o.afterCritical,N=Si({isMovingForward:l,pageBorderBoxCenter:c,source:m,droppables:y,viewport:w});if(!N)return null;var E=ta(N.descriptor.id,g),I=_n({pageBorderBoxCenter:c,viewport:w,destination:N,insideDestination:E,afterCritical:B}),$=Zi({previousPageBorderBoxCenter:c,destination:N,draggable:f,draggables:g,moveRelativeTo:I,insideDestination:E,viewport:w,afterCritical:B});if(!$)return null;var W=Wr({impact:$,draggable:f,droppable:N,draggables:g,afterCritical:B}),oe=wi({pageBorderBoxCenter:W,draggable:f,viewport:w});return{clientSelection:oe,impact:$,scrollJumpRequest:null}},Mn=function(o){var l=o.at;return l?l.type==="REORDER"?l.destination.droppableId:l.combine.droppableId:null},wr=function(l,c){var f=Mn(l);return f?c[f]:null},Kn=function(o){var l=o.state,c=o.type,f=wr(l.impact,l.dimensions.droppables),m=!!f,g=l.dimensions.droppables[l.critical.droppable.id],y=f||g,w=y.axis.direction,B=w==="vertical"&&(c==="MOVE_UP"||c==="MOVE_DOWN")||w==="horizontal"&&(c==="MOVE_LEFT"||c==="MOVE_RIGHT");if(B&&!m)return null;var N=c==="MOVE_DOWN"||c==="MOVE_RIGHT",E=l.dimensions.draggables[l.critical.draggable.id],I=l.current.page.borderBoxCenter,$=l.dimensions,W=$.draggables,oe=$.droppables;return B?An({isMovingForward:N,previousPageBorderBoxCenter:I,draggable:E,destination:y,draggables:W,viewport:l.viewport,previousClientSelection:l.current.client.selection,previousImpact:l.impact,afterCritical:l.afterCritical}):vn({isMovingForward:N,previousPageBorderBoxCenter:I,draggable:E,isOver:y,draggables:W,droppables:oe,viewport:l.viewport,afterCritical:l.afterCritical})};function Dn(o){return o.phase==="DRAGGING"||o.phase==="COLLECTING"}function Hn(o){var l=ee(o.top,o.bottom),c=ee(o.left,o.right);return function(m){return l(m.y)&&c(m.x)}}function ai(o,l){return o.left<l.right&&o.right>l.left&&o.top<l.bottom&&o.bottom>l.top}function na(o){var l=o.pageBorderBox,c=o.draggable,f=o.candidates,m=c.page.borderBox.center,g=f.map(function(y){var w=y.axis,B=Li(y.axis.line,l.center[w.line],y.page.borderBox.center[w.crossAxisLine]);return{id:y.descriptor.id,distance:ua(m,B)}}).sort(function(y,w){return w.distance-y.distance});return g[0]?g[0].id:null}function Ln(o){var l=o.pageBorderBox,c=o.draggable,f=o.droppables,m=ii(f).filter(function(g){if(!g.isEnabled)return!1;var y=g.subject.active;if(!y||!ai(l,y))return!1;if(Hn(y)(l.center))return!0;var w=g.axis,B=y.center[w.crossAxisLine],N=l[w.crossAxisStart],E=l[w.crossAxisEnd],I=ee(y[w.crossAxisStart],y[w.crossAxisEnd]),$=I(N),W=I(E);return!$&&!W?!0:$?N<B:E>B});return m.length?m.length===1?m[0].descriptor.id:na({pageBorderBox:l,draggable:c,candidates:m}):null}var ia=function(l,c){return dr(Aa(l,c))},In=function(o,l){var c=o.frame;return c?ia(l,c.scroll.diff.value):l};function aa(o){var l=o.displaced,c=o.id;return!!(l.visible[c]||l.invisible[c])}function $i(o){var l=o.draggable,c=o.closest,f=o.inHomeList;return c?f&&c.descriptor.index>l.descriptor.index?c.descriptor.index-1:c.descriptor.index:null}var hi=function(o){var l=o.pageBorderBoxWithDroppableScroll,c=o.draggable,f=o.destination,m=o.insideDestination,g=o.last,y=o.viewport,w=o.afterCritical,B=f.axis,N=On(f.axis,c.displaceBy),E=N.value,I=l[B.start],$=l[B.end],W=M(c,m),oe=qn(W,function(Ge){var Qe=Ge.descriptor.id,xt=Ge.page.borderBox.center[B.line],Lt=Bt(Qe,w),Rt=aa({displaced:g,id:Qe});return Lt?Rt?$<=xt:I<xt-E:Rt?$<=xt+E:I<xt}),We=$i({draggable:c,closest:oe,inHomeList:k(c,f)});return Ot({draggable:c,insideDestination:m,destination:f,viewport:y,last:g,displacedBy:N,index:We})},oi=4,fa=function(o){var l=o.draggable,c=o.pageBorderBoxWithDroppableScroll,f=o.previousImpact,m=o.destination,g=o.insideDestination,y=o.afterCritical;if(!m.isCombineEnabled)return null;var w=m.axis,B=On(m.axis,l.displaceBy),N=B.value,E=c[w.start],I=c[w.end],$=M(l,g),W=qn($,function(We){var Ge=We.descriptor.id,Qe=We.page.borderBox,xt=Qe[w.size],Lt=xt/oi,Rt=Bt(Ge,y),Yt=aa({displaced:f.displaced,id:Ge});return Rt?Yt?I>Qe[w.start]+Lt&&I<Qe[w.end]-Lt:E>Qe[w.start]-N+Lt&&E<Qe[w.end]-N-Lt:Yt?I>Qe[w.start]+N+Lt&&I<Qe[w.end]+N-Lt:E>Qe[w.start]+Lt&&E<Qe[w.end]-Lt});if(!W)return null;var oe={displacedBy:B,displaced:f.displaced,at:{type:"COMBINE",combine:{draggableId:W.descriptor.id,droppableId:m.descriptor.id}}};return oe},qa=function(o){var l=o.pageOffset,c=o.draggable,f=o.draggables,m=o.droppables,g=o.previousImpact,y=o.viewport,w=o.afterCritical,B=ia(c.page.borderBox,l),N=Ln({pageBorderBox:B,draggable:c,droppables:m});if(!N)return H;var E=m[N],I=ta(E.descriptor.id,f),$=In(E,B);return fa({pageBorderBoxWithDroppableScroll:$,draggable:c,previousImpact:g,destination:E,insideDestination:I,afterCritical:w})||hi({pageBorderBoxWithDroppableScroll:$,draggable:c,destination:E,insideDestination:I,last:g.displaced,viewport:y,afterCritical:w})},ji=function(o,l){var c;return(0,ue.Z)({},o,(c={},c[l.descriptor.id]=l,c))},ya=function(l){var c=l.previousImpact,f=l.impact,m=l.droppables,g=Mn(c),y=Mn(f);if(!g||g===y)return m;var w=m[g];if(!w.subject.withPlaceholder)return m;var B=ra(w);return ji(m,B)},xa=function(o){var l=o.draggable,c=o.draggables,f=o.droppables,m=o.previousImpact,g=o.impact,y=ya({previousImpact:m,impact:g,droppables:f}),w=Mn(g);if(!w)return y;var B=f[w];if(k(l,B)||B.subject.withPlaceholder)return y;var N=pi(B,l,c);return ji(y,N)},mi=function(o){var l=o.state,c=o.clientSelection,f=o.dimensions,m=o.viewport,g=o.impact,y=o.scrollJumpRequest,w=m||l.viewport,B=f||l.dimensions,N=c||l.current.client.selection,E=kn(N,l.initial.client.selection),I={offset:E,selection:N,borderBoxCenter:Ar(l.initial.client.borderBoxCenter,E)},$={selection:Ar(I.selection,w.scroll.current),borderBoxCenter:Ar(I.borderBoxCenter,w.scroll.current),offset:Ar(I.offset,w.scroll.diff.value)},W={client:I,page:$};if(l.phase==="COLLECTING")return(0,ue.Z)({phase:"COLLECTING"},l,{dimensions:B,viewport:w,current:W});var oe=B.draggables[l.critical.draggable.id],We=g||qa({pageOffset:$.offset,draggable:oe,draggables:B.draggables,droppables:B.droppables,previousImpact:l.impact,viewport:w,afterCritical:l.afterCritical}),Ge=xa({draggable:oe,impact:We,previousImpact:l.impact,draggables:B.draggables,droppables:B.droppables}),Qe=(0,ue.Z)({},l,{current:W,dimensions:{draggables:B.draggables,droppables:Ge},impact:We,viewport:w,scrollJumpRequest:y||null,forceShouldAnimate:y?!1:null});return Qe};function Da(o,l){return o.map(function(c){return l[c]})}var oa=function(o){var l=o.impact,c=o.viewport,f=o.draggables,m=o.destination,g=o.forceShouldAnimate,y=l.displaced,w=Da(y.all,f),B=mt({afterDragging:w,destination:m,displacedBy:l.displacedBy,viewport:c.frame,forceShouldAnimate:g,last:y});return(0,ue.Z)({},l,{displaced:B})},La=function(o){var l=o.impact,c=o.draggable,f=o.droppable,m=o.draggables,g=o.viewport,y=o.afterCritical,w=Wr({impact:l,draggable:c,draggables:m,droppable:f,afterCritical:y});return wi({pageBorderBoxCenter:w,draggable:c,viewport:g})},lr=function(o){var l=o.state,c=o.dimensions,f=o.viewport;l.movementMode!=="SNAP"&&Pe(!1);var m=l.impact,g=f||l.viewport,y=c||l.dimensions,w=y.draggables,B=y.droppables,N=w[l.critical.draggable.id],E=Mn(m);E||Pe(!1);var I=B[E],$=oa({impact:m,viewport:g,destination:I,draggables:w}),W=La({impact:$,draggable:N,droppable:I,draggables:w,viewport:g,afterCritical:l.afterCritical});return mi({impact:$,clientSelection:W,state:l,dimensions:y,viewport:g})},ir=function(o){return{index:o.index,droppableId:o.droppableId}},on=function(o){var l=o.draggable,c=o.home,f=o.draggables,m=o.viewport,g=On(c.axis,l.displaceBy),y=ta(c.descriptor.id,f),w=y.indexOf(l);w===-1&&Pe(!1);var B=y.slice(w+1),N=B.reduce(function(W,oe){return W[oe.descriptor.id]=!0,W},{}),E={inVirtualList:c.descriptor.mode==="virtual",displacedBy:g,effected:N},I=mt({afterDragging:B,destination:c,displacedBy:g,last:null,viewport:m.frame,forceShouldAnimate:!1}),$={displaced:I,displacedBy:g,at:{type:"REORDER",destination:ir(l.descriptor)}};return{impact:$,afterCritical:E}},Pi=function(o,l){return{draggables:o.draggables,droppables:ji(o.droppables,l)}},Ri=function(l){},Oi=function(l){},Ia=function(o){var l=o.draggable,c=o.offset,f=o.initialWindowScroll,m=At(l.client,c),g=Fr(m,f),y=(0,ue.Z)({},l,{placeholder:(0,ue.Z)({},l.placeholder,{client:m}),client:m,page:g});return y},Xa=function(o){var l=o.frame;return l||Pe(!1),l},co=function(o){var l=o.additions,c=o.updatedDroppables,f=o.viewport,m=f.scroll.diff.value;return l.map(function(g){var y=g.descriptor.droppableId,w=c[y],B=Xa(w),N=B.scroll.diff.value,E=Ar(m,N),I=Ia({draggable:g,offset:E,initialWindowScroll:f.scroll.initial});return I})},Ba=function(o){var l=o.state,c=o.published;Ri();var f=c.modified.map(function(Lt){var Rt=l.dimensions.droppables[Lt.droppableId],Yt=Gn(Rt,Lt.scroll);return Yt}),m=(0,ue.Z)({},l.dimensions.droppables,{},Bi(f)),g=ui(co({additions:c.additions,updatedDroppables:m,viewport:l.viewport})),y=(0,ue.Z)({},l.dimensions.draggables,{},g);c.removals.forEach(function(Lt){delete y[Lt]});var w={droppables:m,draggables:y},B=Mn(l.impact),N=B?w.droppables[B]:null,E=w.draggables[l.critical.draggable.id],I=w.droppables[l.critical.droppable.id],$=on({draggable:E,home:I,draggables:y,viewport:l.viewport}),W=$.impact,oe=$.afterCritical,We=N&&N.isCombineEnabled?l.impact:W,Ge=qa({pageOffset:l.current.page.offset,draggable:w.draggables[l.critical.draggable.id],draggables:w.draggables,droppables:w.droppables,previousImpact:We,viewport:l.viewport,afterCritical:oe});Oi();var Qe=(0,ue.Z)({phase:"DRAGGING"},l,{phase:"DRAGGING",impact:Ge,onLiftImpact:W,dimensions:w,afterCritical:oe,forceShouldAnimate:!1});if(l.phase==="COLLECTING")return Qe;var xt=(0,ue.Z)({phase:"DROP_PENDING"},Qe,{phase:"DROP_PENDING",reason:l.reason,isWaiting:!1});return xt},uo=function(l){return l.movementMode==="SNAP"},Gr=function(l,c,f){var m=Pi(l.dimensions,c);return!uo(l)||f?mi({state:l,dimensions:m}):lr({state:l,dimensions:m})};function pr(o){return o.isDragging&&o.movementMode==="SNAP"?(0,ue.Z)({phase:"DRAGGING"},o,{scrollJumpRequest:null}):o}var Bn={phase:"IDLE",completed:null,shouldFlush:!1},Qn=function(o,l){if(o===void 0&&(o=Bn),l.type==="FLUSH")return(0,ue.Z)({},Bn,{shouldFlush:!0});if(l.type==="INITIAL_PUBLISH"){o.phase!=="IDLE"&&Pe(!1);var c=l.payload,f=c.critical,m=c.clientSelection,g=c.viewport,y=c.dimensions,w=c.movementMode,B=y.draggables[f.draggable.id],N=y.droppables[f.droppable.id],E={selection:m,borderBoxCenter:B.client.borderBox.center,offset:an},I={client:E,page:{selection:Ar(E.selection,g.scroll.initial),borderBoxCenter:Ar(E.selection,g.scroll.initial),offset:Ar(E.selection,g.scroll.diff.value)}},$=ii(y.droppables).every(function(Xl){return!Xl.isFixedOnPage}),W=on({draggable:B,home:N,draggables:y.draggables,viewport:g}),oe=W.impact,We=W.afterCritical,Ge={phase:"DRAGGING",isDragging:!0,critical:f,movementMode:w,dimensions:y,initial:I,current:I,isWindowScrollAllowed:$,impact:oe,afterCritical:We,onLiftImpact:oe,viewport:g,scrollJumpRequest:null,forceShouldAnimate:null};return Ge}if(l.type==="COLLECTION_STARTING"){if(o.phase==="COLLECTING"||o.phase==="DROP_PENDING")return o;o.phase!=="DRAGGING"&&Pe(!1);var Qe=(0,ue.Z)({phase:"COLLECTING"},o,{phase:"COLLECTING"});return Qe}if(l.type==="PUBLISH_WHILE_DRAGGING")return o.phase==="COLLECTING"||o.phase==="DROP_PENDING"||Pe(!1),Ba({state:o,published:l.payload});if(l.type==="MOVE"){if(o.phase==="DROP_PENDING")return o;Dn(o)||Pe(!1);var xt=l.payload.client;return Jr(xt,o.current.client.selection)?o:mi({state:o,clientSelection:xt,impact:uo(o)?o.impact:null})}if(l.type==="UPDATE_DROPPABLE_SCROLL"){if(o.phase==="DROP_PENDING"||o.phase==="COLLECTING")return pr(o);Dn(o)||Pe(!1);var Lt=l.payload,Rt=Lt.id,Yt=Lt.newScroll,Ft=o.dimensions.droppables[Rt];if(!Ft)return o;var mr=Gn(Ft,Yt);return Gr(o,mr,!1)}if(l.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(o.phase==="DROP_PENDING")return o;Dn(o)||Pe(!1);var Tn=l.payload,gr=Tn.id,Ur=Tn.isEnabled,Ci=o.dimensions.droppables[gr];Ci||Pe(!1),Ci.isEnabled===Ur&&Pe(!1);var ri=(0,ue.Z)({},Ci,{isEnabled:Ur});return Gr(o,ri,!0)}if(l.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(o.phase==="DROP_PENDING")return o;Dn(o)||Pe(!1);var pa=l.payload,Ra=pa.id,Ma=pa.isCombineEnabled,Ca=o.dimensions.droppables[Ra];Ca||Pe(!1),Ca.isCombineEnabled===Ma&&Pe(!1);var Fi=(0,ue.Z)({},Ca,{isCombineEnabled:Ma});return Gr(o,Fi,!0)}if(l.type==="MOVE_BY_WINDOW_SCROLL"){if(o.phase==="DROP_PENDING"||o.phase==="DROP_ANIMATING")return o;Dn(o)||Pe(!1),o.isWindowScrollAllowed||Pe(!1);var Lo=l.payload.newScroll;if(Jr(o.viewport.scroll.current,Lo))return pr(o);var no=Mr(o.viewport,Lo);return uo(o)?lr({state:o,viewport:no}):mi({state:o,viewport:no})}if(l.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!Dn(o))return o;var mo=l.payload.maxScroll;if(Jr(mo,o.viewport.scroll.max))return o;var Wa=(0,ue.Z)({},o.viewport,{scroll:(0,ue.Z)({},o.viewport.scroll,{max:mo})});return(0,ue.Z)({phase:"DRAGGING"},o,{viewport:Wa})}if(l.type==="MOVE_UP"||l.type==="MOVE_DOWN"||l.type==="MOVE_LEFT"||l.type==="MOVE_RIGHT"){if(o.phase==="COLLECTING"||o.phase==="DROP_PENDING")return o;o.phase!=="DRAGGING"&&Pe(!1);var io=Kn({state:o,type:l.type});return io?mi({state:o,impact:io.impact,clientSelection:io.clientSelection,scrollJumpRequest:io.scrollJumpRequest}):o}if(l.type==="DROP_PENDING"){var Xi=l.payload.reason;o.phase!=="COLLECTING"&&Pe(!1);var ha=(0,ue.Z)({phase:"DROP_PENDING"},o,{phase:"DROP_PENDING",isWaiting:!0,reason:Xi});return ha}if(l.type==="DROP_ANIMATE"){var Gl=l.payload,Va=Gl.completed,rs=Gl.dropDuration,Ws=Gl.newHomeClientOffset;o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||Pe(!1);var ws={phase:"DROP_ANIMATING",completed:Va,dropDuration:rs,newHomeClientOffset:Ws,dimensions:o.dimensions};return ws}if(l.type==="DROP_COMPLETE"){var ql=l.payload.completed;return{phase:"IDLE",completed:ql,shouldFlush:!1}}return o},sa=function(l){return{type:"BEFORE_INITIAL_CAPTURE",payload:l}},gi=function(l){return{type:"LIFT",payload:l}},ss=function(l){return{type:"INITIAL_PUBLISH",payload:l}},al=function(l){return{type:"PUBLISH_WHILE_DRAGGING",payload:l}},ol=function(){return{type:"COLLECTION_STARTING",payload:null}},sl=function(l){return{type:"UPDATE_DROPPABLE_SCROLL",payload:l}},ll=function(l){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:l}},cl=function(l){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:l}},ls=function(l){return{type:"MOVE",payload:l}},za=function(l){return{type:"MOVE_BY_WINDOW_SCROLL",payload:l}},cs=function(l){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:l}},ul=function(){return{type:"MOVE_UP",payload:null}},dl=function(){return{type:"MOVE_DOWN",payload:null}},fl=function(){return{type:"MOVE_RIGHT",payload:null}},ks=function(){return{type:"MOVE_LEFT",payload:null}},Nn=function(){return{type:"FLUSH",payload:null}},Ka=function(l){return{type:"DROP_ANIMATE",payload:l}},Ta=function(l){return{type:"DROP_COMPLETE",payload:l}},As=function(l){return{type:"DROP",payload:l}},us=function(l){return{type:"DROP_PENDING",payload:l}},Ds=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function vc(o){if(!(o.length<=1)){for(var l=o.map(function(w){return w.descriptor.index}),c={},f=1;f<l.length;f++){var m=l[f],g=l[f-1];m!==g+1&&(c[m]=!0)}if(Object.keys(c).length)var y=l.map(function(w){var B=!!c[w];return B?"[\u{1F525}"+w+"]":""+w}).join(", ")}}function Ls(o,l){if(0)var c}var pl=function(o){return function(l){var c=l.getState,f=l.dispatch;return function(m){return function(g){if(g.type!=="LIFT"){m(g);return}var y=g.payload,w=y.id,B=y.clientSelection,N=y.movementMode,E=c();E.phase==="DROP_ANIMATING"&&f(Ta({completed:E.completed})),c().phase!=="IDLE"&&Pe(!1),f(Nn()),f(sa({draggableId:w,movementMode:N}));var I={shouldPublishImmediately:N==="SNAP"},$={draggableId:w,scrollOptions:I},W=o.startPublishing($),oe=W.critical,We=W.dimensions,Ge=W.viewport;Ls(oe,We),f(ss({critical:oe,dimensions:We,clientSelection:B,movementMode:N,viewport:Ge}))}}}},hl=function(o){return function(){return function(l){return function(c){c.type==="INITIAL_PUBLISH"&&o.dragging(),c.type==="DROP_ANIMATE"&&o.dropping(c.payload.completed.result.reason),(c.type==="FLUSH"||c.type==="DROP_COMPLETE")&&o.resting(),l(c)}}}},bn={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},$r={opacity:{drop:0,combining:.7},scale:{drop:.75}},sn={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},Wn=sn.outOfTheWay+"s "+bn.outOfTheWay,ei={fluid:"opacity "+Wn,snap:"transform "+Wn+", opacity "+Wn,drop:function(l){var c=l+"s "+bn.drop;return"transform "+c+", opacity "+c},outOfTheWay:"transform "+Wn,placeholder:"height "+Wn+", width "+Wn+", margin "+Wn},$a=function(l){return Jr(l,an)?null:"translate("+l.x+"px, "+l.y+"px)"},_i={moveTo:$a,drop:function(l,c){var f=$a(l);return f?c?f+" scale("+$r.scale.drop+")":f:null}},Wo=sn.minDropTime,ml=sn.maxDropTime,yu=ml-Wo,bc=1500,xu=.6,wu=function(o){var l=o.current,c=o.destination,f=o.reason,m=ua(l,c);if(m<=0)return Wo;if(m>=bc)return ml;var g=m/bc,y=Wo+yu*g,w=f==="CANCEL"?y*xu:y;return Number(w.toFixed(2))},yc=function(o){var l=o.impact,c=o.draggable,f=o.dimensions,m=o.viewport,g=o.afterCritical,y=f.draggables,w=f.droppables,B=Mn(l),N=B?w[B]:null,E=w[c.descriptor.droppableId],I=La({impact:l,draggable:c,draggables:y,afterCritical:g,droppable:N||E,viewport:m}),$=kn(I,c.client.borderBox.center);return $},Su=function(o){var l=o.draggables,c=o.reason,f=o.lastImpact,m=o.home,g=o.viewport,y=o.onLiftImpact;if(!f.at||c!=="DROP"){var w=oa({draggables:l,impact:y,destination:m,viewport:g,forceShouldAnimate:!0});return{impact:w,didDropInsideDroppable:!1}}if(f.at.type==="REORDER")return{impact:f,didDropInsideDroppable:!0};var B=(0,ue.Z)({},f,{displaced:z});return{impact:B,didDropInsideDroppable:!0}},_u=function(o){var l=o.getState,c=o.dispatch;return function(f){return function(m){if(m.type!=="DROP"){f(m);return}var g=l(),y=m.payload.reason;if(g.phase==="COLLECTING"){c(us({reason:y}));return}if(g.phase!=="IDLE"){var w=g.phase==="DROP_PENDING"&&g.isWaiting;w&&Pe(!1),g.phase==="DRAGGING"||g.phase==="DROP_PENDING"||Pe(!1);var B=g.critical,N=g.dimensions,E=N.draggables[g.critical.draggable.id],I=Su({reason:y,lastImpact:g.impact,afterCritical:g.afterCritical,onLiftImpact:g.onLiftImpact,home:g.dimensions.droppables[g.critical.droppable.id],viewport:g.viewport,draggables:g.dimensions.draggables}),$=I.impact,W=I.didDropInsideDroppable,oe=W?Ui($):null,We=W?b($):null,Ge={index:B.draggable.index,droppableId:B.droppable.id},Qe={draggableId:E.descriptor.id,type:E.descriptor.type,source:Ge,reason:y,mode:g.movementMode,destination:oe,combine:We},xt=yc({impact:$,draggable:E,dimensions:N,viewport:g.viewport,afterCritical:g.afterCritical}),Lt={critical:g.critical,afterCritical:g.afterCritical,result:Qe,impact:$},Rt=!Jr(g.current.client.offset,xt)||!!Qe.combine;if(!Rt){c(Ta({completed:Lt}));return}var Yt=wu({current:g.current.client.offset,destination:xt,reason:y}),Ft={newHomeClientOffset:xt,dropDuration:Yt,completed:Lt};c(Ka(Ft))}}}},xc=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Mu(o){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(c){c.target!==window&&c.target!==window.document||o()}}}function Cu(o){var l=o.onWindowScroll;function c(){l(xc())}var f=me(c),m=Mu(f),g=_r;function y(){return g!==_r}function w(){y()&&Pe(!1),g=Pr(window,[m])}function B(){y()||Pe(!1),f.cancel(),g(),g=_r}return{start:w,stop:B,isActive:y}}var Eu=function(l){return l.type==="DROP_COMPLETE"||l.type==="DROP_ANIMATE"||l.type==="FLUSH"},Ja=function(o){var l=Cu({onWindowScroll:function(f){o.dispatch(za({newScroll:f}))}});return function(c){return function(f){!l.isActive()&&f.type==="INITIAL_PUBLISH"&&l.start(),l.isActive()&&Eu(f)&&l.stop(),c(f)}}},wc=function(o){var l=!1,c=!1,f=setTimeout(function(){c=!0}),m=function(y){l||c||(l=!0,o(y),clearTimeout(f))};return m.wasCalled=function(){return l},m},fo=function(){var o=[],l=function(g){var y=ea(o,function(N){return N.timerId===g});y===-1&&Pe(!1);var w=o.splice(y,1),B=w[0];B.callback()},c=function(g){var y=setTimeout(function(){return l(y)}),w={timerId:y,callback:g};o.push(w)},f=function(){if(o.length){var g=[].concat(o);o.length=0,g.forEach(function(y){clearTimeout(y.timerId),y.callback()})}};return{add:c,flush:f}},ku=function(l,c){return l==null&&c==null?!0:l==null||c==null?!1:l.droppableId===c.droppableId&&l.index===c.index},Sc=function(l,c){return l==null&&c==null?!0:l==null||c==null?!1:l.draggableId===c.draggableId&&l.droppableId===c.droppableId},_c=function(l,c){if(l===c)return!0;var f=l.draggable.id===c.draggable.id&&l.draggable.droppableId===c.draggable.droppableId&&l.draggable.type===c.draggable.type&&l.draggable.index===c.draggable.index,m=l.droppable.id===c.droppable.id&&l.droppable.type===c.droppable.type;return f&&m},ds=function(l,c){Ri(),c(),Oi()},fs=function(l,c){return{draggableId:l.draggable.id,type:l.droppable.type,source:{droppableId:l.droppable.id,index:l.draggable.index},mode:c}},gl=function(l,c,f,m){if(!l){f(m(c));return}var g=wc(f),y={announce:g};l(c,y),g.wasCalled()||f(m(c))},Au=function(o,l){var c=fo(),f=null,m=function($,W){f&&Pe(!1),ds("onBeforeCapture",function(){var oe=o().onBeforeCapture;if(oe){var We={draggableId:$,mode:W};oe(We)}})},g=function($,W){f&&Pe(!1),ds("onBeforeDragStart",function(){var oe=o().onBeforeDragStart;oe&&oe(fs($,W))})},y=function($,W){f&&Pe(!1);var oe=fs($,W);f={mode:W,lastCritical:$,lastLocation:oe.source,lastCombine:null},c.add(function(){ds("onDragStart",function(){return gl(o().onDragStart,oe,l,Ki.onDragStart)})})},w=function($,W){var oe=Ui(W),We=b(W);f||Pe(!1);var Ge=!_c($,f.lastCritical);Ge&&(f.lastCritical=$);var Qe=!ku(f.lastLocation,oe);Qe&&(f.lastLocation=oe);var xt=!Sc(f.lastCombine,We);if(xt&&(f.lastCombine=We),!(!Ge&&!Qe&&!xt)){var Lt=(0,ue.Z)({},fs($,f.mode),{combine:We,destination:oe});c.add(function(){ds("onDragUpdate",function(){return gl(o().onDragUpdate,Lt,l,Ki.onDragUpdate)})})}},B=function(){f||Pe(!1),c.flush()},N=function($){f||Pe(!1),f=null,ds("onDragEnd",function(){return gl(o().onDragEnd,$,l,Ki.onDragEnd)})},E=function(){if(f){var $=(0,ue.Z)({},fs(f.lastCritical,f.mode),{combine:null,destination:null,reason:"CANCEL"});N($)}};return{beforeCapture:m,beforeStart:g,start:y,update:w,flush:B,drop:N,abort:E}},Du=function(o,l){var c=Au(o,l);return function(f){return function(m){return function(g){if(g.type==="BEFORE_INITIAL_CAPTURE"){c.beforeCapture(g.payload.draggableId,g.payload.movementMode);return}if(g.type==="INITIAL_PUBLISH"){var y=g.payload.critical;c.beforeStart(y,g.payload.movementMode),m(g),c.start(y,g.payload.movementMode);return}if(g.type==="DROP_COMPLETE"){var w=g.payload.completed.result;c.flush(),m(g),c.drop(w);return}if(m(g),g.type==="FLUSH"){c.abort();return}var B=f.getState();B.phase==="DRAGGING"&&c.update(B.critical,B.impact)}}}},Lu=function(o){return function(l){return function(c){if(c.type!=="DROP_ANIMATION_FINISHED"){l(c);return}var f=o.getState();f.phase!=="DROP_ANIMATING"&&Pe(!1),o.dispatch(Ta({completed:f.completed}))}}},Iu=function(o){var l=null,c=null;function f(){c&&(cancelAnimationFrame(c),c=null),l&&(l(),l=null)}return function(m){return function(g){if((g.type==="FLUSH"||g.type==="DROP_COMPLETE"||g.type==="DROP_ANIMATION_FINISHED")&&f(),m(g),g.type==="DROP_ANIMATE"){var y={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var B=o.getState();B.phase==="DROP_ANIMATING"&&o.dispatch(Ds())}};c=requestAnimationFrame(function(){c=null,l=Pr(window,[y])})}}}},Bu=function(o){return function(){return function(l){return function(c){(c.type==="DROP_COMPLETE"||c.type==="FLUSH"||c.type==="DROP_ANIMATE")&&o.stopPublishing(),l(c)}}}},Tu=function(o){var l=!1;return function(){return function(c){return function(f){if(f.type==="INITIAL_PUBLISH"){l=!0,o.tryRecordFocus(f.payload.critical.draggable.id),c(f),o.tryRestoreFocusRecorded();return}if(c(f),!!l){if(f.type==="FLUSH"){l=!1,o.tryRestoreFocusRecorded();return}if(f.type==="DROP_COMPLETE"){l=!1;var m=f.payload.completed.result;m.combine&&o.tryShiftRecord(m.draggableId,m.combine.draggableId),o.tryRestoreFocusRecorded()}}}}}},$u=function(l){return l.type==="DROP_COMPLETE"||l.type==="DROP_ANIMATE"||l.type==="FLUSH"},Pu=function(o){return function(l){return function(c){return function(f){if($u(f)){o.stop(),c(f);return}if(f.type==="INITIAL_PUBLISH"){c(f);var m=l.getState();m.phase!=="DRAGGING"&&Pe(!1),o.start(m);return}c(f),o.scroll(l.getState())}}}},vl=function(o){return function(l){return function(c){if(l(c),c.type==="PUBLISH_WHILE_DRAGGING"){var f=o.getState();f.phase==="DROP_PENDING"&&(f.isWaiting||o.dispatch(As({reason:f.reason})))}}}},Ru=U.qC,Ou=function(o){var l=o.dimensionMarshal,c=o.focusMarshal,f=o.styleMarshal,m=o.getResponders,g=o.announce,y=o.autoScroller;return(0,U.MT)(Qn,Ru((0,U.md)(hl(f),Bu(l),pl(l),_u,Lu,Iu,vl,Pu(y),Ja,Tu(c),Du(m,g))))},bl=function(){return{additions:{},removals:{},modified:{}}};function Nu(o){var l=o.registry,c=o.callbacks,f=bl(),m=null,g=function(){m||(c.collectionStarting(),m=requestAnimationFrame(function(){m=null,Ri();var E=f,I=E.additions,$=E.removals,W=E.modified,oe=Object.keys(I).map(function(Qe){return l.draggable.getById(Qe).getDimension(an)}).sort(function(Qe,xt){return Qe.descriptor.index-xt.descriptor.index}),We=Object.keys(W).map(function(Qe){var xt=l.droppable.getById(Qe),Lt=xt.callbacks.getScrollWhileDragging();return{droppableId:Qe,scroll:Lt}}),Ge={additions:oe,removals:Object.keys($),modified:We};f=bl(),Oi(),c.publish(Ge)}))},y=function(E){var I=E.descriptor.id;f.additions[I]=E,f.modified[E.descriptor.droppableId]=!0,f.removals[I]&&delete f.removals[I],g()},w=function(E){var I=E.descriptor;f.removals[I.id]=!0,f.modified[I.droppableId]=!0,f.additions[I.id]&&delete f.additions[I.id],g()},B=function(){m&&(cancelAnimationFrame(m),m=null,f=bl())};return{add:y,remove:w,stop:B}}var Mc=function(o){var l=o.scrollHeight,c=o.scrollWidth,f=o.height,m=o.width,g=kn({x:c,y:l},{x:m,y:f}),y={x:Math.max(0,g.x),y:Math.max(0,g.y)};return y},Vo=function(){var o=document.documentElement;return o||Pe(!1),o},Uo=function(){var o=Vo(),l=Mc({scrollHeight:o.scrollHeight,scrollWidth:o.scrollWidth,width:o.clientWidth,height:o.clientHeight});return l},Cc=function(){var o=xc(),l=Uo(),c=o.y,f=o.x,m=Vo(),g=m.clientWidth,y=m.clientHeight,w=f+g,B=c+y,N=dr({top:c,left:f,right:w,bottom:B}),E={frame:N,scroll:{initial:o,current:o,max:l,diff:{value:an,displacement:an}}};return E},Fu=function(o){var l=o.critical,c=o.scrollOptions,f=o.registry;Ri();var m=Cc(),g=m.scroll.current,y=l.droppable,w=f.droppable.getAllByType(y.type).map(function(I){return I.callbacks.getDimensionAndWatchScroll(g,c)}),B=f.draggable.getAllByType(l.draggable.type).map(function(I){return I.getDimension(g)}),N={draggables:ui(B),droppables:Bi(w)};Oi();var E={dimensions:N,critical:l,viewport:m};return E};function Ec(o,l,c){if(c.descriptor.id===l.id||c.descriptor.type!==l.type)return!1;var f=o.droppable.getById(c.descriptor.droppableId);return f.descriptor.mode==="virtual"}var zu=function(o,l){var c=null,f=Nu({callbacks:{publish:l.publishWhileDragging,collectionStarting:l.collectionStarting},registry:o}),m=function(W,oe){o.droppable.exists(W)||Pe(!1),c&&l.updateDroppableIsEnabled({id:W,isEnabled:oe})},g=function(W,oe){c&&(o.droppable.exists(W)||Pe(!1),l.updateDroppableIsCombineEnabled({id:W,isCombineEnabled:oe}))},y=function(W,oe){c&&(o.droppable.exists(W)||Pe(!1),l.updateDroppableScroll({id:W,newScroll:oe}))},w=function(W,oe){c&&o.droppable.getById(W).callbacks.scroll(oe)},B=function(){if(c){f.stop();var W=c.critical.droppable;o.droppable.getAllByType(W.type).forEach(function(oe){return oe.callbacks.dragStopped()}),c.unsubscribe(),c=null}},N=function(W){c||Pe(!1);var oe=c.critical.draggable;W.type==="ADDITION"&&Ec(o,oe,W.value)&&f.add(W.value),W.type==="REMOVAL"&&Ec(o,oe,W.value)&&f.remove(W.value)},E=function(W){c&&Pe(!1);var oe=o.draggable.getById(W.draggableId),We=o.droppable.getById(oe.descriptor.droppableId),Ge={draggable:oe.descriptor,droppable:We.descriptor},Qe=o.subscribe(N);return c={critical:Ge,unsubscribe:Qe},Fu({critical:Ge,registry:o,scrollOptions:W.scrollOptions})},I={updateDroppableIsEnabled:m,updateDroppableIsCombineEnabled:g,scrollDroppable:w,updateDroppableScroll:y,startPublishing:E,stopPublishing:B};return I},kc=function(o,l){return o.phase==="IDLE"?!0:o.phase!=="DROP_ANIMATING"||o.completed.result.draggableId===l?!1:o.completed.result.reason==="DROP"},yl=function(o){window.scrollBy(o.x,o.y)},Ku=K(function(o){return ii(o).filter(function(l){return!(!l.isEnabled||!l.frame)})}),Hu=function(l,c){var f=qn(Ku(c),function(m){return m.frame||Pe(!1),Hn(m.frame.pageMarginBox)(l)});return f},Wu=function(o){var l=o.center,c=o.destination,f=o.droppables;if(c){var m=f[c];return m.frame?m:null}var g=Hu(l,f);return g},wa={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(l){return Math.pow(l,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},xl=function(o,l){var c=o[l.size]*wa.startFromPercentage,f=o[l.size]*wa.maxScrollAtPercentage,m={startScrollingFrom:c,maxScrollValueAt:f};return m},Ac=function(o){var l=o.startOfRange,c=o.endOfRange,f=o.current,m=c-l;if(m===0)return 0;var g=f-l,y=g/m;return y},Is=1,Vu=function(o,l){if(o>l.startScrollingFrom)return 0;if(o<=l.maxScrollValueAt)return wa.maxPixelScroll;if(o===l.startScrollingFrom)return Is;var c=Ac({startOfRange:l.maxScrollValueAt,endOfRange:l.startScrollingFrom,current:o}),f=1-c,m=wa.maxPixelScroll*wa.ease(f);return Math.ceil(m)},Dc=wa.durationDampening.accelerateAt,Lc=wa.durationDampening.stopDampeningAt,wl=function(o,l){var c=l,f=Lc,m=Date.now(),g=m-c;if(g>=Lc)return o;if(g<Dc)return Is;var y=Ac({startOfRange:Dc,endOfRange:f,current:g}),w=o*wa.ease(y);return Math.ceil(w)},Bs=function(o){var l=o.distanceToEdge,c=o.thresholds,f=o.dragStartTime,m=o.shouldUseTimeDampening,g=Vu(l,c);return g===0?0:m?Math.max(wl(g,f),Is):g},Ts=function(o){var l=o.container,c=o.distanceToEdges,f=o.dragStartTime,m=o.axis,g=o.shouldUseTimeDampening,y=xl(l,m),w=c[m.end]<c[m.start];return w?Bs({distanceToEdge:c[m.end],thresholds:y,dragStartTime:f,shouldUseTimeDampening:g}):-1*Bs({distanceToEdge:c[m.start],thresholds:y,dragStartTime:f,shouldUseTimeDampening:g})},Uu=function(o){var l=o.container,c=o.subject,f=o.proposedScroll,m=c.height>l.height,g=c.width>l.width;return!g&&!m?f:g&&m?null:{x:g?0:f.x,y:m?0:f.y}},Zu=Ii(function(o){return o===0?0:o}),Ic=function(o){var l=o.dragStartTime,c=o.container,f=o.subject,m=o.center,g=o.shouldUseTimeDampening,y={top:m.y-c.top,right:c.right-m.x,bottom:c.bottom-m.y,left:m.x-c.left},w=Ts({container:c,distanceToEdges:y,dragStartTime:l,axis:st,shouldUseTimeDampening:g}),B=Ts({container:c,distanceToEdges:y,dragStartTime:l,axis:Be,shouldUseTimeDampening:g}),N=Zu({x:B,y:w});if(Jr(N,an))return null;var E=Uu({container:c,subject:f,proposedScroll:N});return E?Jr(E,an)?null:E:null},Sl=Ii(function(o){return o===0?0:o>0?1:-1}),ps=function(){var o=function(c,f){return c<0?c:c>f?c-f:0};return function(l){var c=l.current,f=l.max,m=l.change,g=Ar(c,m),y={x:o(g.x,f.x),y:o(g.y,f.y)};return Jr(y,an)?null:y}}(),$s=function(l){var c=l.max,f=l.current,m=l.change,g={x:Math.max(f.x,c.x),y:Math.max(f.y,c.y)},y=Sl(m),w=ps({max:g,current:f,change:y});return!w||y.x!==0&&w.x===0||y.y!==0&&w.y===0},hs=function(l,c){return $s({current:l.scroll.current,max:l.scroll.max,change:c})},ju=function(l,c){if(!hs(l,c))return null;var f=l.scroll.max,m=l.scroll.current;return ps({current:m,max:f,change:c})},Ps=function(l,c){var f=l.frame;return f?$s({current:f.scroll.current,max:f.scroll.max,change:c}):!1},_l=function(l,c){var f=l.frame;return!f||!Ps(l,c)?null:ps({current:f.scroll.current,max:f.scroll.max,change:c})},Gu=function(o){var l=o.viewport,c=o.subject,f=o.center,m=o.dragStartTime,g=o.shouldUseTimeDampening,y=Ic({dragStartTime:m,container:l.frame,subject:c,center:f,shouldUseTimeDampening:g});return y&&hs(l,y)?y:null},qu=function(o){var l=o.droppable,c=o.subject,f=o.center,m=o.dragStartTime,g=o.shouldUseTimeDampening,y=l.frame;if(!y)return null;var w=Ic({dragStartTime:m,container:y.pageMarginBox,subject:c,center:f,shouldUseTimeDampening:g});return w&&Ps(l,w)?w:null},Bc=function(o){var l=o.state,c=o.dragStartTime,f=o.shouldUseTimeDampening,m=o.scrollWindow,g=o.scrollDroppable,y=l.current.page.borderBoxCenter,w=l.dimensions.draggables[l.critical.draggable.id],B=w.page.marginBox;if(l.isWindowScrollAllowed){var N=l.viewport,E=Gu({dragStartTime:c,viewport:N,subject:B,center:y,shouldUseTimeDampening:f});if(E){m(E);return}}var I=Wu({center:y,destination:Mn(l.impact),droppables:l.dimensions.droppables});if(I){var $=qu({dragStartTime:c,droppable:I,subject:B,center:y,shouldUseTimeDampening:f});$&&g(I.descriptor.id,$)}},Xu=function(o){var l=o.scrollWindow,c=o.scrollDroppable,f=me(l),m=me(c),g=null,y=function(E){g||Pe(!1);var I=g,$=I.shouldUseTimeDampening,W=I.dragStartTime;Bc({state:E,scrollWindow:f,scrollDroppable:m,dragStartTime:W,shouldUseTimeDampening:$})},w=function(E){Ri(),g&&Pe(!1);var I=Date.now(),$=!1,W=function(){$=!0};Bc({state:E,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:W,scrollDroppable:W}),g={dragStartTime:I,shouldUseTimeDampening:$},Oi(),$&&y(E)},B=function(){g&&(f.cancel(),m.cancel(),g=null)};return{start:w,stop:B,scroll:y}},Ml=function(o){var l=o.move,c=o.scrollDroppable,f=o.scrollWindow,m=function(N,E){var I=Ar(N.current.client.selection,E);l({client:I})},g=function(N,E){if(!Ps(N,E))return E;var I=_l(N,E);if(!I)return c(N.descriptor.id,E),null;var $=kn(E,I);c(N.descriptor.id,$);var W=kn(E,$);return W},y=function(N,E,I){if(!N||!hs(E,I))return I;var $=ju(E,I);if(!$)return f(I),null;var W=kn(I,$);f(W);var oe=kn(I,W);return oe},w=function(N){var E=N.scrollJumpRequest;if(E){var I=Mn(N.impact);I||Pe(!1);var $=g(N.dimensions.droppables[I],E);if($){var W=N.viewport,oe=y(N.isWindowScrollAllowed,W,$);oe&&m(N,oe)}}};return w},_t=function(o){var l=o.scrollDroppable,c=o.scrollWindow,f=o.move,m=Xu({scrollWindow:c,scrollDroppable:l}),g=Ml({move:f,scrollWindow:c,scrollDroppable:l}),y=function(N){if(N.phase==="DRAGGING"){if(N.movementMode==="FLUID"){m.scroll(N);return}N.scrollJumpRequest&&g(N)}},w={scroll:y,start:m.start,stop:m.stop};return w},Gi="data-rbd",Zo=function(){var o=Gi+"-drag-handle";return{base:o,draggableId:o+"-draggable-id",contextId:o+"-context-id"}}(),Cl=function(){var o=Gi+"-draggable";return{base:o,contextId:o+"-context-id",id:o+"-id"}}(),la=function(){var o=Gi+"-droppable";return{base:o,contextId:o+"-context-id",id:o+"-id"}}(),ms={contextId:Gi+"-scroll-container-context-id"},Ju=function(l){return function(c){return"["+c+'="'+l+'"]'}},Rs=function(l,c){return l.map(function(f){var m=f.styles[c];return m?f.selector+" { "+m+" }":""}).join(" ")},d0="pointer-events: none;",gs=function(o){var l=Ju(o),c=function(){var w=`
|
|
|
cursor: -webkit-grab;
|
|
|
cursor: grab;
|
|
|
`;return{selector:l(Zo.contextId),styles:{always:`
|
|
|
-webkit-touch-callout: none;
|
|
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
|
touch-action: manipulation;
|
|
|
`,resting:w,dragging:d0,dropAnimating:w}}}(),f=function(){var w=`
|
|
|
transition: `+ei.outOfTheWay+`;
|
|
|
`;return{selector:l(Cl.contextId),styles:{dragging:w,dropAnimating:w,userCancel:w}}}(),m={selector:l(la.contextId),styles:{always:"overflow-anchor: none;"}},g={selector:"body",styles:{dragging:`
|
|
|
cursor: grabbing;
|
|
|
cursor: -webkit-grabbing;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
-moz-user-select: none;
|
|
|
-ms-user-select: none;
|
|
|
overflow-anchor: none;
|
|
|
`}},y=[f,c,m,g];return{always:Rs(y,"always"),resting:Rs(y,"resting"),dragging:Rs(y,"dragging"),dropAnimating:Rs(y,"dropAnimating"),userCancel:Rs(y,"userCancel")}},Vn=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?A.useLayoutEffect:A.useEffect,Tc=function(){var l=document.querySelector("head");return l||Pe(!1),l},po=function(l){var c=document.createElement("style");return l&&c.setAttribute("nonce",l),c.type="text/css",c};function Yu(o,l){var c=Vt(function(){return gs(o)},[o]),f=(0,A.useRef)(null),m=(0,A.useRef)(null),g=ct(K(function(I){var $=m.current;$||Pe(!1),$.textContent=I}),[]),y=ct(function(I){var $=f.current;$||Pe(!1),$.textContent=I},[]);Vn(function(){!f.current&&!m.current||Pe(!1);var I=po(l),$=po(l);return f.current=I,m.current=$,I.setAttribute(Gi+"-always",o),$.setAttribute(Gi+"-dynamic",o),Tc().appendChild(I),Tc().appendChild($),y(c.always),g(c.resting),function(){var W=function(We){var Ge=We.current;Ge||Pe(!1),Tc().removeChild(Ge),We.current=null};W(f),W(m)}},[l,y,g,c.always,c.resting,o]);var w=ct(function(){return g(c.dragging)},[g,c.dragging]),B=ct(function(I){if(I==="DROP"){g(c.dropAnimating);return}g(c.userCancel)},[g,c.dropAnimating,c.userCancel]),N=ct(function(){m.current&&g(c.resting)},[g,c.resting]),E=Vt(function(){return{dragging:w,dropping:B,resting:N}},[w,B,N]);return E}var El=function(o){return o&&o.ownerDocument?o.ownerDocument.defaultView:window};function jo(o){return o instanceof El(o).HTMLElement}function $c(o,l){var c="["+Zo.contextId+'="'+o+'"]',f=Vi(document.querySelectorAll(c));if(!f.length)return null;var m=qn(f,function(g){return g.getAttribute(Zo.draggableId)===l});return!m||!jo(m)?null:m}function vs(o){var l=(0,A.useRef)({}),c=(0,A.useRef)(null),f=(0,A.useRef)(null),m=(0,A.useRef)(!1),g=ct(function($,W){var oe={id:$,focus:W};return l.current[$]=oe,function(){var Ge=l.current,Qe=Ge[$];Qe!==oe&&delete Ge[$]}},[]),y=ct(function($){var W=$c(o,$);W&&W!==document.activeElement&&W.focus()},[o]),w=ct(function($,W){c.current===$&&(c.current=W)},[]),B=ct(function(){f.current||m.current&&(f.current=requestAnimationFrame(function(){f.current=null;var $=c.current;$&&y($)}))},[y]),N=ct(function($){c.current=null;var W=document.activeElement;W&&W.getAttribute(Zo.draggableId)===$&&(c.current=$)},[]);Vn(function(){return m.current=!0,function(){m.current=!1;var $=f.current;$&&cancelAnimationFrame($)}},[]);var E=Vt(function(){return{register:g,tryRecordFocus:N,tryRestoreFocusRecorded:B,tryShiftRecord:w}},[g,N,B,w]);return E}function Pc(){var o={draggables:{},droppables:{}},l=[];function c(I){return l.push(I),function(){var W=l.indexOf(I);W!==-1&&l.splice(W,1)}}function f(I){l.length&&l.forEach(function($){return $(I)})}function m(I){return o.draggables[I]||null}function g(I){var $=m(I);return $||Pe(!1),$}var y={register:function($){o.draggables[$.descriptor.id]=$,f({type:"ADDITION",value:$})},update:function($,W){var oe=o.draggables[W.descriptor.id];oe&&oe.uniqueId===$.uniqueId&&(delete o.draggables[W.descriptor.id],o.draggables[$.descriptor.id]=$)},unregister:function($){var W=$.descriptor.id,oe=m(W);oe&&$.uniqueId===oe.uniqueId&&(delete o.draggables[W],f({type:"REMOVAL",value:$}))},getById:g,findById:m,exists:function($){return!!m($)},getAllByType:function($){return ba(o.draggables).filter(function(W){return W.descriptor.type===$})}};function w(I){return o.droppables[I]||null}function B(I){var $=w(I);return $||Pe(!1),$}var N={register:function($){o.droppables[$.descriptor.id]=$},unregister:function($){var W=w($.descriptor.id);W&&$.uniqueId===W.uniqueId&&delete o.droppables[$.descriptor.id]},getById:B,findById:w,exists:function($){return!!w($)},getAllByType:function($){return ba(o.droppables).filter(function(W){return W.descriptor.type===$})}};function E(){o.draggables={},o.droppables={},l.length=0}return{draggable:y,droppable:N,subscribe:c,clean:E}}function Rc(){var o=Vt(Pc,[]);return(0,A.useEffect)(function(){return function(){requestAnimationFrame(o.clean)}},[o]),o}var kl=A.createContext(null),Os=function(){var o=document.body;return o||Pe(!1),o},f0={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},p0=function(l){return"rbd-announcement-"+l};function Al(o){var l=Vt(function(){return p0(o)},[o]),c=(0,A.useRef)(null);(0,A.useEffect)(function(){var g=document.createElement("div");return c.current=g,g.id=l,g.setAttribute("aria-live","assertive"),g.setAttribute("aria-atomic","true"),(0,ue.Z)(g.style,f0),Os().appendChild(g),function(){setTimeout(function(){var B=Os();B.contains(g)&&B.removeChild(g),g===c.current&&(c.current=null)})}},[l]);var f=ct(function(m){var g=c.current;if(g){g.textContent=m;return}},[]);return f}var Qu=0,Dl={separator:"::"};function ed(){Qu=0}function Ll(o,l){return l===void 0&&(l=Dl),Vt(function(){return""+o+l.separator+Qu++},[l.separator,o])}function h0(o){var l=o.contextId,c=o.uniqueId;return"rbd-hidden-text-"+l+"-"+c}function td(o){var l=o.contextId,c=o.text,f=Ll("hidden-text",{separator:"-"}),m=Vt(function(){return h0({contextId:l,uniqueId:f})},[f,l]);return(0,A.useEffect)(function(){var y=document.createElement("div");return y.id=m,y.textContent=c,y.style.display="none",Os().appendChild(y),function(){var B=Os();B.contains(y)&&B.removeChild(y)}},[m,c]),m}var Il=A.createContext(null),m0={react:"^16.8.5","react-dom":"^16.8.5"},Bl=/(\d+)\.(\d+)\.(\d+)/,Cr=function(l){var c=Bl.exec(l);c==null&&Pe(!1);var f=Number(c[1]),m=Number(c[2]),g=Number(c[3]);return{major:f,minor:m,patch:g,raw:l}},yn=function(l,c){return c.major>l.major?!0:c.major<l.major?!1:c.minor>l.minor?!0:c.minor<l.minor?!1:c.patch>=l.patch},Go=function(o,l){var c=Cr(o),f=Cr(l);yn(c,f)},g0=`
|
|
|
We expect a html5 doctype: <!doctype html>
|
|
|
This is to ensure consistent browser layout and measurement
|
|
|
|
|
|
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md
|
|
|
`,Sa=function(o){var l=o.doctype;l&&(l.name.toLowerCase(),l.publicId)};function v0(o){}function Pa(o,l){}function rd(){Pa(function(){Go(m0.react,A.version),Sa(document)},[])}function Oc(o){var l=(0,A.useRef)(o);return(0,A.useEffect)(function(){l.current=o}),l}function b0(){var o=null;function l(){return!!o}function c(y){return y===o}function f(y){o&&Pe(!1);var w={abandon:y};return o=w,w}function m(){o||Pe(!1),o=null}function g(){o&&(o.abandon(),m())}return{isClaimed:l,isActive:c,claim:f,release:m,tryAbandon:g}}var Nc=9,Ns=13,qo=27,je=32,Fc=33,Tl=34,$l=35,Pl=36,y0=37,x0=38,w0=39,ti=40,Rl,zc=(Rl={},Rl[Ns]=!0,Rl[Nc]=!0,Rl),Fs=function(o){zc[o.keyCode]&&o.preventDefault()},Xo=function(){var o="visibilitychange";if(typeof document=="undefined")return o;var l=[o,"ms"+o,"webkit"+o,"moz"+o,"o"+o],c=qn(l,function(f){return"on"+f in document});return c||o}(),yo=0,Jo=5;function _a(o,l){return Math.abs(l.x-o.x)>=Jo||Math.abs(l.y-o.y)>=Jo}var xo={type:"IDLE"};function qi(o){var l=o.cancel,c=o.completed,f=o.getPhase,m=o.setPhase;return[{eventName:"mousemove",fn:function(y){var w=y.button,B=y.clientX,N=y.clientY;if(w===yo){var E={x:B,y:N},I=f();if(I.type==="DRAGGING"){y.preventDefault(),I.actions.move(E);return}I.type!=="PENDING"&&Pe(!1);var $=I.point;if(_a($,E)){y.preventDefault();var W=I.actions.fluidLift(E);m({type:"DRAGGING",actions:W})}}}},{eventName:"mouseup",fn:function(y){var w=f();if(w.type!=="DRAGGING"){l();return}y.preventDefault(),w.actions.drop({shouldBlockNextClick:!0}),c()}},{eventName:"mousedown",fn:function(y){f().type==="DRAGGING"&&y.preventDefault(),l()}},{eventName:"keydown",fn:function(y){var w=f();if(w.type==="PENDING"){l();return}if(y.keyCode===qo){y.preventDefault(),l();return}Fs(y)}},{eventName:"resize",fn:l},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){f().type==="PENDING"&&l()}},{eventName:"webkitmouseforcedown",fn:function(y){var w=f();if(w.type==="IDLE"&&Pe(!1),w.actions.shouldRespectForcePress()){l();return}y.preventDefault()}},{eventName:Xo,fn:l}]}function wo(o){var l=(0,A.useRef)(xo),c=(0,A.useRef)(_r),f=Vt(function(){return{eventName:"mousedown",fn:function(I){if(!I.defaultPrevented&&I.button===yo&&!(I.ctrlKey||I.metaKey||I.shiftKey||I.altKey)){var $=o.findClosestDraggableId(I);if($){var W=o.tryGetLock($,y,{sourceEvent:I});if(W){I.preventDefault();var oe={x:I.clientX,y:I.clientY};c.current(),N(W,oe)}}}}}},[o]),m=Vt(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(I){if(!I.defaultPrevented){var $=o.findClosestDraggableId(I);if($){var W=o.findOptionsForDraggable($);W&&(W.shouldRespectForcePress||o.canGetLock($)&&I.preventDefault())}}}}},[o]),g=ct(function(){var I={passive:!1,capture:!0};c.current=Pr(window,[m,f],I)},[m,f]),y=ct(function(){var E=l.current;E.type!=="IDLE"&&(l.current=xo,c.current(),g())},[g]),w=ct(function(){var E=l.current;y(),E.type==="DRAGGING"&&E.actions.cancel({shouldBlockNextClick:!0}),E.type==="PENDING"&&E.actions.abort()},[y]),B=ct(function(){var I={capture:!0,passive:!1},$=qi({cancel:w,completed:y,getPhase:function(){return l.current},setPhase:function(oe){l.current=oe}});c.current=Pr(window,$,I)},[w,y]),N=ct(function(I,$){l.current.type!=="IDLE"&&Pe(!1),l.current={type:"PENDING",point:$,actions:I},B()},[B]);Vn(function(){return g(),function(){c.current()}},[g])}var Ya;function Qa(){}var nd=(Ya={},Ya[Tl]=!0,Ya[Fc]=!0,Ya[Pl]=!0,Ya[$l]=!0,Ya);function id(o,l){function c(){l(),o.cancel()}function f(){l(),o.drop()}return[{eventName:"keydown",fn:function(g){if(g.keyCode===qo){g.preventDefault(),c();return}if(g.keyCode===je){g.preventDefault(),f();return}if(g.keyCode===ti){g.preventDefault(),o.moveDown();return}if(g.keyCode===x0){g.preventDefault(),o.moveUp();return}if(g.keyCode===w0){g.preventDefault(),o.moveRight();return}if(g.keyCode===y0){g.preventDefault(),o.moveLeft();return}if(nd[g.keyCode]){g.preventDefault();return}Fs(g)}},{eventName:"mousedown",fn:c},{eventName:"mouseup",fn:c},{eventName:"click",fn:c},{eventName:"touchstart",fn:c},{eventName:"resize",fn:c},{eventName:"wheel",fn:c,options:{passive:!0}},{eventName:Xo,fn:c}]}function Kc(o){var l=(0,A.useRef)(Qa),c=Vt(function(){return{eventName:"keydown",fn:function(g){if(g.defaultPrevented||g.keyCode!==je)return;var y=o.findClosestDraggableId(g);if(!y)return;var w=o.tryGetLock(y,E,{sourceEvent:g});if(!w)return;g.preventDefault();var B=!0,N=w.snapLift();l.current();function E(){B||Pe(!1),B=!1,l.current(),f()}l.current=Pr(window,id(N,E),{capture:!0,passive:!1})}}},[o]),f=ct(function(){var g={passive:!1,capture:!0};l.current=Pr(window,[c],g)},[c]);Vn(function(){return f(),function(){l.current()}},[f])}var Hc={type:"IDLE"},Mi=120,eo=.15;function S0(o){var l=o.cancel,c=o.getPhase;return[{eventName:"orientationchange",fn:l},{eventName:"resize",fn:l},{eventName:"contextmenu",fn:function(m){m.preventDefault()}},{eventName:"keydown",fn:function(m){if(c().type!=="DRAGGING"){l();return}m.keyCode===qo&&m.preventDefault(),l()}},{eventName:Xo,fn:l}]}function ad(o){var l=o.cancel,c=o.completed,f=o.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(g){var y=f();if(y.type!=="DRAGGING"){l();return}y.hasMoved=!0;var w=g.touches[0],B=w.clientX,N=w.clientY,E={x:B,y:N};g.preventDefault(),y.actions.move(E)}},{eventName:"touchend",fn:function(g){var y=f();if(y.type!=="DRAGGING"){l();return}g.preventDefault(),y.actions.drop({shouldBlockNextClick:!0}),c()}},{eventName:"touchcancel",fn:function(g){if(f().type!=="DRAGGING"){l();return}g.preventDefault(),l()}},{eventName:"touchforcechange",fn:function(g){var y=f();y.type==="IDLE"&&Pe(!1);var w=g.touches[0];if(w){var B=w.force>=eo;if(B){var N=y.actions.shouldRespectForcePress();if(y.type==="PENDING"){N&&l();return}if(N){if(y.hasMoved){g.preventDefault();return}l();return}g.preventDefault()}}}},{eventName:Xo,fn:l}]}function Wc(o){var l=(0,A.useRef)(Hc),c=(0,A.useRef)(_r),f=ct(function(){return l.current},[]),m=ct(function(W){l.current=W},[]),g=Vt(function(){return{eventName:"touchstart",fn:function(W){if(!W.defaultPrevented){var oe=o.findClosestDraggableId(W);if(oe){var We=o.tryGetLock(oe,w,{sourceEvent:W});if(We){var Ge=W.touches[0],Qe=Ge.clientX,xt=Ge.clientY,Lt={x:Qe,y:xt};c.current(),I(We,Lt)}}}}}},[o]),y=ct(function(){var W={capture:!0,passive:!1};c.current=Pr(window,[g],W)},[g]),w=ct(function(){var $=l.current;$.type!=="IDLE"&&($.type==="PENDING"&&clearTimeout($.longPressTimerId),m(Hc),c.current(),y())},[y,m]),B=ct(function(){var $=l.current;w(),$.type==="DRAGGING"&&$.actions.cancel({shouldBlockNextClick:!0}),$.type==="PENDING"&&$.actions.abort()},[w]),N=ct(function(){var W={capture:!0,passive:!1},oe={cancel:B,completed:w,getPhase:f},We=Pr(window,ad(oe),W),Ge=Pr(window,S0(oe),W);c.current=function(){We(),Ge()}},[B,f,w]),E=ct(function(){var W=f();W.type!=="PENDING"&&Pe(!1);var oe=W.actions.fluidLift(W.point);m({type:"DRAGGING",actions:oe,hasMoved:!1})},[f,m]),I=ct(function(W,oe){f().type!=="IDLE"&&Pe(!1);var We=setTimeout(E,Mi);m({type:"PENDING",point:oe,actions:W,longPressTimerId:We}),N()},[N,f,m,E]);Vn(function(){return y(),function(){c.current();var oe=f();oe.type==="PENDING"&&(clearTimeout(oe.longPressTimerId),m(Hc))}},[f,y,m]),Vn(function(){var W=Pr(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return W},[])}function Er(o){}var bs={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function So(o,l){if(l==null)return!1;var c=!!bs[l.tagName.toLowerCase()];if(c)return!0;var f=l.getAttribute("contenteditable");return f==="true"||f===""?!0:l===o?!1:So(o,l.parentElement)}function Ol(o,l){var c=l.target;return jo(c)?So(o,c):!1}var we=function(o){return dr(o.getBoundingClientRect()).center};function _0(o){return o instanceof El(o).Element}var M0=function(){var o="matches";if(typeof document=="undefined")return o;var l=[o,"msMatchesSelector","webkitMatchesSelector"],c=qn(l,function(f){return f in Element.prototype});return c||o}();function Nl(o,l){return o==null?null:o[M0](l)?o:Nl(o.parentElement,l)}function C0(o,l){return o.closest?o.closest(l):Nl(o,l)}function zs(o){return"["+Zo.contextId+'="'+o+'"]'}function E0(o,l){var c=l.target;if(!_0(c))return null;var f=zs(o),m=C0(c,f);return!m||!jo(m)?null:m}function k0(o,l){var c=E0(o,l);return c?c.getAttribute(Zo.draggableId):null}function Ni(o,l){var c="["+Cl.contextId+'="'+o+'"]',f=Vi(document.querySelectorAll(c)),m=qn(f,function(g){return g.getAttribute(Cl.id)===l});return!m||!jo(m)?null:m}function _o(o){o.preventDefault()}function Yo(o){var l=o.expected,c=o.phase,f=o.isLockActive,m=o.shouldWarn;return!(!f()||l!==c)}function Ks(o){var l=o.lockAPI,c=o.store,f=o.registry,m=o.draggableId;if(l.isClaimed())return!1;var g=f.draggable.findById(m);return!(!g||!g.options.isEnabled||!kc(c.getState(),m))}function A0(o){var l=o.lockAPI,c=o.contextId,f=o.store,m=o.registry,g=o.draggableId,y=o.forceSensorStop,w=o.sourceEvent,B=Ks({lockAPI:l,store:f,registry:m,draggableId:g});if(!B)return null;var N=m.draggable.getById(g),E=Ni(c,N.descriptor.id);if(!E||w&&!N.options.canDragInteractiveElements&&Ol(E,w))return null;var I=l.claim(y||_r),$="PRE_DRAG";function W(){return N.options.shouldRespectForcePress}function oe(){return l.isActive(I)}function We(Ft,mr){Yo({expected:Ft,phase:$,isLockActive:oe,shouldWarn:!0})&&f.dispatch(mr())}var Ge=We.bind(null,"DRAGGING");function Qe(Ft){function mr(){l.release(),$="COMPLETED"}$!=="PRE_DRAG"&&(mr(),$!=="PRE_DRAG"&&Pe(!1)),f.dispatch(gi(Ft.liftActionArgs)),$="DRAGGING";function Tn(gr,Ur){if(Ur===void 0&&(Ur={shouldBlockNextClick:!1}),Ft.cleanup(),Ur.shouldBlockNextClick){var Ci=Pr(window,[{eventName:"click",fn:_o,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(Ci)}mr(),f.dispatch(As({reason:gr}))}return(0,ue.Z)({isActive:function(){return Yo({expected:"DRAGGING",phase:$,isLockActive:oe,shouldWarn:!1})},shouldRespectForcePress:W,drop:function(Ur){return Tn("DROP",Ur)},cancel:function(Ur){return Tn("CANCEL",Ur)}},Ft.actions)}function xt(Ft){var mr=me(function(gr){Ge(function(){return ls({client:gr})})}),Tn=Qe({liftActionArgs:{id:g,clientSelection:Ft,movementMode:"FLUID"},cleanup:function(){return mr.cancel()},actions:{move:mr}});return(0,ue.Z)({},Tn,{move:mr})}function Lt(){var Ft={moveUp:function(){return Ge(ul)},moveRight:function(){return Ge(fl)},moveDown:function(){return Ge(dl)},moveLeft:function(){return Ge(ks)}};return Qe({liftActionArgs:{id:g,clientSelection:we(E),movementMode:"SNAP"},cleanup:_r,actions:Ft})}function Rt(){var Ft=Yo({expected:"PRE_DRAG",phase:$,isLockActive:oe,shouldWarn:!0});Ft&&l.release()}var Yt={isActive:function(){return Yo({expected:"PRE_DRAG",phase:$,isLockActive:oe,shouldWarn:!1})},shouldRespectForcePress:W,fluidLift:xt,snapLift:Lt,abort:Rt};return Yt}var D0=[wo,Kc,Wc];function Vc(o){var l=o.contextId,c=o.store,f=o.registry,m=o.customSensors,g=o.enableDefaultSensors,y=[].concat(g?D0:[],m||[]),w=(0,A.useState)(function(){return b0()})[0],B=ct(function(xt,Lt){xt.isDragging&&!Lt.isDragging&&w.tryAbandon()},[w]);Vn(function(){var xt=c.getState(),Lt=c.subscribe(function(){var Rt=c.getState();B(xt,Rt),xt=Rt});return Lt},[w,c,B]),Vn(function(){return w.tryAbandon},[w.tryAbandon]);var N=ct(function(Qe){return Ks({lockAPI:w,registry:f,store:c,draggableId:Qe})},[w,f,c]),E=ct(function(Qe,xt,Lt){return A0({lockAPI:w,registry:f,contextId:l,store:c,draggableId:Qe,forceSensorStop:xt,sourceEvent:Lt&&Lt.sourceEvent?Lt.sourceEvent:null})},[l,w,f,c]),I=ct(function(Qe){return k0(l,Qe)},[l]),$=ct(function(Qe){var xt=f.draggable.findById(Qe);return xt?xt.options:null},[f.draggable]),W=ct(function(){w.isClaimed()&&(w.tryAbandon(),c.getState().phase!=="IDLE"&&c.dispatch(Nn()))},[w,c]),oe=ct(w.isClaimed,[w]),We=Vt(function(){return{canGetLock:N,tryGetLock:E,findClosestDraggableId:I,findOptionsForDraggable:$,tryReleaseLock:W,isLockClaimed:oe}},[N,E,I,$,W,oe]);Er(y);for(var Ge=0;Ge<y.length;Ge++)y[Ge](We)}var od=function(l){return{onBeforeCapture:l.onBeforeCapture,onBeforeDragStart:l.onBeforeDragStart,onDragStart:l.onDragStart,onDragEnd:l.onDragEnd,onDragUpdate:l.onDragUpdate}};function Mo(o){return o.current||Pe(!1),o.current}function ca(o){var l=o.contextId,c=o.setCallbacks,f=o.sensors,m=o.nonce,g=o.dragHandleUsageInstructions,y=(0,A.useRef)(null);rd();var w=Oc(o),B=ct(function(){return od(w.current)},[w]),N=Al(l),E=td({contextId:l,text:g}),I=Yu(l,m),$=ct(function(gr){Mo(y).dispatch(gr)},[]),W=Vt(function(){return(0,U.DE)({publishWhileDragging:al,updateDroppableScroll:sl,updateDroppableIsEnabled:ll,updateDroppableIsCombineEnabled:cl,collectionStarting:ol},$)},[$]),oe=Rc(),We=Vt(function(){return zu(oe,W)},[oe,W]),Ge=Vt(function(){return _t((0,ue.Z)({scrollWindow:yl,scrollDroppable:We.scrollDroppable},(0,U.DE)({move:ls},$)))},[We.scrollDroppable,$]),Qe=vs(l),xt=Vt(function(){return Ou({announce:N,autoScroller:Ge,dimensionMarshal:We,focusMarshal:Qe,getResponders:B,styleMarshal:I})},[N,Ge,We,Qe,B,I]);y.current=xt;var Lt=ct(function(){var gr=Mo(y),Ur=gr.getState();Ur.phase!=="IDLE"&&gr.dispatch(Nn())},[]),Rt=ct(function(){var gr=Mo(y).getState();return gr.isDragging||gr.phase==="DROP_ANIMATING"},[]),Yt=Vt(function(){return{isDragging:Rt,tryAbort:Lt}},[Rt,Lt]);c(Yt);var Ft=ct(function(gr){return kc(Mo(y).getState(),gr)},[]),mr=ct(function(){return Dn(Mo(y).getState())},[]),Tn=Vt(function(){return{marshal:We,focus:Qe,contextId:l,canLift:Ft,isMovementAllowed:mr,dragHandleUsageInstructionsId:E,registry:oe}},[l,We,E,Qe,Ft,mr,oe]);return Vc({contextId:l,store:xt,registry:oe,customSensors:f,enableDefaultSensors:o.enableDefaultSensors!==!1}),(0,A.useEffect)(function(){return Lt},[Lt]),A.createElement(Il.Provider,{value:Tn},A.createElement(Z,{context:kl,store:xt},o.children))}var Co=0;function sd(){Co=0}function ld(){return Vt(function(){return""+Co++},[])}function cd(){sd(),ed()}function L0(o){var l=ld(),c=o.dragHandleUsageInstructions||Ki.dragHandleUsageInstructions;return A.createElement(Zn,null,function(f){return A.createElement(ca,{nonce:o.nonce,contextId:l,setCallbacks:f,dragHandleUsageInstructions:c,enableDefaultSensors:o.enableDefaultSensors,sensors:o.sensors,onBeforeCapture:o.onBeforeCapture,onBeforeDragStart:o.onBeforeDragStart,onDragStart:o.onDragStart,onDragUpdate:o.onDragUpdate,onDragEnd:o.onDragEnd},o.children)})}var Uc=function(l){return function(c){return l===c}},I0=Uc("scroll"),B0=Uc("auto"),ud=Uc("visible"),ln=function(l,c){return c(l.overflowX)||c(l.overflowY)},T0=function(l,c){return c(l.overflowX)&&c(l.overflowY)},dd=function(l){var c=window.getComputedStyle(l),f={overflowX:c.overflowX,overflowY:c.overflowY};return ln(f,I0)||ln(f,B0)},Qo=function(){return!1;var l,c,f,m},fd=function o(l){return l==null?null:l===document.body?Qo()?l:null:l===document.documentElement?null:dd(l)?l:o(l.parentElement)},Fl=function(o){if(o)var l=fd(o.parentElement)},Zc=function(o){return{x:o.scrollLeft,y:o.scrollTop}},pd=function o(l){if(!l)return!1;var c=window.getComputedStyle(l);return c.position==="fixed"?!0:o(l.parentElement)},hd=function(o){var l=fd(o),c=pd(o);return{closestScrollable:l,isFixedOnPage:c}},Hs=function(o){var l=o.descriptor,c=o.isEnabled,f=o.isCombineEnabled,m=o.isFixedOnPage,g=o.direction,y=o.client,w=o.page,B=o.closest,N=function(){if(!B)return null;var W=B.scrollSize,oe=B.client,We=Mc({scrollHeight:W.scrollHeight,scrollWidth:W.scrollWidth,height:oe.paddingBox.height,width:oe.paddingBox.width});return{pageMarginBox:B.page.marginBox,frameClient:oe,scrollSize:W,shouldClipSubject:B.shouldClipSubject,scroll:{initial:B.scroll,current:B.scroll,max:We,diff:{value:an,displacement:an}}}}(),E=g==="vertical"?st:Be,I=Wi({page:w,withPlaceholder:null,axis:E,frame:N}),$={descriptor:l,isCombineEnabled:f,isFixedOnPage:m,axis:E,isEnabled:c,client:y,page:w,frame:N,subject:I};return $},$0=function(l,c){var f=ni(l);if(!c||l!==c)return f;var m=f.paddingBox.top-c.scrollTop,g=f.paddingBox.left-c.scrollLeft,y=m+c.scrollHeight,w=g+c.scrollWidth,B={top:m,right:w,bottom:y,left:g},N=Xr(B,f.border),E=wn({borderBox:N,margin:f.margin,border:f.border,padding:f.padding});return E},md=function(o){var l=o.ref,c=o.descriptor,f=o.env,m=o.windowScroll,g=o.direction,y=o.isDropDisabled,w=o.isCombineEnabled,B=o.shouldClipSubject,N=f.closestScrollable,E=$0(l,N),I=Fr(E,m),$=function(){if(!N)return null;var oe=ni(N),We={scrollHeight:N.scrollHeight,scrollWidth:N.scrollWidth};return{client:oe,page:Fr(oe,m),scroll:Zc(N),scrollSize:We,shouldClipSubject:B}}(),W=Hs({descriptor:c,isEnabled:!y,isCombineEnabled:w,isFixedOnPage:f.isFixedOnPage,direction:g,client:E,page:I,closest:$});return W},jc={passive:!1},gd={passive:!0},vd=function(o){return o.shouldPublishImmediately?jc:gd};function zl(o){var l=(0,A.useContext)(o);return l||Pe(!1),l}var Kl=function(l){return l&&l.env.closestScrollable||null};function P0(o){var l=(0,A.useRef)(null),c=zl(Il),f=Ll("droppable"),m=c.registry,g=c.marshal,y=Oc(o),w=Vt(function(){return{id:o.droppableId,type:o.type,mode:o.mode}},[o.droppableId,o.mode,o.type]),B=(0,A.useRef)(w),N=Vt(function(){return K(function(Rt,Yt){l.current||Pe(!1);var Ft={x:Rt,y:Yt};g.updateDroppableScroll(w.id,Ft)})},[w.id,g]),E=ct(function(){var Rt=l.current;return!Rt||!Rt.env.closestScrollable?an:Zc(Rt.env.closestScrollable)},[]),I=ct(function(){var Rt=E();N(Rt.x,Rt.y)},[E,N]),$=Vt(function(){return me(I)},[I]),W=ct(function(){var Rt=l.current,Yt=Kl(Rt);Rt&&Yt||Pe(!1);var Ft=Rt.scrollOptions;if(Ft.shouldPublishImmediately){I();return}$()},[$,I]),oe=ct(function(Rt,Yt){l.current&&Pe(!1);var Ft=y.current,mr=Ft.getDroppableRef();mr||Pe(!1);var Tn=hd(mr),gr={ref:mr,descriptor:w,env:Tn,scrollOptions:Yt};l.current=gr;var Ur=md({ref:mr,descriptor:w,env:Tn,windowScroll:Rt,direction:Ft.direction,isDropDisabled:Ft.isDropDisabled,isCombineEnabled:Ft.isCombineEnabled,shouldClipSubject:!Ft.ignoreContainerClipping}),Ci=Tn.closestScrollable;return Ci&&(Ci.setAttribute(ms.contextId,c.contextId),Ci.addEventListener("scroll",W,vd(gr.scrollOptions))),Ur},[c.contextId,w,W,y]),We=ct(function(){var Rt=l.current,Yt=Kl(Rt);return Rt&&Yt||Pe(!1),Zc(Yt)},[]),Ge=ct(function(){var Rt=l.current;Rt||Pe(!1);var Yt=Kl(Rt);l.current=null,Yt&&($.cancel(),Yt.removeAttribute(ms.contextId),Yt.removeEventListener("scroll",W,vd(Rt.scrollOptions)))},[W,$]),Qe=ct(function(Rt){var Yt=l.current;Yt||Pe(!1);var Ft=Kl(Yt);Ft||Pe(!1),Ft.scrollTop+=Rt.y,Ft.scrollLeft+=Rt.x},[]),xt=Vt(function(){return{getDimensionAndWatchScroll:oe,getScrollWhileDragging:We,dragStopped:Ge,scroll:Qe}},[Ge,oe,We,Qe]),Lt=Vt(function(){return{uniqueId:f,descriptor:w,callbacks:xt}},[xt,w,f]);Vn(function(){return B.current=Lt.descriptor,m.droppable.register(Lt),function(){l.current&&Ge(),m.droppable.unregister(Lt)}},[xt,w,Ge,Lt,g,m.droppable]),Vn(function(){l.current&&g.updateDroppableIsEnabled(B.current.id,!o.isDropDisabled)},[o.isDropDisabled,g]),Vn(function(){l.current&&g.updateDroppableIsCombineEnabled(B.current.id,o.isCombineEnabled)},[o.isCombineEnabled,g])}function Gc(){}var bd={width:0,height:0,margin:Rr},R0=function(l){var c=l.isAnimatingOpenOnMount,f=l.placeholder,m=l.animate;return c||m==="close"?bd:{height:f.client.borderBox.height,width:f.client.borderBox.width,margin:f.client.margin}},O0=function(l){var c=l.isAnimatingOpenOnMount,f=l.placeholder,m=l.animate,g=R0({isAnimatingOpenOnMount:c,placeholder:f,animate:m});return{display:f.display,boxSizing:"border-box",width:g.width,height:g.height,marginTop:g.margin.top,marginRight:g.margin.right,marginBottom:g.margin.bottom,marginLeft:g.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:m!=="none"?ei.placeholder:null}};function Eo(o){var l=(0,A.useRef)(null),c=ct(function(){l.current&&(clearTimeout(l.current),l.current=null)},[]),f=o.animate,m=o.onTransitionEnd,g=o.onClose,y=o.contextId,w=(0,A.useState)(o.animate==="open"),B=w[0],N=w[1];(0,A.useEffect)(function(){return B?f!=="open"?(c(),N(!1),Gc):l.current?Gc:(l.current=setTimeout(function(){l.current=null,N(!1)}),c):Gc},[f,B,c]);var E=ct(function($){$.propertyName==="height"&&(m(),f==="close"&&g())},[f,g,m]),I=O0({isAnimatingOpenOnMount:B,animate:o.animate,placeholder:o.placeholder});return A.createElement(o.placeholder.tagName,{style:I,"data-rbd-placeholder-context-id":y,onTransitionEnd:E,ref:o.innerRef})}var es=A.memo(Eo),ko=A.createContext(null);function to(o){o&&jo(o)||Pe(!1)}function Ha(o){return typeof o=="boolean"}function ro(o,l){l.forEach(function(c){return c(o)})}var Hl=[function(l){var c=l.props;c.droppableId||Pe(!1),typeof c.droppableId!="string"&&Pe(!1)},function(l){var c=l.props;Ha(c.isDropDisabled)||Pe(!1),Ha(c.isCombineEnabled)||Pe(!1),Ha(c.ignoreContainerClipping)||Pe(!1)},function(l){var c=l.getDroppableRef;to(c())}],Wl=[function(l){var c=l.props,f=l.getPlaceholderRef;if(c.placeholder)var m=f()}],Vl=[function(l){var c=l.props;c.renderClone||Pe(!1)},function(l){var c=l.getPlaceholderRef;c()&&Pe(!1)}];function Ul(o){Pa(function(){ro(o,Hl),o.props.mode==="standard"&&ro(o,Wl),o.props.mode==="virtual"&&ro(o,Vl)})}var N0=function(o){he(l,o);function l(){for(var f,m=arguments.length,g=new Array(m),y=0;y<m;y++)g[y]=arguments[y];return f=o.call.apply(o,[this].concat(g))||this,f.state={isVisible:!!f.props.on,data:f.props.on,animate:f.props.shouldAnimate&&f.props.on?"open":"none"},f.onClose=function(){f.state.animate==="close"&&f.setState({isVisible:!1})},f}l.getDerivedStateFromProps=function(m,g){return m.shouldAnimate?m.on?{isVisible:!0,data:m.on,animate:"open"}:g.isVisible?{isVisible:!0,data:g.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!m.on,data:m.on,animate:"none"}};var c=l.prototype;return c.render=function(){if(!this.state.isVisible)return null;var m={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(m)},l}(A.PureComponent),qc={dragging:5e3,dropAnimating:4500},yd=function(l,c){return c?ei.drop(c.duration):l?ei.snap:ei.fluid},xd=function(l,c){return l?c?$r.opacity.drop:$r.opacity.combining:null},F0=function(l){return l.forceShouldAnimate!=null?l.forceShouldAnimate:l.mode==="SNAP"};function wd(o){var l=o.dimension,c=l.client,f=o.offset,m=o.combineWith,g=o.dropping,y=!!m,w=F0(o),B=!!g,N=B?_i.drop(f,y):_i.moveTo(f),E={position:"fixed",top:c.marginBox.top,left:c.marginBox.left,boxSizing:"border-box",width:c.borderBox.width,height:c.borderBox.height,transition:yd(w,g),transform:N,opacity:xd(y,B),zIndex:B?qc.dropAnimating:qc.dragging,pointerEvents:"none"};return E}function z0(o){return{transform:_i.moveTo(o.offset),transition:o.shouldAnimateDisplacement?null:"none"}}function K0(o){return o.type==="DRAGGING"?wd(o):z0(o)}function H0(o,l,c){c===void 0&&(c=an);var f=window.getComputedStyle(l),m=l.getBoundingClientRect(),g=vi(m,f),y=Fr(g,c),w={client:g,tagName:l.tagName.toLowerCase(),display:f.display},B={x:g.marginBox.width,y:g.marginBox.height},N={descriptor:o,placeholder:w,displaceBy:B,client:g,page:y};return N}function W0(o){var l=Ll("draggable"),c=o.descriptor,f=o.registry,m=o.getDraggableRef,g=o.canDragInteractiveElements,y=o.shouldRespectForcePress,w=o.isEnabled,B=Vt(function(){return{canDragInteractiveElements:g,shouldRespectForcePress:y,isEnabled:w}},[g,w,y]),N=ct(function(W){var oe=m();return oe||Pe(!1),H0(c,oe,W)},[c,m]),E=Vt(function(){return{uniqueId:l,descriptor:c,options:B,getDimension:N}},[c,N,B,l]),I=(0,A.useRef)(E),$=(0,A.useRef)(!0);Vn(function(){return f.draggable.register(I.current),function(){return f.draggable.unregister(I.current)}},[f.draggable]),Vn(function(){if($.current){$.current=!1;return}var W=I.current;I.current=E,f.draggable.update(E,W)},[E,f.draggable])}function V0(o,l,c){Pa(function(){function f(g){return"Draggable[id: "+g+"]: "}var m=o.draggableId;m||Pe(!1),typeof m!="string"&&Pe(!1),va(o.index)||Pe(!1),o.mapped.type!=="DRAGGING"&&(to(c()),o.isEnabled&&($c(l,m)||Pe(!1)))})}function U0(o){}function Z0(o){o.preventDefault()}function Zl(o){var l=(0,A.useRef)(null),c=ct(function(gr){l.current=gr},[]),f=ct(function(){return l.current},[]),m=zl(Il),g=m.contextId,y=m.dragHandleUsageInstructionsId,w=m.registry,B=zl(ko),N=B.type,E=B.droppableId,I=Vt(function(){return{id:o.draggableId,index:o.index,type:N,droppableId:E}},[o.draggableId,o.index,N,E]),$=o.children,W=o.draggableId,oe=o.isEnabled,We=o.shouldRespectForcePress,Ge=o.canDragInteractiveElements,Qe=o.isClone,xt=o.mapped,Lt=o.dropAnimationFinished;if(V0(o,g,f),U0(Qe),!Qe){var Rt=Vt(function(){return{descriptor:I,registry:w,getDraggableRef:f,canDragInteractiveElements:Ge,shouldRespectForcePress:We,isEnabled:oe}},[I,w,f,Ge,We,oe]);W0(Rt)}var Yt=Vt(function(){return oe?{tabIndex:0,role:"button","aria-describedby":y,"data-rbd-drag-handle-draggable-id":W,"data-rbd-drag-handle-context-id":g,draggable:!1,onDragStart:Z0}:null},[g,y,W,oe]),Ft=ct(function(gr){xt.type==="DRAGGING"&&xt.dropping&&gr.propertyName==="transform"&&Lt()},[Lt,xt]),mr=Vt(function(){var gr=K0(xt),Ur=xt.type==="DRAGGING"&&xt.dropping?Ft:null,Ci={innerRef:c,draggableProps:{"data-rbd-draggable-context-id":g,"data-rbd-draggable-id":W,style:gr,onTransitionEnd:Ur},dragHandleProps:Yt};return Ci},[g,Yt,W,xt,Ft,c]),Tn=Vt(function(){return{draggableId:I.id,type:I.type,source:{index:I.index,droppableId:I.droppableId}}},[I.droppableId,I.id,I.index,I.type]);return $(mr,xt.snapshot,Tn)}var ys=function(o,l){return o===l},Ao=function(o){var l=o.combine,c=o.destination;return c?c.droppableId:l?l.droppableId:null},ho=function(l){return l.combine?l.combine.draggableId:null},Sd=function(l){return l.at&&l.at.type==="COMBINE"?l.at.combine.draggableId:null};function _d(){var o=K(function(m,g){return{x:m,y:g}}),l=K(function(m,g,y,w,B){return{isDragging:!0,isClone:g,isDropAnimating:!!B,dropAnimation:B,mode:m,draggingOver:y,combineWith:w,combineTargetFor:null}}),c=K(function(m,g,y,w,B,N,E){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:B,combineWith:N,mode:g,offset:m,dimension:y,forceShouldAnimate:E,snapshot:l(g,w,B,N,null)}}}),f=function(g,y){if(g.isDragging){if(g.critical.draggable.id!==y.draggableId)return null;var w=g.current.client.offset,B=g.dimensions.draggables[y.draggableId],N=Mn(g.impact),E=Sd(g.impact),I=g.forceShouldAnimate;return c(o(w.x,w.y),g.movementMode,B,y.isClone,N,E,I)}if(g.phase==="DROP_ANIMATING"){var $=g.completed;if($.result.draggableId!==y.draggableId)return null;var W=y.isClone,oe=g.dimensions.draggables[y.draggableId],We=$.result,Ge=We.mode,Qe=Ao(We),xt=ho(We),Lt=g.dropDuration,Rt={duration:Lt,curve:bn.drop,moveTo:g.newHomeClientOffset,opacity:xt?$r.opacity.drop:null,scale:xt?$r.scale.drop:null};return{mapped:{type:"DRAGGING",offset:g.newHomeClientOffset,dimension:oe,dropping:Rt,draggingOver:Qe,combineWith:xt,mode:Ge,forceShouldAnimate:null,snapshot:l(Ge,W,Qe,xt,Rt)}}}return null};return f}function Xc(o){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:o,combineWith:null}}var j0={mapped:{type:"SECONDARY",offset:an,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Xc(null)}};function G0(){var o=K(function(y,w){return{x:y,y:w}}),l=K(Xc),c=K(function(y,w,B){return w===void 0&&(w=null),{mapped:{type:"SECONDARY",offset:y,combineTargetFor:w,shouldAnimateDisplacement:B,snapshot:l(w)}}}),f=function(w){return w?c(an,w,!0):null},m=function(w,B,N,E){var I=N.displaced.visible[w],$=!!(E.inVirtualList&&E.effected[w]),W=b(N),oe=W&&W.draggableId===w?B:null;if(!I){if(!$)return f(oe);if(N.displaced.invisible[w])return null;var We=Hi(E.displacedBy.point),Ge=o(We.x,We.y);return c(Ge,oe,!0)}if($)return f(oe);var Qe=N.displacedBy.point,xt=o(Qe.x,Qe.y);return c(xt,oe,I.shouldAnimate)},g=function(w,B){if(w.isDragging)return w.critical.draggable.id===B.draggableId?null:m(B.draggableId,w.critical.draggable.id,w.impact,w.afterCritical);if(w.phase==="DROP_ANIMATING"){var N=w.completed;return N.result.draggableId===B.draggableId?null:m(B.draggableId,N.result.draggableId,N.impact,N.afterCritical)}return null};return g}var Md=function(){var l=_d(),c=G0(),f=function(g,y){return l(g,y)||c(g,y)||j0};return f},q0={dropAnimationFinished:Ds},X0=te(Md,q0,null,{context:kl,pure:!0,areStatePropsEqual:ys})(Zl);function Cd(o){var l=zl(ko),c=l.isUsingCloneFor;return c===o.draggableId&&!o.isClone?null:A.createElement(X0,o)}function qr(o){var l=typeof o.isDragDisabled=="boolean"?!o.isDragDisabled:!0,c=!!o.disableInteractiveElementBlocking,f=!!o.shouldRespectForcePress;return A.createElement(Cd,(0,ue.Z)({},o,{isClone:!1,isEnabled:l,canDragInteractiveElements:c,shouldRespectForcePress:f}))}function jl(o){var l=(0,A.useContext)(Il);l||Pe(!1);var c=l.contextId,f=l.isMovementAllowed,m=(0,A.useRef)(null),g=(0,A.useRef)(null),y=o.children,w=o.droppableId,B=o.type,N=o.mode,E=o.direction,I=o.ignoreContainerClipping,$=o.isDropDisabled,W=o.isCombineEnabled,oe=o.snapshot,We=o.useClone,Ge=o.updateViewportMaxScroll,Qe=o.getContainerForClone,xt=ct(function(){return m.current},[]),Lt=ct(function(ri){m.current=ri},[]),Rt=ct(function(){return g.current},[]),Yt=ct(function(ri){g.current=ri},[]);Ul({props:o,getDroppableRef:xt,getPlaceholderRef:Rt});var Ft=ct(function(){f()&&Ge({maxScroll:Uo()})},[f,Ge]);P0({droppableId:w,type:B,mode:N,direction:E,isDropDisabled:$,isCombineEnabled:W,ignoreContainerClipping:I,getDroppableRef:xt});var mr=A.createElement(N0,{on:o.placeholder,shouldAnimate:o.shouldAnimatePlaceholder},function(ri){var pa=ri.onClose,Ra=ri.data,Ma=ri.animate;return A.createElement(es,{placeholder:Ra,onClose:pa,innerRef:Yt,animate:Ma,contextId:c,onTransitionEnd:Ft})}),Tn=Vt(function(){return{innerRef:Lt,placeholder:mr,droppableProps:{"data-rbd-droppable-id":w,"data-rbd-droppable-context-id":c}}},[c,w,mr,Lt]),gr=We?We.dragging.draggableId:null,Ur=Vt(function(){return{droppableId:w,type:B,isUsingCloneFor:gr}},[w,gr,B]);function Ci(){if(!We)return null;var ri=We.dragging,pa=We.render,Ra=A.createElement(Cd,{draggableId:ri.draggableId,index:ri.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(Ma,Ca){return pa(Ma,Ca,ri)});return qt.createPortal(Ra,Qe())}return A.createElement(ko.Provider,{value:Ur},y(Tn,oe),Ci())}var xs=function(l,c){return l===c.droppable.type},Ed=function(l,c){return c.draggables[l.draggable.id]},Do=function(){var l={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},c=(0,ue.Z)({},l,{shouldAnimatePlaceholder:!1}),f=K(function(y){return{draggableId:y.id,type:y.type,source:{index:y.index,droppableId:y.droppableId}}}),m=K(function(y,w,B,N,E,I){var $=E.descriptor.id,W=E.descriptor.droppableId===y;if(W){var oe=I?{render:I,dragging:f(E.descriptor)}:null,We={isDraggingOver:B,draggingOverWith:B?$:null,draggingFromThisWith:$,isUsingPlaceholder:!0};return{placeholder:E.placeholder,shouldAnimatePlaceholder:!1,snapshot:We,useClone:oe}}if(!w)return c;if(!N)return l;var Ge={isDraggingOver:B,draggingOverWith:$,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:E.placeholder,shouldAnimatePlaceholder:!0,snapshot:Ge,useClone:null}}),g=function(w,B){var N=B.droppableId,E=B.type,I=!B.isDropDisabled,$=B.renderClone;if(w.isDragging){var W=w.critical;if(!xs(E,W))return c;var oe=Ed(W,w.dimensions),We=Mn(w.impact)===N;return m(N,I,We,We,oe,$)}if(w.phase==="DROP_ANIMATING"){var Ge=w.completed;if(!xs(E,Ge.critical))return c;var Qe=Ed(Ge.critical,w.dimensions);return m(N,I,Ao(Ge.result)===N,Mn(Ge.impact)===N,Qe,$)}if(w.phase==="IDLE"&&w.completed&&!w.shouldFlush){var xt=w.completed;if(!xs(E,xt.critical))return c;var Lt=Mn(xt.impact)===N,Rt=!!(xt.impact.at&&xt.impact.at.type==="COMBINE"),Yt=xt.critical.droppable.id===N;return Lt?Rt?l:c:Yt?l:c}return c};return g},kd={updateViewportMaxScroll:cs};function ts(){return document.body||Pe(!1),document.body}var Ad={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ts},Cn=te(Do,kd,null,{context:kl,pure:!0,areStatePropsEqual:ys})(jl);Cn.defaultProps=Ad},88359:function(er,ft){"use strict";var x;var A=60103,J=60106,he=60107,ue=60108,U=60114,q=60109,ce=60110,_=60112,v=60113,De=60120,Ne=60115,L=60116,Le=60121,Re=60122,pt=60117,lt=60129,Z=60131;if(typeof Symbol=="function"&&Symbol.for){var Ie=Symbol.for;A=Ie("react.element"),J=Ie("react.portal"),he=Ie("react.fragment"),ue=Ie("react.strict_mode"),U=Ie("react.profiler"),q=Ie("react.provider"),ce=Ie("react.context"),_=Ie("react.forward_ref"),v=Ie("react.suspense"),De=Ie("react.suspense_list"),Ne=Ie("react.memo"),L=Ie("react.lazy"),Le=Ie("react.block"),Re=Ie("react.server.block"),pt=Ie("react.fundamental"),lt=Ie("react.debug_trace_mode"),Z=Ie("react.legacy_hidden")}function Ht(Me){if(typeof Me=="object"&&Me!==null){var _e=Me.$$typeof;switch(_e){case A:switch(Me=Me.type,Me){case he:case U:case ue:case v:case De:return Me;default:switch(Me=Me&&Me.$$typeof,Me){case ce:case _:case L:case Ne:case q:return Me;default:return _e}}case J:return _e}}}var Se=q,pe=A,T=_,F=he,ie=L,j=Ne,ze=J,tt=U,Nt=ue,gt=v;x=ce,x=Se,x=pe,x=T,x=F,x=ie,x=j,x=ze,x=tt,x=Nt,x=gt,x=function(){return!1},x=function(){return!1},ft.isContextConsumer=function(Me){return Ht(Me)===ce},x=function(Me){return Ht(Me)===q},x=function(Me){return typeof Me=="object"&&Me!==null&&Me.$$typeof===A},x=function(Me){return Ht(Me)===_},x=function(Me){return Ht(Me)===he},x=function(Me){return Ht(Me)===L},x=function(Me){return Ht(Me)===Ne},x=function(Me){return Ht(Me)===J},x=function(Me){return Ht(Me)===U},x=function(Me){return Ht(Me)===ue},x=function(Me){return Ht(Me)===v},x=function(Me){return typeof Me=="string"||typeof Me=="function"||Me===he||Me===U||Me===lt||Me===ue||Me===v||Me===De||Me===Z||typeof Me=="object"&&Me!==null&&(Me.$$typeof===L||Me.$$typeof===Ne||Me.$$typeof===q||Me.$$typeof===ce||Me.$$typeof===_||Me.$$typeof===pt||Me.$$typeof===Le||Me[0]===Re)},x=Ht},72973:function(er,ft,x){"use strict";er.exports=x(88359)},84279:function(er,ft,x){"use strict";var A=Object.defineProperty,J=Object.defineProperties,he=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,ce=(e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))U.call(t,r)&&ce(e,r,t[r]);if(ue)for(var r of ue(t))q.call(t,r)&&ce(e,r,t[r]);return e},v=(e,t)=>J(e,he(t)),De=e=>typeof e=="symbol"?e:e+"",Ne=(e,t)=>{var r={};for(var n in e)U.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ue)for(var n of ue(e))t.indexOf(n)<0&&q.call(e,n)&&(r[n]=e[n]);return r};function L(e){return Array.isArray(e)}var Le={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function Re(){return"window"in globalThis&&"document"in globalThis}function pt(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function lt(){return typeof navigator.vibrate=="function"}function Z(){var e,t;if(!Re())return"other";const r=(t=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?t:navigator.platform;return/^mac/i.test(r)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(r)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function Ie(){if(!Re())return!0;if(/firefox/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/firefox\/(\d+)/i);return e?parseInt(e[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/edg\/(\d+)/i);return e?parseInt(e[1])>=79:!1}return!0}function Ht(){return HTMLElement.prototype.hasOwnProperty("popover")}var Se={strings:Le,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return Se._locale||(Se._locale=Re()?navigator.language.slice(0,5):"en-US"),Se._locale},set locale(e){Se._locale=e,Se._numberFormatter=void 0,Se.dirty=!0},get numberFormatter(){return Se._numberFormatter||(Se._numberFormatter=new Intl.NumberFormat(Se.locale)),Se._numberFormatter},merge(e,t){if(typeof e=="string"&&t)Se.strings[e]=_(_({},Se.strings[e]),t),Se.dirty=!0;else for(const r of Object.keys(e))Se.merge(r,e[r])},get dirty(){return Se._dirty},set dirty(e){Se._dirty||Se._dirty===e||(Se._dirty=!0,setTimeout(()=>{Se._dirty=!1,this._subscribers.forEach(t=>t==null?void 0:t())},0))},subscribe(e){return Se._subscribers.push(e),Se._subscribers.length-1},unsubscribe(e){e<0||e>=Se._subscribers.length||(Se._subscribers[e]=void 0)},update(e){let t=e.querySelectorAll("[data-l10n-tooltip]");for(const r of t){const n=r.getAttribute("data-l10n-tooltip");if(n){const i=pe(n);i&&r.setAttribute("data-tooltip",i)}}t=e.querySelectorAll("[data-l10n-arial-label]");for(const r of t){const n=r.getAttribute("data-l10n-arial-label");if(n){const i=pe(n);i&&r.setAttribute("aria-label",i)}}}};function pe(e,...t){if(e===void 0)return;let r="";const n=Se.locale;Se.strings[n]&&(r=Se.strings[n][e]);const i=n.slice(0,2);if(!r&&Se.strings[i]&&(r=Se.strings[i][e]),r||(r=Se.strings.en[e]),!r)return;const a=/(%@|%([0-9]+)\$@)/g;let s=a.exec(r),u=0;for(;s;){if(t[u++]){const p=s[2]?parseInt(s[2],10)-1:u-1;let h=t[p];typeof h=="number"&&(h=Se.numberFormatter.format(h)),r=r.replace(s[1],h)}s=a.exec(r)}return r=r.replace(/%%/g,"%"),r}var T={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},F={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},ie={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},j={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},ze={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},tt={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function Nt(e){var t,r,n,i,a,s;const u=e.split("!");let d,p,h,S=255,D=255,P=255,O=-1;const de=u.length>0&&u[0].startsWith("-");de&&(u[0]=u[0].slice(1));for(let Ve=0;Ve<u.length;Ve++){d=S,p=D,h=P;const se=(t=u[Ve].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:t[1],ke=se==null?void 0:se.toLowerCase(),Xe=se&&(s=(a=(i=(n=(r=j[ke])!=null?r:j[ze[se]])!=null?n:F[se])!=null?i:tt[se])!=null?a:T[se])!=null?s:u[Ve].trim();let $e=Xe.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if($e!=null&&$e[1]&&$e[2]&&$e[3])S=Math.max(0,Math.min(255,Number.parseInt($e[1],16))),D=Math.max(0,Math.min(255,Number.parseInt($e[2],16))),P=Math.max(0,Math.min(255,Number.parseInt($e[3],16)));else if($e=Xe.match(/^#([\da-f]{3})$/i),$e!=null&&$e[1]){const St=Number.parseInt($e[1][0],16),Kt=Number.parseInt($e[1][1],16),Tt=Number.parseInt($e[1][2],16);S=Math.max(0,Math.min(255,St*16+St)),D=Math.max(0,Math.min(255,Kt*16+Kt)),P=Math.max(0,Math.min(255,Tt*16+Tt))}else if($e=Xe.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),$e!=null&&$e[1]&&$e[2]&&$e[3])S=Math.max(0,Math.min(255,Number.parseInt($e[1]))),D=Math.max(0,Math.min(255,Number.parseInt($e[2]))),P=Math.max(0,Math.min(255,Number.parseInt($e[3])));else return;O>=0&&(S=(1-O)*S+O*d,D=(1-O)*D+O*p,P=(1-O)*P+O*h,O=-1),Ve+1<u.length&&(O=Math.max(0,Math.min(100,Number.parseInt(u[++Ve])))/100)}return O>=0&&(S=O*S+(1-O)*d,D=O*D+(1-O)*p,P=O*P+(1-O)*h),de&&(S=255-S,D=255-D,P=255-P),"#"+("00"+Math.round(S).toString(16)).slice(-2)+("00"+Math.round(D).toString(16)).slice(-2)+("00"+Math.round(P).toString(16)).slice(-2)}function gt(e){var t,r;return e=e.trim(),(r=(t=ie[e.toLowerCase()])!=null?t:ie[ze[e]])!=null?r:Nt(e)}function Me(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&t.a===void 0&&(t.a=1),t}function _e(e,t,r){return r<0&&(r+=6),r>=6&&(r-=6),r<1?(t-e)*r+e:r<3?t:r<4?(t-e)*(4-r)+e:e}function Je(e){let[t,r,n]=[e.h,e.s,e.l];t=(t+360)%360/60,n=Math.max(0,Math.min(n,1)),r=Math.max(0,Math.min(r,1));const i=n<=.5?n*(r+1):n+r-n*r,a=n*2-i;return{r:Math.round(255*_e(a,i,t+2)),g:Math.round(255*_e(a,i,t)),b:Math.round(255*_e(a,i,t-2))}}function re(e){return e<0?0:e>255?255:Math.round(e)}function Ue(e){const{r:t,g:r,b:n}=e;let i=((1<<24)+(re(t)<<16)+(re(r)<<8)+re(n)).toString(16).slice(1);return i[0]===i[1]&&i[2]===i[3]&&i[4]===i[5]&&i[6]===i[7]&&(i=i[0]+i[2]+i[4]),"#"+i}function rt(e){let{r:t,g:r,b:n}=e;t=t/255,r=r/255,n=n/255;const i=Math.min(t,r,n),a=Math.max(t,r,n),s=a-i;let u,d;a===i?u=0:t===a?u=(r-n)/s:r===a?u=2+(n-t)/s:n===a&&(u=4+(t-r)/s),u=Math.min(u*60,360),u<0&&(u+=360);const p=(i+a)/2;return a===i?d=0:p<=.5?d=s/(a+i):d=s/(2-a-i),{h:u,s:d,l:p}}function ge(e){let t=Me(e);if(!t)return e;let{h:r,s:n,l:i}=rt(t);return n+=.1,i-=.1,Ue(Je({h:r,s:n,l:i}))}var Ae={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},ve={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},fe=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function ot(e,t,r){if(!/[A-Za-z\d]/.test(e)||(r==="up"&&(r=void 0),!t&&!r))return e;const n=e.codePointAt(0);if(n===void 0)return e;for(const i of fe)if((!t||i.variant===t)&&(!r||i.style===r)&&n>=i.offset&&n<i.offset+i.len){const a=i.start+n-i.offset;return String.fromCodePoint(ve[a]||a)}return e}function Ze(e){var t;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const r in ve)if(ve[r]===e){e=(t=r.codePointAt(0))!=null?t:0;break}for(const r of fe)if(e>=r.start&&e<r.start+r.len)return{char:String.fromCodePoint(e-r.start+r.offset),variant:r.variant,style:r.style};return{char:String.fromCodePoint(e)}}function Oe(e){var t;let r="";for(const n of e){if("{}<>[]$&#^_%:'\u02DC".includes(n)){r+=n;continue}const i=(t=n.codePointAt(0))!=null?t:0;let a=Ae[i];if(a)a.startsWith("\\")?r+=a+" ":r+=a;else{const{char:s,variant:u,style:d}=Ze(i);switch(a=s,u){case"double-struck":a=`\\mathbb{${a}}`;break;case"fraktur":a=`\\mathfrak{${a}}`;break;case"script":a=`\\mathscr{${a}}`;break;case"sans-serif":a=`\\mathsf{${a}}`;break;case"monospace":a=`\\mathtt{${a}}`;break;case"calligraphic":a=`\\mathcal{${a}}`;break}switch(d){case"bold":a=`\\mathbf{${a}}`;break;case"italic":a=`\\mathit{${a}}`;break;case"bolditalic":a=`\\mathbfit{${a}}`;break}r+=a}}return r}function xe(e){return e?Array.isArray(e)?e:typeof e=="object"&&"group"in e?e.group:[]:[]}var yt={},ht=_({},Ae),Ut={},Gt={},cr={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},ur={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},rr={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},ar={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:rr},"amsmath.sty":{package:ur,primitive:!0},"texvc.sty":{package:cr,primitive:!1}},ut={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},be=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,ae,Q;Ie()?(ae=new RegExp("\\p{Letter}","u"),Q=new RegExp("[0-9\\p{Letter}]","u")):(ae=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,Q=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function V(e,t,r="mord",n){t!==void 0&&(yt[e]={definitionType:"symbol",type:r,variant:n,codepoint:t},ht[t]||(ht[t]=e))}function Y(e,t,r){if(typeof e=="string"){for(let n=0;n<e.length;n++){const i=e.charAt(n);V(i,i.codePointAt(0))}return}for(const[n,i,a,s]of e)V(n,i,a!=null?a:t,s!=null?s:r)}function ye(e,t){for(let r=e;r<=t;r++)V(String.fromCodePoint(r),r)}function te(e){var t;return(t=Gt[e])!=null?t:null}function ne(e,t){var r,n;if(t.length===0||t==="\\"||!t.startsWith("\\"))return[];const i=[];for(const s in Ut)s.startsWith(t)&&!Ut[s].infix&&i.push({match:s,frequency:(r=Ut[s].frequency)!=null?r:0});for(const s in yt)s.startsWith(t)&&i.push({match:s,frequency:(n=yt[s].frequency)!=null?n:0});const a=t.substring(1);for(const s of Object.keys(e.options.macros))s.startsWith(a)&&i.push({match:"\\"+s,frequency:0});return i.sort((s,u)=>{var d,p;return s.frequency===u.frequency?s.match.length===u.match.length?s.match<u.match?-1:1:s.match.length-u.match.length:((d=u.frequency)!=null?d:0)-((p=s.frequency)!=null?p:0)}),i.map(s=>s.match)}function Ke(e){let t="auto";const r=e.match(/:([^=]+)/);return r&&(t=r[1].trim()),t}function Fe(e){if(!e)return[];const t=[];let r=e.split("]");if(r[0].startsWith("[")){t.push({isOptional:!0,type:Ke(r[0].slice(1))});for(let n=1;n<=r.length;n++)t.push(...Fe(r[n]))}else if(r=e.split("}"),r[0].startsWith("{")){t.push({isOptional:!1,type:Ke(r[0].slice(1))});for(let n=1;n<=r.length;n++)t.push(...Fe(r[n]))}return t}function Ce(e){if(!e)return"";let t="",r=!0;for(const n of e)typeof n.value=="string"?t+=n.value:r=!1;return r?t:""}function kt(e,t){typeof e=="string"&&(e=[e]);const r={tabular:!1,params:[],createAtom:t};for(const n of e)Gt[n]=r}function $t(e,t,r){typeof e=="string"&&(e=[e]);const i={tabular:!0,params:Fe(t),createAtom:r};for(const a of e)Gt[a]=i}function G(e,t,r){var n,i;r||(r={});const a={definitionType:"function",params:Fe(t),ifMode:r.ifMode,isFunction:(n=r.isFunction)!=null?n:!1,applyMode:r.applyMode,infix:(i=r.infix)!=null?i:!1,parse:r.parse,createAtom:r.createAtom,applyStyle:r.applyStyle,serialize:r.serialize,render:r.render};if(typeof e=="string")Ut["\\"+e]=a;else for(const s of e)Ut["\\"+s]=a}var nt;function dt(e){return nt||(nt=vr(ar)),e?vr(_(_({},nt),e)):nt}function qt(e,t){var r,n,i,a;if(typeof e=="string"){let s=0;const u=e;return/(^|[^\\])#1/.test(u)&&(s=1),/(^|[^\\])#2/.test(u)&&(s=2),/(^|[^\\])#3/.test(u)&&(s=3),/(^|[^\\])#4/.test(u)&&(s=4),/(^|[^\\])#5/.test(u)&&(s=5),/(^|[^\\])#6/.test(u)&&(s=6),/(^|[^\\])#7/.test(u)&&(s=7),/(^|[^\\])#8/.test(u)&&(s=8),/(^|[^\\])#9/.test(u)&&(s=9),{expand:(r=t==null?void 0:t.expand)!=null?r:!0,captureSelection:(n=t==null?void 0:t.captureSelection)!=null?n:!0,args:s,def:u}}return _({expand:(i=t==null?void 0:t.expand)!=null?i:!0,captureSelection:(a=t==null?void 0:t.captureSelection)!=null?a:!0,args:0},e)}function vr(e){if(!e)return{};const t={};for(const r of Object.keys(e)){const n=e[r];if(n==null)delete t[r];else if(typeof n=="object"&&"package"in n)for(const i of Object.keys(n.package))t[i]=qt(n.package[i],{expand:!n.primitive,captureSelection:n.captureSelection});else t[r]=qt(n)}return t}function or(e,t="math"){if(!e||e.length===0)return null;let r=null;if(e.startsWith("\\")){if(r=Ut[e],r)return!r.ifMode||r.ifMode===t?r:null;t==="math"?r=yt[e]:ut[e]&&(r={definitionType:"symbol",type:"mord",codepoint:ut[e]})}else if(t==="math"){if(r=yt[e],!r&&e.length===1){const n=Vt("math",e.codePointAt(0));return n.startsWith("\\")?v(_({},or(n,"math")),{command:n}):null}}else ut[e]?r={definitionType:"symbol",type:"mord",codepoint:ut[e]}:t==="text"&&(r={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return r!=null?r:null}function tn(e,t){if(!e.startsWith("\\"))return null;const r=e.slice(1);return t[r]}function Vt(e,t){if(t===void 0)return"";if(e==="math"&&ht[t])return ht[t];if(e==="text"){const r=Object.keys(ut).find(n=>ut[n]===t);return r||String.fromCodePoint(t)}return String.fromCodePoint(t)}var ct=[0,.68889,0,0,.72222],rn=[0,.68889,0,0,.66667],nn=[0,.68889,0,0,.77778],br=[0,.68889,0,0,.61111],dr=[.16667,.68889,0,0,.77778],Xr=[0,.68889,0,0,.55556],It=[0,0,0,0,.25],$n=[0,.825,0,0,2.33334],dn=[0,.9,0,0,2.33334],wn=[0,.68889,0,0,.54028],jr=[-.03598,.46402,0,0,.5],Lr=[-.13313,.36687,0,0,1],At=[.01354,.52239,0,0,1],Fr=[.01354,.52239,0,0,1.11111],vi=[0,.54986,0,0,1],ni=[0,.69224,0,0,.5],li=[0,.43056,0,0,1],hn=[.08198,.58198,0,0,.77778],Di=[.19444,.69224,0,0,.41667],Sn=[.1808,.675,0,0,1],K=[.19444,.69224,0,0,.83334],X=[.13667,.63667,0,0,1],me=[-.064,.437,0,0,1.334],Ee=[.08167,.58167,0,0,.77778],at=[0,.69224,0,0,.72222],Mt=[0,.69224,0,0,.66667],Qt=[-.13313,.36687,0,0,.77778],Jt=[.06062,.54986,0,0,.77778],zr=[0,.69224,0,0,.77778],Ir=[.25583,.75583,0,0,.77778],nr=[.25142,.75726,0,0,.77778],Yr=[.20576,.70576,0,0,.77778],hr=[.30274,.79383,0,0,.77778],_r=[.22958,.72958,0,0,.77778],Fn=[.1808,.675,0,0,.77778],Pr=[.13667,.63667,0,0,.77778],Kr=[.13597,.63597,0,0,.77778],Pn=[.03517,.54986,0,0,.77778],jt=[0,.675,0,0,.77778],Pe=[.19444,.69224,0,0,.61111],Zn=[0,.54986,0,0,.76042],bi=[0,.54986,0,0,.66667],Rn=[.0391,.5391,0,0,.77778],yi=[.03517,.54986,0,0,1.33334],xi=[.38569,.88569,0,0,.77778],jn=[.23222,.74111,0,0,.77778],Ji=[.19444,.69224,0,0,.77778],ga=[0,.37788,0,0,.5],Yi=[0,.54986,0,0,.72222],Ki=[0,.69224,0,0,.83334],an=[.11111,.69224,0,0,.66667],Ar=[.26167,.75726,0,0,.77778],kn=[.48256,.98256,0,0,.77778],Jr=[.28481,.79383,0,0,.77778],Hi=[.08167,.58167,0,0,.22222],Li=[.08167,.58167,0,0,.38889],ua=[0,.43056,.04028,0,.66667],ci=[.41951,.91951,0,0,.77778],Ii=[.24982,.74947,0,0,.38865],Na=[.08319,.58283,0,0,.75623],Aa=[0,.10803,0,0,.27764],Fa=[0,.47534,0,0,.50181],Rr=[.18906,.47534,0,0,.50181],lo=[0,.69141,0,0,.50181],bo=[.24982,.74947,0,0,.27764],Qi=[0,.69141,0,0,.21471],Wi=[.25,.75,0,0,.44722],Gn=[0,.64444,0,0,.575],va=[.08556,.58556,0,0,.89444],ba=[0,.69444,0,0,.89444],ea=[0,.68611,0,0,.9],qn=[0,.68611,0,0,.86944],Vi=[.25,.75,0,0,.575],Bi=[.25,.75,0,0,.31944],ui=[0,.69444,0,0,.63889],ii=[0,.69444,0,0,.31944],da=[0,.44444,0,0,.63889],ta=[0,.44444,0,0,.51111],Ui=[0,.69444,0,0,.575],b=[.13333,.63333,0,0,.89444],M=[0,.44444,0,0,.31944],C=[0,.69444,0,0,.86944],k=[0,.68611,0,0,.69166],R=[0,.68611,0,0,.83055],z=[0,.68611,0,0,.89444],H=[0,.69444,0,0,.60278],ee=[.19444,.69444,0,0,.51111],le=[0,.69444,0,0,.83055],Te=[-.10889,.39111,0,0,1.14999],st=[.19444,.69444,0,0,.575],Be=[.19444,.69444,0,0,1.14999],vt=[.19444,.69444,0,0,.70277],bt=[.05556,.75,0,0,.575],Dt=[0,.68611,0,0,.95833],Wt=[.08556,.58556,0,0,.76666],Ct=[-.02639,.47361,0,0,.575],qe=[0,.44444,0,0,.89444],He=[0,.55556,0,0,.76666],et=[-.10889,.39111,0,0,.89444],Ye=[.00222,.50222,0,0,.89444],wt=[.19667,.69667,0,0,.89444],mt=[.08556,.58556,0,0,1.14999],Pt=[0,.69444,0,0,.70277],zt=[-.02778,.47222,0,0,.575],Ot=[.25,.75,0,0,.51111],Bt=[-.13889,.36111,0,0,1.14999],sr=[.19444,.69444,0,0,1.02222],Et=[.12963,.69444,0,0,.89444],tr=[.19444,.69444,0,0,.44722],Zt=[0,.64444,.13167,0,.59111],Xt=[.19444,.64444,.13167,0,.59111],Hr=[0,.68611,.17208,0,.8961],Br=[.19444,.44444,.105,0,.53222],Or=[0,.44444,.085,0,.82666],yr=[0,.69444,.06709,0,.59111],mn=[0,.69444,.12945,0,.35555],Yn=[0,.69444,0,0,.94888],fr=[0,.69444,.11472,0,.59111],Dr=[0,.68611,.10778,0,.88555],fn=[0,.69444,.07939,0,.62055],Wr=[0,.69444,.12417,0,.30667],Mr=[0,.64444,.13556,0,.51111],Qr=[.19444,.64444,.13556,0,.51111],xr=[0,.68333,.16389,0,.74333],pn=[.19444,.43056,.08847,0,.46],zn=[0,.43056,.07514,0,.71555],wi=[0,.69444,.06646,0,.51111],Ti=[0,.69444,0,0,.83129],An=[0,.69444,.1225,0,.51111],Tr=[0,.68333,.09403,0,.76666],Si=[0,.68333,.11111,0,.76666],Vr=[0,.69444,.06961,0,.51444],gn=[0,.69444,0,0,.27778],_n=[.25,.75,0,0,.38889],On=[0,.64444,0,0,.5],di=[0,.69444,0,0,.77778],fi=[0,.68333,0,0,.75],pi=[0,.68333,0,0,.77778],ra=[0,.68333,0,0,.68056],Zi=[0,.68333,0,0,.72222],vn=[.25,.75,0,0,.5],Mn=[.25,.75,0,0,.27778],wr=[0,.69444,0,0,.5],Kn=[0,.69444,0,0,.55556],Dn=[0,.43056,0,0,.44445],Hn=[0,.43056,0,0,.5],ai=[.19444,.43056,0,0,.55556],na=[0,.43056,0,0,.55556],Ln=[.08333,.58333,0,0,.77778],ia=[0,.43056,0,0,.27778],In=[0,.66786,0,0,.27778],aa=[0,.69444,0,0,.75],$i=[0,.66786,0,0,.5],hi=[0,.68333,0,0,.625],oi=[.19444,.69444,0,0,.44445],fa=[0,.69444,0,0,.72222],qa=[.19444,.69444,0,0,.5],ji=[.19444,.69444,0,0,1],ya=[.011,.511,0,0,1.126],xa=[.19444,.69444,0,0,.61111],mi=[.05556,.75,0,0,.5],Da=[0,.68333,0,0,.83334],oa=[.0391,.5391,0,0,.66667],La=[-.05555,.44445,0,0,.5],lr=[0,.43056,0,0,.77778],ir=[0,.55556,0,0,.66667],on=[-.03625,.46375,0,0,.77778],Pi=[-.01688,.48312,0,0,.77778],Ri=[.0391,.5391,0,0,1],Oi=[0,.69444,0,0,.61111],Ia=[-.03472,.46528,0,0,.5],Xa=[.25,.75,0,0,.44445],co=[-.14236,.35764,0,0,1],Ba=[.244,.744,0,0,.412],uo=[.19444,.69444,0,0,.88889],Gr=[.12963,.69444,0,0,.77778],pr=[.19444,.69444,0,0,.38889],Bn=[.011,.511,0,0,1.638],Qn=[.19444,.69444,0,0,0],sa=[0,.44444,0,0,.575],gi=[.19444,.44444,0,0,.575],ss=[0,.68611,0,0,.75555],al=[0,.69444,0,0,.66759],ol=[0,.68611,0,0,.80555],sl=[0,.68611,.08229,0,.98229],ll=[0,.68611,0,0,.76666],cl=[0,.44444,0,0,.58472],ls=[.19444,.44444,0,0,.6118],za=[.19444,.43056,0,0,.5],cs=[0,.68333,.02778,.08334,.76278],ul=[0,.68333,.08125,.05556,.83125],dl=[0,.43056,0,.05556,.48472],fl=[.19444,.43056,0,.08334,.51702],ks=[.25,.75,0,0,.42778],Nn=[0,.69444,0,0,.55],Ka=[0,.69444,0,0,.73334],Ta=[0,.69444,0,0,.79445],As=[0,.69444,0,0,.51945],us=[0,.69444,0,0,.70278],Ds=[0,.69444,0,0,.76389],vc=[.25,.75,0,0,.34306],Ls=[0,.69444,0,0,.56111],pl=[0,.69444,0,0,.25556],hl=[.19444,.45833,0,0,.56111],bn=[0,.45833,0,0,.56111],$r=[0,.69444,0,0,.30556],sn=[0,.69444,0,0,.58056],Wn=[0,.69444,0,0,.67223],ei=[0,.69444,0,0,.85556],$a=[0,.69444,0,0,.55834],_i=[0,.65556,.11156,0,.5],Wo=[0,.69444,.08094,0,.70834],ml=[.17014,0,0,0,.44445],yu=[0,.69444,.0799,0,.5],bc=[0,.69444,0,0,.73752],xu=[0,.69444,.09205,0,.5],wu=[0,.69444,.09031,0,.77778],yc=[0,.69444,.07816,0,.27778],Su=[0,.69444,.00316,0,.5],_u=[.19444,.69444,0,0,.83334],xc=[.05556,.75,0,0,.83334],Mu=[0,.75,0,0,.5],Cu=[.125,.08333,0,0,.27778],Eu=[0,.08333,0,0,.27778],Ja=[0,.65556,0,0,.5],wc=[0,.69444,0,0,.47222],fo=[0,.69444,0,0,.66667],ku=[0,.69444,0,0,.59722],Sc=[0,.69444,0,0,.54167],_c=[0,.69444,0,0,.70834],ds=[.25,.75,0,0,.28889],fs=[0,.69444,0,0,.51667],gl=[0,.44444,0,0,.44445],Au=[.19444,.44444,0,0,.51667],Du=[0,.44444,0,0,.38333],Lu=[0,.44444,0,0,.51667],Iu=[0,.69444,0,0,.83334],Bu=[.35001,.85,0,0,.45834],Tu=[.35001,.85,0,0,.57778],$u=[.35001,.85,0,0,.41667],Pu=[.35001,.85,0,0,.58334],vl=[0,.72222,0,0,.55556],Ru=[1e-5,.6,0,0,.66667],Ou=[1e-5,.6,0,0,.77778],bl=[.25001,.75,0,0,.94445],Nu=[.306,.805,.19445,0,.47222],Mc=[.30612,.805,.19445,0,.47222],Vo=[.25001,.75,0,0,.83334],Uo=[.35001,.85,0,0,.47222],Cc=[.25001,.75,0,0,1.11111],Fu=[.65002,1.15,0,0,.59722],Ec=[.65002,1.15,0,0,.81111],zu=[.65002,1.15,0,0,.47222],kc=[.65002,1.15,0,0,.66667],yl=[0,.75,0,0,1],Ku=[.55001,1.05,0,0,1.27778],Hu=[.862,1.36,.44445,0,.55556],Wu=[.86225,1.36,.44445,0,.55556],wa=[.55001,1.05,0,0,1.11111],xl=[.65002,1.15,0,0,.52778],Ac=[.65002,1.15,0,0,.61111],Is=[.55001,1.05,0,0,1.51112],Vu=[.95003,1.45,0,0,.73611],Dc=[.95003,1.45,0,0,1.04445],Lc=[.95003,1.45,0,0,.52778],wl=[.95003,1.45,0,0,.75],Bs=[0,.75,0,0,1.44445],Ts=[.95003,1.45,0,0,.58334],Uu=[1.25003,1.75,0,0,.79167],Zu=[1.25003,1.75,0,0,1.27778],Ic=[1.25003,1.75,0,0,.58334],Sl=[1.25003,1.75,0,0,.80556],ps=[0,.825,0,0,1.8889],$s=[1.25003,1.75,0,0,.63889],hs=[.64502,1.155,0,0,.875],ju=[1e-5,.6,0,0,.875],Ps=[-99e-5,.601,0,0,.66667],_l=[.64502,1.155,0,0,.66667],Gu=[1e-5,.9,0,0,.88889],qu=[.65002,1.15,0,0,.88889],Bc=[.90001,0,0,0,.88889],Xu=[-.00499,.605,0,0,1.05556],Ml=[0,.12,0,0,.45],_t=[0,.61111,0,0,.525],Gi=[.08333,.69444,0,0,.525],Zo=[-.08056,.53055,0,0,.525],Cl=[-.05556,.55556,0,0,.525],la=[0,.43056,0,0,.525],ms=[.22222,.43056,0,0,.525],Ju=[0,0,0,0,.525],Rs={"AMS-Regular":{32:It,65:ct,66:rn,67:ct,68:ct,69:rn,70:br,71:nn,72:nn,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:nn,76:rn,77:[0,.68889,0,0,.94445],78:ct,79:dr,80:br,81:dr,82:ct,83:Xr,84:rn,85:ct,86:ct,87:[0,.68889,0,0,1],88:ct,89:ct,90:rn,107:Xr,160:It,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:Xr,295:wn,710:$n,732:dn,770:$n,771:dn,989:Ee,1008:ua,8245:[0,.54986,0,0,.275],8463:wn,8487:ct,8498:Xr,8502:rn,8503:[0,.68889,0,0,.44445],8504:rn,8513:[0,.68889,0,0,.63889],8592:jr,8594:jr,8602:Lr,8603:Lr,8606:At,8608:At,8610:Fr,8611:Fr,8619:vi,8620:vi,8621:[-.13313,.37788,0,0,1.38889],8622:Lr,8624:ni,8625:ni,8630:li,8631:li,8634:hn,8635:hn,8638:Di,8639:Di,8642:Di,8643:Di,8644:Sn,8646:Sn,8647:Sn,8648:K,8649:Sn,8650:K,8651:At,8652:At,8653:Lr,8654:Lr,8655:Lr,8666:X,8667:X,8669:[-.13313,.37788,0,0,1],8672:me,8674:me,8705:[0,.825,0,0,.5],8708:Xr,8709:Ee,8717:[0,.43056,0,0,.42917],8722:jr,8724:[.08198,.69224,0,0,.77778],8726:Ee,8733:zr,8736:at,8737:at,8738:[.03517,.52239,0,0,.72222],8739:Hi,8740:[.25142,.74111,0,0,.27778],8741:Li,8742:[.25142,.74111,0,0,.5],8756:Mt,8757:Mt,8764:Qt,8765:[-.13313,.37788,0,0,.77778],8769:Qt,8770:on,8774:hr,8776:Pi,8778:Ee,8782:Jt,8783:Jt,8785:hn,8786:hn,8787:hn,8790:zr,8791:_r,8796:[.08198,.91667,0,0,.77778],8806:Ir,8807:Ir,8808:nr,8809:nr,8812:[.25583,.75583,0,0,.5],8814:Yr,8815:Yr,8816:hr,8817:hr,8818:_r,8819:_r,8822:Fn,8823:Fn,8828:Pr,8829:Pr,8830:_r,8831:_r,8832:Yr,8833:Yr,8840:hr,8841:hr,8842:Kr,8843:Kr,8847:Pn,8848:Pn,8858:hn,8859:hn,8861:hn,8862:jt,8863:jt,8864:jt,8865:jt,8872:[0,.69224,0,0,.61111],8873:at,8874:[0,.69224,0,0,.88889],8876:br,8877:br,8878:ct,8879:ct,8882:Pn,8883:Pn,8884:Pr,8885:Pr,8888:[0,.54986,0,0,1.11111],8890:ai,8891:Pe,8892:Pe,8901:[0,.54986,0,0,.27778],8903:Ee,8905:Ee,8906:Ee,8907:zr,8908:zr,8909:[-.03598,.46402,0,0,.77778],8910:Zn,8911:Zn,8912:Pn,8913:Pn,8914:bi,8915:bi,8916:Mt,8918:Rn,8919:Rn,8920:yi,8921:yi,8922:xi,8923:xi,8926:Pr,8927:Pr,8928:hr,8929:hr,8934:jn,8935:jn,8936:jn,8937:jn,8938:Yr,8939:Yr,8940:hr,8941:hr,8994:Ji,8995:Ji,9416:[.15559,.69224,0,0,.90222],9484:ni,9488:ni,9492:ga,9496:ga,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:jt,9633:jt,9650:Yi,9651:Yi,9654:Pn,9660:Yi,9661:Yi,9664:Pn,9674:an,9733:[.19444,.69224,0,0,.94445],10003:Ki,10016:Ki,10731:an,10846:[.19444,.75583,0,0,.61111],10877:Pr,10878:Pr,10885:Ir,10886:Ir,10887:Kr,10888:Kr,10889:Ar,10890:Ar,10891:kn,10892:kn,10901:Pr,10902:Pr,10933:nr,10934:nr,10935:Ar,10936:Ar,10937:Ar,10938:Ar,10949:Ir,10950:Ir,10955:Jr,10956:Jr,57350:Hi,57351:Li,57352:Ee,57353:ua,57356:nr,57357:nr,57358:ci,57359:hr,57360:hr,57361:ci,57366:nr,57367:nr,57368:nr,57369:nr,57370:Kr,57371:Kr},"Caligraphic-Regular":{32:It,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:It},"Fraktur-Regular":{32:It,33:[0,.69141,0,0,.29574],34:Qi,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:Ii,41:Ii,42:[0,.62119,0,0,.27764],43:Na,44:Aa,45:Na,46:Aa,47:[.24982,.74947,0,0,.50181],48:Fa,49:Fa,50:Fa,51:Rr,52:Rr,53:Rr,54:lo,55:Rr,56:lo,57:Rr,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:bo,93:bo,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:It,8216:Qi,8217:Qi,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:It,33:[0,.69444,0,0,.35],34:H,35:[.19444,.69444,0,0,.95833],36:bt,37:[.05556,.75,0,0,.95833],38:ba,39:ii,40:Wi,41:Wi,42:[0,.75,0,0,.575],43:b,44:[.19444,.15556,0,0,.31944],45:Du,46:[0,.15556,0,0,.31944],47:Vi,48:Gn,49:Gn,50:Gn,51:Gn,52:Gn,53:Gn,54:Gn,55:Gn,56:Gn,57:Gn,58:M,59:[.19444,.44444,0,0,.31944],60:va,61:et,62:va,63:[0,.69444,0,0,.54305],64:ba,65:qn,66:[0,.68611,0,0,.81805],67:R,68:[0,.68611,0,0,.88194],69:ss,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:ea,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:k,77:[0,.68611,0,0,1.09166],78:ea,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:qn,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Bi,92:Vi,93:Bi,94:Ui,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:ui,99:ta,100:ui,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:ui,105:ii,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:ii,109:[0,.44444,0,0,.95833],110:da,111:sa,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:da,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:ta,123:Vi,124:Bi,125:Vi,126:[.35,.34444,0,0,.575],160:It,163:[0,.69444,0,0,.86853],168:Ui,172:[0,.44444,0,0,.76666],176:C,177:b,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:b,216:[.04861,.73472,0,0,.89444],223:ku,230:[0,.44444,0,0,.83055],247:b,248:[.09722,.54167,0,0,.575],305:M,338:[0,.68611,0,0,1.16944],339:qe,567:[.19444,.44444,0,0,.35139],710:Ui,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Ui,715:Ui,728:Ui,729:ii,730:C,732:Ui,733:Ui,915:k,916:Dt,920:z,923:ol,926:ll,928:ea,931:R,933:z,934:R,936:z,937:R,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:ii,8217:ii,8220:H,8221:H,8224:ee,8225:ee,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:al,8465:le,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:le,8501:Pt,8592:Te,8593:st,8594:Te,8595:st,8596:Te,8597:Vi,8598:Be,8599:Be,8600:Be,8601:Be,8636:Te,8637:Te,8640:Te,8641:Te,8656:Te,8657:vt,8658:Te,8659:vt,8660:Te,8661:[.25,.75,0,0,.70277],8704:ui,8706:[0,.69444,.06389,0,.62847],8707:ui,8709:bt,8711:Dt,8712:Wt,8715:Wt,8722:b,8723:b,8725:Vi,8726:Vi,8727:zt,8728:Ct,8729:Ct,8730:[.18,.82,0,0,.95833],8733:qe,8734:[0,.44444,0,0,1.14999],8736:at,8739:Bi,8741:Vi,8743:He,8744:He,8745:He,8746:He,8747:[.19444,.69444,.12778,0,.56875],8764:et,8768:[.19444,.69444,0,0,.31944],8771:Ye,8776:[.02444,.52444,0,0,.89444],8781:Ye,8801:Ye,8804:wt,8805:wt,8810:mt,8811:mt,8826:va,8827:va,8834:va,8835:va,8838:wt,8839:wt,8846:He,8849:wt,8850:wt,8851:He,8852:He,8853:b,8854:b,8855:b,8856:b,8857:b,8866:Pt,8867:Pt,8868:ba,8869:ba,8900:Ct,8901:[-.02639,.47361,0,0,.31944],8902:zt,8968:Ot,8969:Ot,8970:Ot,8971:Ot,8994:Bt,8995:Bt,9651:sr,9657:zt,9661:sr,9667:zt,9711:Be,9824:Et,9825:Et,9826:Et,9827:Et,9837:[0,.75,0,0,.44722],9838:tr,9839:tr,10216:Wi,10217:Wi,10815:ea,10927:wt,10928:wt,57376:Qn},"Main-BoldItalic":{32:It,33:[0,.69444,.11417,0,.38611],34:fn,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:mn,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:Zt,49:Zt,50:Zt,51:Zt,52:Xt,53:Zt,54:Zt,55:Xt,56:Zt,57:Zt,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:fr,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:Hr,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:Hr,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:yr,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:Br,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:Br,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:It,168:[0,.69444,.11473,0,.59111],176:Yn,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:Or,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:Or,567:[.19444,.44444,.04611,0,.385],710:yr,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:mn,730:Yn,732:fr,733:fr,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:Hr,931:[0,.68611,.11431,0,.82666],933:Dr,934:[0,.68611,.05632,0,.82666],936:Dr,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:mn,8217:mn,8220:[0,.69444,.16772,0,.62055],8221:fn},"Main-Italic":{32:It,33:Wr,34:Vr,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Wr,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:Mr,49:Mr,50:Mr,51:Mr,52:Qr,53:Mr,54:Mr,55:Qr,56:Mr,57:Mr,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:An,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:xr,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:xr,79:Tr,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:xr,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:wi,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:pn,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:pn,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:It,168:[0,.66786,.10474,0,.51111],176:Ti,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:zn,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:zn,710:wi,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Ti,732:[0,.66786,.11585,0,.51111],733:An,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Tr,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:xr,931:[0,.68333,.12028,0,.71555],933:Si,934:[0,.68333,.05986,0,.71555],936:Si,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Wr,8217:Wr,8220:[0,.69444,.1685,0,.51444],8221:Vr,8463:wn},"Main-Regular":{32:It,33:gn,34:wr,35:_u,36:mi,37:xc,38:di,39:gn,40:_n,41:_n,42:Mu,43:Ln,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:vn,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,58:ia,59:[.19444,.43056,0,0,.27778],60:Rn,61:Qt,62:Rn,63:wc,64:di,65:fi,66:[0,.68333,0,0,.70834],67:Zi,68:[0,.68333,0,0,.76389],69:ra,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:fi,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:pi,76:hi,77:[0,.68333,0,0,.91667],78:fi,79:pi,80:ra,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Zi,85:fi,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:fi,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Mn,92:vn,93:Mn,94:wr,95:[.31,.12056,.02778,0,.5],97:Hn,98:Kn,99:Dn,100:Kn,101:Dn,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Kn,105:In,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:gn,109:[0,.43056,0,0,.83334],110:na,111:Hn,112:ai,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:na,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:Dn,123:vn,124:Mn,125:vn,126:[.35,.31786,0,0,.5],160:It,163:[0,.69444,0,0,.76909],167:oi,168:$i,172:[0,.43056,0,0,.66667],176:aa,177:Ln,182:xa,184:ml,198:[0,.68333,0,0,.90278],215:Ln,216:[.04861,.73194,0,0,.77778],223:wr,230:[0,.43056,0,0,.72222],247:Ln,248:[.09722,.52778,0,0,.5],305:ia,338:[0,.68333,0,0,1.01389],339:lr,567:[.19444,.43056,0,0,.30556],710:wr,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:wr,715:wr,728:wr,729:In,730:aa,732:$i,733:wr,915:hi,916:Da,920:pi,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:fi,931:Zi,933:pi,934:Zi,936:pi,937:Zi,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:gn,8217:gn,8220:wr,8221:wr,8224:oi,8225:oi,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:wn,8465:fa,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:fa,8501:Oi,8592:Lr,8593:qa,8594:Lr,8595:qa,8596:Lr,8597:vn,8598:ji,8599:ji,8600:ji,8601:ji,8614:[.011,.511,0,0,1],8617:ya,8618:ya,8636:Lr,8637:Lr,8640:Lr,8641:Lr,8652:[.011,.671,0,0,1],8656:Lr,8657:xa,8658:Lr,8659:xa,8660:Lr,8661:[.25,.75,0,0,.61111],8704:Kn,8706:[0,.69444,.05556,.08334,.5309],8707:Kn,8709:mi,8711:Da,8712:oa,8715:oa,8722:Ln,8723:Ln,8725:vn,8726:vn,8727:Ia,8728:La,8729:La,8730:[.2,.8,0,0,.83334],8733:lr,8734:li,8736:at,8739:Mn,8741:vn,8743:ir,8744:ir,8745:ir,8746:ir,8747:[.19444,.69444,.11111,0,.41667],8764:Qt,8768:[.19444,.69444,0,0,.27778],8771:on,8773:[-.022,.589,0,0,1],8776:Pi,8781:on,8784:[-.133,.67,0,0,.778],8801:on,8804:Kr,8805:Kr,8810:Ri,8811:Ri,8826:Rn,8827:Rn,8834:Rn,8835:Rn,8838:Kr,8839:Kr,8846:ir,8849:Kr,8850:Kr,8851:ir,8852:ir,8853:Ln,8854:Ln,8855:Ln,8856:Ln,8857:Ln,8866:Oi,8867:Oi,8868:di,8869:di,8872:[.249,.75,0,0,.867],8900:La,8901:[-.05555,.44445,0,0,.27778],8902:Ia,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:Xa,8969:Xa,8970:Xa,8971:Xa,8994:co,8995:co,9136:Ba,9137:Ba,9651:uo,9657:Ia,9661:uo,9667:Ia,9711:ji,9824:Gr,9825:Gr,9826:Gr,9827:Gr,9837:[0,.75,0,0,.38889],9838:pr,9839:pr,10216:_n,10217:_n,10222:Ba,10223:Ba,10229:[.011,.511,0,0,1.609],10230:Bn,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:Bn,10815:fi,10927:Kr,10928:Kr,57376:Qn},"Math-BoldItalic":{32:It,48:sa,49:sa,50:sa,51:gi,52:gi,53:gi,54:Gn,55:gi,56:Gn,57:gi,65:qn,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:sl,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:ss,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:al,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:cl,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:It,915:[0,.68611,.15972,0,.65694],916:Dt,920:[0,.68611,.03194,0,.86722],923:ol,926:[0,.68611,.07458,0,.84125],928:sl,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:ll,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:cl,960:[0,.44444,.03704,0,.68241],961:ls,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:ls,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:It,48:Hn,49:Hn,50:Hn,51:za,52:za,53:za,54:On,55:za,56:On,57:za,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:ul,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:cs,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:dl,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:It,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:cs,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:ul,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:dl,960:[0,.43056,.03588,0,.57003],961:fl,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:fl,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:It,33:[0,.69444,0,0,.36667],34:$a,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:$r,40:ks,41:ks,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:Nn,49:Nn,50:Nn,51:Nn,52:Nn,53:Nn,54:Nn,55:Nn,56:Nn,57:Nn,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:As,64:Ka,65:Ka,66:Ka,67:us,68:Ta,69:[0,.69444,0,0,.64167],70:Oi,71:Ka,72:Ta,73:[0,.69444,0,0,.33056],74:As,75:Ds,76:sn,77:[0,.69444,0,0,.97778],78:Ta,79:Ta,80:us,81:[.10556,.69444,0,0,.79445],82:us,83:Oi,84:Ka,85:Ds,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Ka,89:[0,.69444,.0275,0,.73334],90:Wn,91:vc,93:vc,94:Nn,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Ls,99:[0,.45833,0,0,.48889],100:Ls,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Ls,105:pl,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:pl,109:[0,.45833,0,0,.86667],110:bn,111:[0,.45833,0,0,.55],112:hl,113:hl,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:bn,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:It,168:Nn,176:Ka,180:Nn,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Nn,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Nn,729:$r,730:Ka,732:Nn,733:Nn,915:sn,916:[0,.69444,0,0,.91667],920:ei,923:Wn,926:Ka,928:Ta,931:Ta,933:ei,934:Ta,936:ei,937:Ta,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:$r,8217:$r,8220:$a,8221:$a},"SansSerif-Italic":{32:It,33:[0,.69444,.05733,0,.31945],34:Su,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:yc,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:Cu,45:[0,.44444,.01946,0,.33333],46:Eu,47:[.25,.75,.13164,0,.5],48:_i,49:_i,50:_i,51:_i,52:_i,53:_i,54:_i,55:_i,56:_i,57:_i,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:fo,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:Wo,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:Sc,77:[0,.69444,.08094,0,.875],78:Wo,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:yu,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:It,168:[0,.67937,.06385,0,.5],176:bc,184:ml,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:yu,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:xu,715:wr,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:bc,732:[0,.67659,.08826,0,.5],733:xu,915:[0,.69444,.13372,0,.54167],916:Iu,920:[0,.69444,.07555,0,.77778],923:Oi,926:[0,.69444,.12816,0,.66667],928:Wo,931:[0,.69444,.11983,0,.72222],933:wu,934:[0,.69444,.04603,0,.72222],936:wu,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:yc,8217:yc,8220:[0,.69444,.14205,0,.5],8221:Su},"SansSerif-Regular":{32:It,33:[0,.69444,0,0,.31945],34:wr,35:_u,36:mi,37:xc,38:[0,.69444,0,0,.75834],39:gn,40:_n,41:_n,42:Mu,43:Ln,44:Cu,45:[0,.44444,0,0,.33333],46:Eu,47:vn,48:Ja,49:Ja,50:Ja,51:Ja,52:Ja,53:Ja,54:Ja,55:Ja,56:Ja,57:Ja,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:wc,64:fo,65:fo,66:fo,67:ui,68:[0,.69444,0,0,.72223],69:ku,70:[0,.69444,0,0,.56945],71:fo,72:_c,73:gn,74:wc,75:[0,.69444,0,0,.69445],76:Sc,77:[0,.69444,0,0,.875],78:_c,79:[0,.69444,0,0,.73611],80:ui,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Kn,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:fo,89:[0,.69444,.025,0,.66667],90:Oi,91:ds,93:ds,94:wr,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:fs,99:gl,100:fs,101:gl,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:fs,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:Lu,111:[0,.44444,0,0,.5],112:Au,113:Au,114:[0,.44444,.01389,0,.34167],115:Du,116:[0,.57143,0,0,.36111],117:Lu,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:It,168:[0,.67937,0,0,.5],176:fo,184:ml,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:wr,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:wr,715:wr,728:wr,729:[0,.67937,0,0,.27778],730:fo,732:[0,.67659,0,0,.5],733:wr,915:Sc,916:Iu,920:di,923:Oi,926:fo,928:_c,931:fa,933:di,934:fa,936:di,937:fa,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:gn,8217:gn,8220:wr,8221:wr},"Script-Regular":{32:It,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:It},"Size1-Regular":{32:It,40:Bu,41:Bu,47:Tu,91:$u,92:Tu,93:$u,123:Pu,125:Pu,160:It,710:vl,732:vl,770:vl,771:vl,8214:[-99e-5,.601,0,0,.77778],8593:Ru,8595:Ru,8657:Ou,8659:Ou,8719:bl,8720:bl,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:Mc,8748:Nu,8749:Nu,8750:Mc,8896:Vo,8897:Vo,8898:Vo,8899:Vo,8968:Uo,8969:Uo,8970:Uo,8971:Uo,9168:Ps,10216:Uo,10217:Uo,10752:Cc,10753:Cc,10754:Cc,10756:Vo,10758:Vo},"Size2-Regular":{32:It,40:Fu,41:Fu,47:Ec,91:zu,92:Ec,93:zu,123:kc,125:kc,160:It,710:yl,732:yl,770:yl,771:yl,8719:Ku,8720:Ku,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:Wu,8748:Hu,8749:Hu,8750:Wu,8896:wa,8897:wa,8898:wa,8899:wa,8968:xl,8969:xl,8970:xl,8971:xl,10216:Ac,10217:Ac,10752:Is,10753:Is,10754:Is,10756:wa,10758:wa},"Size3-Regular":{32:It,40:Vu,41:Vu,47:Dc,91:Lc,92:Dc,93:Lc,123:wl,125:wl,160:It,710:Bs,732:Bs,770:Bs,771:Bs,8730:[.95003,1.45,0,0,1],8968:Ts,8969:Ts,8970:Ts,8971:Ts,10216:wl,10217:wl},"Size4-Regular":{32:It,40:Uu,41:Uu,47:Zu,91:Ic,92:Zu,93:Ic,123:Sl,125:Sl,160:It,710:ps,732:ps,770:ps,771:ps,8730:[1.25003,1.75,0,0,1],8968:$s,8969:$s,8970:$s,8971:$s,9115:hs,9116:ju,9117:hs,9118:hs,9119:ju,9120:hs,9121:_l,9122:Ps,9123:_l,9124:_l,9125:Ps,9126:_l,9127:Gu,9128:qu,9129:Bc,9130:[0,.3,0,0,.88889],9131:Gu,9132:qu,9133:Bc,9143:[.88502,.915,0,0,1.05556],10216:Sl,10217:Sl,57344:Xu,57345:Xu,57680:Ml,57681:Ml,57682:Ml,57683:Ml},"Typewriter-Regular":{32:Ju,33:_t,34:_t,35:_t,36:Gi,37:Gi,38:_t,39:_t,40:Gi,41:Gi,42:[0,.52083,0,0,.525],43:Zo,44:[.13889,.125,0,0,.525],45:Zo,46:[0,.125,0,0,.525],47:Gi,48:_t,49:_t,50:_t,51:_t,52:_t,53:_t,54:_t,55:_t,56:_t,57:_t,58:la,59:[.13889,.43056,0,0,.525],60:Cl,61:[-.19549,.41562,0,0,.525],62:Cl,63:_t,64:_t,65:_t,66:_t,67:_t,68:_t,69:_t,70:_t,71:_t,72:_t,73:_t,74:_t,75:_t,76:_t,77:_t,78:_t,79:_t,80:_t,81:[.13889,.61111,0,0,.525],82:_t,83:_t,84:_t,85:_t,86:_t,87:_t,88:_t,89:_t,90:_t,91:Gi,92:Gi,93:Gi,94:_t,95:[.09514,0,0,0,.525],96:_t,97:la,98:_t,99:la,100:_t,101:la,102:_t,103:ms,104:_t,105:_t,106:[.22222,.61111,0,0,.525],107:_t,108:_t,109:la,110:la,111:la,112:ms,113:ms,114:la,115:la,116:[0,.55358,0,0,.525],117:la,118:la,119:la,120:la,121:ms,122:la,123:Gi,124:Gi,125:Gi,126:_t,127:_t,160:Ju,176:_t,184:[.19445,0,0,0,.525],305:la,567:ms,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:_t,715:_t,728:_t,730:_t,770:_t,771:_t,776:_t,915:_t,916:_t,920:_t,923:_t,926:_t,928:_t,931:_t,933:_t,934:_t,936:_t,937:_t,8216:_t,8217:_t,8242:_t,9251:[.11111,.21944,0,0,.525]}},d0=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,gs=10,Vn=.25,Tc=1.2,po=.431,Yu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[po,po,po],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[Vn,Vn,Vn],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},El=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],jo=5,$c={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function vs(e,t){e===void 0&&(e=77);const r=Rs[t][e];if(r)return{defaultMetrics:!1,depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]};if(e===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const n=String.fromCodePoint(e);if(n in $c)e=$c[n].codePointAt(0);else if(d0.test(n))return e=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var Pc={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Rc={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},kl={doubleleftarrow:`M262 157
|
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
|
|
|
c -179 0 -524 -115 -524 -115
|
|
|
c -5 -1 -9 -5 -9 -10
|
|
|
c 0 -1 1 -2 1 -3
|
|
|
l 4 -22
|
|
|
c 1 -5 5 -9 11 -9
|
|
|
h 2
|
|
|
s 338 93 512 92
|
|
|
c 174 0 513 -92 513 -92
|
|
|
h 2
|
|
|
c 5 0 9 4 11 9
|
|
|
l 5 22
|
|
|
c 1 6 -2 12 -8 13
|
|
|
c 0 0 -342 115 -520 115
|
|
|
z
|
|
|
`,leftgroup:`M400000 80
|
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
|
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
|
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function Os(e){if(Rc[e]){const[p,h,S]=Rc[e],D=`<span class="stretchy" style="height:${S}em"><svg width="100%" height="${S}em" viewBox="0 0 ${p} ${h}" preserveAspectRatio="none" ><path fill="currentcolor" d="${kl[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*S/2)/100}em;min-width:0">${D}</span>`}const[t,r,n,i]=Pc[e];let a,s;const u=n/1e3;t.length===3?(a=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],s=["xMinYMin","xMidYMin","xMaxYMin"]):t.length===2?(a=["slice-1-of-2","slice-2-of-2"],s=["xMinYMin","xMaxYMin"]):(a=["slice-1-of-1"],s=[i]);const d=t.map((p,h)=>`<span class="${a[h]}" style=height:${u}em><svg width=400em height=${u}em viewBox="0 0 400000 ${n}" preserveAspectRatio="${s[h]} slice"><path fill="currentcolor" d="${kl[p]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${u}em;min-width:${r}em;">${d}</span>`}function f0(e){return Pc[e]?Pc[e][2]/1e3:Rc[e][2]}function p0(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n===13&&e.charCodeAt(r+1)===10&&(n=10,r++),(n===13||n===12)&&(n=10),n===0&&(n=65533),n>=55296&&n<=56319){const i=e.charCodeAt(r+1);if(i>=56320&&i<=57343){const a=n-55296,s=i-56320;n=Ho(2,16)+a*Ho(2,10)+s,r++}}t.push(n)}return t}var Al=8205,Qu=[[Al,1],[65038,2],[127995,5],[129456,4],[917536,96]],Dl,ed=[127462,127487];function Ll(e){var t;if(Dl===void 0){Dl={};for(const r of Qu)for(let n=r[0];n<=r[0]+r[1]-1;n++)Dl[n]=!0}return(t=Dl[e])!=null?t:!1}function h0(e){return e>=ed[0]&&e<=ed[1]}function td(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const t=[],r=p0(e);let n=0;for(;n<r.length;){const i=r[n++],a=r[n];if(a===Al){const s=n-1;for(n+=2;r[n]===Al;)n+=2;t.push(String.fromCodePoint(...r.slice(s,n-s+1)))}else if(Ll(a)){const s=n-1;for(;Ll(r[n]);)n+=r[n]===Al?2:1;t.push(String.fromCodePoint(...r.slice(s,2*n-s-1)))}else h0(i)?(n+=1,t.push(String.fromCodePoint(...r.slice(n-2,2)))):t.push(String.fromCodePoint(i))}return t}var Il=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=td(e)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(e){const t=typeof this.s=="string"?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return t!=null&&t[0]?(this.pos+=t[0].length,t[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const e=this.get();if(e==="\\"){if(!this.end()){let t=this.match(/^[a-zA-Z\*]+/);return t?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):t=this.get(),"\\"+t}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();const t=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(t)return String.fromCodePoint(Number.parseInt(t.slice(t.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let t=!1;if(/[\d?@]/.test(this.peek())&&(t=!0,this.pos+1<this.s.length)){const r=this.s[this.pos+1];t=/[^\dA-Za-z]/.test(r)}return t?"#"+this.get():"#"}}else if(e==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return e}};function m0(e,t){var r,n,i,a;const s=[];let u=e.next();if(u&&u!=="\\relax"){if(u==="\\noexpand")u=e.next(),u&&s.push(u);else if(u==="\\obeyspaces")e.obeyspaces=!0;else if(u==="\\bgroup")s.push("<{>");else if(u==="\\egroup")s.push("<}>");else if(u==="\\string"){if(u=e.next(),u)if(u.startsWith("\\"))for(const d of u)s.push(d==="\\"?"\\backslash":d);else u==="<{>"?s.push("\\{"):u==="<space>"?s.push("~"):u==="<}>"&&s.push("\\}")}else if(u==="\\csname"){for(;e.peek()==="<space>";)e.next();let d="",p=!1,h=[];do{if(h.length===0)if(/^#[\d?@]$/.test(e.peek())){const S=e.get().slice(1);h=Bl((n=(r=t==null?void 0:t(S))!=null?r:t==null?void 0:t("?"))!=null?n:"\\placeholder{}",t),u=h[0]}else u=e.next(),h=u?[u]:[];p=h.length===0,!p&&u==="\\endcsname"&&(p=!0,h.shift()),p||(p=u==="<$>"||u==="<$$>"||u==="<{>"||u==="<}>"||typeof u=="string"&&u.length>1&&u.startsWith("\\")),p||(d+=h.shift())}while(!p);d&&s.push("\\"+d),s.push(...h)}else if(u!=="\\endcsname")if(u.length>1&&u.startsWith("#")){const d=u.slice(1);s.push(...Bl((a=(i=t==null?void 0:t(d))!=null?i:t==null?void 0:t("?"))!=null?a:"\\placeholder{}",t))}else s.push(u)}return s}function Bl(e,t=null){const r=[];let n="";for(const s of e.toString().split(/\r?\n/)){n&&r.push(n),n=" ";const u=s.match(/((?:\\%)|[^%])*/);u!==null&&r.push(u[0])}const i=new Il(Oe(r.join(""))),a=[];do a.push(...m0(i,t));while(!i.end());return a}function Cr(e){let t="";const r=[];for(const n of e)n&&(t&&/^[a-zA-Z\*]/.test(n)&&r.push(t),r.push(n),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(n)&&r.push(" "),t=/\\[a-zA-Z]+\*?$/.test(n)?" ":"");return r.join("")}function yn(e,...t){return console.assert(e.startsWith("\\")),t.length===0?e:Cr([e,...t.map(r=>`{${r}}`)])}function Go(e){return Cr(e.map(t=>{var r;return(r={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[t])!=null?r:t}))}var g0=class bu{constructor(t){bu._registry[t]=this}static createAtom(t,r,n){return bu._registry[t].createAtom(r,or(r,t),n)}static serialize(t,r){var n;if(!t||t.length===0)return"";if((n=r.skipStyles)!=null&&n){const i=[];for(const a of v0(t)){const s=bu._registry[a[0].mode];i.push(...s.serialize(a,r))}return Cr(i)}return Cr(b0(t,r))}static getFont(t,r,n){return bu._registry[t].getFont(r,n)}};g0._registry={};var Sa=g0;function v0(e){const t=[];let r=[],n="NONE";for(const i of e)i.type!=="first"&&(i.mode!==n?(r.length>0&&t.push(r),r=[i],n=i.mode):r.push(i));return r.length>0&&t.push(r),t}function Pa(e,t){const r=[];let n=[],i;for(const a of e)if(a.type!=="first"&&a.style){let s;t==="variant"?(s=a.style.variant,a.style.variantStyle&&a.style.variantStyle!=="up"&&(s+="-"+a.style.variantStyle)):s=a.style[t],s===i?n.push(a):(n.length>0&&r.push(n),n=[a],i=s)}return n.length>0&&r.push(n),r}function rd(e,t){var r;const{parent:n}=e[0],i=n==null?void 0:n.computedStyle.color,a=[];for(const s of v0(e)){const u=t.defaultMode;for(const d of Pa(s,"color")){const p=d[0].computedStyle,h=Sa._registry[d[0].mode].serialize(d,v(_({},t),{defaultMode:u==="text"?"text":"math"}));!t.skipStyles&&p.color&&p.color!=="none"&&(!n||i!==p.color)?a.push(yn("\\textcolor",(r=p.verbatimColor)!=null?r:p.color,Cr(h))):a.push(Cr(h))}}return a}function Oc(e,t){const{parent:r}=e[0],n=r==null?void 0:r.computedStyle.backgroundColor;return Pa(e,"backgroundColor").map(i=>{var a;if(i.length>0||i[0].type!=="box"){const s=i[0].computedStyle;if(s.backgroundColor&&s.backgroundColor!=="none"&&(!r||n!==s.backgroundColor))return yn("\\colorbox",(a=s.verbatimBackgroundColor)!=null?a:s.backgroundColor,Cr(rd(i,v(_({},t),{defaultMode:"text"}))))}return Cr(rd(i,t))})}function b0(e,t){if(e.length===0)return[];const{parent:r}=e[0],n=r==null?void 0:r.computedStyle.fontSize,i=[];for(const a of Pa(e,"fontSize")){const s=a[0].computedStyle.fontSize,u=Oc(a,t);u&&(s&&s!=="auto"&&(!r||n!==s)?i.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][s],...u):i.push(...u))}return i}function Nc(e){return e?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[e]:void 0}function Ns(e){if(e.length===0)return"ord";const t=Nc(e[0].type),r=Nc(e[e.length-1].type);return t&&t===r?t:"ord"}function qo(e,t){if(typeof e=="string")return e;if(typeof e=="number"){console.assert(Number.isFinite(e));const r=Math.ceil(100*e)/100;return r===0?"0":r.toString()+(t!=null?t:"")}return""}var je=class Qp{constructor(t,r){var n,i,a,s,u;if(typeof t=="number"?this.value=String.fromCodePoint(t):typeof t=="string"?this.value=t:L(t)?this.children=t.filter(p=>p!==null):t&&t instanceof Qp&&(this.children=[t]),this.children)for(const p of this.children)p.parent=this;this.type=(n=r==null?void 0:r.type)!=null?n:"ignore",this.isSelected=(r==null?void 0:r.isSelected)===!0,r!=null&&r.caret&&(this.caret=r.caret),this.classes=(i=r==null?void 0:r.classes)!=null?i:"",this.isTight=(a=r==null?void 0:r.isTight)!=null?a:!1,r!=null&&r.attributes&&(this.attributes=r.attributes);let d=r==null?void 0:r.fontFamily;r!=null&&r.style&&this.value&&(d=(u=Sa.getFont((s=r.mode)!=null?s:"math",this,v(_({variant:"normal"},r.style),{letterShapeStyle:r.letterShapeStyle})))!=null?u:void 0),d||(d="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(r==null?void 0:r.maxFontSize)!==void 0&&(this.maxFontSize=r.maxFontSize),y0(this,d)}set atomID(t){t===void 0||t.length===0||(this.id=t)}selected(t){if(this.isSelected!==t&&(this.isSelected=t,this.children))for(const r of this.children)r.selected(t)}setStyle(t,r,n){if(r===void 0)return;const i=qo(r,n);i.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[t]=i)}setTop(t){Number.isFinite(t)&&Math.abs(t)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=qo(t,"em"),this.height-=t,this.depth+=t)}get left(){var t;return(t=this.cssProperties)!=null&&t["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=qo(t,"em")))}set right(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=qo(t,"em")))}set bottom(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=qo(t,"em")))}get width(){return this._width*this.scale}set width(t){this._width=t,this.hasExplicitWidth=!0}set softWidth(t){}get height(){return this._height*this.scale}set height(t){this._height=t}get depth(){return this._depth*this.scale}set depth(t){this._depth=t}wrap(t){const r=t.parent;if(!r)return this;t.isPhantom&&this.setStyle("opacity",0);const n=t.color;n&&n!==r.color&&this.setStyle("color",n);let i=t.backgroundColor;this.isSelected&&(i=ge(i)),i&&i!==r.backgroundColor&&(this.setStyle("background-color",i),this.setStyle("display","inline-block"));const a=t.scalingFactor;return this.scale=a,this.skew*=a,this.italic*=a,this}toMarkup(){var t,r,n,i;let a=(t=this.value)!=null?t:"";if(this.children)for(const P of this.children)a+=P.toMarkup();let s="";if(this.svgBody)s=Os(this.svgBody);else if(this.svgOverlay){s='<span style="',s+="display: inline-block;",s+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,s+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,s+='">',s+=a,s+="</span>",s+='<svg style="position:absolute;overflow:visible;',s+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const P=(r=this.cssProperties)==null?void 0:r.padding;P?(s+=`top:${P};`,s+=`left:${P};`,s+=`width:calc(100% - 2 * ${P} );`):s+="top:0;left:0;width:100%;",s+="z-index:2;",s+='"',this.svgStyle&&(s+=this.svgStyle),s+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,s+=`>${this.svgOverlay}</svg>`}let u="";const d=this.classes.split(" ");d.push((n={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?n:""),this.caret==="latex"&&d.push("ML__latex-caret"),this.isSelected&&d.push("ML__selected");const p=d.length===1?d[0]:d.filter((P,O,de)=>P.length>0&&de.indexOf(P)===O).join(" ");if(p.length>0&&(u+=` class="${p}"`),this.id&&(u+=` data-atom-id=${this.id}`),this.cssId&&(u+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(u+=" "+Object.keys(this.attributes).map(P=>`${P}="${this.attributes[P]}"`).join(" ")),this.htmlData){const P=this.htmlData.split(",");for(const O of P){const de=O.match(/([^=]+)=(.+$)/);if(de){const Ve=de[1].trim().replace(/ /g,"-");Ve&&(u+=` data-${Ve}="${de[2]}" `)}else{const Ve=O.trim().replace(/ /g,"-");Ve&&(u+=` data-${Ve} `)}}}const h=(i=this.cssProperties)!=null?i:{};this.hasExplicitWidth&&h.width===void 0&&(h.width=`${Math.ceil(this._width*100)/100}em`);const S=Object.keys(h).map(P=>`${P}:${h[P]}`);if(this.scale!==void 0&&this.scale!==1&&(a.length>0||s.length>0)&&S.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const P=this.htmlStyle.split(";");let O="";for(const de of P){const Ve=de.match(/([^=]+):(.+$)/);if(Ve){const se=Ve[1].trim().replace(/ /g,"-");se&&(O+=`${se}:${Ve[2]};`)}}O&&(u+=` style="${O}"`)}S.length>0&&(u+=` style="${S.join(";")}"`);let D="";return u.length>0||s.length>0?D=`<span${u}>${a}${s}</span>`:D=a,this.caret==="text"?D+='<span class="ML__text-caret"></span>':this.caret==="math"&&(D+='<span class="ML__caret"></span>'),D}tryCoalesceWith(t){if(this.svgBody||!this.value||t.svgBody||!t.value)return!1;const r=this.children&&this.children.length>0,n=t.children&&t.children.length>0;if(r||n)return!1;if(t.cssProperties||this.cssProperties){for(const d of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(t.cssProperties&&d in t.cssProperties||this.cssProperties&&d in this.cssProperties)return!1}const i=this.cssProperties?Object.keys(this.cssProperties).length:0,a=t.cssProperties?Object.keys(t.cssProperties).length:0;if(i!==a)return!1;if(i>0){for(const d of Object.keys(this.cssProperties))if(this.cssProperties[d]!==t.cssProperties[d])return!1}const s=this.classes.trim().replace(/\s+/g," ").split(" "),u=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==u.length)return!1;s.sort(),u.sort();for(const[d,p]of s.entries())if(p==="vertical-separator"||p!==u[d])return!1;return this.value+=t.value,this.height=Math.max(this.height,t.height),this.depth=Math.max(this.depth,t.depth),this._width=this._width+t._width,this.maxFontSize=Math.max(this.maxFontSize,t.maxFontSize),this.italic=t.italic,!0}};function Fc(e){if(!e||e.length===0)return[];e[0].children=Fc(e[0].children);const t=[e[0]];for(let r=1;r<e.length;r++)t[t.length-1].tryCoalesceWith(e[r])||(e[r].children=Fc(e[r].children),t.push(e[r]));return t}function Tl(e){return e.children&&(e.children=Fc(e.children)),e}function $l(e,t){if(!e)return new je(null,t);const r=new je(null,{classes:"ML__strut",type:"ignore"});r.setStyle("height",Math.max(0,e.height),"em");const n=[r];if(e.depth!==0){const i=new je(null,{classes:"ML__strut--bottom",type:"ignore"});i.setStyle("height",e.height+e.depth,"em"),i.setStyle("vertical-align",-e.depth,"em"),n.push(i)}return n.push(e),new je(n,v(_({},t),{type:"lift"}))}function Pl(e){const t=f0(e)/2,r=new je(null,{maxFontSize:0});return r.height=t+.166,r.depth=t-.166,r.svgBody=e,r}function y0(e,t){var r;if(e.type==="latex"){e.height=.9,e.depth=.2,e._width=1;return}if(e.value){e.height=-1/0,e.depth=-1/0,e._width=0,e.skew=-1/0,e.italic=-1/0;for(let n=0;n<e.value.length;n++){const i=vs(e.value.codePointAt(n),t);e.height=Math.max(e.height,i.height),e.depth=Math.max(e.depth,i.depth),e._width+=i.width,e.skew=i.skew,e.italic=i.italic}return}if(e.children&&e.children.length>0){let n=-1/0,i=-1/0,a=0;for(const s of e.children)s.height>n&&(n=s.height),s.depth>i&&(i=s.depth),a=Math.max(a,(r=s.maxFontSize)!=null?r:0);e.height=n,e.depth=i,e._width=e.children.reduce((s,u)=>s+u.width,0),e.maxFontSize=a}}function x0(e){if("individualShift"in e){const t=e.individualShift;let r=t[0];const n=[r],i=-r.shift-r.box.depth;let a=i;for(let s=1;s<t.length;s++){const u=t[s],d=-u.shift-a-u.box.depth,p=d-(r.box.height+r.box.depth);a=a+d,n.push(p),n.push(u),r=u}return[n,i]}if("top"in e){let t=e.top;for(const r of e.children)t-=typeof r=="number"?r:r.box.height+r.box.depth;return[e.children,t]}else{if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){const t=e.firstBaseline[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.firstBaseline,-t.box.depth]}else if("shift"in e){const t=e.children[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.children,-t.box.depth-e.shift]}}return[null,0]}function w0(e){var t;const[r,n]=x0(e);if(!r)return[[],0,0];const i=new je(null,{classes:"pstrut"});let a=0;for(const O of r)if(typeof O!="number"){const de=O.box;a=Math.max(a,de.maxFontSize,de.height)}a+=2,i.height=a,i.setStyle("height",a,"em");const s=[];let u=n,d=n,p=n,h=0;for(const O of r){if(typeof O=="number")p+=O;else{const de=O.box,Ve=(t=O.classes)!=null?t:[],se=new je([i,de],{classes:Ve.join(" "),style:O.style});de.setStyle("height",de.height+de.depth,"em"),de.setStyle("display","inline-block"),se.setStyle("top",-a-p-de.depth,"em"),O.marginLeft&&se.setStyle("margin-left",O.marginLeft,"em"),O.marginRight&&se.setStyle("margin-right",O.marginRight,"em"),s.push(se),p+=de.height+de.depth,h=Math.max(h,se.width)}u=Math.min(u,p),d=Math.max(d,p)}s.forEach(O=>{O.softWidth=h});const S=new je(s,{classes:"vlist"});if(S.softWidth=h,S.height=d,S.setStyle("height",d,"em"),u>=0)return[[new je(S,{classes:"vlist-r"})],d,-u];const D=new je(new je(null),{classes:"vlist"});D.height=-u,D.setStyle("height",-u,"em");const P=new je(8203,{classes:"vlist-s",maxFontSize:0});return P.softWidth=0,P.height=0,P.depth=0,[[new je([S,P],{classes:"vlist-r"}),new je(D,{classes:"vlist-r"})],d,-u]}var ti=class extends je{constructor(e,t){var r;const[n,i,a]=w0(e);super(n.length===1?n[0]:n,{type:t==null?void 0:t.type,classes:((r=t==null?void 0:t.classes)!=null?r:"")+" vlist-t"+(n.length===2?" vlist-t2":"")}),this.height=i,this.depth=a,this.softWidth=n.reduce((s,u)=>Math.max(s,u.width),0)}};function Rl(e,t){var r,n,i,a,s;const u=e.metrics,d=new je(t.base),p=(r=t.baseShift)!=null?r:0,h=(n=t.slant)!=null?n:0;let S=0,D=0;t.above&&(S=(i=t.aboveShift)!=null?i:Math.max(u.bigOpSpacing1,u.bigOpSpacing3-t.above.depth)),t.below&&(D=(a=t.belowShift)!=null?a:Math.max(u.bigOpSpacing2,u.bigOpSpacing4-t.below.height));let P=null;if(t.below&&t.above){const O=u.bigOpSpacing5+t.below.height+t.below.depth+D+d.depth+p;P=new ti({bottom:O,children:[u.bigOpSpacing5,{box:t.below,marginLeft:-h,classes:["ML__center"]},D,{box:d,classes:["ML__center"]},S,{box:t.above,marginLeft:h,classes:["ML__center"]},u.bigOpSpacing5]}).wrap(e)}else if(t.below&&!t.above)P=new ti({top:d.height-p,children:[u.bigOpSpacing5,{box:t.below,marginLeft:-h,classes:["ML__center"]},D,{box:d,classes:["ML__center"]}]}).wrap(e);else if(!t.below&&t.above){const O=d.depth+p;P=new ti({bottom:O,children:[{box:d,classes:["ML__center"]},S,{box:t.above,marginLeft:h,classes:["ML__center"]},u.bigOpSpacing5]}).wrap(e)}else{const O=d.depth+p;P=new ti({bottom:O,children:[{box:d},u.bigOpSpacing5]}).wrap(e)}return new je(P,{type:(s=t.type)!=null?s:"op"})}var zc=7,Fs=6,Xo=5,yo=4,Jo=3,_a=2,xo=1,qi=0,wo=class{constructor(e,t,r){this.id=e,this.sizeDelta=t,this.cramped=r;const n={"-4":2,"-3":1,0:0}[t];this.metrics=Object.keys(Yu).reduce((i,a)=>v(_({},i),{[a]:Yu[a][n]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return Qa[[qi,xo,qi,xo,_a,Jo,_a,Jo][this.id]]}get sub(){return Qa[[qi,qi,qi,qi,_a,_a,_a,_a][this.id]]}get fracNum(){return Qa[[qi,xo,qi,xo,_a,Jo,yo,Xo][this.id]]}get fracDen(){return Qa[[qi,qi,qi,qi,_a,_a,yo,yo][this.id]]}get cramp(){return Qa[[qi,qi,_a,_a,yo,yo,Fs,Fs][this.id]]}get isTight(){return this.sizeDelta<0}},Ya={7:new wo(zc,0,!1),6:new wo(Fs,0,!0),5:new wo(Xo,0,!1),4:new wo(yo,0,!0),3:new wo(Jo,-3,!1),2:new wo(_a,-3,!0),1:new wo(xo,-4,!1),0:new wo(qi,-4,!0)},Qa=v(_({},Ya),{displaystyle:Ya[zc],textstyle:Ya[Xo],scriptstyle:Ya[Jo],scriptscriptstyle:Ya[xo]});function nd(e,t){var r;if(!e)return 0;const n={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:gs,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(r=e.unit)!=null?r:"pt"];if(Number.isFinite(t)){const i=Ho(10,t);return Math.round(e.dimension/gs*n*i)/i}return e.dimension*n}function id(e,t){if(e===null)return 0;const r=nd(e)/gs;if(Number.isFinite(t)){const n=Ho(10,t);return Math.round(r*n)/n}return r}function Kc(e){var t;return`${e.dimension}${(t=e.unit)!=null?t:"pt"}`}function Hc(e){let t=Kc(e.glue);return e.grow&&e.grow.dimension!==0&&(t+=` plus ${Kc(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(t+=` minus ${Kc(e.shrink)}`),t}function Mi(e){var t,r;if(e==null)return null;let n="";if("dimension"in e&&(n=`${e.dimension}${(t=e.unit)!=null?t:"pt"}`),"glue"in e&&(n=Hc(e)),"number"in e)if(!("base"in e)||e.base==="decimal")n=Number(e.number).toString();else if(e.base==="alpha")n=`\`${String.fromCodePoint(e.number)}`;else{const i=Math.round(e.number)>>>0;e.base==="hexadecimal"?(n=Number(i).toString(16).toUpperCase(),i<=255?n=n.padStart(2,"0"):i<=65535?n=n.padStart(4,"0"):i<=16777215?n=n.padStart(6,"0"):n=n.padStart(8,"0"),n=`"${n}`):e.base==="octal"&&(n=Number(i).toString(8),i<=63?n=n.padStart(2,"0"):i<=30583?n=n.padStart(4,"0"):n=n.padStart(8,"0"),n=`'${n}`)}return"register"in e&&("factor"in e&&(e.factor===-1?n="-":e.factor!==1&&(n=Number(e.factor).toString())),"global"in e&&e.global&&(n+="\\global"),n+=`\\${e.register}`),"string"in e&&(n=e.string),(r=e.relax)!=null&&r&&(n+="\\relax"),n}function eo(e,t){return e==null?null:"number"in e?v(_({},e),{number:e.number*t}):"register"in e?"factor"in e&&e.factor?v(_({},e),{factor:e.factor*t}):v(_({},e),{factor:t}):"dimension"in e?v(_({},e),{dimension:e.dimension*t}):"glue"in e?e.shrink&&e.grow?{glue:eo(e.glue,t),shrink:eo(e.shrink,t),grow:eo(e.grow,t)}:e.shrink?{glue:eo(e.glue,t),shrink:eo(e.shrink,t)}:e.grow?{glue:eo(e.glue,t),grow:eo(e.grow,t)}:{glue:eo(e.glue,t)}:null}var S0={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function ad(){return _({},S0)}function Wc(){return{registers:ad(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:Se.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Nt,backgroundColorMap:gt,getMacro:e=>tn(e,dt())}}var Er=class eh{constructor(t,r){var n,i,a,s,u,d,p,h,S,D,P,O,de,Ve,se;let ke;t!=null&&t.parent?(this.parent=t.parent,ke=t.parent,this.registers={}):(ke=_(_({},Wc()),(n=t==null?void 0:t.from)!=null?n:{}),this.registers=ke.registers),ke.atomIdsSettings&&(this.atomIdsSettings=_({},ke.atomIdsSettings)),this.renderPlaceholder=ke.renderPlaceholder,this.isPhantom=(s=(a=t==null?void 0:t.isPhantom)!=null?a:(i=this.parent)==null?void 0:i.isPhantom)!=null?s:!1,this.letterShapeStyle=ke.letterShapeStyle,this.minFontScale=ke.minFontScale,r!=null&&r.color&&r.color!=="none"?this.color=r.color:this.color=(d=(u=this.parent)==null?void 0:u.color)!=null?d:"",r!=null&&r.backgroundColor&&r.backgroundColor!=="none"?this.backgroundColor=r.backgroundColor:this.backgroundColor=(h=(p=this.parent)==null?void 0:p.backgroundColor)!=null?h:"",r!=null&&r.fontSize&&r.fontSize!=="auto"&&r.fontSize!==((S=this.parent)==null?void 0:S.size)?this.size=r.fontSize:this.size=(P=(D=this.parent)==null?void 0:D.size)!=null?P:jo;let Xe=(de=(O=this.parent)==null?void 0:O.mathstyle)!=null?de:Qa.displaystyle;if(typeof(t==null?void 0:t.mathstyle)=="string"){if(ke instanceof eh)switch(t.mathstyle){case"cramp":Xe=Xe.cramp;break;case"superscript":Xe=Xe.sup;break;case"subscript":Xe=Xe.sub;break;case"numerator":Xe=Xe.fracNum;break;case"denominator":Xe=Xe.fracDen;break}switch(t.mathstyle){case"textstyle":Xe=Qa.textstyle;break;case"displaystyle":Xe=Qa.displaystyle;break;case"scriptstyle":Xe=Qa.scriptstyle;break;case"scriptscriptstyle":Xe=Qa.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=Xe,this.smartFence=ke.smartFence,this.placeholderSymbol=ke.placeholderSymbol,this.colorMap=(Ve=ke.colorMap)!=null?Ve:$e=>$e,this.backgroundColorMap=(se=ke.backgroundColorMap)!=null?se:$e=>$e,this.getMacro=ke.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const t=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,t}scale(t){return t*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===zc||this.mathstyle.id===Fs}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(El[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(t){var r;if((r=this.registers)!=null&&r[t])return this.registers[t];if(this.parent)return this.parent.getRegister(t)}getRegisterAsNumber(t){const r=this.getRegister(t);if(typeof r=="number")return r;if(typeof r=="string")return Number(r)}getRegisterAsGlue(t){var r;if((r=this.registers)!=null&&r[t]){const n=this.registers[t];return typeof n=="object"&&"glue"in n?n:typeof n=="object"&&"dimension"in n?{glue:{dimension:n.dimension}}:typeof n=="number"?{glue:{dimension:n}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(t)}getRegisterAsEm(t,r){return id(this.getRegisterAsDimension(t),r)}getRegisterAsDimension(t){var r;if((r=this.registers)!=null&&r[t]){const n=this.registers[t];return typeof n=="object"&&"glue"in n?n.glue:typeof n=="object"&&"dimension"in n?n:typeof n=="number"?{dimension:n}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(t)}setRegister(t,r){if(r===void 0){delete this.registers[t];return}this.registers[t]=r}evaluate(t){if(!t||!("register"in t))return t;let r=this;if("global"in t&&t.global)for(;r.parent;)r=r.parent;let n=1;"factor"in t&&t.factor!==1&&t.factor!==void 0&&(n=t.factor);const i=r.getRegister(t.register);if(i===void 0)return;if(typeof i=="string")return{string:Number(i).toString()+i};if(typeof i=="number")return{number:n*i};const a=r.evaluate(i);if(a!==void 0)return"string"in a?{string:Number(i).toString()+a.string}:"number"in a?{number:n*a.number}:"dimension"in a?v(_({},a),{dimension:n*a.dimension}):"glue"in a?v(_({},a),{glue:v(_({},a.glue),{dimension:n*a.glue.dimension}),shrink:a.shrink?v(_({},a.shrink),{dimension:n*a.shrink.dimension}):void 0,grow:a.grow?v(_({},a.grow),{dimension:n*a.grow.dimension}):void 0}):t}toDimension(t){const r=this.evaluate(t);return r===void 0?null:"dimension"in r?r:"glue"in r?r.glue:"number"in r?{dimension:r.number}:null}toEm(t,r){if(t===null)return 0;const n=this.toDimension(t);return n===null?0:nd(n,r)/gs}toNumber(t){if(t===null)return null;const r=this.evaluate(t);return r===void 0?null:"number"in r?r.number:"dimension"in r?r.dimension:"glue"in r?r.glue.dimension:"string"in r?Number(r.string):null}toColor(t){var r,n;if(t===null)return null;const i=this.evaluate(t);return i===void 0?null:"string"in i?(n=(r=this.colorMap)==null?void 0:r.call(this,i.string))!=null?n:i.string:null}toBackgroundColor(t){var r,n;if(t===null)return null;const i=this.evaluate(t);return i===void 0?null:"string"in i?(n=(r=this.backgroundColorMap)==null?void 0:r.call(this,i.string))!=null?n:i.string:null}},bs=["body","above","below","superscript","subscript"];function So(e){return typeof e=="string"&&bs.includes(e)}function Ol(e){return e!==void 0&&Array.isArray(e)&&e.length===2}var we=class as{constructor(t){var r,n,i,a,s,u;this.type=t.type,typeof t.value=="string"&&(this.value=t.value),this.command=(n=(r=t.command)!=null?r:this.value)!=null?n:"",this.mode=(i=t.mode)!=null?i:"math",t.isFunction&&(this.isFunction=!0),t.limits&&(this.subsupPlacement=t.limits),this.style=_({},t.style),this.displayContainsHighlight=(a=t.displayContainsHighlight)!=null?a:!1,this.captureSelection=(s=t.captureSelection)!=null?s:!1,this.skipBoundary=(u=t.skipBoundary)!=null?u:!1,t.verbatimLatex!==void 0&&t.verbatimLatex!==null&&(this.verbatimLatex=t.verbatimLatex),t.args&&(this.args=t.args),t.body&&(this.body=t.body),this._changeCounter=0}static createBox(t,r,n){var i;if(!r)return null;const a=_0(r),s=[];for(const d of a){const p=d[0].style,h=M0(t,d,{style:{color:p.color,backgroundColor:p.backgroundColor,fontSize:p.fontSize}});h&&s.push(h)}if(s.length===0)return null;const u=((i=n==null?void 0:n.classes)!=null?i:"").trim();return s.length===1&&!u&&!(n!=null&&n.type)?s[0].wrap(t):new je(s,{classes:u,type:n==null?void 0:n.type}).wrap(t)}static serialize(t,r){return Sa.serialize(t,r)}static commonAncestor(t,r){if(t===r||t.parent===r.parent)return t.parent;const n=new WeakSet;let{parent:i}=t;for(;i;)n.add(i),i=i.parent;for(i=r.parent;i;){if(n.has(i))return i;i=i.parent}console.assert(!!i)}static fromJson(t){return typeof t=="string"?new as({type:"mord",value:t,mode:"math"}):new as(t)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const t={};if(this.type&&(t.type=this.type),this.mode!=="math"&&(t.mode=this.mode),this.command&&this.command!==this.value&&(t.command=this.command),this.value!==void 0&&(t.value=this.value),this.style&&Object.keys(this.style).length>0&&(t.style=_({},this.style)),this.verbatimLatex!==void 0&&(t.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(t.explicitSubsupPlacement=!0),this.isFunction&&(t.isFunction=!0),this.displayContainsHighlight&&(t.displayContainsHighlight=!0),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.skipBoundary&&(t.skipBoundary=!0),this.captureSelection&&(t.captureSelection=!0),this.args&&(t.args=C0(this.args)),this._branches)for(const r of Object.keys(this._branches))this._branches[r]&&(t[r]=this._branches[r].filter(n=>n.type!=="first").map(n=>n.toJson()));return t.type==="mord"&&Object.keys(t).length===2&&"value"in t?t.value:t}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(t){if(t){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:r}=this;for(;r;)r.parent||r._changeCounter++,"verbatimLatex"in r&&(r.verbatimLatex=void 0),r._children=void 0,r=r.parent}}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=or(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):this.body&&this.command?Cr([yn(this.command,this.bodyToLatex(t)),this.supsubToLatex(t)]):this.body?Cr([this.bodyToLatex(t),this.supsubToLatex(t)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(t){var r;return Sa.serialize(this.body,v(_({},t),{defaultMode:(r=t.defaultMode)!=null?r:this.latexMode}))}aboveToLatex(t){return Sa.serialize(this.above,t)}belowToLatex(t){return Sa.serialize(this.below,t)}supsubToLatex(t){let r="";if(t=v(_({},t),{defaultMode:"math"}),this.branch("subscript")!==void 0){const n=Sa.serialize(this.subscript,t);n.length===0?r+="_{}":n.length===1?/^[0-9]$/.test(n)?r+=`_${n}`:r+=`_{${n}}`:r+=`_{${n}}`}if(this.branch("superscript")!==void 0){const n=Sa.serialize(this.superscript,t);n.length===0?r+="^{}":n.length===1?n==="\u2032"?r+="^\\prime ":n==="\u2033"?r+="^\\doubleprime ":/^[0-9]$/.test(n)?r+=`^${n}`:r+=`^{${n}}`:r+=`^{${n}}`}return r}get treeDepth(){let t=1,r=this.parent;for(;r;)r=r.parent,t+=1;return t}get inCaptureSelection(){let t=this;for(;t;){if(t.captureSelection)return!0;t=t.parent}return!1}get parentPrompt(){let t=this.parent;for(;t;){if(t.type==="prompt"&&!t.captureSelection)return t;t=t.parent}return null}branch(t){if(So(t)&&this._branches)return this._branches[t]}get branches(){if(!this._branches)return[];const t=[];for(const r of bs)this._branches[r]&&t.push(r);return t}createBranch(t){return console.assert(So(t)),So(t)?(this._branches?this._branches[t]||(this._branches[t]=[this.makeFirstAtom(t)]):this._branches={[t]:[this.makeFirstAtom(t)]},this.isDirty=!0,this._branches[t]):[]}get row(){return Ol(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Ol(this.parentBranch)?this.parentBranch[1]:-1}get body(){var t;return(t=this._branches)==null?void 0:t.body}set body(t){this.setChildren(t,"body")}get superscript(){var t;return(t=this._branches)==null?void 0:t.superscript}set superscript(t){this.setChildren(t,"superscript")}get subscript(){var t;return(t=this._branches)==null?void 0:t.subscript}set subscript(t){this.setChildren(t,"subscript")}get above(){var t;return(t=this._branches)==null?void 0:t.above}set above(t){this.setChildren(t,"above")}get below(){var t;return(t=this._branches)==null?void 0:t.below}set below(t){this.setChildren(t,"below")}get computedStyle(){var t,r;const n=typeof this.style.verbatimColor=="string",i=typeof this.style.verbatimBackgroundColor=="string",a=_(_({},(r=(t=this.parent)==null?void 0:t.computedStyle)!=null?r:{}),this.style);return delete a.variant,delete a.variantStyle,i||delete a.verbatimBackgroundColor,n||delete a.verbatimColor,a}applyStyle(t){this.isDirty=!0,this.style=_(_({},this.style),t),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const r of this.children)r.applyStyle(t)}getInitialBaseElement(){var t,r,n;return this.hasEmptyBranch("body")?this:(console.assert(((t=this.body)==null?void 0:t[0].type)==="first"),(n=(r=this.body[1])==null?void 0:r.getInitialBaseElement())!=null?n:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(t){const r=this.branch(t);return r?(console.assert(r.length>0),console.assert(r[0].type==="first"),r.length===1):!0}setChildren(t,r){var n;if(!t||(console.assert(So(r)),!So(r)))return;console.assert(((n=t[0])==null?void 0:n.type)!=="first");const i=[this.makeFirstAtom(r),...t];this._branches?this._branches[r]=i:this._branches={[r]:i};for(const a of t)a.parent=this,a.parentBranch=r;this.isDirty=!0}makeFirstAtom(t){const r=new as({type:"first",mode:this.mode});return r.parent=this,r.parentBranch=t,r}addChild(t,r){console.assert(t.type!=="first"),this.createBranch(r).push(t),this.isDirty=!0,t.parent=this,t.parentBranch=r}addChildBefore(t,r){console.assert(r.parentBranch!==void 0);const n=this.createBranch(r.parentBranch);n.splice(n.indexOf(r),0,t),this.isDirty=!0,t.parent=this,t.parentBranch=r.parentBranch}addChildAfter(t,r){console.assert(r.parentBranch!==void 0);const n=this.createBranch(r.parentBranch);n.splice(n.indexOf(r)+1,0,t),this.isDirty=!0,t.parent=this,t.parentBranch=r.parentBranch}addChildren(t,r){const n=this.createBranch(r);for(const i of t)i.parent=this,i.parentBranch=r,n.push(i);this.isDirty=!0}addChildrenAfter(t,r){console.assert(t.length===0||t[0].type!=="first"),console.assert(r.parentBranch!==void 0);const n=this.createBranch(r.parentBranch);n.splice(n.indexOf(r)+1,0,...t),this.isDirty=!0;for(const i of t)i.parent=this,i.parentBranch=r.parentBranch;return t[t.length-1]}removeBranch(t){const r=this.branch(t);if(So(t)&&(this._branches[t]=void 0),!r)return[];for(const n of r)n.parent=void 0,n.parentBranch=void 0;return console.assert(r[0].type==="first"),r.shift(),this.isDirty=!0,r}removeChild(t){if(console.assert(t.parent===this),t.type==="first")return;const r=this.branch(t.parentBranch),n=r.indexOf(t);console.assert(n>=0),r.splice(n,1),this.isDirty=!0,t.parent=void 0,t.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:t}=this;return t[t.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:t}=this;return t[t.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const t=[];for(const r of bs)if(this._branches[r])for(const n of this._branches[r])t.push(...n.children),t.push(n);return this._children=t,t}render(t){if(this.type==="first"&&!t.atomIdsSettings)return null;const r=or(this.command,this.mode);if(r!=null&&r.render)return r.render(this,t);const n=new Er({parent:t},this.style);let i=this.createBox(n,{classes:this.parent?"":"ML__base"});return i?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(i=this.attachSupsub(n,{base:i})),i.wrap(n)):null}attachSupsub(t,r){var n;const i=r.base,a=this.superscript,s=this.subscript;if(!a&&!s)return i;let u=null,d=null;const p=(n=r.isCharacterBox)!=null?n:this.isCharacterBox();let h=0;if(a){const de=new Er({parent:t,mathstyle:"superscript"});u=as.createBox(de,a),p||(h=i.height-t.metrics.supDrop*de.scalingFactor)}let S=0;if(s){const de=new Er({parent:t,mathstyle:"subscript"});d=as.createBox(de,s),p||(S=i.depth+t.metrics.subDrop*de.scalingFactor)}let D;t.isDisplayStyle?D=t.metrics.sup1:t.isCramped?D=t.metrics.sup3:D=t.metrics.sup2;const P=.5/gs/t.scalingFactor;let O=null;if(d&&u){h=Math.max(h,D,u.depth+.25*t.metrics.xHeight),S=Math.max(S,t.metrics.sub2);const de=t.metrics.defaultRuleThickness;if(h-u.depth-(d.height-S)<4*de){S=4*de-(h-u.depth)+d.height;const se=.8*t.metrics.xHeight-(h-u.depth);se>0&&(h+=se,S-=se)}const Ve=this.isExtensibleSymbol&&i.italic?-i.italic:0;O=new ti({individualShift:[{box:d,shift:S,marginLeft:Ve},{box:u,shift:-h}]}).wrap(t)}else d&&!u?(S=Math.max(S,t.metrics.sub1,d.height-.8*po),O=new ti({shift:S,children:[{box:d,marginRight:P,marginLeft:this.isCharacterBox()?-i.italic:0}]})):!d&&u&&(h=Math.max(h,D,u.depth+.25*po),O=new ti({shift:-h,children:[{box:u,marginRight:P}]}));return new je([i,new je(O,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:r.type})}attachLimits(t,r){const n=this.superscript?as.createBox(new Er({parent:t,mathstyle:"superscript"},this.style),this.superscript):null,i=this.subscript?as.createBox(new Er({parent:t,mathstyle:"subscript"},this.style),this.subscript):null;return!n&&!i?r.base.wrap(t):Rl(t,v(_({},r),{above:n,below:i}))}bind(t,r){if(!r||t.isPhantom||this.value==="\u200B")return r;let n=this.parent;for(;n&&!n.captureSelection;)n=n.parent;return n!=null&&n.captureSelection||(this.id||(this.id=t.makeID()),r.atomID=this.id),r}createBox(t,r){var n,i,a,s;const u=(n=this.value)!=null?n:this.body,d=(i=r==null?void 0:r.boxType)!=null?i:Nc(this.type);let p=(a=r==null?void 0:r.classes)!=null?a:"";this.mode==="text"&&(p+=" ML__text");const h=typeof u=="string"||u===void 0?new je(u!=null?u:null,{type:d,isSelected:this.isSelected,mode:this.mode,maxFontSize:t.scalingFactor,style:v(_({variant:"normal"},this.style),{fontSize:Math.max(1,t.size+t.mathstyle.sizeDelta)}),letterShapeStyle:t.letterShapeStyle,classes:p}):(s=as.createBox(t,u,{type:d,classes:p}))!=null?s:new je(null);return t.isTight&&(h.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(h.italic=0),h.right=h.italic,this.bind(t,h),this.caret&&!this.superscript&&!this.subscript&&(h.caret=this.caret),h}isDigit(){var t;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((t=this.body)==null?void 0:t.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var t;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((t=this.body)==null?void 0:t.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function _0(e){let t;const r=[];let n=[];for(const i of e)if(!t&&!i.style)n.push(i);else{const a=i.computedStyle;t&&a.color===t.color&&a.backgroundColor===t.backgroundColor&&a.fontSize===t.fontSize?n.push(i):(n.length>0&&r.push(n),n=[i],t=a)}return n.length>0&&r.push(n),r}function M0(e,t,r){var n,i,a,s,u;if(!t||t.length===0)return null;const d=new Er({parent:e},r.style),p=!((n=d.atomIdsSettings)!=null&&n.groupNumbers);let h=[];if(t.length===1){const D=t[0],P=D.render(d);P&&(p&&D.isSelected&&P.selected(!0),h=[P])}else{let D="",P=!0;for(const O of t){(i=d.atomIdsSettings)!=null&&i.groupNumbers&&D&&(P&&O.isDigit()||!P&&Nl(O))&&(d.atomIdsSettings.overrideID=D);const de=O.render(d);d.atomIdsSettings&&(d.atomIdsSettings.overrideID=void 0),de&&((a=d.atomIdsSettings)!=null&&a.groupNumbers&&((O.isDigit()||Nl(O))&&(!D||P!==O.isDigit())&&(P=O.isDigit(),D=(s=O.id)!=null?s:""),D&&(!(O.isDigit()||Nl(O))||!O.hasEmptyBranch("superscript")||!O.hasEmptyBranch("subscript"))&&(D="")),p&&O.isSelected&&de.selected(!0),h.push(de))}}if(h.length===0)return null;const S=new je(h,v(_({isTight:d.isTight},r),{type:(u=r.type)!=null?u:"lift"}));return S.isSelected=h.every(D=>D.isSelected),S.wrap(d)}function Nl(e){return e.mode==="text"}function C0(e){return e.map(t=>t===null?"<null>":Array.isArray(t)&&t[0]instanceof we?{atoms:t.map(r=>r.toJson())}:typeof t=="object"&&"group"in t?{group:t.group.map(r=>r.toJson())}:t)}var zs=class th extends we{constructor(t,r,n){super({type:"text",command:t,mode:"text",displayContainsHighlight:!0}),this.value=r,this.verbatimLatex=r,this.applyStyle(n)}static fromJson(t){return new th(t.command,t.value,t.style)}render(t){const r=this.createBox(t);return this.caret&&(r.caret=this.caret),r}_serialize(t){var r;return(r=this.verbatimLatex)!=null?r:Vt("text",this.value.codePointAt(0))}};function E0(e,t){if(e.direction===t.direction){const r=e.ranges.length;if(t.ranges.length===r){let n=0;for(;n<r&&k0(e.ranges[n],t.ranges[n])==="equal";)n++;return n===r?"equal":"different"}}return"different"}function k0(e,t){return e[0]===t[0]&&e[1]===t[1]?"equal":"different"}function Ni(e){let t=1/0,r=-1/0;for(const n of e.ranges)t=Math.min(t,n[0],n[1]),r=Math.max(r,n[0],n[1]);return[t,r]}function _o(e){return typeof e=="number"&&!Number.isNaN(e)}function Yo(e){return Array.isArray(e)&&e.length===2}function Ks(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function A0(e,t){const r=e.at(t);let n;if(r){n=r.mode;let i=r.parent;for(;!n&&i;)i&&(n=i.mode),i=i.parent}return n}function D0(e,t){if(!t)return"";if(typeof t=="string")return t;if(!e||t.after===void 0)return t.value;let r=!1,n=!1,i=!1,a=!1,s=!1,u=!1,d=!1,p=!1,h=!1,S=!1,D=!1,P=!1,O=!1,de=!1,Ve=!1,se=e[0],ke=0;for(;se!=null&&se.type&&/^(subsup|placeholder)$/.test(se.type);)ke+=1,se=e[ke];return r=!se||se.type==="first",se&&(de=se.mode==="text",n=!de&&se.type==="mord"&&ae.test(se.value),i=!de&&se.type==="mord"&&/\d+$/.test(se.value),a=!de&&se.isFunction,s=se.type==="genfrac",u=se.type==="surd",d=se.type==="mbin",p=se.type==="mrel",h=se.type==="mop"||se.type==="operator"||se.type==="extensible-symbol",S=se.type==="mpunct"||se.type==="minner",D=se.type==="array",P=se.type==="mopen",O=se.type==="mclose"||se.type==="leftright",Ve=se.type==="space"),t.after.includes("nothing")&&r||t.after.includes("letter")&&n||t.after.includes("digit")&&i||t.after.includes("function")&&a||t.after.includes("frac")&&s||t.after.includes("surd")&&u||t.after.includes("binop")&&d||t.after.includes("relop")&&p||t.after.includes("operator")&&h||t.after.includes("punct")&&S||t.after.includes("array")&&D||t.after.includes("openfence")&&P||t.after.includes("closefence")&&O||t.after.includes("text")&&de||t.after.includes("space")&&Ve?t.value:""}function Vc(e,t,r){return r?D0(e,r[t]):""}var od={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function Mo(e,t){var r;let n=(r=t==null?void 0:t.format)!=null?r:"auto";return n==="auto"&&([n,e]=L0(e)),n==="ascii-math"?(e=e.replace(/\u2061/gu,""),e=e.replace(/\u3016/gu,"{"),e=e.replace(/\u3017/gu,"}"),e=e.replace(/([^\\])sinx/g,"$1\\sin x"),e=e.replace(/([^\\])cosx/g,"$1\\cos x "),e=e.replace(/\u2013/g,"-"),["ascii-math",ca(e,{inlineShortcuts:t==null?void 0:t.inlineShortcuts})]):["latex",e]}function ca(e,t){var r,n,i;if(!e)return"";let a=!1,s;const u=(r=t.inlineShortcuts)!=null?r:od;if(!a&&(e.startsWith("^")||e.startsWith("_"))&&(s=Co(e.slice(1),{inlineShortcuts:u,noWrap:!0}),e=e[0]+"{"+s.match+"}",e+=ca(s.rest,t),a=!0),a||(s=e.match(/^(sqrt|\u221A)(.*)/),s&&(s=Co(s[2],{inlineShortcuts:u,noWrap:!0}),e="\\sqrt{"+((n=s.match)!=null?n:"\\placeholder{}")+"}",e+=ca(s.rest,t),a=!0)),a||(s=e.match(/^(\\cbrt|\u221B)(.*)/),s&&(s=Co(s[2],{inlineShortcuts:u,noWrap:!0}),e="\\sqrt[3]{"+((i=s.match)!=null?i:"\\placeholder{}")+"}",e+=ca(s.rest,t),a=!0)),a||(s=e.match(/^abs(.*)/),s&&(s=Co(s[1],{inlineShortcuts:u,noWrap:!0}),e="\\left|"+s.match+"\\right|",e+=ca(s.rest,t),a=!0)),a||(s=e.match(/^["”“](.*?)["”“](.*)/),s&&(e="\\text{"+s[1]+"}",e+=ca(s[2],t),a=!0)),a||(s=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),s&&(e=sd(s[1],u),e+=ca(s[2],t),a=!0)),!a&&/^([fgh])[^a-zA-Z]/.test(e)&&(s=Co(e.slice(1),{inlineShortcuts:u,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+s.match+"\\right)":e[0]+s.match,e+=ca(s.rest,t),a=!0),a||(s=e.match(/^([a-zA-Z]+)(.*)/),s&&(e=sd(s[1],u),e+=ca(s[2],t),a=!0)),!a)if(s=Co(e,{inlineShortcuts:u,noWrap:!0}),s.match&&s.rest[0]==="/"){const d=Co(s.rest.slice(1),{inlineShortcuts:u,noWrap:!0});d.match&&(e="\\frac{"+s.match+"}{"+d.match+"}"+ca(d.rest,t)),a=!0}else s.match&&(e=e.startsWith("(")?"\\left("+s.match+"\\right)"+ca(s.rest,t):s.match+ca(s.rest,t),a=!0);return a||(s=e.match(/^(\s+)(.*)$/),s&&(e=" "+ca(s[2],t),a=!0)),e}function Co(e,t){let r="";e=e.trim();let n=e,i=e.charAt(0),a={"(":")","{":"}","[":"]"}[i];if(a){let s=1,u=1;for(;u<e.length&&s>0;)e[u]===i&&s++,e[u]===a&&s--,u++;s===0?(t.noWrap&&i==="("?r=ca(e.substring(1,u-1),t):(i==="{"&&a==="}"&&(i="\\{",a="\\}"),r="\\left"+i+ca(e.substring(1,u-1),t)+"\\right"+a),n=e.slice(Math.max(0,u))):(r=e.substring(1,u),n="")}else{let s=e.match(/^([a-zA-Z]+)/);if(s){let u=Vc(null,e,t.inlineShortcuts);if(u)return u=u.replace("_{#?}",""),u=u.replace("^{#?}",""),{match:u,rest:e.slice(u.length)}}if(s=e.match(/^([a-zA-Z])/),s)return{match:s[1],rest:e.slice(1)};if(s=e.match(/^(-)?\d+(\.\d*)?/),s)return{match:s[0],rest:e.slice(s[0].length)};/^\\(left|right)/.test(e)||(s=e.match(/^(\\[a-zA-Z]+)/),s&&(n=e.slice(s[1].length),r=s[1]))}return{match:r,rest:n}}function sd(e,t){let r=Vc(null,e,t);return r?(r=r.replace("_{#?}",""),r=r.replace("^{#?}",""),r+=" "):r=e,r}var ld=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function cd(e){const t=e.trim();for(const r of ld)if(t.startsWith(r[0])&&t.endsWith(r[1]))return[!0,t.substring(r[0].length,t.length-r[1].length)];return[!1,e]}function L0(e){if(e=e.trim(),e.length<=1)return["latex",e];let t;return[t,e]=cd(e),t?["latex",e]:e.startsWith("`")&&e.endsWith("`")?(e=e.substring(1,e.length-1),["ascii-math",e]):e.includes("\\")?["latex",e]:/\$.+\$/.test(e)?["latex",`\\text{${e}}`]:[void 0,e]}var Uc="$$",I0="$$",B0=(e,t,r)=>(ld.some(n=>t.startsWith(n[0])&&t.endsWith(n[1]))||(t=`${Uc} ${t} ${I0}`),t),ud=class u0{constructor(t){u0._modes[t]=this}static onPaste(t,r,n){var i;if(!r.contentEditable&&r.userSelect==="none")return r.model.announce("plonk"),!1;if(typeof n=="string"){const s=new DataTransfer;s.setData("text/plain",n),n=s}const a=new ClipboardEvent("paste",{clipboardData:n,cancelable:!0});return(i=r.host)!=null&&i.dispatchEvent(a)?u0._modes[t].onPaste(r,n):!1}static copyToClipboard(t,r){if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const n=t.model,i=n.selectionIsCollapsed?[0,n.lastOffset]:Ni(n.selection),a=n.getValue(i,r);navigator.clipboard.writeText(a).then(()=>{},()=>t.model.announce("plonk"))}static onCopy(t,r){var n;if(!r.clipboardData)return;if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const i=t.model,a=i.selectionIsCollapsed?[0,i.lastOffset]:Ni(i.selection);let s=i.getAtoms(a);if(s.every(u=>u.mode==="text"||!u.mode))r.clipboardData.setData("text/plain",s.filter(u=>u instanceof zs).map(u=>u.value).join(""));else if(s.every(u=>u.mode==="latex"))r.clipboardData.setData("text/plain",i.getAtoms(a,{includeChildren:!0}).map(u=>{var d;return(d=u.value)!=null?d:""}).join(""));else{let u;s.length===1&&s[0].verbatimLatex!==void 0?u=s[0].verbatimLatex:u=i.getValue(a,"latex-expanded"),r.clipboardData.setData("application/x-latex",u);try{r.clipboardData.setData("text/plain",t.options.onExport(t,u,a))}catch(d){}if(s.length===1){const d=s[0];(d.type==="root"||d.type==="group")&&(s=d.body.filter(p=>p.type!=="first"))}try{r.clipboardData.setData("application/json+mathlive",JSON.stringify(s.map(d=>d.toJson())))}catch(d){}if((n=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&n.ComputeEngine){const d=window.MathfieldElement.computeEngine;if(d)try{const p=d.jsonSerializationOptions;d.jsonSerializationOptions={metadata:["latex"]};const h=d.parse(i.getValue(a,"latex-unstyled"));d.jsonSerializationOptions=p;const S=JSON.stringify(h.json);S&&r.clipboardData.setData("application/json",S)}catch(p){}}}r.preventDefault()}static insert(t,r,n={}){var i;const a=n.mode==="auto"?t.mode:(i=n.mode)!=null?i:t.mode;return u0._modes[a].insert(t,r,n)}onPaste(t,r){return!1}insert(t,r,n){return!1}};ud._modes={};var ln=ud,T0=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],dd={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function Qo(e){var t;return((t=e.element)==null?void 0:t.mathfield)===e}function fd(e){var t,r;return(r=(t=e.querySelector(".ML__caret"))!=null?t:e.querySelector(".ML__text-caret"))!=null?r:e.querySelector(".ML__latex-caret")}function Fl(e){const t=fd(e);if(!t)return null;const r=t.getBoundingClientRect();return{x:r.right,y:r.bottom,height:r.height}}function Zc(e){var t;if(!e.parent)return"root";let r=(t=e.parent.id)!=null?t:"";return r+=typeof e.parentBranch=="string"?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,r}function pd(e,t,r){if(!t)return null;const n=e.field.getBoundingClientRect(),i=t.right-t.left,a=t.bottom-t.top,s=Math.ceil(t.left-n.left+e.field.scrollLeft*r),u=Math.ceil(t.top-n.top);return{left:s,right:s+i,top:u,bottom:u+a}}function hd(e){const t=e.getBoundingClientRect(),r=parseInt(getComputedStyle(e).marginRight),n={top:t.top-1,bottom:t.bottom,left:t.left,right:t.right-1+r};if(e.children.length===0||e.tagName.toUpperCase()==="SVG")return n;for(const i of e.children)if(i.nodeType===1&&"atomId"in i.dataset&&!i.classList.contains("pstrut")){const a=hd(i);n.left=Math.min(n.left,a.left),n.right=Math.max(n.right,a.right),n.top=Math.min(n.top,a.top),n.bottom=Math.max(n.bottom,a.bottom)}return n}function Hs(e,t){var r,n;if(!t.id)return null;let i=(n=(r=e.atomBoundsCache)==null?void 0:r.get(t.id))!=null?n:null;if(i!==null)return i;const a=e.field.querySelector(`[data-atom-id="${t.id}"]`);return i=a?hd(a):null,e.atomBoundsCache&&(i?e.atomBoundsCache.set(t.id,i):e.atomBoundsCache.delete(t.id)),i!=null?i:null}function $0(e,t,r){const n=new Map;for(const i of e.model.getAtoms(t,{includeChildren:!0})){if(r!=null&&r.excludeAtomsWithBackground&&i.style.backgroundColor)continue;const a=e.field,s=a.offsetWidth;let d=Math.floor(a.getBoundingClientRect().width)/s;d=isNaN(d)?1:d;const p=pd(e,Hs(e,i),d);if(p){const h=Zc(i);if(n.has(h)){const S=n.get(h);n.set(h,{left:Math.min(S.left,p.left),right:Math.max(S.right,p.right),top:Math.min(S.top,p.top),bottom:Math.max(S.bottom,p.bottom)})}else n.set(h,p)}}return[...n.values()]}function md(e,t){return e.model.selection.ranges.reduce((r,n)=>r.concat(...$0(e,n,t)),[])}function jc(e,t){return e==="*"||t==="none"?!0:t==="same-origin"?!window.origin||e===window.origin:typeof t=="function"?t(e):!1}function gd(e){let t=0,r=0;const n=e.offsetWidth,i=e.offsetHeight;for(;e instanceof HTMLElement;)t+=e.offsetTop,r+=e.offsetLeft,e=e.offsetParent;return new DOMRect(r,t,n,i)}var vd=`@keyframes ML__caret-blink {
|
|
|
0%,
|
|
|
100% {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
50% {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
}
|
|
|
.ML__container {
|
|
|
display: inline-flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: space-between;
|
|
|
align-items: flex-end;
|
|
|
min-height: 39px;
|
|
|
/* Need some room for the virtual keyboard toggle */
|
|
|
width: 100%;
|
|
|
/* Encourage browsers to consider allocating a hardware accelerated
|
|
|
layer for this element. */
|
|
|
isolation: isolate;
|
|
|
/* Prevent the browser from trying to interpret touch gestures in the field */
|
|
|
/* "Disabling double-tap to zoom removes the need for browsers to
|
|
|
delay the generation of click events when the user taps the screen." */
|
|
|
touch-action: none;
|
|
|
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
|
|
|
--_selection-color: var(--selection-color, #000);
|
|
|
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
|
|
|
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
|
|
|
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
|
|
|
--_smart-fence-color: var(--smart-fence-color, currentColor);
|
|
|
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
|
|
|
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
|
|
|
--_correct-color: var(--correct-color, #10a000);
|
|
|
--_incorrect-color: var(--incorrect-color, #a01b00);
|
|
|
--_composition-background-color: var(--composition-background-color, #fff1c2);
|
|
|
--_composition-text-color: var(--composition-text-color, black);
|
|
|
--_composition-underline-color: var(--composition-underline-color, transparent);
|
|
|
}
|
|
|
/* This is the actual field content (formula) */
|
|
|
.ML__content {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
align-self: center;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
padding: 2px 3px 2px 1px;
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle,
|
|
|
.ML__menu-toggle {
|
|
|
box-sizing: border-box;
|
|
|
display: flex;
|
|
|
align-self: center;
|
|
|
align-items: center;
|
|
|
flex-shrink: 0;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
width: 34px;
|
|
|
height: 34px;
|
|
|
padding: 0;
|
|
|
margin-right: 4px;
|
|
|
cursor: pointer;
|
|
|
/* Avoid some weird blinking with :hover */
|
|
|
border-radius: 8px;
|
|
|
border: 1px solid transparent;
|
|
|
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
|
|
|
color: hsl(var(--_hue), 40%, 50%);
|
|
|
fill: currentColor;
|
|
|
background: transparent;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle:hover,
|
|
|
.ML__menu-toggle:hover {
|
|
|
background: hsla(0, 0%, 70%, 0.3);
|
|
|
color: #333;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle > span,
|
|
|
.ML__menu-toggle > span {
|
|
|
display: flex;
|
|
|
align-self: center;
|
|
|
align-items: center;
|
|
|
}
|
|
|
/* The invisible element used to capture keyboard events. We're just trying
|
|
|
really hard to make sure it doesn't show. */
|
|
|
.ML__keyboard-sink {
|
|
|
display: inline-block;
|
|
|
resize: none;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
/* Need these for Microsoft Edge */
|
|
|
position: fixed;
|
|
|
clip: rect(0 0 0 0);
|
|
|
/* Need this to prevent iOS Safari from auto-zooming */
|
|
|
font-size: 1em;
|
|
|
font-family: KaTeX_Main;
|
|
|
line-height: 0.5;
|
|
|
/* On Chromium, if this is 0, no keyboard events are received */
|
|
|
}
|
|
|
[part="placeholder"] {
|
|
|
color: var(--neutral-400);
|
|
|
}
|
|
|
.ML__composition {
|
|
|
background: var(--_composition-background-color);
|
|
|
color: var(--_composition-text-color);
|
|
|
text-decoration: underline var(--_composition-underline-color);
|
|
|
}
|
|
|
.ML__caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
width: 0;
|
|
|
display: inline-block;
|
|
|
height: 0.76em;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_caret-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.045em;
|
|
|
bottom: -0.05em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__text-caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
width: 0;
|
|
|
display: inline-block;
|
|
|
height: 0.76em;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_caret-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.045em;
|
|
|
bottom: -0.05em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__latex-caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_latex-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.019em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__focused .ML__latex-caret::after,
|
|
|
.ML__focused .ML__text-caret::after,
|
|
|
.ML__focused .ML__caret::after {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.ML__focused .ML__text {
|
|
|
background: var(--_text-highlight-background-color);
|
|
|
}
|
|
|
/* When using smartFence, the anticipated closing fence is displayed
|
|
|
with this style */
|
|
|
.ML__smart-fence__close {
|
|
|
opacity: var(--_smart-fence-opacity);
|
|
|
color: var(--_smart-fence-color);
|
|
|
}
|
|
|
.ML__selected,
|
|
|
.ML__focused .ML__selected .ML__contains-caret,
|
|
|
.ML__focused .ML__selected .ML__smart-fence__close,
|
|
|
.ML__focused .ML__selected .ML__placeholder {
|
|
|
color: var(--_selection-color);
|
|
|
opacity: 1;
|
|
|
}
|
|
|
.ML__selection {
|
|
|
box-sizing: border-box;
|
|
|
background: var(--_selection-background-color) !important;
|
|
|
}
|
|
|
.ML__contains-caret.ML__close,
|
|
|
.ML__contains-caret.ML__open,
|
|
|
.ML__contains-caret > .ML__close,
|
|
|
.ML__contains-caret > .ML__open,
|
|
|
.ML__contains-caret .ML__sqrt-sign,
|
|
|
.ML__contains-caret .ML__sqrt-line {
|
|
|
color: var(--_caret-color);
|
|
|
}
|
|
|
.ML__contains-highlight {
|
|
|
box-sizing: border-box;
|
|
|
background: transparent;
|
|
|
}
|
|
|
.ML__focused .ML__contains-highlight {
|
|
|
background: var(--_contains-highlight-background-color);
|
|
|
}
|
|
|
.ML__raw-latex {
|
|
|
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
|
|
|
font-weight: 400;
|
|
|
font-size: 0.8em;
|
|
|
letter-spacing: -0.05em;
|
|
|
color: var(--_latex-color);
|
|
|
}
|
|
|
.ML__suggestion {
|
|
|
color: var(--neutral-500);
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
|
|
|
background: hsl(var(--_hue), 25%, 35%);
|
|
|
color: #fafafa;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle:focus {
|
|
|
outline: none;
|
|
|
border-radius: 8px;
|
|
|
border: 2px solid hsl(var(--_hue), 40%, 50%);
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle.is-pressed,
|
|
|
.ML__virtual-keyboard-toggle.is-active:hover,
|
|
|
.ML__virtual-keyboard-toggle.is-active {
|
|
|
background: hsl(var(--_hue), 25%, 35%);
|
|
|
color: #fafafa;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
/* Add an attribute 'data-tooltip' to automatically show a
|
|
|
tooltip over a element on hover.
|
|
|
*/
|
|
|
[data-tooltip] {
|
|
|
position: relative;
|
|
|
}
|
|
|
[data-tooltip]::after {
|
|
|
content: attr(data-tooltip);
|
|
|
position: absolute;
|
|
|
display: block;
|
|
|
z-index: 2;
|
|
|
pointer-events: none;
|
|
|
right: auto;
|
|
|
top: calc(-100% - 4px);
|
|
|
width: max-content;
|
|
|
max-width: 200px;
|
|
|
padding: 8px 8px;
|
|
|
border-radius: 4px;
|
|
|
background: #616161;
|
|
|
color: #fff;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
text-align: center;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-style: normal;
|
|
|
font-weight: 400;
|
|
|
font-size: 13px;
|
|
|
/* Phone */
|
|
|
opacity: 0;
|
|
|
transform: scale(0.5);
|
|
|
}
|
|
|
@media only screen and (max-width: 767px) {
|
|
|
[data-tooltip]::after {
|
|
|
padding: 8px 16px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
}
|
|
|
menu [data-tooltip]::after {
|
|
|
left: 100%;
|
|
|
top: 0%;
|
|
|
}
|
|
|
menu .ML__base {
|
|
|
cursor: default;
|
|
|
}
|
|
|
/** Don't display if we're tracking, i.e. have the pointer down */
|
|
|
.tracking [data-tooltip]:hover::after {
|
|
|
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
|
|
|
visibility: hidden;
|
|
|
}
|
|
|
/** But do display if tracking and inside a menu */
|
|
|
.tracking menu li[data-tooltip]:hover::after,
|
|
|
[data-tooltip]:hover::after {
|
|
|
visibility: visible;
|
|
|
opacity: 1;
|
|
|
transform: scale(1);
|
|
|
transition-property: opacity, scale;
|
|
|
transition-duration: 0.15s;
|
|
|
transition-delay: 1s;
|
|
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__prompt {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.ML__editablePromptBox {
|
|
|
outline: 1px solid #acacac;
|
|
|
border-radius: 2px;
|
|
|
z-index: -1;
|
|
|
}
|
|
|
.ML__focusedPromptBox {
|
|
|
outline: highlight auto 1px;
|
|
|
}
|
|
|
.ML__lockedPromptBox {
|
|
|
background-color: rgba(142, 142, 141, 0.4);
|
|
|
z-index: -1;
|
|
|
}
|
|
|
.ML__correctPromptBox {
|
|
|
outline: 1px solid var(--_correct-color);
|
|
|
box-shadow: 0 0 5px var(--_correct-color);
|
|
|
}
|
|
|
.ML__incorrectPromptBox {
|
|
|
outline: 1px solid var(--_incorrect-color);
|
|
|
box-shadow: 0 0 5px var(--_incorrect-color);
|
|
|
}
|
|
|
.variant-submenu {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
padding: 8px;
|
|
|
}
|
|
|
.variant-submenu [part=menu-item] {
|
|
|
font-size: 2rem;
|
|
|
text-align: center;
|
|
|
margin: 0;
|
|
|
}
|
|
|
.insert-matrix-submenu {
|
|
|
display: grid;
|
|
|
padding: 8px;
|
|
|
align-content: center;
|
|
|
justify-content: center;
|
|
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
|
}
|
|
|
.insert-matrix-submenu [part=menu-item] {
|
|
|
font-size: 21px;
|
|
|
border: none;
|
|
|
border-radius: 0;
|
|
|
line-height: 21px;
|
|
|
text-align: center;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
}
|
|
|
.border-submenu [part=menu-item] {
|
|
|
font-size: 2rem;
|
|
|
line-height: 1.2;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.swatches-submenu {
|
|
|
--_swatch-size: 2rem;
|
|
|
--_columns: 4;
|
|
|
display: flex;
|
|
|
flex-flow: wrap;
|
|
|
padding: 8px;
|
|
|
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.menu-swatch {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
box-sizing: border-box;
|
|
|
width: fit-content;
|
|
|
height: fit-content;
|
|
|
margin: 2px;
|
|
|
padding: 0;
|
|
|
background: var(--neutral-200);
|
|
|
}
|
|
|
.menu-swatch > .label {
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
line-height: 0;
|
|
|
}
|
|
|
.menu-swatch > .label > span {
|
|
|
display: inline-block;
|
|
|
margin: 6px;
|
|
|
min-width: var(--_swatch-size);
|
|
|
min-height: var(--_swatch-size);
|
|
|
border-radius: 50%;
|
|
|
}
|
|
|
.menu-swatch.active {
|
|
|
background: var(--neutral-100);
|
|
|
scale: 1.4;
|
|
|
}
|
|
|
.menu-swatch.active > .label > span {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.menu-swatch .ui-checkmark,
|
|
|
.menu-swatch .ui-mixedmark {
|
|
|
position: absolute;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
color: white;
|
|
|
}
|
|
|
.menu-swatch.dark-contrast .ui-checkmark,
|
|
|
.menu-swatch.dark-contrast .ui-mixedmark {
|
|
|
color: #000;
|
|
|
}
|
|
|
`,zl=`.ML__container {
|
|
|
min-height: auto !important;
|
|
|
--_hue: var(--hue, 212);
|
|
|
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
|
|
|
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
|
|
|
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
|
|
|
}
|
|
|
.ML__sr-only {
|
|
|
position: absolute;
|
|
|
width: 1px;
|
|
|
height: 1px;
|
|
|
margin: -1px;
|
|
|
padding: 0;
|
|
|
overflow: hidden;
|
|
|
clip: rect(0, 0, 0, 0);
|
|
|
clip-path: inset(50%);
|
|
|
white-space: nowrap;
|
|
|
border: 0;
|
|
|
}
|
|
|
.ML__is-inline {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__base {
|
|
|
visibility: inherit;
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
cursor: text;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
box-sizing: content-box;
|
|
|
border: 0;
|
|
|
outline: 0;
|
|
|
vertical-align: baseline;
|
|
|
font-weight: inherit;
|
|
|
font-family: inherit;
|
|
|
font-style: inherit;
|
|
|
text-decoration: none;
|
|
|
width: min-content;
|
|
|
}
|
|
|
.ML__strut,
|
|
|
.ML__strut--bottom {
|
|
|
display: inline-block;
|
|
|
min-height: 0.5em;
|
|
|
}
|
|
|
.ML__small-delim {
|
|
|
font-family: KaTeX_Main;
|
|
|
}
|
|
|
/* Text mode */
|
|
|
.ML__text {
|
|
|
font-family: var(--_text-font-family);
|
|
|
white-space: pre;
|
|
|
}
|
|
|
/* Use cmr for 'math upright' */
|
|
|
.ML__cmr {
|
|
|
font-family: KaTeX_Main;
|
|
|
font-style: normal;
|
|
|
}
|
|
|
.ML__mathit {
|
|
|
font-family: KaTeX_Math;
|
|
|
/* The KaTeX_Math font is italic by default, so the font-style below is only
|
|
|
useful when a fallback font is used
|
|
|
*/
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__mathbf {
|
|
|
font-family: KaTeX_Main;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
|
|
|
to match TeX idiosyncratic behavior */
|
|
|
.lcGreek.ML__mathbf {
|
|
|
font-family: KaTeX_Math;
|
|
|
font-weight: normal;
|
|
|
}
|
|
|
.ML__mathbfit {
|
|
|
font-family: KaTeX_Math;
|
|
|
font-weight: bold;
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__ams {
|
|
|
font-family: KaTeX_AMS;
|
|
|
}
|
|
|
/* Blackboard */
|
|
|
.ML__bb {
|
|
|
font-family: KaTeX_AMS;
|
|
|
}
|
|
|
.ML__cal {
|
|
|
font-family: KaTeX_Caligraphic;
|
|
|
}
|
|
|
.ML__frak {
|
|
|
font-family: KaTeX_Fraktur;
|
|
|
}
|
|
|
.ML__tt {
|
|
|
font-family: KaTeX_Typewriter;
|
|
|
}
|
|
|
.ML__script {
|
|
|
font-family: KaTeX_Script;
|
|
|
}
|
|
|
.ML__sans {
|
|
|
font-family: KaTeX_SansSerif;
|
|
|
}
|
|
|
.ML__series_ul {
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.ML__series_el {
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.ML__series_l {
|
|
|
font-weight: 200;
|
|
|
}
|
|
|
.ML__series_sl {
|
|
|
font-weight: 300;
|
|
|
}
|
|
|
.ML__series_sb {
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
.ML__bold,
|
|
|
.ML__boldsymbol {
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
.ML__series_eb {
|
|
|
font-weight: 800;
|
|
|
}
|
|
|
.ML__series_ub {
|
|
|
font-weight: 900;
|
|
|
}
|
|
|
.ML__series_uc {
|
|
|
font-stretch: ultra-condensed;
|
|
|
}
|
|
|
.ML__series_ec {
|
|
|
font-stretch: extra-condensed;
|
|
|
}
|
|
|
.ML__series_c {
|
|
|
font-stretch: condensed;
|
|
|
}
|
|
|
.ML__series_sc {
|
|
|
font-stretch: semi-condensed;
|
|
|
}
|
|
|
.ML__series_sx {
|
|
|
font-stretch: semi-expanded;
|
|
|
}
|
|
|
.ML__series_x {
|
|
|
font-stretch: expanded;
|
|
|
}
|
|
|
.ML__series_ex {
|
|
|
font-stretch: extra-expanded;
|
|
|
}
|
|
|
.ML__series_ux {
|
|
|
font-stretch: ultra-expanded;
|
|
|
}
|
|
|
.ML__it {
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__shape_ol {
|
|
|
-webkit-text-stroke: 1px black;
|
|
|
text-stroke: 1px black;
|
|
|
color: transparent;
|
|
|
}
|
|
|
.ML__shape_sc {
|
|
|
font-variant: small-caps;
|
|
|
}
|
|
|
.ML__shape_sl {
|
|
|
font-style: oblique;
|
|
|
}
|
|
|
/* First level emphasis */
|
|
|
.ML__emph {
|
|
|
color: #bc2612;
|
|
|
}
|
|
|
/* Second level emphasis */
|
|
|
.ML__emph .ML__emph {
|
|
|
color: #0c7f99;
|
|
|
}
|
|
|
.ML__highlight {
|
|
|
color: #007cb2;
|
|
|
background: #edd1b0;
|
|
|
}
|
|
|
.ML__center {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__label_padding {
|
|
|
padding: 0 0.5em;
|
|
|
}
|
|
|
.ML__frac-line {
|
|
|
width: 100%;
|
|
|
min-height: 1px;
|
|
|
}
|
|
|
.ML__frac-line:after {
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: max(-1px, -0.04em);
|
|
|
min-height: max(1px, 0.04em);
|
|
|
/* Ensure the line is visible when printing even if "turn off background images" is on*/
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
/* There's a bug since Chrome 62 where
|
|
|
sub-pixel border lines don't draw at some zoom
|
|
|
levels (110%, 90%).
|
|
|
Setting the min-height used to work around it, but that workaround
|
|
|
broke in Chrome 84 or so.
|
|
|
Setting the background (and the min-height) seems to work for now.
|
|
|
*/
|
|
|
background: currentColor;
|
|
|
box-sizing: content-box;
|
|
|
/* Vuetify sets the box-sizing to inherit
|
|
|
causes the fraction line to not draw at all sizes (see #26) */
|
|
|
/* On some versions of Firefox on Windows, the line fails to
|
|
|
draw at some zoom levels, but setting the transform triggers
|
|
|
the hardware accelerated path, which works */
|
|
|
transform: translate(0, 0);
|
|
|
}
|
|
|
.ML__sqrt {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__sqrt-sign {
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__sqrt-line {
|
|
|
display: inline-block;
|
|
|
height: max(1px, 0.04em);
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__sqrt-line:before {
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: min(-1px, -0.04em);
|
|
|
min-height: max(1px, 0.04em);
|
|
|
/* Ensure the line is visible when printing even if "turn off background images" is on*/
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
background: currentColor;
|
|
|
/* On some versions of Firefox on Windows, the line fails to
|
|
|
draw at some zoom levels, but setting the transform triggers
|
|
|
the hardware accelerated path, which works */
|
|
|
transform: translate(0, 0);
|
|
|
}
|
|
|
.ML__sqrt-line:after {
|
|
|
border-bottom-width: 1px;
|
|
|
content: ' ';
|
|
|
display: block;
|
|
|
margin-top: -0.1em;
|
|
|
}
|
|
|
.ML__sqrt-index {
|
|
|
margin-left: 0.27777778em;
|
|
|
margin-right: -0.55555556em;
|
|
|
}
|
|
|
.ML__delim-size1 {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__delim-size2 {
|
|
|
font-family: KaTeX_Size2;
|
|
|
}
|
|
|
.ML__delim-size3 {
|
|
|
font-family: KaTeX_Size3;
|
|
|
}
|
|
|
.ML__delim-size4 {
|
|
|
font-family: KaTeX_Size4;
|
|
|
}
|
|
|
.ML__delim-mult .delim-size1 > span {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__delim-mult .delim-size4 > span {
|
|
|
font-family: KaTeX_Size4;
|
|
|
}
|
|
|
.ML__accent-body > span {
|
|
|
font-family: KaTeX_Main;
|
|
|
width: 0;
|
|
|
}
|
|
|
.ML__accent-vec {
|
|
|
position: relative;
|
|
|
left: 0.24em;
|
|
|
}
|
|
|
/** The markup for a LaTeX formula, either in an editable mathfield or
|
|
|
in a static display.
|
|
|
*/
|
|
|
.ML__latex {
|
|
|
display: inline-block;
|
|
|
direction: ltr;
|
|
|
text-align: left;
|
|
|
text-indent: 0;
|
|
|
text-rendering: auto;
|
|
|
font-family: KaTeX_Main, 'Times New Roman', serif;
|
|
|
font-style: normal;
|
|
|
font-size-adjust: none;
|
|
|
font-stretch: normal;
|
|
|
font-variant-caps: normal;
|
|
|
letter-spacing: normal;
|
|
|
line-height: 1.2;
|
|
|
word-wrap: normal;
|
|
|
word-spacing: normal;
|
|
|
white-space: nowrap;
|
|
|
text-shadow: none;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
width: min-content;
|
|
|
}
|
|
|
.ML__latex .style-wrap {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .mfrac {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .left-right {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .vlist-t {
|
|
|
display: inline-table;
|
|
|
table-layout: fixed;
|
|
|
border-collapse: collapse;
|
|
|
}
|
|
|
.ML__latex .vlist-r {
|
|
|
display: table-row;
|
|
|
}
|
|
|
.ML__latex .vlist {
|
|
|
display: table-cell;
|
|
|
vertical-align: bottom;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .vlist > span {
|
|
|
display: block;
|
|
|
height: 0;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .vlist > span > span {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .vlist > span > .pstrut {
|
|
|
overflow: hidden;
|
|
|
width: 0;
|
|
|
}
|
|
|
.ML__latex .vlist-t2 {
|
|
|
margin-right: -2px;
|
|
|
}
|
|
|
.ML__latex .vlist-s {
|
|
|
display: table-cell;
|
|
|
vertical-align: bottom;
|
|
|
font-size: 1px;
|
|
|
width: 2px;
|
|
|
min-width: 2px;
|
|
|
}
|
|
|
.ML__latex .msubsup {
|
|
|
text-align: left;
|
|
|
}
|
|
|
.ML__latex .negativethinspace {
|
|
|
display: inline-block;
|
|
|
margin-left: -0.16667em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .thinspace {
|
|
|
display: inline-block;
|
|
|
width: 0.16667em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .mediumspace {
|
|
|
display: inline-block;
|
|
|
width: 0.22222em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .thickspace {
|
|
|
display: inline-block;
|
|
|
width: 0.27778em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .enspace {
|
|
|
display: inline-block;
|
|
|
width: 0.5em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .quad {
|
|
|
display: inline-block;
|
|
|
width: 1em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .qquad {
|
|
|
display: inline-block;
|
|
|
width: 2em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .llap,
|
|
|
.ML__latex .rlap {
|
|
|
width: 0;
|
|
|
position: relative;
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .llap > .inner,
|
|
|
.ML__latex .rlap > .inner {
|
|
|
position: absolute;
|
|
|
}
|
|
|
.ML__latex .llap > .fix,
|
|
|
.ML__latex .rlap > .fix {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .llap > .inner {
|
|
|
right: 0;
|
|
|
}
|
|
|
.ML__latex .rlap > .inner {
|
|
|
left: 0;
|
|
|
}
|
|
|
.ML__latex .rule {
|
|
|
display: inline-block;
|
|
|
border: solid 0;
|
|
|
position: relative;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line,
|
|
|
.ML__latex .underline .underline-line {
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line:before,
|
|
|
.ML__latex .underline .underline-line:before {
|
|
|
content: '';
|
|
|
border-bottom-style: solid;
|
|
|
border-bottom-width: max(1px, 0.04em);
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
display: block;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line:after,
|
|
|
.ML__latex .underline .underline-line:after {
|
|
|
border-bottom-style: solid;
|
|
|
border-bottom-width: max(1px, 0.04em);
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: -1px;
|
|
|
}
|
|
|
.ML__latex .stretchy {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
left: 0;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .stretchy:before,
|
|
|
.ML__latex .stretchy:after {
|
|
|
content: '';
|
|
|
}
|
|
|
.ML__latex .stretchy svg {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
height: inherit;
|
|
|
fill: currentColor;
|
|
|
stroke: currentColor;
|
|
|
fill-rule: nonzero;
|
|
|
fill-opacity: 1;
|
|
|
stroke-width: 1;
|
|
|
stroke-linecap: butt;
|
|
|
stroke-linejoin: miter;
|
|
|
stroke-miterlimit: 4;
|
|
|
stroke-dasharray: none;
|
|
|
stroke-dashoffset: 0;
|
|
|
stroke-opacity: 1;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-2 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
width: 50.2%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-2-of-2 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
width: 50.2%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
width: 25.1%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-2-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 25%;
|
|
|
width: 50%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-3-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
width: 25.1%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-1 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
left: 0;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .nulldelimiter {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .op-group {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .op-symbol {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .op-symbol.small-op {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__latex .op-symbol.large-op {
|
|
|
font-family: KaTeX_Size2;
|
|
|
}
|
|
|
.ML__latex .mtable .vertical-separator {
|
|
|
display: inline-block;
|
|
|
min-width: 1px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ML__latex .mtable .arraycolsep {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-m > .vlist-t {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-c > .vlist-t {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-l > .vlist-t {
|
|
|
text-align: left;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-r > .vlist-t {
|
|
|
text-align: right;
|
|
|
}
|
|
|
.ML__error {
|
|
|
display: inline-block;
|
|
|
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
|
|
|
background-color: hsla(341, 100%, 40%, 0.1);
|
|
|
background-repeat: repeat-x;
|
|
|
background-size: 3px 3px;
|
|
|
padding-bottom: 3px;
|
|
|
background-position: 0 100%;
|
|
|
}
|
|
|
.ML__error > .ML__error {
|
|
|
background: transparent;
|
|
|
padding: 0;
|
|
|
}
|
|
|
.ML__placeholder {
|
|
|
color: var(--_placeholder-color);
|
|
|
opacity: var(--_placeholder-opacity);
|
|
|
padding-left: 0.4ex;
|
|
|
padding-right: 0.4ex;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
}
|
|
|
.ML__notation {
|
|
|
position: absolute;
|
|
|
box-sizing: border-box;
|
|
|
line-height: 0;
|
|
|
}
|
|
|
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
|
|
|
For UI elements, see \`[data-ML__tooltip]\`
|
|
|
*/
|
|
|
.ML__tooltip-container {
|
|
|
position: relative;
|
|
|
transform: scale(0);
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content {
|
|
|
position: fixed;
|
|
|
display: inline-table;
|
|
|
visibility: hidden;
|
|
|
z-index: 2;
|
|
|
width: max-content;
|
|
|
max-width: 400px;
|
|
|
padding: 12px 12px;
|
|
|
border-radius: 8px;
|
|
|
background: #616161;
|
|
|
--_selection-color: #fff;
|
|
|
color: #fff;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
opacity: 0;
|
|
|
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content .ML__text {
|
|
|
white-space: normal;
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content .ML__base {
|
|
|
display: contents;
|
|
|
}
|
|
|
.ML__tooltip-container:hover .ML__tooltip-content {
|
|
|
visibility: visible;
|
|
|
opacity: 1;
|
|
|
font-size: 0.75em;
|
|
|
transform: scale(1) translate(0, 3em);
|
|
|
}
|
|
|
`,Kl=`#mathlive-environment-popover.is-visible {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
#mathlive-environment-popover {
|
|
|
--_environment-panel-height: var(--environment-panel-height, 70px);
|
|
|
--_accent-color: var(--accent-color, #aaa);
|
|
|
--_background: var(--environment-panel-background, #fff);
|
|
|
--_button-background: var(--environment-panel-button-background, white);
|
|
|
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
|
|
|
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
|
|
|
--_button-text: var(--environment-panel-button-text, #e3e4e8);
|
|
|
position: absolute;
|
|
|
width: calc(var(--_environment-panel-height) * 2);
|
|
|
height: var(--_environment-panel-height);
|
|
|
border-radius: 4px;
|
|
|
border: 1.5px solid var(--_accent-color);
|
|
|
background-color: var(--_background);
|
|
|
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
|
|
|
pointer-events: all;
|
|
|
visibility: hidden;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons {
|
|
|
height: calc(var(--_environment-panel-height) * 5/4);
|
|
|
width: calc(var(--_environment-panel-height) * 5/4);
|
|
|
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
|
|
|
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons .font {
|
|
|
fill: white;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons circle {
|
|
|
fill: #7f7f7f;
|
|
|
transition: fill 300ms;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
|
|
|
fill-opacity: 1;
|
|
|
fill: var(--_background);
|
|
|
stroke: var(--_accent-color);
|
|
|
stroke-width: 3px;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons line {
|
|
|
stroke: var(--_accent-color);
|
|
|
stroke-opacity: 0;
|
|
|
stroke-width: 40;
|
|
|
pointer-events: none;
|
|
|
transition: stroke-opacity 300ms;
|
|
|
stroke-linecap: round;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
|
|
|
fill: var(--_accent-color);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
|
|
|
stroke-opacity: 1;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
|
|
|
height: 100%;
|
|
|
width: 50%;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
|
|
|
width: var(--_environment-panel-height);
|
|
|
height: var(--_environment-panel-height);
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-around;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
|
|
|
pointer-events: all;
|
|
|
margin-top: 2px;
|
|
|
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
|
|
|
height: calc(var(--_environment-panel-height) / 3 - 2px);
|
|
|
border-radius: calc(var(--_environment-panel-height) / 25);
|
|
|
background-color: var(--_button-background);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
|
|
|
background-color: var(--_button-background-hover);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
|
|
|
stroke: var(--_button-text);
|
|
|
stroke-width: 2;
|
|
|
stroke-linecap: round;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
|
|
|
fill-opacity: 0;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
|
|
|
pointer-events: none;
|
|
|
background-color: var(--_button-background-active);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
|
|
|
stroke: var(--_accent-color);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
|
|
|
fill: var(--_accent-color);
|
|
|
}
|
|
|
`,P0=`/* The element that display info while in latex mode */
|
|
|
#mathlive-suggestion-popover {
|
|
|
background-color: rgba(97, 97, 97);
|
|
|
color: #fff;
|
|
|
text-align: center;
|
|
|
border-radius: 8px;
|
|
|
position: fixed;
|
|
|
z-index: 1;
|
|
|
display: none;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
|
|
|
}
|
|
|
#mathlive-suggestion-popover.top-tip::after {
|
|
|
content: '';
|
|
|
position: absolute;
|
|
|
top: -15px;
|
|
|
left: calc(50% - 15px);
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
border-left: 15px solid transparent;
|
|
|
border-right: 15px solid transparent;
|
|
|
border-bottom: 15px solid rgba(97, 97, 97);
|
|
|
font-size: 1rem;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.bottom-tip::after {
|
|
|
content: '';
|
|
|
position: absolute;
|
|
|
bottom: -15px;
|
|
|
left: calc(50% - 15px);
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
border-left: 15px solid transparent;
|
|
|
border-right: 15px solid transparent;
|
|
|
border-top: 15px solid rgba(97, 97, 97);
|
|
|
font-size: 1rem;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.is-animated {
|
|
|
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
|
|
|
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.is-visible {
|
|
|
display: flex;
|
|
|
}
|
|
|
@keyframes ML__fade-in {
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
}
|
|
|
/* The wrapper class for the entire content of the popover panel */
|
|
|
#mathlive-suggestion-popover ul {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
list-style: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
align-items: flex-start;
|
|
|
max-height: 400px;
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
margin: 8px;
|
|
|
padding: 8px;
|
|
|
width: calc(100% - 16px - 16px);
|
|
|
column-gap: 1em;
|
|
|
border-radius: 8px;
|
|
|
cursor: pointer;
|
|
|
/* Since the content can be clicked on, provide feedback on hover */
|
|
|
}
|
|
|
#mathlive-suggestion-popover li a {
|
|
|
color: #5ea6fd;
|
|
|
padding-top: 0.3em;
|
|
|
margin-top: 0.4em;
|
|
|
display: block;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li a:hover {
|
|
|
color: #5ea6fd;
|
|
|
text-decoration: underline;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li:hover,
|
|
|
#mathlive-suggestion-popover li.is-pressed,
|
|
|
#mathlive-suggestion-popover li.is-active {
|
|
|
background: rgba(255, 255, 255, 0.1);
|
|
|
}
|
|
|
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
|
|
|
.ML__popover__command {
|
|
|
font-size: 1.6rem;
|
|
|
font-family: KaTeX_Main;
|
|
|
}
|
|
|
.ML__popover__current {
|
|
|
background: #5ea6fd;
|
|
|
color: #fff;
|
|
|
}
|
|
|
.ML__popover__latex {
|
|
|
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
|
|
|
align-self: center;
|
|
|
}
|
|
|
/* The keyboard shortcuts for a symbol as displayed in the popover */
|
|
|
.ML__popover__keybinding {
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 0.8em;
|
|
|
opacity: 0.7;
|
|
|
}
|
|
|
/* Style for the character that joins the modifiers of a keyboard shortcut
|
|
|
(usually a "+" sign)*/
|
|
|
.ML__shortcut-join {
|
|
|
opacity: 0.5;
|
|
|
}
|
|
|
`,Gc=`/* The element that displays the keys as the user type them */
|
|
|
#mathlive-keystroke-caption-panel {
|
|
|
visibility: hidden;
|
|
|
/*min-width: 160px;*/
|
|
|
/*background-color: rgba(97, 97, 200, .95);*/
|
|
|
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
|
|
|
border-color: var(--secondary-border, hsl(0, 0%, 91%));
|
|
|
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
|
|
|
text-align: center;
|
|
|
border-radius: 6px;
|
|
|
padding: 16px;
|
|
|
position: absolute;
|
|
|
z-index: 1;
|
|
|
display: flex;
|
|
|
flex-direction: row-reverse;
|
|
|
justify-content: center;
|
|
|
--keystroke: white;
|
|
|
--on-keystroke: #555;
|
|
|
--keystroke-border: #f7f7f7;
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
body:not([theme='light']) #mathlive-keystroke-caption-panel {
|
|
|
--keystroke: hsl(var(--_hue), 50%, 30%);
|
|
|
--on-keystroke: hsl(0, 0%, 98%);
|
|
|
--keystroke-border: hsl(var(--_hue), 50%, 25%);
|
|
|
}
|
|
|
}
|
|
|
body[theme='dark'] #mathlive-keystroke-caption-panel {
|
|
|
--keystroke: hsl(var(--_hue), 50%, 30%);
|
|
|
--on-keystroke: hsl(0, 0%, 98%);
|
|
|
--keystroke-border: hsl(var(--_hue), 50%, 25%);
|
|
|
}
|
|
|
#mathlive-keystroke-caption-panel > span {
|
|
|
min-width: 14px;
|
|
|
/*height: 8px;*/
|
|
|
margin: 0 8px 0 0;
|
|
|
padding: 4px;
|
|
|
background-color: var(--keystroke);
|
|
|
color: var(--on-keystroke);
|
|
|
fill: currentColor;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 1em;
|
|
|
border-radius: 6px;
|
|
|
border: 2px solid var(--keystroke-border);
|
|
|
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
|
|
|
}
|
|
|
`,bd=`.ML__keyboard {
|
|
|
--_keyboard-height: 0;
|
|
|
--_keyboard-zindex: var(--keyboard-zindex, 105);
|
|
|
--_accent-color: var(--keyboard-accent-color, #0c75d8);
|
|
|
--_background: var(--keyboard-background, #cacfd7);
|
|
|
--_border: var(--keyboard-border, #ddd);
|
|
|
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
|
|
|
--_padding-top: var(--keyboard-padding-top, 5px);
|
|
|
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
|
|
|
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
|
|
|
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
|
|
|
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
|
|
|
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
|
|
|
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
|
|
|
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
|
|
|
--_keycap-background: var(--keycap-background, white);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
|
|
|
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
|
|
|
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
|
|
|
--_keycap-border: var(--keycap-border, #e5e6e9);
|
|
|
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
|
|
|
--_keycap-text: var(--keycap-text, #000);
|
|
|
--_keycap-text-active: var(--keycap-text-active, #fff);
|
|
|
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
|
|
|
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
|
|
|
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
|
|
|
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
|
|
|
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
|
|
|
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
|
|
|
--_keycap-height: var(--keycap-height, 60px);
|
|
|
/* Keycap width (incl. margin) */
|
|
|
--_keycap-max-width: var(--keycap-max-width, 100px);
|
|
|
--_keycap-gap: var(--keycap-gap, 8px);
|
|
|
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
|
|
|
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
|
|
|
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
|
|
|
--_variant-panel-background: var(--variant-panel-background, #fff);
|
|
|
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
|
|
|
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 70px);
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
|
|
|
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
|
|
|
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
|
|
|
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
|
|
|
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
|
|
|
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
|
|
|
}
|
|
|
.is-math-mode .MLK__rows .if-text-mode,
|
|
|
.is-text-mode .MLK__rows .if-math-mode {
|
|
|
display: none;
|
|
|
}
|
|
|
.if-can-undo,
|
|
|
.if-can-redo,
|
|
|
.if-can-copy,
|
|
|
.if-can-cut,
|
|
|
.if-can-paste {
|
|
|
opacity: 0.4;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.can-undo .if-can-undo,
|
|
|
.can-redo .if-can-redo,
|
|
|
.can-copy .if-can-copy,
|
|
|
.can-cut .if-can-cut,
|
|
|
.can-paste .if-can-paste {
|
|
|
opacity: 1;
|
|
|
pointer-events: all;
|
|
|
}
|
|
|
body > .ML__keyboard {
|
|
|
position: fixed;
|
|
|
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
|
|
|
}
|
|
|
body > .ML__keyboard.is-visible > .MLK__backdrop {
|
|
|
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
|
|
|
border-top: 1px solid var(--_border);
|
|
|
}
|
|
|
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
|
|
|
box-shadow: none;
|
|
|
border: none;
|
|
|
}
|
|
|
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
|
|
|
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
|
|
|
transition-property: transform, opacity;
|
|
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__keyboard {
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
z-index: var(--_keyboard-zindex);
|
|
|
box-sizing: border-box;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
line-height: 1;
|
|
|
overflow-wrap: unset;
|
|
|
text-align: left;
|
|
|
vertical-align: baseline;
|
|
|
cursor: auto;
|
|
|
white-space: pre;
|
|
|
box-shadow: none;
|
|
|
opacity: 1;
|
|
|
transform: none;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.ML__keyboard :where(div) {
|
|
|
box-sizing: border-box;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
line-height: 1;
|
|
|
overflow-wrap: unset;
|
|
|
text-align: left;
|
|
|
vertical-align: baseline;
|
|
|
cursor: auto;
|
|
|
white-space: pre;
|
|
|
box-shadow: none;
|
|
|
transform: none;
|
|
|
}
|
|
|
.MLK__backdrop {
|
|
|
position: absolute;
|
|
|
bottom: calc(-1 * var(--_keyboard-height));
|
|
|
width: 100%;
|
|
|
height: var(--_keyboard-height);
|
|
|
box-sizing: border-box;
|
|
|
padding-top: var(--_padding-top);
|
|
|
padding-bottom: var(--_padding-bottom);
|
|
|
padding-left: var(--_padding-horizontal);
|
|
|
padding-right: var(--_padding-horizontal);
|
|
|
opacity: 0;
|
|
|
visibility: hidden;
|
|
|
transform: translate(0, 0);
|
|
|
background: var(--_background);
|
|
|
}
|
|
|
.backdrop-is-transparent .MLK__backdrop {
|
|
|
background: transparent;
|
|
|
}
|
|
|
/* If a custom layout has a custom container/backdrop
|
|
|
(backdrop-is-transparent), make sure to let pointer event go through. */
|
|
|
.backdrop-is-transparent .MLK__plate {
|
|
|
background: transparent;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
/* If a custom layout has a custom container/backdrop, make sure to
|
|
|
allow pointer events on it. */
|
|
|
.backdrop-is-transparent .MLK__layer > div > div {
|
|
|
pointer-events: all;
|
|
|
}
|
|
|
.ML__keyboard.is-visible > .MLK__backdrop {
|
|
|
transform: translate(0, calc(-1 * var(--_keyboard-height)));
|
|
|
opacity: 1;
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.caps-lock-indicator {
|
|
|
display: none;
|
|
|
width: 8px;
|
|
|
height: 8px;
|
|
|
background: #0cbc0c;
|
|
|
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
|
|
|
border-radius: 8px;
|
|
|
right: 8px;
|
|
|
top: 8px;
|
|
|
position: absolute;
|
|
|
}
|
|
|
.ML__keyboard.is-caps-lock .caps-lock-indicator {
|
|
|
display: block;
|
|
|
}
|
|
|
.ML__keyboard.is-caps-lock .shift {
|
|
|
background: var(--_keycap-background-active);
|
|
|
color: var(--_keycap-text-active);
|
|
|
}
|
|
|
.MLK__plate {
|
|
|
position: absolute;
|
|
|
top: var(--_padding-top);
|
|
|
left: var(--_padding-horizontal);
|
|
|
width: calc(100% - 2 * var(--_padding-horizontal));
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
box-sizing: border-box;
|
|
|
container-type: inline-size;
|
|
|
touch-action: none;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
pointer-events: all;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 16px;
|
|
|
/* Size of toolbar labels */
|
|
|
font-weight: 400;
|
|
|
text-shadow: none;
|
|
|
}
|
|
|
.ML__box-placeholder {
|
|
|
color: var(--_box-placeholder-color);
|
|
|
}
|
|
|
.MLK__tex {
|
|
|
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__tex-math {
|
|
|
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.MLK__layer {
|
|
|
display: none;
|
|
|
outline: none;
|
|
|
}
|
|
|
.MLK__layer.is-visible {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
}
|
|
|
/* Keyboard layouts are made or rows of keys... */
|
|
|
.MLK__rows {
|
|
|
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
border-collapse: separate;
|
|
|
clear: both;
|
|
|
border: 0;
|
|
|
margin: 0;
|
|
|
margin-bottom: var(--_keycap-gap);
|
|
|
gap: var(--_keycap-gap);
|
|
|
/* If the styling include, e.g., some shadows, they will be
|
|
|
cut off by the overflow. In that case, set the padding to
|
|
|
compensate. */
|
|
|
padding-left: var(--_row-padding-left);
|
|
|
padding-right: var(--_row-padding-right);
|
|
|
overflow: visible;
|
|
|
touch-action: none;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row {
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: center;
|
|
|
width: 100%;
|
|
|
gap: var(--_keycap-gap);
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
/* For the alignment of the text on some modifiers (e.g. shift) */
|
|
|
/* Extra spacing between two adjacent keys */
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .tex {
|
|
|
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .tex-math {
|
|
|
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .big-op {
|
|
|
font-size: calc(1.25 * var(--_keycap-font-size));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .small {
|
|
|
font-size: var(--_keycap-small-font-size);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .bottom {
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .left {
|
|
|
align-items: flex-start;
|
|
|
padding-left: 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .right {
|
|
|
align-items: flex-end;
|
|
|
padding-right: 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w0 {
|
|
|
width: 0;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w5 {
|
|
|
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w15 {
|
|
|
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w20 {
|
|
|
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w40 {
|
|
|
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w50 {
|
|
|
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .MLK__keycap.w50 {
|
|
|
font-size: 80%;
|
|
|
padding-top: 10px;
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .separator {
|
|
|
background: transparent;
|
|
|
border: none;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .horizontal-rule {
|
|
|
height: 6px;
|
|
|
margin-top: 3px;
|
|
|
margin-bottom: 0;
|
|
|
width: 100%;
|
|
|
border-radius: 0;
|
|
|
border-top: var(--_horizontal-rule);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .ghost {
|
|
|
background: var(--_toolbar-background);
|
|
|
border: none;
|
|
|
color: var(--_toolbar-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .ghost:hover {
|
|
|
background: var(--_toolbar-background-hover);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .bigfnbutton {
|
|
|
font-size: var(--_keycap-extra-small-font-size);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift,
|
|
|
.MLK__rows > .MLK__row .action {
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
background: var(--_keycap-secondary-background);
|
|
|
border-color: var(--_keycap-secondary-border);
|
|
|
border-bottom-color: var(--_keycap-secondary-border-bottom);
|
|
|
line-height: 0.8;
|
|
|
font-size: min(1rem, var(--_keycap-small-font-size));
|
|
|
font-weight: 600;
|
|
|
padding: 8px 12px 8px 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift:hover,
|
|
|
.MLK__rows > .MLK__row .action:hover {
|
|
|
background: var(--_keycap-secondary-background-hover);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .action.primary {
|
|
|
background: var(--_keycap-primary-background);
|
|
|
color: var(--_keycap-primary-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .action.primary:hover {
|
|
|
background: var(--_keycap-primary-background-hover);
|
|
|
color: var(--_keycap-primary-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift.selected,
|
|
|
.MLK__rows > .MLK__row .action.selected {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift.selected.is-pressed,
|
|
|
.MLK__rows > .MLK__row .action.selected.is-pressed,
|
|
|
.MLK__rows > .MLK__row .shift.selected.is-active,
|
|
|
.MLK__rows > .MLK__row .action.selected.is-active {
|
|
|
color: white;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .warning {
|
|
|
background: #cd0030;
|
|
|
color: white;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .warning svg.svg-glyph {
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
min-height: 24px;
|
|
|
}
|
|
|
/** A regular keycap
|
|
|
* Use the :where() pseudo-class to give it a very low specifity,
|
|
|
* so that it can be overriden by custom style.
|
|
|
*/
|
|
|
:where(.MLK__rows > .MLK__row div) {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
justify-content: space-evenly;
|
|
|
width: calc(var(--_keycap-width) - var(--_keycap-gap));
|
|
|
height: var(--_keycap-height);
|
|
|
box-sizing: border-box;
|
|
|
padding: 0;
|
|
|
vertical-align: top;
|
|
|
text-align: center;
|
|
|
float: left;
|
|
|
color: var(--_keycap-text);
|
|
|
fill: currentColor;
|
|
|
font-size: var(--_keycap-font-size);
|
|
|
background: var(--_keycap-background);
|
|
|
border: 1px solid var(--_keycap-border);
|
|
|
border-bottom-color: var(--_keycap-border-bottom);
|
|
|
border-radius: 6px;
|
|
|
cursor: pointer;
|
|
|
touch-action: none;
|
|
|
/* Keys with a variants panel */
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div):hover {
|
|
|
overflow: visible;
|
|
|
background: var(--_keycap-background-hover);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) .ML__latex {
|
|
|
pointer-events: none;
|
|
|
touch-action: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
|
|
|
margin: 8px 0;
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
min-height: 20px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
|
|
|
margin: 8px 0;
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
min-height: 24px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
|
|
|
font-size: 25px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).is-pressed {
|
|
|
background: var(--_keycap-background-pressed);
|
|
|
color: var(--_keycap-text-pressed);
|
|
|
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed {
|
|
|
z-index: calc(var(--_keyboard-zindex) - 5);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active aside,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
|
|
|
display: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed {
|
|
|
background: var(--_keycap-background-pressed);
|
|
|
color: var(--_keycap-text-pressed);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).shift.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active {
|
|
|
background: var(--_keycap-background-active);
|
|
|
color: var(--_keycap-text-active);
|
|
|
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) small {
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) aside {
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 10px;
|
|
|
line-height: 10px;
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
}
|
|
|
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
|
|
|
Note there are a different set of tooltip rules for the keyboard toggle
|
|
|
(it's in a different CSS tree) */
|
|
|
.ML__keyboard [data-tooltip] {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]::after {
|
|
|
position: absolute;
|
|
|
display: inline-table;
|
|
|
content: attr(data-tooltip);
|
|
|
top: inherit;
|
|
|
bottom: 100%;
|
|
|
width: max-content;
|
|
|
max-width: 200px;
|
|
|
padding: 8px 8px;
|
|
|
background: #616161;
|
|
|
color: #fff;
|
|
|
text-align: center;
|
|
|
z-index: 2;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
border-radius: 2px;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-weight: 400;
|
|
|
font-size: 12px;
|
|
|
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
|
|
|
opacity: 0;
|
|
|
transform: scale(0.5);
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]:hover {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]:hover::after {
|
|
|
opacity: 1;
|
|
|
transform: scale(1);
|
|
|
}
|
|
|
.MLK__toolbar {
|
|
|
align-self: center;
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: space-between;
|
|
|
width: 100%;
|
|
|
max-width: 996px;
|
|
|
min-height: 32px;
|
|
|
/* Icons for undo/redo, etc. */
|
|
|
}
|
|
|
.MLK__toolbar svg {
|
|
|
height: 20px;
|
|
|
width: 20px;
|
|
|
}
|
|
|
.MLK__toolbar > .left {
|
|
|
position: relative;
|
|
|
display: flex;
|
|
|
justify-content: flex-start;
|
|
|
flex-flow: row;
|
|
|
}
|
|
|
.MLK__toolbar > .right {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
flex-flow: row;
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
/* "button" in the toolbar */
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
color: var(--_toolbar-text);
|
|
|
fill: currentColor;
|
|
|
background: var(--_toolbar-background);
|
|
|
font-size: var(--_toolbar-font-size);
|
|
|
padding: 4px 15px;
|
|
|
cursor: pointer;
|
|
|
width: max-content;
|
|
|
min-width: 42px;
|
|
|
min-height: 34px;
|
|
|
border: none;
|
|
|
padding-left: 10px;
|
|
|
padding-right: 10px;
|
|
|
padding-bottom: 8px;
|
|
|
padding-top: 8px;
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 4px;
|
|
|
margin-left: 4px;
|
|
|
margin-right: 4px;
|
|
|
border-radius: 8px;
|
|
|
box-shadow: none;
|
|
|
border-bottom: 2px solid transparent;
|
|
|
}
|
|
|
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
|
|
|
background: var(--_toolbar-background-hover);
|
|
|
}
|
|
|
.MLK__toolbar > div > div.disabled svg,
|
|
|
.MLK__toolbar > div > div.disabled:hover svg,
|
|
|
.MLK__toolbar > div > div.disabled.is-pressed svg {
|
|
|
color: var(--_toolbar-text);
|
|
|
opacity: 0.2;
|
|
|
}
|
|
|
.MLK__toolbar > div > div:hover,
|
|
|
.MLK__toolbar > div > div:active,
|
|
|
.MLK__toolbar > div > div.is-pressed,
|
|
|
.MLK__toolbar > div > div.is-active {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
}
|
|
|
.MLK__toolbar > div > div.selected {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
background: var(--_toolbar-background-selected);
|
|
|
border-radius: 0;
|
|
|
border-bottom-color: var(--_toolbar-text-active);
|
|
|
padding-bottom: 4px;
|
|
|
margin-bottom: 8px;
|
|
|
}
|
|
|
/* This is the element that displays variants on press+hold */
|
|
|
.MLK__variant-panel {
|
|
|
visibility: hidden;
|
|
|
position: fixed;
|
|
|
display: flex;
|
|
|
flex-flow: row wrap-reverse;
|
|
|
justify-content: center;
|
|
|
align-content: center;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
bottom: auto;
|
|
|
top: 0;
|
|
|
box-sizing: content-box;
|
|
|
transform: none;
|
|
|
z-index: calc(var(--_keyboard-zindex) + 1);
|
|
|
touch-action: none;
|
|
|
max-width: 350px;
|
|
|
background: var(--_variant-panel-background);
|
|
|
text-align: center;
|
|
|
border-radius: 6px;
|
|
|
padding: 6px;
|
|
|
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
|
|
|
transition: none;
|
|
|
}
|
|
|
.MLK__variant-panel.is-visible {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.MLK__variant-panel.compact {
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
|
|
|
}
|
|
|
.MLK__variant-panel .item {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
font-size: var(--_variant-keycap-font-size);
|
|
|
height: var(--_variant-keycap-length);
|
|
|
width: var(--_variant-keycap-length);
|
|
|
margin: 0;
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 5px;
|
|
|
border: 1px solid transparent;
|
|
|
background: transparent;
|
|
|
pointer-events: all;
|
|
|
cursor: pointer;
|
|
|
color: var(--_variant-keycap-text);
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
@media (max-height: 412px) {
|
|
|
.MLK__variant-panel .item {
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
}
|
|
|
}
|
|
|
.MLK__variant-panel .item .ML__latex {
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.MLK__variant-panel .item.is-active {
|
|
|
background: var(--_variant-keycap-background-active);
|
|
|
color: var(--_variant-keycap-text-active);
|
|
|
}
|
|
|
.MLK__variant-panel .item.is-pressed {
|
|
|
background: var(--_variant-keycap-background-pressed);
|
|
|
color: var(--_variant-keycap-text-pressed);
|
|
|
}
|
|
|
.MLK__variant-panel .item.small {
|
|
|
font-size: var(--_keycap-small-font-size);
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button {
|
|
|
box-sizing: border-box;
|
|
|
background: #fbfbfb;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button > span {
|
|
|
display: inline-block;
|
|
|
margin: 6px;
|
|
|
width: calc(100% - 12px);
|
|
|
height: calc(100% - 12px);
|
|
|
border-radius: 50%;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button:hover {
|
|
|
background: #f0f0f0;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button:hover > span {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.MLK__variant-panel .item.box > div,
|
|
|
.MLK__variant-panel .item.box > span {
|
|
|
border: 1px dashed rgba(0, 0, 0, 0.24);
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning {
|
|
|
min-height: 60px;
|
|
|
min-width: 60px;
|
|
|
background: #cd0030;
|
|
|
color: white;
|
|
|
padding: 5px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
border-radius: 5px;
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning.is-pressed,
|
|
|
.MLK__variant-panel .item .warning.is-active {
|
|
|
background: red;
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning svg.svg-glyph {
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
|
}
|
|
|
.MLK__variant-panel .item aside {
|
|
|
font-size: var(--_variant-keycap-aside-font-size);
|
|
|
line-height: 12px;
|
|
|
opacity: 0.78;
|
|
|
padding-top: 2px;
|
|
|
}
|
|
|
.MLK__keycap {
|
|
|
position: relative;
|
|
|
}
|
|
|
.MLK__shift {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
right: 4px;
|
|
|
top: 4px;
|
|
|
font-size: var(--_keycap-shift-font-size);
|
|
|
color: var(--_keycap-shift-color);
|
|
|
}
|
|
|
.hide-shift .MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
@media (max-width: 414px) {
|
|
|
.MLK__variant-panel {
|
|
|
max-width: 350px;
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
}
|
|
|
}
|
|
|
/* @xs breakpoint: iPhone 5 */
|
|
|
@container (max-width: 414px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
|
|
|
--_keycap-height: max(var(--_keycap-height), 42px);
|
|
|
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
font-size: 100%;
|
|
|
margin-left: 2px;
|
|
|
margin-right: 2px;
|
|
|
}
|
|
|
.MLK__rows .shift,
|
|
|
.MLK__rows .action {
|
|
|
font-size: 65%;
|
|
|
}
|
|
|
.MLK__rows .warning svg.svg-glyph {
|
|
|
width: 14px;
|
|
|
height: 14px;
|
|
|
min-height: 14px;
|
|
|
}
|
|
|
}
|
|
|
@container (max-width: 744px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
|
|
|
--_keycap-height: max(var(--keycap-height, 52px), 52px);
|
|
|
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
padding-left: 0;
|
|
|
padding-right: 0;
|
|
|
}
|
|
|
.MLK__tooltip::after {
|
|
|
padding: 8px 16px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.fnbutton {
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.bigfnbutton {
|
|
|
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.small {
|
|
|
font-size: 13px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > aside {
|
|
|
display: none;
|
|
|
}
|
|
|
.MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
/* Medium breakpoint: larger phones */
|
|
|
@container (max-width: 768px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-height: max(var(--keycap-height, 42px), 42px);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > small {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
@media (max-height: 768px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-height: max(var(--keycap-height, 42px), 42px);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > small {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
@container (max-width: 1444px) {
|
|
|
.MLK__rows .if-wide {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
.ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
|
|
|
--_background: var(--keyboard-background, #151515);
|
|
|
--_border: var(--keyboard-border, transparent);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
|
|
|
--keyboard-toolbar-background-hover: #303030;
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
|
|
|
--_keycap-background: var(--keycap-background, #1f2022);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
|
|
|
--_keycap-border: var(--_keycap-border, transparent);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
|
|
|
--_keycap-text: var(--keycap-text, #e3e4e8);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
|
|
|
--keycap-secondary-border: transparent;
|
|
|
--keycap-secondary-border-bottom: transparent;
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #303030);
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
|
|
|
}
|
|
|
}
|
|
|
/* Same as the media query, but with a class */
|
|
|
[theme='dark'] .ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
|
|
|
--_background: var(--keyboard-background, #151515);
|
|
|
--_border: var(--keyboard-border, transparent);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
|
|
|
--keyboard-toolbar-background-hover: #303030;
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
|
|
|
--_keycap-background: var(--keycap-background, #1f2022);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
|
|
|
--_keycap-border: var(--_keycap-border, transparent);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
|
|
|
--_keycap-text: var(--keycap-text, #e3e4e8);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
|
|
|
--keycap-secondary-border: transparent;
|
|
|
--keycap-secondary-border-bottom: transparent;
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #303030);
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
|
|
|
}
|
|
|
[theme='light'] .ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0c75d8);
|
|
|
--_background: var(--keyboard-background, #cacfd7);
|
|
|
--_border: var(--keyboard-border, #ddd);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
|
|
|
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
|
|
|
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
|
|
|
--_keycap-background: var(--keycap-background, white);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
|
|
|
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
|
|
|
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
|
|
|
--_keycap-border: var(--_keycap-border, #e5e6e9);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
|
|
|
--_keycap-text: var(--keycap-text, #000);
|
|
|
--_keycap-text-active: var(--keycap-text-active, #fff);
|
|
|
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
|
|
|
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
|
|
|
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #fff);
|
|
|
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
|
|
|
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
|
|
|
}
|
|
|
`,R0=`:host {
|
|
|
--primary-color: #5898ff;
|
|
|
--primary-color-dimmed: #c0c0f0;
|
|
|
--primary-color-dark: var(--blue-500);
|
|
|
--primary-color-light: var(--blue-100);
|
|
|
--primary-color-reverse: #ffffff;
|
|
|
--secondary-color: #ff8a65;
|
|
|
--secondary-color-dimmed: #f0d5c5;
|
|
|
--secondary-color-dark: var(--orange-500);
|
|
|
--secondary-color-light: var(--orange-100);
|
|
|
--secondary-color-reverse: #ffffff;
|
|
|
--link-color: #5898ff;
|
|
|
--link-color-dimmed: #c5c5c5;
|
|
|
--link-color-dark: #121212;
|
|
|
--link-color-light: #e2e2e2;
|
|
|
--link-color-reverse: #ffffff;
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--neutral-100: #f5f5f5;
|
|
|
--neutral-200: #eeeeee;
|
|
|
--neutral-300: #e0e0e0;
|
|
|
--neutral-400: #bdbdbd;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #757575;
|
|
|
--neutral-700: #616161;
|
|
|
--neutral-800: #424242;
|
|
|
--neutral-900: #212121;
|
|
|
--red-25: #fff8f7;
|
|
|
--red-50: #fff1ef;
|
|
|
--red-100: #ffeae6;
|
|
|
--red-200: #ffcac1;
|
|
|
--red-300: #ffa495;
|
|
|
--red-400: #ff7865;
|
|
|
--red-500: #f21c0d;
|
|
|
--red-600: #e50018;
|
|
|
--red-700: #d30024;
|
|
|
--red-800: #bd002c;
|
|
|
--red-900: #a1002f;
|
|
|
--orange-25: #fffbf8;
|
|
|
--orange-50: #fff7f1;
|
|
|
--orange-100: #fff3ea;
|
|
|
--orange-200: #ffe1c9;
|
|
|
--orange-300: #ffcca2;
|
|
|
--orange-400: #ffb677;
|
|
|
--orange-500: #fe9310;
|
|
|
--orange-600: #f58700;
|
|
|
--orange-700: #ea7c00;
|
|
|
--orange-800: #dc6d00;
|
|
|
--orange-900: #ca5b00;
|
|
|
--brown-25: #fff8ef;
|
|
|
--brown-50: #fff1df;
|
|
|
--brown-100: #ffe9ce;
|
|
|
--brown-200: #ebcca6;
|
|
|
--brown-300: #cdaf8a;
|
|
|
--brown-400: #af936f;
|
|
|
--brown-500: #856a47;
|
|
|
--brown-600: #7f5e34;
|
|
|
--brown-700: #78511f;
|
|
|
--brown-800: #6e4200;
|
|
|
--brown-900: #593200;
|
|
|
--yellow-25: #fffdf9;
|
|
|
--yellow-50: #fffcf2;
|
|
|
--yellow-100: #fffaec;
|
|
|
--yellow-200: #fff2ce;
|
|
|
--yellow-300: #ffe8ab;
|
|
|
--yellow-400: #ffdf85;
|
|
|
--yellow-500: #ffcf33;
|
|
|
--yellow-600: #f1c000;
|
|
|
--yellow-700: #dfb200;
|
|
|
--yellow-800: #c9a000;
|
|
|
--yellow-900: #ad8a00;
|
|
|
--lime-25: #f4ffee;
|
|
|
--lime-50: #e9ffdd;
|
|
|
--lime-100: #ddffca;
|
|
|
--lime-200: #a8fb6f;
|
|
|
--lime-300: #94e659;
|
|
|
--lime-400: #80d142;
|
|
|
--lime-500: #63b215;
|
|
|
--lime-600: #45a000;
|
|
|
--lime-700: #268e00;
|
|
|
--lime-800: #007417;
|
|
|
--lime-900: #005321;
|
|
|
--green-25: #f5fff5;
|
|
|
--green-50: #ebffea;
|
|
|
--green-100: #e0ffdf;
|
|
|
--green-200: #a7ffa7;
|
|
|
--green-300: #5afa65;
|
|
|
--green-400: #45e953;
|
|
|
--green-500: #17cf36;
|
|
|
--green-600: #00b944;
|
|
|
--green-700: #00a34a;
|
|
|
--green-800: #008749;
|
|
|
--green-900: #00653e;
|
|
|
--teal-25: #f3ffff;
|
|
|
--teal-50: #e6fffe;
|
|
|
--teal-100: #d9fffe;
|
|
|
--teal-200: #8dfffe;
|
|
|
--teal-300: #57f4f4;
|
|
|
--teal-400: #43e5e5;
|
|
|
--teal-500: #17cfcf;
|
|
|
--teal-600: #00c2c0;
|
|
|
--teal-700: #00b5b1;
|
|
|
--teal-800: #00a49e;
|
|
|
--teal-900: #009087;
|
|
|
--cyan-25: #f7fcff;
|
|
|
--cyan-50: #eff8ff;
|
|
|
--cyan-100: #e7f5ff;
|
|
|
--cyan-200: #c2e6ff;
|
|
|
--cyan-300: #95d5ff;
|
|
|
--cyan-400: #61c4ff;
|
|
|
--cyan-500: #13a7ec;
|
|
|
--cyan-600: #069eda;
|
|
|
--cyan-700: #0095c9;
|
|
|
--cyan-800: #0088b2;
|
|
|
--cyan-900: #0a7897;
|
|
|
--blue-25: #f7faff;
|
|
|
--blue-50: #eef5ff;
|
|
|
--blue-100: #e5f1ff;
|
|
|
--blue-200: #bfdbff;
|
|
|
--blue-300: #92c2ff;
|
|
|
--blue-400: #63a8ff;
|
|
|
--blue-500: #0d80f2;
|
|
|
--blue-600: #0077db;
|
|
|
--blue-700: #006dc4;
|
|
|
--blue-800: #0060a7;
|
|
|
--blue-900: #005086;
|
|
|
--indigo-25: #f8f7ff;
|
|
|
--indigo-50: #f1efff;
|
|
|
--indigo-100: #eae7ff;
|
|
|
--indigo-200: #ccc3ff;
|
|
|
--indigo-300: #ac99ff;
|
|
|
--indigo-400: #916aff;
|
|
|
--indigo-500: #63c;
|
|
|
--indigo-600: #5a21b2;
|
|
|
--indigo-700: #4e0b99;
|
|
|
--indigo-800: #3b0071;
|
|
|
--indigo-900: #220040;
|
|
|
--purple-25: #fbf7ff;
|
|
|
--purple-50: #f8f0ff;
|
|
|
--purple-100: #f4e8ff;
|
|
|
--purple-200: #e4c4ff;
|
|
|
--purple-300: #d49aff;
|
|
|
--purple-400: #c36aff;
|
|
|
--purple-500: #a219e6;
|
|
|
--purple-600: #9000c4;
|
|
|
--purple-700: #7c009f;
|
|
|
--purple-800: #600073;
|
|
|
--purple-900: #3d0043;
|
|
|
--magenta-25: #fff8fb;
|
|
|
--magenta-50: #fff2f6;
|
|
|
--magenta-100: #ffebf2;
|
|
|
--magenta-200: #ffcddf;
|
|
|
--magenta-300: #ffa8cb;
|
|
|
--magenta-400: #ff7fb7;
|
|
|
--magenta-500: #eb4799;
|
|
|
--magenta-600: #da3689;
|
|
|
--magenta-700: #c82179;
|
|
|
--magenta-800: #b00065;
|
|
|
--magenta-900: #8a004c;
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--semantic-bg-blue: var(--blue-25);
|
|
|
--semantic-bg-red: var(--red-25);
|
|
|
--semantic-bg-orange: var(--orange-25);
|
|
|
--semantic-bg-green: var(--green-25);
|
|
|
--neutral-100: #121212;
|
|
|
--neutral-200: #424242;
|
|
|
--neutral-300: #616161;
|
|
|
--neutral-400: #757575;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #bdbdbd;
|
|
|
--neutral-700: #e0e0e0;
|
|
|
--neutral-800: #eeeeee;
|
|
|
--neutral-900: #f5f5f5;
|
|
|
}
|
|
|
}
|
|
|
:host([theme='dark']) {
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--semantic-bg-blue: var(--blue-25);
|
|
|
--semantic-bg-red: var(--red-25);
|
|
|
--semantic-bg-orange: var(--orange-25);
|
|
|
--semantic-bg-green: var(--green-25);
|
|
|
--neutral-100: #121212;
|
|
|
--neutral-200: #424242;
|
|
|
--neutral-300: #616161;
|
|
|
--neutral-400: #757575;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #bdbdbd;
|
|
|
--neutral-700: #e0e0e0;
|
|
|
--neutral-800: #eeeeee;
|
|
|
--neutral-900: #f5f5f5;
|
|
|
}
|
|
|
/* @media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--label-color: #fff;
|
|
|
--active-label-color: #000;
|
|
|
--menu-bg: #525252;
|
|
|
--active-bg: #5898ff;
|
|
|
--active-bg-dimmed: #5c5c5c;
|
|
|
}
|
|
|
} */
|
|
|
:host {
|
|
|
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
|
|
|
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
|
|
|
'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
|
--ui-font-size: 14px;
|
|
|
--ui-line-height: 1.5;
|
|
|
--ui-letter-spacing: 0.007em;
|
|
|
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
|
|
|
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
|
|
|
--ui-layer-1: var(--neutral-100);
|
|
|
--ui-layer-2: var(--neutral-200);
|
|
|
--ui-layer-3: var(--neutral-300);
|
|
|
--ui-layer-4: var(--neutral-400);
|
|
|
--ui-layer-5: var(--neutral-500);
|
|
|
--ui-layer-6: var(--neutral-600);
|
|
|
--ui-border-color: var(--primary-color);
|
|
|
--ui-border-radius: 4px;
|
|
|
--ui-text: var(--neutral-900);
|
|
|
--ui-text-secondary: var(--neutral-700);
|
|
|
--ui-text-placeholder: var(--neutral-500);
|
|
|
--ui-text-muted: var(--neutral-300);
|
|
|
/** A field is a UI element in which a user can type data, for
|
|
|
* example an input or textarea element.
|
|
|
*/
|
|
|
--ui-field-bg: var(--neutral-100);
|
|
|
--ui-field-bg-hover: var(--neutral-100);
|
|
|
--ui-field-bg-disabled: var(--neutral-300);
|
|
|
--ui-field-bg-invalid: var(--red-100);
|
|
|
--ui-field-bg-focus: var(--neutral-100);
|
|
|
--ui-field-border: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-hover: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-disabled: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-invalid: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-focus: 0.5px solid var(--border-color);
|
|
|
--ui-menu-bg: var(--neutral-100);
|
|
|
--ui-menu-text: var(--neutral-900);
|
|
|
--ui-menu-bg-hover: var(--neutral-200);
|
|
|
--ui-menu-text-hover: var(--neutral-900);
|
|
|
/** The \`active\` state is used for the state of menu items
|
|
|
* when they are selected.
|
|
|
*/
|
|
|
--ui-menu-bg-active: var(--primary-color);
|
|
|
--ui-menu-text-active: var(--primary-color-reverse);
|
|
|
/** The \`active-muted\` set is used for the state of
|
|
|
* submenus when they are open.
|
|
|
*/
|
|
|
--ui-menu-bg-active-muted: var(--neutral-300);
|
|
|
--ui-menu-text-active-muted: var(--neutral-900);
|
|
|
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
|
|
|
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
|
|
|
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
|
|
|
--ui-menu-divider: 0.5px solid #c7c7c7;
|
|
|
/* var(--neutral-300); */
|
|
|
--ui-menu-z-index: 10000;
|
|
|
--page-bg: var(--neutral-100);
|
|
|
--content-bg: var(--neutral-200);
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--ui-menu-bg: var(--neutral-200);
|
|
|
}
|
|
|
}
|
|
|
:host([theme='dark']) {
|
|
|
--ui-menu-bg: var(--neutral-200);
|
|
|
}
|
|
|
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
|
|
|
Noto is a Linux/Android font.
|
|
|
*/
|
|
|
:lang(zh-cn),
|
|
|
:lang(zh-sg),
|
|
|
:lang(zh-my),
|
|
|
:lang(zh) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
|
|
|
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
|
|
|
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
|
|
|
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
|
|
|
}
|
|
|
:lang(zh-tw),
|
|
|
:lang(zh-hk),
|
|
|
:lang(zh-mo) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
|
|
|
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
|
|
|
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
|
|
|
}
|
|
|
:lang(ja),
|
|
|
:lang(ja-jp),
|
|
|
:lang(ja-jp-mac) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
|
|
|
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
|
|
|
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
|
|
|
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
|
|
|
}
|
|
|
:lang(ko),
|
|
|
:lang(ko-kr),
|
|
|
:lang(ko-kr-std) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
|
|
|
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
|
|
|
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
|
|
|
}
|
|
|
:lang(ko-kr-apple) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
|
|
|
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
|
|
|
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
|
|
|
}
|
|
|
:lang(zh-cn),
|
|
|
:lang(zh-sg),
|
|
|
:lang(zh-my),
|
|
|
:lang(zh),
|
|
|
:lang(zh-tw),
|
|
|
:lang(zh-hk),
|
|
|
:lang(zh-mo),
|
|
|
:lang(ja),
|
|
|
:lang(ja-jp),
|
|
|
:lang(ja-jp-mac),
|
|
|
:lang(ko),
|
|
|
:lang(ko-kr),
|
|
|
:lang(ko-kr-std),
|
|
|
:lang(ko-kr-apple) {
|
|
|
--ui-font-size: 1rem;
|
|
|
--ui-line-height: 1.7;
|
|
|
--ui-letter-spacing: 0;
|
|
|
}
|
|
|
:dir(rtl) {
|
|
|
--ui-line-height: auto;
|
|
|
--ui-letter-spacing: 0;
|
|
|
}
|
|
|
`,O0=`.ui-menu *,
|
|
|
.ui-menu ::before,
|
|
|
.ui-menu ::after {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ui-menu {
|
|
|
display: none;
|
|
|
color-scheme: light dark;
|
|
|
-webkit-user-select: none;
|
|
|
/* Important: Safari iOS doesn't respect user-select */
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
-webkit-touch-callout: none;
|
|
|
-webkit-tap-highlight-color: rgba(0 0 0 0);
|
|
|
--active-label-color: #fff;
|
|
|
/* ui-menu-text-active */
|
|
|
--label-color: #121212;
|
|
|
/* ui-menu-text */
|
|
|
--menu-bg: #e2e2e2;
|
|
|
/* ui-menu-background */
|
|
|
--active-bg: #5898ff;
|
|
|
/* ui-menu-background-active */
|
|
|
--active-bg-dimmed: #c5c5c5;
|
|
|
/* ui-menu-background-active-muted */
|
|
|
}
|
|
|
/** Use the :where pseudo selector to make the specificity of the
|
|
|
* selector 0, so that it can be overridden by the user.
|
|
|
*/
|
|
|
:where(.ui-menu-container) {
|
|
|
position: absolute;
|
|
|
overflow: visible;
|
|
|
width: auto;
|
|
|
height: auto;
|
|
|
z-index: 10000;
|
|
|
border-radius: 8px;
|
|
|
background: var(--ui-menu-bg);
|
|
|
box-shadow: var(--ui-menu-shadow);
|
|
|
list-style: none;
|
|
|
padding: 6px 0 6px 0;
|
|
|
margin: 0;
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
color: var(--ui-menu-text);
|
|
|
font-weight: normal;
|
|
|
font-style: normal;
|
|
|
text-shadow: none;
|
|
|
text-transform: none;
|
|
|
letter-spacing: 0;
|
|
|
outline: none;
|
|
|
opacity: 1;
|
|
|
/* The [popover] elements have a 1px solid black border. Ugh. */
|
|
|
border: none;
|
|
|
width: fit-content;
|
|
|
height: fit-content;
|
|
|
}
|
|
|
:where(.ui-menu-container > li) {
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
align-items: center;
|
|
|
padding: 1px 7px 1px 7px;
|
|
|
margin-top: 0;
|
|
|
margin-left: 6px;
|
|
|
margin-right: 6px;
|
|
|
border-radius: 4px;
|
|
|
white-space: nowrap;
|
|
|
position: relative;
|
|
|
outline: none;
|
|
|
fill: currentColor;
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
text-align: left;
|
|
|
color: inherit;
|
|
|
font-family: var(--ui-font-family);
|
|
|
font-size: var(--ui-font-size);
|
|
|
line-height: var(--ui-line-height);
|
|
|
letter-spacing: var(--ui-letter-spacing);
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label) {
|
|
|
appearance: none;
|
|
|
background: none;
|
|
|
outline: none;
|
|
|
width: 100%;
|
|
|
margin: 0;
|
|
|
padding: 1px 2px 1px 1px;
|
|
|
overflow: visible;
|
|
|
border: 1px solid transparent;
|
|
|
white-space: nowrap;
|
|
|
text-align: start;
|
|
|
}
|
|
|
:where(.ui-menu-container > li:has(.heading)) {
|
|
|
margin-top: 0.5em;
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label.heading) {
|
|
|
font-weight: bold;
|
|
|
opacity: 0.4;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.indent > .label) {
|
|
|
margin-inline-start: 12px;
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label.indent) {
|
|
|
margin-inline-start: 12px;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[role='divider']) {
|
|
|
border-bottom: 1px solid var(--ui-menu-divider);
|
|
|
border-radius: 0;
|
|
|
padding: 0;
|
|
|
margin-left: 15px;
|
|
|
margin-right: 15px;
|
|
|
padding-top: 5px;
|
|
|
margin-bottom: 5px;
|
|
|
width: calc(100% - 30px);
|
|
|
/** 100% - (margin-left + margin-right) */
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-disabled='true']) {
|
|
|
opacity: 0.5;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active) {
|
|
|
background: var(--ui-menu-bg-active);
|
|
|
background: -apple-system-control-accent;
|
|
|
color: var(--ui-menu-text-active);
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active.is-submenu-open) {
|
|
|
background: var(--ui-menu-bg-active-muted);
|
|
|
color: inherit;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
|
|
|
padding-inline-end: 0;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
|
|
|
color: var(--ui-menu-text-active);
|
|
|
}
|
|
|
/** Keyboard shortcut */
|
|
|
:where(.ui-menu-container > li > kbd) {
|
|
|
font-family: var(--ui-font-family);
|
|
|
margin-inline-start: 12px;
|
|
|
opacity: 0.4;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active > kbd) {
|
|
|
opacity: 0.85;
|
|
|
}
|
|
|
.ui-trailing-chevron {
|
|
|
display: flex;
|
|
|
margin-inline-start: 24px;
|
|
|
width: 10px;
|
|
|
height: 10px;
|
|
|
margin-bottom: 4px;
|
|
|
}
|
|
|
.ui-trailing-chevron:dir(rtl) {
|
|
|
transform: scaleX(-1);
|
|
|
}
|
|
|
.ui-checkmark {
|
|
|
display: flex;
|
|
|
margin-inline-end: -11px;
|
|
|
margin-inline-start: -4px;
|
|
|
margin-top: 2px;
|
|
|
width: 16px;
|
|
|
height: 16px;
|
|
|
}
|
|
|
.ui-mixedmark {
|
|
|
display: flex;
|
|
|
margin-inline-end: -11px;
|
|
|
margin-inline-start: -4px;
|
|
|
margin-top: 2px;
|
|
|
width: 16px;
|
|
|
height: 16px;
|
|
|
}
|
|
|
`,Eo;function es(e){let t="";switch(e){case"mathfield-element":t=`
|
|
|
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
|
|
|
:host([hidden]) { display: none; }
|
|
|
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
|
|
|
:host(:focus), :host(:focus-within) {
|
|
|
outline: Highlight auto 1px; /* For Firefox */
|
|
|
outline: -webkit-focus-ring-color auto 1px;
|
|
|
}
|
|
|
:host([readonly]:focus), :host([readonly]:focus-within),
|
|
|
:host([read-only]:focus), :host([read-only]:focus-within) {
|
|
|
outline: none;
|
|
|
}
|
|
|
@media (hover: none) and (pointer: coarse) {
|
|
|
:host(:not(:focus)) :first-child { pointer-events: none !important; }
|
|
|
}`;break;case"core":t=zl;break;case"mathfield":t=vd;break;case"environment-popover":t=Kl;break;case"suggestion-popover":t=P0;break;case"keystroke-caption":t=Gc;break;case"virtual-keyboard":t=bd;break;case"ui":t=R0;break;case"menu":t=O0;break;default:debugger}return t}function ko(e){return Eo||(Eo={}),Eo[e]||(Eo[e]=new CSSStyleSheet,Eo[e].replaceSync(es(e))),Eo[e]}var to;function Ha(e){var t;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${e}`))return;const r=window.document.createElement("style");r.id=`mathlive-style-${e}`,r.append(window.document.createTextNode(es(e))),window.document.head.appendChild(r);return}if(to||(to={}),((t=to[e])!=null?t:0)!==0)to[e]+=1;else{const r=ko(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,r],to[e]=1}}function ro(e){if("adoptedStyleSheets"in document&&to!=null&&to[e]&&(to[e]-=1,to[e]<=0)){const t=Eo[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==t)}}var Hl=class rh extends we{constructor(t){var r;super(v(_({},t),{type:"accent",body:(r=t.body)!=null?r:void 0})),t.accentChar?this.accent=t.accentChar:this.svgAccent=t==null?void 0:t.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(t){return new rh(t)}toJson(){return v(_({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(t){var r;const n=new Er({parent:t,mathstyle:"cramp"},this.style),i=(r=we.createBox(n,this.body))!=null?r:new je("\u25A2",{style:this.style});let a=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(a=i.skew);let s=Math.min(i.height,po),u;if(this.svgAccent)u=Pl(this.svgAccent),s=n.metrics.bigOpSpacing1-s;else if(this.accent){const p=new je(this.accent,{fontFamily:"Main-Regular"});p.italic=0;const h=this.accent===8407?" ML__accent-vec":"";u=new je(new je(p),{classes:"ML__accent-body"+h})}u=new ti({shift:0,children:[{box:new je(i)},-s,{box:u,marginLeft:i.left+2*a,classes:["ML__center"]}]});const d=new je(u,{type:"lift"});return this.caret&&(d.caret=this.caret),this.bind(n,d.wrap(n)),this.attachSupsub(n,{base:d})}},Wl={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},Vl=Object.fromEntries(Object.entries(Wl).map(([e,t])=>[t,e]));function Ul(e){var t;return(t={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[e])!=null?t:e.codePointAt(0)}function N0(e,t,r,n){var i;const s=new je(Ul(e),{fontFamily:"Main-Regular",isSelected:n.isSelected,classes:"ML__small-delim "+((i=n.classes)!=null?i:"")}).wrap(t);return r&&s.setTop((1-t.scalingFactor)*Vn),s}function qc(e,t,r,n,i){var a,s;const u=new Er({parent:n,mathstyle:"textstyle"},i==null?void 0:i.style),d=new je(Ul(e),{fontFamily:`Size${t}-Regular`,isSelected:i.isSelected,classes:((a=i.classes)!=null?a:"")+` ML__delim-size${t}`,type:(s=i.type)!=null?s:"ignore"}).wrap(u);return r&&d.setTop((1-u.scalingFactor)*Vn),d}function yd(e,t,r,n,i){var a;let s,u,d,p;s=d=p=Ul(e),u=null;let h="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?d=s=p=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?d=s=p=8741:e==="\\uparrow"?d=p=9168:e==="\\Uparrow"?d=p=8214:e==="\\downarrow"?s=d=9168:e==="\\Downarrow"?s=d=8214:e==="\\updownarrow"?(s=8593,d=9168,p=8595):e==="\\Updownarrow"?(s=8657,d=8214,p=8659):e==="["||e==="\\lbrack"?(s=9121,d=9122,p=9123,h="Size4-Regular"):e==="]"||e==="\\rbrack"?(s=9124,d=9125,p=9126,h="Size4-Regular"):e==="\\lfloor"||e==="\u230A"?(d=s=9122,p=9123,h="Size4-Regular"):e==="\\lceil"||e==="\u2308"?(s=9121,d=p=9122,h="Size4-Regular"):e==="\\rfloor"||e==="\u230B"?(d=s=9125,p=9126,h="Size4-Regular"):e==="\\rceil"||e==="\u2309"?(s=9124,d=p=9125,h="Size4-Regular"):e==="("||e==="\\lparen"?(s=9115,d=9116,p=9117,h="Size4-Regular"):e===")"||e==="\\rparen"?(s=9118,d=9119,p=9120,h="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(s=9127,u=9128,p=9129,d=9130,h="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(s=9131,u=9132,p=9133,d=9130,h="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(s=9127,p=9129,d=9130,h="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(s=9131,p=9133,d=9130,h="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(s=9127,p=9133,d=9130,h="Size4-Regular"):e==="\\rmoustache"||e==="\u23B1"?(s=9131,p=9129,d=9130,h="Size4-Regular"):e==="\\surd"?(s=57345,p=9143,d=57344,h="Size4-Regular"):e==="\\ulcorner"?(s=9484,d=p=32):e==="\\urcorner"?(s=9488,d=p=32):e==="\\llcorner"?(p=9492,d=s=32):e==="\\lrcorner"&&(s=9496,d=s=32);const S=vs(s,h),D=S.height+S.depth,P=vs(d,h),O=P.height+P.depth,de=vs(p,h),Ve=de.height+de.depth;let se=0,ke=1;if(u!==null){const ki=vs(u,h);se=ki.height+ki.depth,ke=2}const Xe=D+Ve+se,$e=Math.max(0,Math.ceil((t-Xe)/(ke*O))),St=Xe+$e*ke*O;let Kt=Vn;r&&(Kt=Kt*n.scalingFactor);const Tt=St/2-Kt,kr=.008,en=[];en.push({box:new je(p,{fontFamily:h})}),en.push(-kr);const it=new je(d,{fontFamily:h});if(u===null)for(let ki=0;ki<$e;ki++)en.push({box:it});else{for(let ki=0;ki<$e;ki++)en.push({box:it});en.push(-kr),en.push({box:new je(u,{fontFamily:h})}),en.push(-kr);for(let ki=0;ki<$e;ki++)en.push({box:it})}en.push(-kr),en.push({box:new je(s,{fontFamily:h})});let ja="";h==="Size1-Regular"?ja=" delim-size1":h==="Size4-Regular"&&(ja=" delim-size4");const Oo=new ti({bottom:Tt,children:en},{classes:ja});return new je(Oo,v(_({},i!=null?i:{}),{classes:((a=i==null?void 0:i.classes)!=null?a:"")+" ML__delim-mult"}))}var xd=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),F0=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),wd=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),z0=[0,1.2,1.8,2.4,3];function K0(e,t,r,n){return e===void 0||e==="."?Ao(r,n.classes):(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),xd.has(e)||wd.has(e)?qc(e,t,!1,r,n):F0.has(e)?yd(e,z0[t],!1,r,n):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}var H0=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],W0=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],V0=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function U0(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(console.assert(e.type==="stack"),"Size4-Regular")}function Z0(e,t,r,n){const i={"-4":0,"-3":1,0:2}[n.mathstyle.sizeDelta];for(let a=i;a<r.length&&r[a].type!=="stack";a++){const s=vs(e,U0(r[a]));if(s.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let u=s.height+s.depth;if(r[a].type==="small"&&(r[a].mathstyle==="scriptscriptstyle"?u*=Math.max(El[Math.max(1,n.size-2)],n.minFontScale):r[a].mathstyle==="scriptstyle"&&(u*=Math.max(El[Math.max(1,n.size-1)],n.minFontScale))),u>t)return r[a]}return r[r.length-1]}function Zl(e,t,r,n,i,a){if(!t||t.length===0||t===".")return Ao(i);t==="<"||t==="\\lt"?t="\\langle":(t===">"||t==="\\gt")&&(t="\\rangle");let s;wd.has(t)?s=H0:xd.has(t)?s=V0:s=W0;const u=Z0(Ul(t),r,s,i),d=new Er({parent:i,mathstyle:u.mathstyle},a==null?void 0:a.style);return u.type==="small"?N0(t,d,n,v(_({},a),{type:e})):u.type==="large"?qc(t,u.size,n,d,v(_({},a),{type:e})):(console.assert(u.type==="stack"),yd(t,r,n,d,v(_({},a),{type:e})))}function ys(e,t,r,n,i,a){if(t===".")return Ao(i,a==null?void 0:a.classes);const s=Vn*i.scalingFactor,u=901,d=5/gs,p=Math.max(r-s,n+s),h=Math.max(p/500*u,2*p-d);return Zl(e,t,h,!0,i,a)}function Ao(e,t){const r=new je(null,{classes:" nulldelimiter "+(t!=null?t:""),type:"ignore"});return r.width=e.getRegisterAsEm("nulldelimiterspace"),r.wrap(new Er({parent:e,mathstyle:"textstyle"}))}var ho=class nh extends we{constructor(t){var r;super({type:"placeholder",command:"\\placeholder",mode:(r=t==null?void 0:t.mode)!=null?r:"math",style:t==null?void 0:t.style}),this.captureSelection=!0}static fromJson(t){return new nh(t)}toJson(){return super.toJson()}render(t){let r;return this.value=t.placeholderSymbol,typeof t.renderPlaceholder=="function"?r=t.renderPlaceholder(t):r=this.createBox(t),this.caret&&(r.classes+=" ML__placeholder-selected"),r}_serialize(t){return t.skipPlaceholders?"":"\\placeholder{}"}},Sd=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],_d=["cases","dcases","rcases"],Xc=["align","align*","aligned","gather","gathered","split"],j0=["array","subequations","eqnarray"];function G0(e){return j0.concat(Xc).concat(_d).concat(Sd).includes(e)}function Md(e){return Sd.includes(e)}function q0(e){return _d.includes(e)}function X0(e){return Xc.includes(e)}function Cd(e,t,r){let n=0;for(const p of r)"align"in p&&(n+=1);let i=0;const a=[];for(const p of t){let h=0;for(i=Math.max(i,Math.min(p.length,n));h<p.length;){const S=[],D=Math.min(p.length,h+n);for(;h<D;){const P=p[h];P.length===0?S.push([new we({type:"first",mode:e.mode})]):P[0].type!=="first"?S.push([new we({type:"first",mode:e.mode}),...P]):(console.assert(!P.slice(1).some(O=>O.type==="first")),S.push(P)),h+=1}a.push(S)}}a.length>0&&a[a.length-1].length===1&&a[a.length-1][0].length===1&&a[a.length-1][0][0].type==="first"&&a.pop();const s=[];for(const p of a){if(p.length!==i)for(let h=p.length;h<i;h++)p.push([new we({type:"first",mode:e.mode}),new ho]);s.push(p)}let u=0,d=0;for(const p of s){d=0;for(const h of p){for(const S of h)S.parent=e,S.parentBranch=[u,d];d+=1}u+=1}return e.isDirty=!0,s}var qr=class ih extends we{constructor(t,r,n,i={}){var a;super({type:"array"}),this.environmentName=t,this.rowGaps=n,i.mathstyleName&&(this.mathstyleName=i.mathstyleName),i.columns&&(i.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=i.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=Cd(this,r,this.colFormat),i.leftDelim&&(this.leftDelim=i.leftDelim),i.rightDelim&&(this.rightDelim=i.rightDelim),i.arraycolsep!==void 0&&(this.arraycolsep=i.arraycolsep),this.colSeparationType=i.colSeparationType,i.arraystretch!==void 0&&(this.arraystretch=i.arraystretch),this.minColumns=(a=i.minColumns)!=null?a:1}static fromJson(t){return new ih(t.environmentName,t.array,t.rowGaps,t)}toJson(){const t=v(_({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(r=>r.map(n=>n.map(i=>i.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(t.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(t.arraycolsep=this.arraycolsep),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}branch(t){var r;if(Ol(t))return(r=this.array[t[0]][t[1]])!=null?r:void 0}createBranch(t){var r;return Ol(t)?(this.isDirty=!0,(r=this.branch(t))!=null?r:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(t=>!!t.align).length}removeBranch(t){if(So(t))return super.removeBranch(t);const r=this.branch(t);return this.array[t[0]][t[1]]=void 0,r.forEach(n=>{n.parent=void 0,n.parentBranch=void 0}),console.assert(r[0].type==="first"),r.shift(),this.isDirty=!0,r}get hasChildren(){return this.children.length>0}get children(){const t=[];for(const r of this.array)for(const n of r)if(n)for(const i of n)t.push(...i.children),t.push(i);return[...t,...super.children]}render(t){var r,n,i,a,s,u;const d=new Er({parent:t,mathstyle:this.mathstyleName},this.style),p=d.getRegisterAsEm("arrayrulewidth"),h=d.getRegisterAsEm("arraycolsep"),S=d.getRegisterAsEm("doublerulesep"),D=(n=(r=this.arraystretch)!=null?r:d.getRegisterAsNumber("arraystretch"))!=null?n:1;let P=typeof this.arraycolsep=="number"?this.arraycolsep:h;this.colSeparationType==="small"&&(P=.2778*(new Er({parent:t,mathstyle:"scriptstyle"}).scalingFactor/t.scalingFactor));const O=D*Tc,de=.7*O,Ve=.3*O;let se=0;const ke=[];let Xe=0;const $e=this.array.length;for(let un=0;un<$e;++un){const Jn=this.array[un];Xe=Math.max(Xe,Jn.length);const Ai=new Er({parent:d,mathstyle:this.mathstyleName},this.style);let No=de/Ai.scalingFactor,Fo=Ve/Ai.scalingFactor;const zo={cells:[],height:0,depth:0,pos:0};for(const vo of Jn){const Ff=(i=we.createBox(Ai,vo,{type:"ignore"}))!=null?i:new je(null,{type:"ignore"});Fo=Math.max(Fo,Ff.depth),No=Math.max(No,Ff.height),zo.cells.push(Ff)}let Ko=(a=id(this.rowGaps[un]))!=null?a:0;Ko>0&&(Ko+=Ve,Fo=Math.max(Fo,Ko),Ko=0),un<$e-1&&!Md(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Fo+=d.getRegisterAsEm("jot")),zo.height=No,zo.depth=Fo,se+=No,zo.pos=se,se+=Fo+Ko,ke.push(zo)}const St=se/2+Vn,Kt=[];for(let un=0;un<Xe;un++){const Jn=[];for(const Ai of ke){const No=Ai.cells[un];No.depth=Ai.depth,No.height=Ai.height,Jn.push({box:No,shift:Ai.pos-St})}Jn.length>0&&Kt.push(new ti({individualShift:Jn}))}const Tt=[];let kr=!1,en=!1,it=0,ja=!this.leftDelim;const{colFormat:Oo}=this;for(const un of Oo){if("align"in un&&it>=Kt.length)break;if("align"in un)kr?Tt.push(xs(2*P)):(en||ja)&&Tt.push(xs(P)),Tt.push(new je(Kt[it],{classes:"col-align-"+un.align})),it++,kr=!0,en=!1,ja=!1;else if("gap"in un){if(typeof un.gap=="number")Tt.push(xs(un.gap));else{const Jn=Ed(t,ke,St,un.gap);Jn&&Tt.push(Jn)}kr=!1,en=!1,ja=!1}else if("separator"in un){const Jn=new je(null,{classes:"vertical-separator"});Jn.height=se,Jn.setStyle("height",se,"em"),Jn.setStyle("border-right",`${p}em ${un.separator} currentColor`),Jn.setStyle("vertical-align",-(se-St),"em");let Ai=0;en?Ai=S-p:kr&&(Ai=P-p),Jn.left=Ai,Tt.push(Jn),kr=!1,en=!0,ja=!1}}kr&&!this.rightDelim&&Tt.push(xs(P));const oo=new je(Tt,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(oo.caret=this.caret),this.bind(t,oo);const ki=oo.height,Ga=oo.depth,ka=this.bind(t,new je([this.bind(t,ys("open",(s=this.leftDelim)!=null?s:".",ki,Ga,d,{isSelected:this.isSelected})),oo,this.bind(t,ys("close",(u=this.rightDelim)!=null?u:".",ki,Ga,d,{isSelected:this.isSelected}))],{type:"ord"}));return ka?(ka.setStyle("display","inline-block"),this.caret&&(ka.caret=this.caret),this.bind(t,this.attachSupsub(t,{base:ka}))):null}_serialize(t){var r;const n=[];if(this.environmentName==="lines"?n.push("{\\displaylines"):n.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(n.push("{"),this.colFormat!==void 0)for(const i of this.colFormat)"align"in i&&typeof i.align=="string"?n.push(i.align):"separator"in i&&i.separator==="solid"?n.push("|"):"separator"in i&&i.separator==="dashed"&&n.push(":");n.push("}")}for(let i=0;i<this.array.length;i++){for(let a=0;a<this.array[i].length;a++)a>0&&n.push(" & "),n.push(we.serialize(this.array[i][a],t));if(i<this.array.length-1){const a=this.rowGaps[i];a!=null&&a.dimension?n.push(`\\\\[${a.dimension} ${(r=a.unit)!=null?r:"pt"}] `):n.push("\\\\ ")}}return this.environmentName==="lines"?n.push("}"):n.push(`\\end{${this.environmentName}}`),Cr(n)}getCell(t,r){return this.array[t][r]}setCell(t,r,n){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[t][r]!==void 0);for(const a of this.array[t][r])a.parent=void 0,a.parentBranch=void 0;let i=n;(n.length===0||n[0].type!=="first")&&(i=[new we({type:"first",mode:this.mode}),...n]),this.array[t][r]=i;for(const a of i)a.parent=this,a.parentBranch=[t,r];this.isDirty=!0}addRowBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));const r=[];for(let n=0;n<this.colCount;n++)r.push(jl(this));this.array.splice(t,0,r);for(let n=t;n<this.rowCount;n++)for(let i=0;i<this.colCount;i++){const a=this.array[n][i];if(a)for(const s of a)s.parentBranch=[n,i]}this.isDirty=!0}addRowAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));const r=[];for(let n=0;n<this.colCount;n++)r.push(jl(this));this.array.splice(t+1,0,r);for(let n=t+1;n<this.rowCount;n++)for(let i=0;i<this.colCount;i++){const a=this.array[n][i];if(a)for(const s of a)s.parentBranch=[n,i]}this.isDirty=!0}removeRow(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>t);const r=this.array.splice(t,1);for(const n of r)for(const i of n)if(i)for(const a of i)a.parent=void 0,a.parentBranch=void 0;for(let n=t;n<this.rowCount;n++)for(let i=0;i<this.colCount;i++){const a=this.array[n][i];if(a)for(const s of a)s.parentBranch=[n,i]}this.isDirty=!0}addColumnBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const r of this.array)r.splice(t,0,jl(this));for(let r=0;r<this.rowCount;r++)for(let n=t;n<this.colCount;n++){const i=this.array[r][n];if(i)for(const a of i)a.parentBranch=[r,n]}this.isDirty=!0}addColumnAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const r of this.array)r.splice(t+1,0,jl(this));for(let r=0;r<this.rowCount;r++)for(let n=t+1;n<this.colCount;n++){const i=this.array[r][n];if(i)for(const a of i)a.parentBranch=[r,n]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>t);for(const r of this.array){const n=r.splice(t,1);for(const i of n)if(i)for(const a of i)a.parent=void 0,a.parentBranch=void 0}for(let r=0;r<this.rowCount;r++)for(let n=t;n<this.colCount;n++){const i=this.array[r][n];if(i)for(const a of i)a.parentBranch=[r,n]}this.isDirty=!0}get cells(){const t=[];for(const r of this.array)for(const n of r)n&&t.push(n.filter(i=>i.type!=="first"));return t}};function jl(e){const t=new we({type:"first",mode:e.mode});t.parent=e;const r=new ho;return r.parent=e,[t,r]}function xs(e){const t=new je(null,{classes:"arraycolsep"});return t.width=e,t}function Ed(e,t,r,n){if(!n)return null;const i=[];for(const a of t){const s=we.createBox(e,n,{type:"ignore"});s&&(s.depth=a.depth,s.height=a.height,i.push({box:s,shift:a.pos-r}))}return new ti({individualShift:i}).wrap(e)}var Do=class ah extends we{constructor(t){super({mode:t.mode,command:t.command,style:t.style,body:t.body,type:"box"}),this.framecolor=t.framecolor,this.backgroundcolor=t.backgroundcolor,this.padding=t.padding,this.offset=t.offset,this.border=t.border}static fromJson(t){return new ah(t)}toJson(){return v(_({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(t){var r,n,i,a;const s=we.createBox(t,this.body,{type:"lift"});if(!s)return null;const u=t.toEm((r=this.offset)!=null?r:{dimension:0});s.depth+=u,s.setStyle("display","inline-block"),s.setStyle("position","relative"),s.setStyle("height",Math.floor(100*s.height+s.depth)/100,"em"),s.setStyle("vertical-align",-Math.floor(100*s.height)/100,"em");const d=new Er({parent:t},this.style),p=d.toEm((n=this.padding)!=null?n:{register:"fboxsep"}),h=new je(null,{classes:"ML__box"});h.height=s.height+p,h.depth=s.depth+p,h.setStyle("box-sizing","border-box"),h.setStyle("position","absolute"),h.setStyle("top",-p+.3,"em"),h.setStyle("left",0),h.setStyle("height",h.height+h.depth,"em"),h.setStyle("width","100%"),this.backgroundcolor&&h.setStyle("background-color",(i=d.toColor(this.backgroundcolor))!=null?i:"transparent"),this.framecolor&&h.setStyle("border",`${d.getRegisterAsEm("fboxrule",2)}em solid ${(a=d.toColor(this.framecolor))!=null?a:"black"}`),this.border&&h.setStyle("border",this.border);const S=new je([h,s],{type:"lift"});return S.setStyle("display","inline-block"),S.setStyle("position","relative"),S.setStyle("line-height",0),S.height=s.height+p+(u>0?u:0),S.depth=s.depth+p+(u<0?-u:0),S.setStyle("padding-left",p,"em"),S.setStyle("padding-right",p,"em"),S.setStyle("height",Math.floor(100*(s.height+s.depth+2*p+Math.abs(u)))/100,"em"),S.setStyle("margin-top",-p,"em"),S.setStyle("top",Math.floor(100*(s.depth-s.height+2*p-u))/100,"em"),S.setStyle("vertical-align",Math.floor(100*(s.depth+2*p))/100,"em"),this.caret&&(S.caret=this.caret),this.attachSupsub(t,{base:S})}_serialize(t){return t.skipStyles?Cr([this.bodyToLatex(t),this.supsubToLatex(t)]):super._serialize(t)}},kd=class oh extends we{constructor(t,r){var n;super({type:"composition",mode:(n=r==null?void 0:r.mode)!=null?n:"math",value:t})}static fromJson(t){return new oh(t.value,t)}toJson(){return super.toJson()}get computedStyle(){return{}}render(t){const r=new je(this.value,{classes:"ML__composition",type:"composition"});return this.bind(t,r),this.caret&&(r.caret=this.caret),r}_serialize(t){return""}},ts=class sh extends we{constructor(t){super({type:"error",value:t,command:t,mode:"math"}),this.verbatimLatex=t}static fromJson(t){return new sh(t.command)}toJson(){return super.toJson()}render(t){const r=this.createBox(t,{classes:"ML__error"});return this.caret&&(r.caret=this.caret),r}},Ad=class lh extends we{constructor(t,r,n){super({type:"group",mode:r,style:n}),this.body=t,this.boxType=t.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,t&&t.length===1&&t[0].command===","&&(this.captureSelection=!0)}static fromJson(t){return new lh(t.body,t.mode,t.style)}render(t){const r=we.createBox(t,this.body,{type:this.boxType});return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=or(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):`{${this.bodyToLatex(t)}}`}},Cn=class ch extends we{constructor(t,r,n){super({type:"leftright",style:n.style,displayContainsHighlight:!0}),this.variant=t,this.body=r,this.leftDelim=n.leftDelim,this.rightDelim=n.rightDelim}static fromJson(t){var r;return new ch((r=t.variant)!=null?r:"",t.body,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}_serialize(t){var r,n;const i=this.matchingRightDelim();return this.variant==="left...right"?Cr(["\\left",(r=this.leftDelim)!=null?r:".",this.bodyToLatex(t),"\\right",i]):this.variant==="mleft...mright"?Cr(["\\mleft",(n=this.leftDelim)!=null?n:".",this.bodyToLatex(t),"\\mright",i]):Cr([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(t),i])}matchingRightDelim(){var t,r;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const n=(t=this.leftDelim)!=null?t:".";return(r=Wl[n])!=null?r:n}render(t){var r,n;const i=new Er({parent:t},this.style);console.assert(this.body!==void 0);const a=new Er({parent:t,mathstyle:"textstyle"},this.style),s=(r=we.createBox(i,this.body,{type:"inner"}))!=null?r:new je(null,{type:"inner"}),u=s.height/a.scalingFactor,d=s.depth/a.scalingFactor,p=[];if(this.leftDelim&&p.push(this.bind(a,ys("open",this.leftDelim,u,d,a,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),s&&(o(s.children,this,i,u,d),p.push(s)),this.rightDelim){let P=this.containsCaret?" ML__contains-caret":"",O=this.rightDelim;O==="?"&&(i.smartFence?(O=this.matchingRightDelim(),P+=" ML__smart-fence__close"):O="."),p.push(this.bind(a,ys("close",O,u,d,a,{isSelected:this.isSelected,classes:P+" ML__close",mode:this.mode,style:this.style})))}let h=this.variant==="mleft...mright";const S=this.leftSibling;S&&(!h&&S.isFunction&&(h=!0),!h&&S.type==="subsup"&&((n=S.leftSibling)!=null&&n.isFunction)&&(h=!0));const D=new je(p,{type:h?"close":"inner",classes:"left-right"});return D.setStyle("margin-top",`${-s.depth}em`),D.setStyle("height",`${s.height+s.depth}em`),this.caret&&(D.caret=this.caret),this.bind(i,D.wrap(i))}};function o(e,t,r,n,i){if(e)for(let a=0;a<e.length;a++){const s=e[a];s.type==="middle"?(e[a]=t.bind(r,ys("inner",s.value,n,i,r,{isSelected:t.isSelected})),e[a].caret=s.caret,e[a].isSelected=s.isSelected,e[a].cssId=s.cssId,e[a].htmlData=s.htmlData,e[a].htmlStyle=s.htmlStyle,e[a].attributes=s.attributes,e[a].cssProperties=s.cssProperties):s.children&&o(s.children,t,r,n,i)}}var l=class uh extends we{constructor(t,r){var n;super({type:"macro",command:t,style:r.style}),this.body=r.body,r.captureSelection===void 0?r.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=r.captureSelection,this.macroArgs=r.args,this.expand=(n=r.expand)!=null?n:!1}static fromJson(t){return new uh(t.command,t)}toJson(){const t=super.toJson();return this.expand&&(t.expand=!0),this.captureSelection!==void 0&&(t.captureSelection=this.captureSelection),this.macroArgs&&(t.args=this.macroArgs),t}_serialize(t){var r;return t.expandMacro&&this.expand?this.bodyToLatex(t):this.command+((r=this.macroArgs)!=null?r:"")}render(t){const r=we.createBox(t,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}},c=class dh extends we{constructor(){super({type:"macro-argument"})}static fromJson(t){return new dh}toJson(){return super.toJson()}_serialize(t){return""}render(t){return null}},f=class fh extends we{constructor(t,r,n=!1,i,a){var s;super({type:"prompt",mode:(s=a==null?void 0:a.mode)!=null?s:"math",style:a==null?void 0:a.style,command:"\\placeholder"}),this.body=i,this.correctness=r,this.placeholderId=t,this.locked=n,this.captureSelection=this.locked}static fromJson(t){return new fh(t.placeholderId,t.correctness,t.locked,t.body,t)}toJson(){const t=super.toJson();return this.placeholderId&&(t.placeholderId=this.placeholderId),this.body||delete t.body,this.body&&(t.body=this.body.filter(r=>r.type!=="first").map(r=>r.toJson())),this.correctness&&(t.correctness=this.correctness),t.locked=this.locked,t}render(t){const r=new Er({parent:t}),n=r.getRegisterAsEm("fboxsep"),i=n,a=n,s=we.createBox(t,this.body);if(!s)return null;s.height||(s.height=r.metrics.xHeight),s.setStyle("vertical-align",-s.height,"em"),this.correctness==="correct"?s.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&s.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const u=new je(s,{type:"ord"});u.setStyle("display","inline-block"),u.setStyle("height",s.height+s.depth,"em"),u.setStyle("vertical-align",-a,"em");let d="ML__prompt ";this.locked?d+=" ML__lockedPromptBox ":d+=" ML__editablePromptBox ",this.correctness==="correct"?d+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(d+=" ML__incorrectPromptBox "),this.containsCaret&&(d+=" ML__focusedPromptBox ");const p=new je(null,{classes:d,attributes:{part:"prompt"}});p.height=u.height+a,p.depth=u.depth+a,p.width=u.width+2*i,p.setStyle("box-sizing","border-box"),p.setStyle("position","absolute"),p.setStyle("height",u.height+u.depth+2*a,"em"),i===0&&p.setStyle("width","100%"),i!==0&&(p.setStyle("width",`calc(100% + ${2*i}em)`),p.setStyle("top",n,"em"),p.setStyle("left",-i,"em")),(!this.body||this.body.length===1)&&(p.width=3*i,p.setStyle("width",`calc(100% + ${3*i}em)`),p.setStyle("left",-1.5*i,"em"));let h="";this.correctness==="incorrect"&&(h+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),h&&(p.svgOverlay=h);const S=new je([p,u],{classes:"ML__prompt-atom"});return S.setStyle("position","relative"),S.setStyle("display","inline-block"),S.setStyle("line-height",0),S.height=u.height+a+.2,S.depth=u.depth+a,S.left=i,S.right=i,S.setStyle("height",u.height+a,"em"),S.setStyle("top",u.depth-u.height,"em"),S.setStyle("vertical-align",u.depth+a,"em"),S.setStyle("margin-left",.5,"em"),S.setStyle("margin-right",.5,"em"),this.caret&&(S.caret=this.caret),this.bind(r,this.attachSupsub(t,{base:S}))}_serialize(t){var r;const n=(r=this.bodyToLatex(t))!=null?r:"";if(t.skipPlaceholders)return n;let i="\\placeholder";return this.placeholderId&&(i+=`[${this.placeholderId}]`),this.correctness==="correct"?i+="[correct]":this.correctness==="incorrect"&&(i+="[incorrect]"),this.locked&&(i+="[locked]"),yn(i,n)}},m=class ph extends we{constructor(t){super({type:"subsup",style:t==null?void 0:t.style}),this.subsupPlacement="auto"}static fromJson(t){const r=new ph(t);for(const n of bs)t[n]&&r.setChildren(t[n],n);return r}render(t){var r;const n=new Er({parent:t,isPhantom:!0}),i=this.leftSibling,a=(r=i.render(n))!=null?r:new je(null),s=new je(null);return s.height=a.height,s.depth=a.depth,this.attachSupsub(t,{base:s,isCharacterBox:i.isCharacterBox(),type:"ignore"})}_serialize(t){return this.supsubToLatex(t)}};function g(e){return e?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e):!1}var y=class{constructor(e,t,r){this.errors=[],this.index=0,this.endCount=0;var n,i,a,s;r!=null||(r={}),this.tokens=e,this.context=t instanceof Er&&!(r!=null&&r.parseMode)&&!r.mathstyle?t:new Er({from:t,mathstyle:r.mathstyle},r.style),this.args=(n=r.args)!=null?n:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(i=r.style)!=null?i:{},parseMode:(a=r.parseMode)!=null?a:"math",mathstyle:(s=r.mathstyle)!=null?s:"displaystyle",tabular:!1}}beginContext(e){var t,r,n;const i=this.parsingContext,a={parent:i,mathlist:[],style:_({},i.style),parseMode:(t=e==null?void 0:e.mode)!=null?t:i.parseMode,mathstyle:(r=e==null?void 0:e.mathstyle)!=null?r:i.mathstyle,tabular:(n=e==null?void 0:e.tabular)!=null?n:!1};this.parsingContext=a}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push(_({before:Go(this.tokens.slice(this.index,this.index+10)),after:Go(this.tokens.slice(Math.max(0,this.index-10),this.index))},e))}get mathlist(){return this.parsingContext.mathlist}set mathlist(e){this.parsingContext.mathlist=e}get parseMode(){return this.parsingContext.parseMode}set parseMode(e){this.parsingContext.parseMode=e}get tabularMode(){return this.parsingContext.tabular}get style(){let e=this.parsingContext;for(;e;){if(e.style)return _({},e.style);e=e.parent}return{}}set style(e){this.parsingContext.style=e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(e){return this.tokens[this.index]===e?(this.index++,!0):!1}lastSubsupAtom(){let e;return this.mathlist.length>0&&(e=this.mathlist[this.mathlist.length-1],e.type==="subsup"||e.subsupPlacement!==void 0)||(e=new m({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;const{index:t}=this;if(t<this.tokens.length&&this.tokens[t].startsWith("\\")){const r=or(this.tokens[t],this.parseMode);return!r||r.definitionType==="symbol"||r.ifMode&&!r.ifMode.includes(this.parseMode)?!1:(e=r.infix)!=null?e:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const e=this.peek();return e!=="\\\\"&&e!=="\\cr"&&e!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var e;const t=(e=this.args)==null?void 0:e.call(this,"?");return t?w(t,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new ho({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let t=this.tokens[this.index];for(;t&&t!==e;)t=this.tokens[++this.index];t===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){const t=this.index;let r=this.end(),n="";for(;!r;){const a=this.get();g(a)?(n+=a,r=this.end()||n.length>=e.length):r=!0}const i=e.toUpperCase()===n.toUpperCase();return i||(this.index=t),i}scanString(){let e="";for(;!this.end();){const t=this.peek();if(t==="]")return e;if(t==="<space>")e+=" ";else if(t.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=t.substring(1);else if(g(t))e+=t;else return e;this.next()}return e}scanBalancedString(){let e="",t=this.end(),r=1;for(;!t;){const n=this.get();n==="<space>"?e+=" ":n==="<{>"?(e+="{",r+=1):n==="<}>"?(r-=1,r>0?e+="}":this.index-=1):n==="<$>"?e+="$":n==="<$$>"?e+="$$":e+=n,t=r===0||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let t="",r=1;for(;r>0&&!this.end();){const n=this.get();n==="<}>"?(r-=1,r>0&&(t+="}")):n==="<{>"?(r+=1,t+="{"):(/\\[a-zA-Z]+$/.test(t)&&/^[a-zA-Z]/.test(n)&&(t+=" "),t+=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[n])!=null?e:n)}return t}scanNumber(e=!0){var t,r;let n=!1,i=this.peek();for(;i==="<space>"||i==="+"||i==="-";)this.get(),i==="-"&&(n=!n),i=this.peek();e=!!e;let a=10,s=/\d/;if(this.match("'"))a=8,s=/[0-7]/,e=!0;else if(this.match('"'))a=16,s=/[\dA-F]/,e=!0;else if(this.match("x"))a=16,s=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return i=this.get(),i?i.length===2&&i.startsWith("\\")?{number:(n?-1:1)*((t=i.codePointAt(1))!=null?t:0),base:"alpha"}:{number:(n?-1:1)*((r=i.codePointAt(0))!=null?r:0),base:"alpha"}:null;let u="";for(;this.hasPattern(s);)u+=this.get();if(!e&&(this.match(".")||this.match(",")))for(u+=".";this.hasPattern(s);)u+=this.get();const d=e?Number.parseInt(u,a):Number.parseFloat(u);return Number.isNaN(d)?null:{number:n?-d:d,base:a===16?"hexadecimal":a===8?"octal":"decimal"}}scanRegister(){var e;const t=this.index,r=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return r;let n=!1;if(r===null)for(;;){const a=this.peek();if(a==="-")n=!n;else if(a!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const a=this.get();return a.startsWith("\\")?r?{register:a,global:!0,factor:(n?-1:1)*r.number}:n?{register:a,global:!0,factor:-1}:{register:a,global:!0}:(this.index=t,null)}let i=this.get();return i!=null&&i.startsWith("\\")?(i=i.substring(1),this.context.registers[i]?!n||r!==null?{register:i,factor:(n?-1:1)*((e=r==null?void 0:r.number)!=null?e:1)}:{register:i}:(this.index=t,null)):(this.index=t,null)}scanValue(){const e=this.scanRegister();if(e)return e;const t=this.index,r=this.scanGlueOrDimen();if(r&&("unit"in r||"glue"in r&&"unit"in r.glue))return r;this.index=t;const n=this.scanNumber();if(n)return n;if(this.end()||!g(this.peek()))return null;const i=this.scanString();return i.length>0?{string:i}:null}scanDimen(){const e=this.scanNumber(!1);if(e===null)return null;const t=e.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let r;return this.matchKeyword("pt")?r="pt":this.matchKeyword("mm")?r="mm":this.matchKeyword("cm")?r="cm":this.matchKeyword("ex")?r="ex":this.matchKeyword("px")?r="px":this.matchKeyword("em")?r="em":this.matchKeyword("bp")?r="bp":this.matchKeyword("dd")?r="dd":this.matchKeyword("pc")?r="pc":this.matchKeyword("in")?r="in":this.matchKeyword("mu")&&(r="mu"),r?{dimension:t,unit:r}:{dimension:t}}scanGlueOrDimen(){const e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;const t={glue:e};if(this.matchKeyword("plus")){const r=this.scanDimen();if(r)t.grow=r;else return t}if(this.skipWhitespace(),this.match("\\relax"))return t;if(this.skipWhitespace(),this.matchKeyword("minus")){const r=this.scanDimen();if(r)t.shrink=r;else return t}return!t.grow&&!t.shrink?e:t}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const t=this.get();t==="c"||t==="r"||t==="l"?e.push({align:t}):t==="|"?e.push({separator:"solid"}):t===":"?e.push({separator:"dashed"}):t==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),e.push({gap:this.scan(r=>r==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return e}scanModeSet(){let e;if(this.match("\\(")&&(e="textstyle"),!e&&this.match("\\[")&&(e="displaystyle"),!e)return null;this.beginContext({mode:"math",mathstyle:e});const t=this.scan(r=>r===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const t=this.scan(r=>r===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanEnvironment(){if(!this.match("\\begin"))return null;const e=this.scanArgument("string");if(!e)return null;const t=te(e);if(!t)return this.onError({code:"unknown-environment",arg:e}),null;const r=[];if(t.params)for(const u of t.params)if(u.isOptional)r.push(this.scanOptionalArgument(u.type));else{const d=this.scanArgument(u.type);d||this.onError({code:"missing-argument",arg:e}),r.push(d)}this.beginContext({tabular:t.tabular});const n=[],i=[];let a=[],s=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),s=!0),!s&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),s=!0),!s)if(this.matchColumnSeparator())a.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){a.push(this.mathlist),this.mathlist=[];let u=null;this.skipWhitespace(),this.match("[")&&(u=this.scanDimen(),this.skipWhitespace(),this.match("]")),i.push(u!=null?u:{dimension:0}),n.push(a),a=[]}else this.mathlist.push(...this.scan(u=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(u)));while(!s);return a.push(this.mathlist),a.length>0&&n.push(a),this.endContext(),t.createAtom(e,n,i,r)}scanExpression(){const e=this.mathlist;if(this.mathlist=[],this.parseExpression()){const t=this.mathlist;return this.mathlist=e,t}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=s=>s==="<}>");let t="",r=null,n=[],i=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!t?(t=this.get(),r=or(t,"math"),r&&(n=this.scanArguments(r)[1]),i=this.mathlist,this.mathlist=[]):this.parseExpression();let a;return t?(console.assert(!!r),n.unshift(this.mathlist),i&&n.unshift(i),a=[r.createAtom({command:t,args:n,style:this.style,mode:this.parseMode})]):a=this.mathlist,this.endContext(),a}scanGroup(){const e=this.index;if(!this.match("<{>"))return null;const t=this.scan(n=>n==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const r=new Ad(t,this.parseMode,this.style);return r.verbatimLatex=Go(this.tokens.slice(e,this.index)),r}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let e=1;for(;!this.end()&&e!==0;)this.match("(")&&(e+=1),this.match(")")&&(e-=1),e!==0&&this.parseExpression();const t=new Cn("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),t}scanDelim(){this.skipWhitespace();const e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!g(e)&&!e.startsWith("\\"))return null;this.next();const t=or(e,"math");return t?t.definitionType==="function"&&t.ifMode&&!t.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):t.definitionType==="symbol"&&(t.type==="mopen"||t.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:(this.onError({code:"unexpected-delimiter",arg:e}),null):(this.onError({code:"unknown-command",arg:e}),null)}scanLeftRight(){var e;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new ts("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new ts("\\mright");let t="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;t="\\mright"}const r=this.scanDelim();if(!r)return this.onError({code:"unexpected-delimiter"}),new ts(t==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(t);)this.parseExpression();const n=this.mathlist;this.endContext();const i=(e=this.scanDelim())!=null?e:".";return new Cn(t==="\\right"?"left...right":"mleft...mright",n,{leftDelim:r,rightDelim:i,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;const t=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?t.addChild(new we({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):t.addChild(new we({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&t.addChildren(xe(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const e=this.match("\\limits"),t=!e&&this.match("\\nolimits"),r=!t&&!e&&this.match("\\displaylimits");if(!e&&!t&&!r)return!1;const n=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return n===null?!1:(n.explicitSubsupPlacement=!0,e&&(n.subsupPlacement="over-under"),t&&(n.subsupPlacement="adjacent"),r&&(n.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let t;const r=[];let n=e.infix?2:0;for(;n<e.params.length;){const i=e.params[n];i.type==="rest"?r.push(this.scan(a=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(a))):i.isOptional?r.push(this.scanOptionalArgument(i.type)):i.type.endsWith("*")?t=i.type.slice(0,-1):r.push(this.scanArgument(i.type)),n+=1}return[t,r]}scanSymbolOrLiteral(){const e=this.peek();if(!e)return null;this.next();let t;if(g(e)){const r=Sa.createAtom(this.parseMode,e,_({},this.style));return r?[r]:null}if(t=this.scanMacro(e),t)return[t];if(e.startsWith("\\")){const r=or(e,this.parseMode);if(!r)return this.onError({code:"unknown-command",arg:e}),[new ts(e)];if(r.definitionType==="symbol"){const n=_({},this.style);r.variant&&(n.variant=r.variant),t=new we({type:r.type,command:e,style:n,value:String.fromCodePoint(r.codepoint),mode:this.parseMode,verbatimLatex:e})}else{if(r.applyMode||r.applyStyle||r.infix)return this.onError({code:"invalid-command",arg:e}),[new ts(e)];r.createAtom&&(t=r.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return t?[t]:null}scanArgument(e){var t;this.skipFiller();const r=this.parseMode;if(e==="auto"&&(e=r),!this.match("<{>")){if(e==="string")return this.scanString();if(e==="value")return this.scanValue();if(e==="delim")return(t=this.scanDelim())!=null?t:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==r&&this.beginContext({mode:"math"});const i=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),i}if(e==="text"){e!==r&&this.beginContext({mode:"text"});const i=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),i}return e==="balanced-string"||console.assert(!1),null}if(e==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const i=this.mathlist;return this.endContext(),{group:i}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const i=this.mathlist;return this.endContext(),{group:i}}let n=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const i=this.mathlist;return this.endContext(),{group:i}}return e==="string"?n=this.scanString():e==="balanced-string"?n=this.scanBalancedString():e==="colspec"?n=this.scanColspec():e==="value"&&(n=this.scanValue()),this.skipUntilToken("<}>"),n}scanOptionalArgument(e){if(e=e==="auto"?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let t=null;for(;!this.end()&&!this.match("]");)if(e==="string")t=this.scanString();else if(e==="value")t=this.scanValue();else if(e==="colspec")t=this.scanColspec();else if(e==="bbox"){const r={},n=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const i of n){const a=i.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(a)r.padding={dimension:parseInt(a[1]),unit:a[2]};else{const s=i.match(/^\s*border\s*:\s*(.*)/);s?r.border=s[1]:r.backgroundcolor={string:i}}}t=r}else e==="math"&&(this.beginContext({mode:"math"}),t=this.mathlist.concat(this.scan(r=>r==="]")),this.endContext());return t}scanSymbolOrCommand(e){var t,r,n;if(e==="\\placeholder"){const u=this.scanOptionalArgument("string"),d=this.scanOptionalArgument("math"),p=we.serialize(d,{defaultMode:"math"});let h=[],S;!S&&p==="correct"?S="correct":!S&&p==="incorrect"?S="incorrect":p!==""&&(h=d);const D=this.scanOptionalArgument("string")==="locked",P=this.scanArgument("auto");let O;return P&&Array.isArray(P)&&P.length>0?O=P:P&&typeof P=="object"&&"group"in P?O=P.group:O=h,u?[new f(u,S,D,O!=null?O:h,{mode:this.parseMode,style:this.style})]:[new ho({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){const u=this.index,d=this.scanLiteralGroup()||this.next();if(!d)return null;if(this.context.registers[d.substring(1)]){const p=this.scanArgument("string");p!==null&&(this.context.registers[d.substring(1)]=p);const h=Cr([e,Go(this.tokens.slice(u,this.index))]);return[new we({type:"text",value:"",verbatimLatex:h})]}}let i=this.scanMacro(e);if(i)return[i];const a=or(e,this.parseMode);if(!a)return this.parseMode==="text"?(/[a-zA-Z]/.test((t=this.peek())!=null?t:"")&&(e+=" "),[...e].map(u=>new we({type:"text",value:u,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:e}),[new ts(e)]);const s=this.index;if(a.definitionType==="symbol"){const u=_({},this.style);a.variant&&(u.variant=a.variant),i=new we({type:a.type,command:e,style:u,value:String.fromCodePoint(a.codepoint),mode:this.parseMode})}else{if(a.ifMode&&!a.ifMode.includes(this.parseMode))return[];const u=this.parseMode;a.applyMode&&(this.parseMode=a.applyMode);let d,p=[];if(a.parse?p=a.parse(this):[d,p]=this.scanArguments(a),this.parseMode=u,a.applyMode&&!a.applyStyle&&!a.createAtom)return xe(p[0]);if(a.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof a.createAtom=="function")i=a.createAtom({command:e,args:p,style:this.style,mode:this.parseMode}),d&&(i.body=xe(this.scanArgument(d)));else if(typeof a.applyStyle=="function"){const h=_(_({},this.style),a.applyStyle(e,p,this.context)),S=this.parseMode;if(a.applyMode&&(this.parseMode=a.applyMode),d){const D=this.style;this.style=h;const P=this.scanArgument(d);return this.style=D,this.parseMode=S,xe(P)}this.style=h}else i=new we({type:"mord",command:(r=a.command)!=null?r:e,style:_({},this.style),value:e,mode:(n=a.applyMode)!=null?n:this.parseMode})}if(!i)return null;if(i instanceof we&&i.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){const u=Cr([e,Go(this.tokens.slice(s,this.index))]);u&&(i.verbatimLatex=u)}if(i.verbatimLatex===null&&(i.verbatimLatex=void 0),i.isFunction&&this.smartFence){const u=this.scanSmartFence();if(u)return[i,u]}return[i]}scanSymbolCommandOrLiteral(){const e=this.get();if(!e)return null;if(g(e)){const t=Sa.createAtom(this.parseMode,e,_({},this.style));if(!t)return null;if(t.isFunction&&this.smartFence){const r=this.scanSmartFence();if(r)return[t,r]}return[t]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e==="<space>"?this.parseMode==="text"?[new zs(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var t;const r=this.context.getMacro(e);if(!r)return null;const n=this.index,i=r.args,a={"?":(t=this.args)==null?void 0:t.call(this,"?")};for(let s=1;s<=i;s++){let u=this.scanLiteralGroup();if(!u){const d=this.index;this.scanExpression(),u=Go(this.tokens.slice(d,this.index))}a[s]=u}return new l(e,{expand:r.expand,captureSelection:r.captureSelection,args:n===this.index?null:Go(this.tokens.slice(n,this.index)),style:this.parsingContext.style,body:w(r.def,{context:this.context,parseMode:this.parseMode,args:s=>a[s],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,t,r,n;let i=(n=(r=(t=(e=this.scanEnvironment())!=null?e:this.scanModeShift())!=null?t:this.scanModeSet())!=null?r:this.scanGroup())!=null?n:this.scanLeftRight();if(i===null){if(this.parseSupSub()||this.parseLimits())return!0;i=this.scanSymbolCommandOrLiteral()}return i?(Array.isArray(i)?this.mathlist.push(...i):this.mathlist.push(i),!0):!1}};function w(e,t){var r,n,i,a;const s=(r=t==null?void 0:t.args)!=null?r:void 0,u=new y(Bl(e,s),t==null?void 0:t.context,{args:s,mathstyle:(n=t==null?void 0:t.mathstyle)!=null?n:"displaystyle",parseMode:(i=t==null?void 0:t.parseMode)!=null?i:"math",style:(a=t==null?void 0:t.style)!=null?a:{}}),d=[];for(;!u.end();)d.push(...u.scan(()=>!1));return d}function B(e,t){var r;const n=new y(Bl(e,null),t==null?void 0:t.context,{mathstyle:"displaystyle",parseMode:(r=t==null?void 0:t.parseMode)!=null?r:"math"});for(;!n.end();)n.scan();return n.errors}var N=class hh extends we{constructor(t,r){super({type:"chem"},{command:t,mode:"math"});const n=I.go(E.go(r,t==="\\pu"?"pu":"ce"),!1);this.body=w(n),this._verbatimLatex=t+"{"+r+"}",this.arg=r,this.captureSelection=!0}static fromJson(t){return new hh(t.command,t.arg)}set verbatimLatex(t){}get verbatimLatex(){return this._verbatimLatex}toJson(){return v(_({},super.toJson()),{arg:this.arg})}render(t){const r=we.createBox(t,this.body,{type:"inner"});return this.caret&&(r.caret=this.caret),this.bind(t,r)}_serialize(t){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};G(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var t;return new N(e.command,(t=e.args[0])!=null?t:"")}});var E={go:function(e,t){if(!e)return[];t===void 0&&(t="ce");var r="0",n={};n.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var i,a=10,s=[];;){i!==e?(a=10,i=e):a--;var u=E.stateMachines[t],d=u.transitions[r]||u.transitions["*"];e:for(var p=0;p<d.length;p++){var h=E.patterns.match_(d[p].pattern,e);if(h){for(var S=d[p].task,D=0;D<S.action_.length;D++){var P;if(u.actions[S.action_[D].type_])P=u.actions[S.action_[D].type_](n,h.match_,S.action_[D].option);else if(E.actions[S.action_[D].type_])P=E.actions[S.action_[D].type_](n,h.match_,S.action_[D].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+S.action_[D].type_+")"];E.concatArray(s,P)}if(r=S.nextState||r,e.length>0){if(S.revisit||(e=h.remainder),!S.toContinue)break e}else return s}}if(a<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Object.prototype.toString.call(t)==="[object Array]")for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=E.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var r=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return r?{match_:r[0],remainder:e.substr(r[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return E.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return E.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return E.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return E.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return E.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return E.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return E.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return E.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return E.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return E.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return E.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return E.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return E.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return E.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return E.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return E.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return E.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return E.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return E.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return E.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t;if(t=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),t)return{match_:t[0],remainder:e.substr(t[0].length)};var r=E.patterns.findObserveGroups(e,"","$","$","");return r&&(t=r.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),t)?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,r,n,i,a,s,u,d,p){var h=function(se,ke){if(typeof ke=="string")return se.indexOf(ke)!==0?null:ke;var Xe=se.match(ke);return Xe?Xe[0]:null},S=function(se,ke,Xe){for(var $e=0;ke<se.length;){var St=se.charAt(ke),Kt=h(se.substr(ke),Xe);if(Kt!==null&&$e===0)return{endMatchBegin:ke,endMatchEnd:ke+Kt.length};if(St==="{")$e++;else if(St==="}"){if($e===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];$e--}ke++}return $e>0,null},D=h(e,t);if(D===null||(e=e.substr(D.length),D=h(e,r),D===null))return null;var P=S(e,D.length,n||i);if(P===null)return null;var O=e.substring(0,n?P.endMatchEnd:P.endMatchBegin);if(a||s){var de=this.findObserveGroups(e.substr(P.endMatchEnd),a,s,u,d);if(de===null)return null;var Ve=[O,de.match_];return{match_:p?Ve.join(""):Ve,remainder:de.remainder}}else return{match_:O,remainder:e.substr(P.endMatchEnd)}},match_:function(e,t){var r=E.patterns.patterns[e];if(r===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof r=="function")return E.patterns.patterns[e](t);var n=t.match(r);if(n){var i;return n[2]?i=[n[1],n[2]]:n[1]?i=n[1]:i=n[0],{match_:i,remainder:t.substr(n[0].length)}}return null}},actions:{"a=":function(e,t){e.a=(e.a||"")+t},"b=":function(e,t){e.b=(e.b||"")+t},"p=":function(e,t){e.p=(e.p||"")+t},"o=":function(e,t){e.o=(e.o||"")+t},"q=":function(e,t){e.q=(e.q||"")+t},"d=":function(e,t){e.d=(e.d||"")+t},"rm=":function(e,t){e.rm=(e.rm||"")+t},"text=":function(e,t){e.text_=(e.text_||"")+t},insert:function(e,t,r){return{type_:r}},"insert+p1":function(e,t,r){return{type_:r,p1:t}},"insert+p1+p2":function(e,t,r){return{type_:r,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:"rm",p1:t||""}},text:function(e,t){return E.go(t,"text")},"{text}":function(e,t){var r=["{"];return E.concatArray(r,E.go(t,"text")),r.push("}"),r},"tex-math":function(e,t){return E.go(t,"tex-math")},"tex-math tight":function(e,t){return E.go(t,"tex-math tight")},bond:function(e,t,r){return{type_:"bond",kind_:r||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return E.go(t)},"1/2":function(e,t){var r=[];t.match(/^[+\-]/)&&(r.push(t.substr(0,1)),t=t.substr(1));var n=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return n[1]=n[1].replace(/\$/g,""),r.push({type_:"frac",p1:n[1],p2:n[2]}),n[3]&&(n[3]=n[3].replace(/\$/g,""),r.push({type_:"tex-math",p1:n[3]})),r},"9,9":function(e,t){return E.go(t,"9,9")}},createTransitions:function(e){var t,r,n,i,a={};for(t in e)for(r in e[t])for(n=r.split("|"),e[t][r].stateArray=n,i=0;i<n.length;i++)a[n[i]]=[];for(t in e)for(r in e[t])for(n=e[t][r].stateArray||[],i=0;i<n.length;i++){var s=e[t][r];if(s.action_){s.action_=[].concat(s.action_);for(var u=0;u<s.action_.length;u++)typeof s.action_[u]=="string"&&(s.action_[u]={type_:s.action_[u]})}else s.action_=[];for(var d=t.split("|"),p=0;p<d.length;p++)if(n[i]==="*")for(var h in a)a[h].push({pattern:d[p],task:s});else a[n[i]].push({pattern:d[p],task:s})}return a},stateMachines:{}};E.stateMachines={ce:{transitions:E.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,t){var r;if((e.d||"").match(/^[0-9]+$/)){var n=e.d;e.d=void 0,r=this.output(e),e.b=n}else r=this.output(e);return E.actions["o="](e,t),r},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var r=[];return E.concatArray(r,this.output(e)),E.concatArray(r,E.actions.bond(e,t,"-")),r}else e.d=t},"- after o/d":function(e,t,r){var n=E.patterns.match_("orbital",e.o||""),i=E.patterns.match_("one lowercase greek letter $",e.o||""),a=E.patterns.match_("one lowercase latin letter $",e.o||""),s=E.patterns.match_("$one lowercase latin letter$ $",e.o||""),u=t==="-"&&(n&&n.remainder===""||i||a||s);u&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!n&&a&&(e.o="$"+e.o+"$");var d=[];return u?(E.concatArray(d,this.output(e)),d.push({type_:"hyphen"})):(n=E.patterns.match_("digits",e.d||""),r&&n&&n.remainder===""?(E.concatArray(d,E.actions["d="](e,t)),E.concatArray(d,this.output(e))):(E.concatArray(d,this.output(e)),E.concatArray(d,E.actions.bond(e,t,"-")))),d},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:E.go(t,"o")}},comma:function(e,t){var r=t.replace(/\s*$/,""),n=r!==t;return n&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:r}:{type_:"comma enumeration M",p1:r}},output:function(e,t,r){var n;if(!e.r)n=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!r||(e.sb&&n.push({type_:"entitySkip"}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&r!==2?(e.o=e.a,e.a=void 0):!e.o&&!e.q&&!e.d&&(e.b||e.p)?(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):e.o&&e.dType==="kv"&&E.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&e.dType==="kv"&&!e.q&&(e.dType=void 0),n.push({type_:"chemfive",a:E.go(e.a,"a"),b:E.go(e.b,"bd"),p:E.go(e.p,"pq"),o:E.go(e.o,"o"),q:E.go(e.q,"pq"),d:E.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var i;e.rdt==="M"?i=E.go(e.rd,"tex-math"):e.rdt==="T"?i=[{type_:"text",p1:e.rd||""}]:i=E.go(e.rd);var a;e.rqt==="M"?a=E.go(e.rq,"tex-math"):e.rqt==="T"?a=[{type_:"text",p1:e.rq||""}]:a=E.go(e.rq),n={type_:"arrow",r:e.r,rd:i,rq:a}}for(var s in e)s!=="parenthesisLevel"&&s!=="beginsWithBond"&&delete e[s];return n},"oxidation-output":function(e,t){var r=["{"];return E.concatArray(r,E.go(t,"oxidation")),r.push("}"),r},"frac-output":function(e,t){return{type_:"frac-ce",p1:E.go(t[0]),p2:E.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:E.go(t[0]),p2:E.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:E.go(t[0]),p2:E.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:E.go(t[0]),p2:E.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:E.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,r){return{type_:"operator",kind_:r||t}}}},a:{transitions:E.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:E.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:E.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var r in e)delete e[r];return t}}}},pq:{transitions:E.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,t){return{type_:"state of aggregation subscript",p1:E.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:E.go(t[1],"pq")}}}},bd:{transitions:E.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,t){return{type_:"color",color1:t[0],color2:E.go(t[1],"bd")}}}},oxidation:{transitions:E.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:E.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var r in e)delete e[r];return t}}}},"tex-math tight":{transitions:E.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var r in e)delete e[r];return t}}}},"9,9":{transitions:E.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:E.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,t){var r=[];return t[0]==="+-"||t[0]==="+/-"?r.push("\\pm "):t[0]&&r.push(t[0]),t[1]&&(E.concatArray(r,E.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?E.concatArray(r,E.go(t[2],"pu-9,9")):r.push(t[2])),(t[3]||t[4])&&(t[3]==="e"||t[4]==="*"?r.push({type_:"cdot"}):r.push({type_:"times"}))),t[5]&&r.push("10^{"+t[5]+"}"),r},"number^":function(e,t){var r=[];return t[0]==="+-"||t[0]==="+/-"?r.push("\\pm "):t[0]&&r.push(t[0]),E.concatArray(r,E.go(t[1],"pu-9,9")),r.push("^{"+t[2]+"}"),r},operator:function(e,t,r){return{type_:"operator",kind_:r||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,r=E.patterns.match_("{(...)}",e.d||"");r&&r.remainder===""&&(e.d=r.match_);var n=E.patterns.match_("{(...)}",e.q||"");if(n&&n.remainder===""&&(e.q=n.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var i={d:E.go(e.d,"pu"),q:E.go(e.q,"pu")};e.o==="//"?t={type_:"pu-frac",p1:i.d,p2:i.q}:(t=i.d,i.d.length>1||i.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),E.concatArray(t,i.q))}else t=E.go(e.d,"pu-2");for(var a in e)delete e[a];return t}}},"pu-2":{transitions:E.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var r=E.patterns.match_("{(...)}",e.rm||"");r&&r.remainder===""?t=E.go(r.match_,"pu"):t={type_:"rm",p1:e.rm}}for(var n in e)delete e[n];return t}}},"pu-9,9":{transitions:E.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var r=e.text_.length%3;r===0&&(r=3);for(var n=e.text_.length-3;n>0;n-=3)t.push(e.text_.substr(n,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,r)),t.reverse()}else t.push(e.text_);for(var i in e)delete e[i];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var r=e.text_.length-3,n=0;n<r;n+=3)t.push(e.text_.substr(n,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(n))}else t.push(e.text_);for(var i in e)delete e[i];return t}}}};var I={go:function(e,t){if(!e)return"";for(var r="",n=!1,i=0;i<e.length;i++){var a=e[i];typeof a=="string"?r+=a:(r+=I._go2(a),a.type_==="1st-level escape"&&(n=!0))}return!t&&!n&&r&&(r="{"+r+"}"),r},_goInner:function(e){return e&&I.go(e,!0)},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var r={a:I._goInner(e.a),b:I._goInner(e.b),p:I._goInner(e.p),o:I._goInner(e.o),q:I._goInner(e.q),d:I._goInner(e.d)};r.a&&(r.a.match(/^[+\-]/)&&(r.a="{"+r.a+"}"),t+=r.a+"\\,"),(r.b||r.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(r.b||"")+"}}_{\\hphantom{"+(r.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(r.b||"")+"}}",t+="_{\\vphantom{2}\\llap{\\smash[t]{"+(r.p||"")+"}}}"),r.o&&(r.o.match(/^[+\-]/)&&(r.o="{"+r.o+"}"),t+=r.o),e.dType==="kv"?((r.d||r.q)&&(t+="{\\vphantom{X}}"),r.d&&(t+="^{"+r.d+"}"),r.q&&(t+="_{\\smash[t]{"+r.q+"}}")):e.dType==="oxidation"?(r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.d+"}"),r.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+r.q+"}}")):(r.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+r.q+"}}"),r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.d+"}"));break;case"rm":t="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),t="\\mathrm{"+e.p1+"}"):t="\\text{"+e.p1+"}";break;case"roman numeral":t="\\mathrm{"+e.p1+"}";break;case"state of aggregation":t="\\mskip2mu "+I._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+I._goInner(e.p1);break;case"bond":if(t=I._getBond(e.kind_),!t)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var n="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+n+"}{"+n+"}{"+n+"}{"+n+"}";break;case"pu-frac":var i="\\frac{"+I._goInner(e.p1)+"}{"+I._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+i+"}{"+i+"}{"+i+"}{"+i+"}";break;case"tex-math":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+I._goInner(e.p1)+"}{"+I._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+I._goInner(e.p1)+"}{"+I._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+I._goInner(e.p1)+"}{"+I._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+I._goInner(e.p1)+"}_{"+I._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+I._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var a={rd:I._goInner(e.rd),rq:I._goInner(e.rq)},s=I._getArrow(e.r);a.rd||a.rq?e.r==="<=>"||e.r==="<=>>"||e.r==="<<=>"||e.r==="<-->"?(s="\\long"+s,a.rd&&(s="\\overset{"+a.rd+"}{"+s+"}"),a.rq&&(e.r==="<-->"?s="\\underset{\\lower2mu{"+a.rq+"}}{"+s+"}":s="\\underset{\\lower6mu{"+a.rq+"}}{"+s+"}"),s=" {}\\mathrel{"+s+"}{} "):(a.rq&&(s+="[{"+a.rq+"}]"),s+="{"+a.rd+"}",s=" {}\\mathrel{\\x"+s+"}{} "):s=" {}\\mathrel{\\long"+s+"}{} ",t=s;break;case"operator":t=I._getOperator(e.kind_);break;case"1st-level escape":t=e.p1+" ";break;case"space":t=" ";break;case"entitySkip":t="~";break;case"pu-space-1":t="~";break;case"pu-space-2":t="\\mkern3mu ";break;case"1000 separator":t="\\mkern2mu ";break;case"commaDecimal":t="{,}";break;case"comma enumeration L":t="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":t="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":t="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":t="\\text{-}";break;case"addition compound":t="\\,{\\cdot}\\,";break;case"electron dot":t="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":t="{\\times}";break;case"prime":t="\\prime ";break;case"cdot":t="\\cdot ";break;case"tight cdot":t="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":t="\\times ";break;case"circa":t="{\\sim}";break;case"^":t="uparrow";break;case"v":t="downarrow";break;case"ellipsis":t="\\ldots ";break;case"/":t="/";break;case" / ":t="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return t},_getArrow:function(e){switch(e){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function $(e){}function W(e){}var oe=class mh extends we{constructor(t){super(v(_({},t),{type:"delim"})),this.value=t.delim,this.size=t.size}static fromJson(t){return new mh(t)}toJson(){return v(_({},super.toJson()),{delim:this.value,size:this.size})}render(t){return new je(this.value,{type:"middle"})}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=or(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):yn(this.command,this.value)}},We=class gh extends we{constructor(t){super(v(_({},t),{type:"sizeddelim",value:t.delim})),this.delimType=t.delimType,this.size=t.size}static fromJson(t){return new gh(t)}toJson(){return v(_({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(t){let r=K0(this.value,this.size,t,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return r?(r=this.bind(t,r),this.caret&&(r.caret=this.caret),r):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=or(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):yn(this.command,this.value)}},Ge=class vh extends we{constructor(t,r,n,i){var a,s;super({type:"enclose",command:t,style:i.style}),this.body=r,this.backgroundcolor=i.backgroundcolor,n.updiagonalarrow&&(n.updiagonalstrike=!1),n.box&&(n.left=!1,n.right=!1,n.bottom=!1,n.top=!1),this.notation=n,this.shadow=(a=i.shadow)!=null?a:"none",this.strokeWidth=(s=i.strokeWidth)!=null?s:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=i.strokeStyle,this.svgStrokeStyle=i.svgStrokeStyle,this.strokeColor=i.strokeColor,this.borderStyle=i.borderStyle,this.padding=i.padding,this.captureSelection=!1}static fromJson(t){return new vh(t.command,t.body,t.notation,t)}toJson(){return v(_({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(t){var r;if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=or(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,t);let i=(r=this.command)!=null?r:"";if(this.command==="\\enclose"){i+="{"+Object.keys(this.notation).join(" ")+"}";let a="",s="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(a+=s+'mathbackground="'+this.backgroundcolor+'"',s=","),this.shadow&&this.shadow!=="auto"&&(a+=s+'shadow="'+this.shadow+'"',s=","),this.strokeWidth||this.strokeStyle!=="solid"?(a+=s+this.borderStyle,s=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(a+=s+'mathcolor="'+this.strokeColor+'"',s=","),a&&(i+=`[${a}]`)}return yn(i,this.bodyToLatex(t))}render(t){const r=new Er({parent:t},this.style),n=we.createBox(r,this.body);if(!n)return null;const i=xt(this.borderStyle),a=r.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});n.setStyle("position","relative"),n.setStyle("display","inline-block"),n.setStyle("top",a,"em"),n.setStyle("height",n.height+n.depth,"em"),n.setStyle("width",n.width,"em");const s=new je(null,{classes:"ML__notation"});let u=n.height+n.depth+2*a;const d=n.width+2*a;let p="";if(this.notation.horizontalstrike&&(p+=this.line(3,50,97,50)),this.notation.verticalstrike&&(p+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(p+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(p+=this.line(3,3,97,97)),this.notation.updiagonalarrow){p+=this.line(a.toString(),(a+n.depth+n.height).toString(),(a+n.width).toString(),a.toString());const O=.03*Math.sqrt(d*d+u*u)*1,de=n.width*O,Ve=(n.depth+n.height)*O,se=a+n.width;let ke=a;ke+Ve-.4*de<0&&(ke=.4*de-Ve),p+='<polygon points="',p+=`${se},${ke} ${se-de-.4*Ve},${ke+Ve-.4*de} `,p+=`${se-.7*de},${ke+.7*Ve} ${se-de+.4*Ve},${ke+Ve+.4*de} `,p+=`${se},${ke}`,p+=`" stroke='none' fill="${this.strokeColor}"`,p+="/>"}let h=0;if(this.notation.phasorangle){const D=Rt(r),P=(n.height+n.depth+2*D+a).toString(),O=(n.height+n.depth)/2;p+=this.line(a.toString(),P,(a+O+n.width).toString(),P),p+=this.line(a.toString(),P,(a+O).toString(),(a-D).toString()),u+=D,h=O,n.left+=u/2-a}if(this.notation.longdiv){const D=Rt(r);u+=D,p+=this.line(a.toString(),a.toString(),(a+n.width).toString(),a.toString());const P=.3;h=P+D,n.left+=P+D,n.setTop(a+D),p+='<path d="',p+=`M ${a} ${a} a${P} ${(n.depth+n.height+2*D)/2}, 0, 1, 1, 0 ${n.depth+n.height+2*D} "`,p+=` stroke-width="${Lt(r)}" stroke="${this.strokeColor}" fill="none"`,p+="/>"}if(s.width=n.width+2*a+h,s.height=n.height+a,s.depth=n.depth+a,s.setStyle("box-sizing","border-box"),s.setStyle("left",`calc(-${i} / 2 )`),s.setStyle("height",`${Math.floor(100*u)/100}em`),s.setStyle("top",`calc(${i} / 2 )`),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.notation.box&&s.setStyle("border","1px solid red"),this.notation.actuarial&&(s.setStyle("border-top",this.borderStyle),s.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(s.setStyle("border-bottom",this.borderStyle),s.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(s.setStyle("border-radius","8px"),s.setStyle("border",this.borderStyle)),this.notation.circle&&(s.setStyle("border-radius","50%"),s.setStyle("border",this.borderStyle)),this.notation.top&&s.setStyle("border-top",this.borderStyle),this.notation.left&&s.setStyle("border-left",this.borderStyle),this.notation.right&&s.setStyle("border-right",this.borderStyle),this.notation.bottom&&s.setStyle("border-bottom",this.borderStyle),p){let D="";this.shadow==="auto"&&(D+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(D+=`filter: drop-shadow(${this.shadow})`),D+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,D+=' stroke-linecap="round"',this.svgStrokeStyle&&(D+=` stroke-dasharray="${this.svgStrokeStyle}"`),s.svgStyle=D,s.svgOverlay=p}const S=new je([s,n]);return S.setStyle("position","relative"),S.setStyle("vertical-align",a,"em"),S.setStyle("height",`${Math.floor(100*(n.height+n.depth+2*a))/100}em`),S.setStyle("display","inline-block"),S.height=s.height,S.depth=s.depth,S.width=s.width-2*a,S.left=a,S.right=a,this.caret&&(S.caret=this.caret),S.wrap(r)}line(t,r,n,i){return`<line x1="${Qe(t)}" y1="${Qe(r)}" x2="${Qe(n)}" y2="${Qe(i)}" vector-effect="non-scaling-stroke"></line>`}};function Qe(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function xt(e){if(!e)return"1px";const t=e.match(/([0-9][a-zA-Z\%]+)/);return t===null?"1px":t[1]}function Lt(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function Rt(e){const t=e.isDisplayStyle?po:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*t/4}var Yt=class bh extends we{constructor(t,r,n){var i,a;super(v(_({},n),{type:"genfrac",displayContainsHighlight:!0})),this.above=t,this.below=r,this.hasBarLine=(i=n==null?void 0:n.hasBarLine)!=null?i:!0,this.continuousFraction=(a=n==null?void 0:n.continuousFraction)!=null?a:!1,this.numerPrefix=n==null?void 0:n.numerPrefix,this.denomPrefix=n==null?void 0:n.denomPrefix,this.mathstyleName=n==null?void 0:n.mathstyleName,this.leftDelim=n==null?void 0:n.leftDelim,this.rightDelim=n==null?void 0:n.rightDelim,this.fractionNavigationOrder=n==null?void 0:n.fractionNavigationOrder}static fromJson(t){return new bh(t.above,t.below,t)}toJson(){const t={};return this.continuousFraction&&(t.continuousFraction=!0),this.numerPrefix&&(t.numerPrefix=this.numerPrefix),this.denomPrefix&&(t.denomPrefix=this.denomPrefix),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),this.hasBarLine||(t.hasBarLine=!1),this.mathstyleName&&(t.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(t.fractionNavigationOrder=this.fractionNavigationOrder),_(_({},super.toJson()),t)}get children(){if(this._children)return this._children;const t=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const r of this.below)t.push(...r.children),t.push(r);for(const r of this.above)t.push(...r.children),t.push(r)}else{for(const r of this.above)t.push(...r.children),t.push(r);for(const r of this.below)t.push(...r.children),t.push(r)}return this._children=t,t}render(t){var r,n;const i=new Er({parent:t,mathstyle:this.mathstyleName},this.style),a=i.metrics,s=new Er({parent:i,mathstyle:this.continuousFraction?"":"numerator"},this.style),u=this.numerPrefix?new je([new je(this.numerPrefix),we.createBox(s,this.above)],{isTight:s.isTight,type:"ignore"}):(r=we.createBox(s,this.above,{type:"ignore"}))!=null?r:new je(null,{type:"ignore"}),d=new Er({parent:i,mathstyle:this.continuousFraction?"":"denominator"},this.style),p=this.denomPrefix?new je([new je(this.denomPrefix),we.createBox(d,this.below,{type:"ignore"})]):(n=we.createBox(d,this.below,{type:"ignore"}))!=null?n:new je(null,{type:"ignore"}),h=this.hasBarLine?a.defaultRuleThickness:0;let S,D=0,P;i.isDisplayStyle?(S=s.metrics.num1,D=h>0?3*h:7*h,P=d.metrics.denom1):(h>0?(S=s.metrics.num2,D=h):(S=s.metrics.num3,D=3*a.defaultRuleThickness),P=d.metrics.denom2);const O=[];this.isSelected&&O.push("ML__selected");const de=u.depth,Ve=p.height;let se;if(h<=0){const Tt=S-de-(Ve-P);Tt<D&&(S+=(D-Tt)/2,P+=(D-Tt)/2),se=new ti({individualShift:[{box:u,shift:-S,classes:[...O,"ML__center"]},{box:p,shift:P,classes:[...O,"ML__center"]}]}).wrap(i)}else{const Tt=new je(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Tt.softWidth=Math.max(u.width,p.width),Tt.height=h/2,Tt.depth=h/2;const kr=Vn+h/2;S<D+de+kr&&(S=D+de+kr);const en=Vn-h/2;P<D+Ve-en&&(P=D+Ve-en),se=new ti({individualShift:[{box:p,shift:P,classes:[...O,"ML__center"]},{box:Tt,shift:-en,classes:O},{box:u,shift:-S,classes:[...O,"ML__center"]}]}).wrap(i)}const ke=i.isDisplayStyle?a.delim1:a.delim2,Xe=this.leftDelim?this.bind(t,Zl("open",this.leftDelim,ke,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Ao(i,"open");let $e=null;this.continuousFraction?$e=new je(null,{type:"close"}):this.rightDelim?$e=this.bind(t,Zl("close",this.rightDelim,ke,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):$e=Ao(i,"close");const St=new je([Xe,se,$e],{isTight:i.isTight,type:"inner",classes:"mfrac"}),Kt=this.bind(t,St);return this.caret&&(Kt.caret=this.caret),this.attachSupsub(t,{base:Kt})}},Ft=class yh extends we{constructor(t,r){var n;super({type:"latex",value:t,mode:"latex"}),this.isSuggestion=(n=r==null?void 0:r.isSuggestion)!=null?n:!1,this.isError=!1}static fromJson(t){const r=new yh(t.value);return t.isSuggestion&&(r.isSuggestion=!0),t.isError&&(r.isError=!0),r}toJson(){const t={};return this.isSuggestion&&(t.isSuggestion=!0),this.isError&&(t.isError=!0),_({type:"latex",value:this.value},t)}get computedStyle(){return{}}render(t){const r=new je(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}},mr=class xh extends we{constructor(t){super({type:"latexgroup",mode:"latex"}),this.body=[...t].map(r=>new Ft(r)),this.skipBoundary=!1}static fromJson(t){return new xh("")}toJson(){return super.toJson()}render(t){const r=we.createBox(t,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}_serialize(t){var r,n;return(n=(r=this.body)==null?void 0:r.map(i=>i.value).join(""))!=null?n:""}},Tn=class wh extends we{constructor(t,r){super(v(_({},r),{type:"extensible-symbol",isFunction:r==null?void 0:r.isFunction})),this.value=t,this.variant=r==null?void 0:r.variant,this.subsupPlacement=r==null?void 0:r.limits}static fromJson(t){return new wh(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.value&&(t.symbol=this.value),t}render(t){var r;const n=t.isDisplayStyle&&this.value!=="\\smallint",i=new je(this.value,{fontFamily:n?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(n?"large-op":"small-op"),type:"op",maxFontSize:t.scalingFactor,isSelected:this.isSelected});if(!i)return null;i.right=i.italic;const a=(i.height-i.depth)/2-Vn*t.scalingFactor,s=i.italic;i.setTop(a);let u=i;if(this.superscript||this.subscript){const d=(r=this.subsupPlacement)!=null?r:"auto";u=d==="over-under"||d==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:i,baseShift:a,slant:s}):this.attachSupsub(t,{base:i})}return new je(this.bind(t,u),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=or(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const n=[];return n.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&n.push("\\limits"),this.subsupPlacement==="adjacent"&&n.push("\\nolimits"),this.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(this.supsubToLatex(t)),Cr(n)}},gr=class Sh extends we{constructor(t){const r=t.body;super(v(_({},t),{type:"overlap",body:typeof r=="string"?[new we({value:r})]:r,style:t==null?void 0:t.style})),this.skipBoundary=!0,this.align=t==null?void 0:t.align,this.boxType=t==null?void 0:t.boxType}static fromJson(t){return new Sh(t)}toJson(){const t={};return this.align&&(t.align=this.align),this.boxType&&(t.boxType=this.boxType),_(_({},super.toJson()),t)}render(t){const r=we.createBox(t,this.body,{classes:"inner"});return r?(this.caret&&(r.caret=this.caret),this.bind(t,new je([r,new je(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Ur=class _h extends we{constructor(t){var r,n,i,a;super({type:"overunder",command:t.command,style:t.style,mode:t.mode,body:t.body,skipBoundary:(r=t.skipBoundary)!=null?r:!0}),this.subsupPlacement=t.supsubPlacement,this.svgAbove=t.svgAbove,this.svgBelow=t.svgBelow,this.svgBody=t.svgBody,this.above=t.above,this.below=t.below,this.boxType=(n=t.boxType)!=null?n:"ord",this.paddedBody=(i=t.paddedBody)!=null?i:!1,this.paddedLabels=(a=t.paddedLabels)!=null?a:!1}static fromJson(t){return new _h(t)}toJson(){const t=super.toJson();return this.skipBoundary||(t.skipBoundary=!1),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.svgAbove&&(t.svgAbove=this.svgAbove),this.svgBelow&&(t.svgBelow=this.svgBelow),this.svgBody&&(t.svgBody=this.svgBody),this.boxType!=="ord"&&(t.boxType=this.boxType),this.paddedBody&&(t.paddedBody=!0),this.paddedLabels&&(t.paddedLabels=!0),t}render(t){let r=this.svgBody?Pl(this.svgBody):we.createBox(t,this.body,{type:"ignore"});const n=new Er({parent:t,mathstyle:"scriptstyle"},this.style);let i=null;this.svgAbove?i=Pl(this.svgAbove):this.above&&(i=we.createBox(n,this.above,{type:"ignore"}));let a=null;this.svgBelow?a=Pl(this.svgBelow):this.below&&(a=we.createBox(n,this.below,{type:"ignore"})),this.paddedBody&&(r=new je([Ao(t,"open"),r,Ao(t,"close")],{type:"ignore"}));let s=Ci(t,{base:r,above:i,below:a,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return s?(this.subsupPlacement==="over-under"?s=this.attachLimits(t,{base:s,type:s.type}):s=this.attachSupsub(t,{base:s}),this.caret&&(s.caret=this.caret),this.bind(t,s)):null}};function Ci(e,t){if(!t.base)return null;if(!t.above&&!t.below){const u=new je(t.base,{type:t.type});return u.setStyle("position","relative"),u}let r=0;t.above&&(r=e.metrics.bigOpSpacing5);let n=null;const i=t.base,a=0,s=["ML__center"];if(t.paddedAboveBelow&&s.push("ML__label_padding"),t.below&&t.above){const u=e.metrics.bigOpSpacing5+t.below.height+t.below.depth+i.depth+a;n=new ti({bottom:u,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:s},{box:i,classes:["ML__center"]},r,{box:t.above,classes:s},e.metrics.bigOpSpacing5]})}else t.below?n=new ti({top:i.height-a,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:s},{box:i,classes:["ML__center"]}]}):t.above&&(n=new ti({bottom:i.depth+a,children:[{box:i,classes:["ML__center"]},r,{box:t.above,classes:s},e.metrics.bigOpSpacing5]}));return new je(n,{type:t.type})}var ri=class Mh extends we{constructor(t){var r,n,i,a;super(v(_({},t),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(r=t.isInvisible)!=null?r:!1,this.smashDepth=(n=t.smashDepth)!=null?n:!1,this.smashHeight=(i=t.smashHeight)!=null?i:!1,this.smashWidth=(a=t.smashWidth)!=null?a:!1}static fromJson(t){return new Mh(t)}toJson(){const t={};return this.isInvisible&&(t.isInvisible=!0),this.smashDepth&&(t.smashDepth=!0),this.smashHeight&&(t.smashHeight=!0),this.smashWidth&&(t.smashWidth=!0),_(_({},super.toJson()),t)}render(t){const r=new Er({parent:t,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),we.createBox(r,this.body,{classes:"inner"});const n=we.createBox(this.isInvisible?r:t,this.body);if(!n)return null;if(this.smashWidth){const i=new je(null,{classes:"fix"});return new je([n,i],{classes:"rlap"}).wrap(t)}if(!this.smashHeight&&!this.smashDepth)return n;if(this.smashHeight&&(n.height=0),this.smashDepth&&(n.depth=0),n.children)for(const i of n.children)this.smashHeight&&(i.height=0),this.smashDepth&&(i.depth=0);return new ti({firstBaseline:[{box:n}]},{type:n.type}).wrap(t)}},pa=class Ch extends we{constructor(t){var r;super(_({type:"spacing"},t)),this.width=t==null?void 0:t.width,this._braced=(r=t==null?void 0:t.braced)!=null?r:!1}static fromJson(t){return new Ch(t)}toJson(){const t=super.toJson();return this.width!==void 0&&(t.width=this.width),this._braced&&(t.braced=!0),t}render(t){var r;if(this.command==="space")return new je(this.mode==="math"?null:" ");let n;if(this.width!==void 0)n=new je(null,{classes:"mspace"}),n.left=t.toEm(this.width);else{const i=(r={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?r:"mediumspace";n=new je(null,{classes:i})}return n=this.bind(t,n),this.caret&&(n.caret=this.caret),n}_serialize(t){var r;if(!t.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=or(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,t);const i=(r=this.command)!=null?r:"";return this.width===void 0?i:this._braced&&!("register"in this.width)?`${i}{${Mi(this.width)}}`:`${i}${Mi(this.width)}`}},Ra=class Eh extends we{constructor(t){var r;super(v(_({},t),{type:"surd",mode:(r=t.mode)!=null?r:"math",style:t.style,displayContainsHighlight:!0,body:t.body})),this.above=t.index}static fromJson(t){return new Eh(v(_({},t),{index:t.above}))}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=or(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const n=this.command,i=this.bodyToLatex(t);return this.above&&!this.hasEmptyBranch("above")?yn(`${n}[${this.aboveToLatex(t)}]`,i):/^[0-9]$/.test(i)?`${n}${i}`:yn(n,i)}get children(){if(this._children)return this._children;const t=[];if(this.above)for(const r of this.above)t.push(...r.children),t.push(r);if(this.body)for(const r of this.body)t.push(...r.children),t.push(r);return this._children=t,t}render(t){var r;const n=new Er({parent:t,mathstyle:"cramp"},this.style),i=(r=we.createBox(n,this.body,{type:"inner"}))!=null?r:new je(null),a=n.scalingFactor,s=n.metrics.defaultRuleThickness/a,u=t.isDisplayStyle?po:s,d=new je(null,{classes:"ML__sqrt-line",style:this.style});d.height=s,d.softWidth=i.width;let p=a*(s+u/4);const S=Math.max(a*2*u,i.height+i.depth)+p+s,D=new Er({parent:t},this.style),P=this.bind(D,new je(Zl("inner","\\surd",S,!1,D,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!P)return null;const O=P.height+P.depth-s;O>i.height+i.depth+p&&(p=(p+O-(i.height+i.depth))/2),P.setTop(P.height-i.height-p);const de=this.bind(t,new ti({firstBaseline:[{box:new je(i)},p-2*s,{box:d},s]})),Ve=we.createBox(new Er({parent:t,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!Ve){const Xe=new je([P,de],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return Xe.setStyle("display","inline-block"),Xe.setStyle("height",Xe.height+Xe.depth,"em"),this.caret&&(Xe.caret=this.caret),this.bind(t,Xe)}const se=new ti({shift:-.6*(Math.max(P.height,de.height)-Math.max(P.depth,de.depth)),children:[{box:Ve}]}),ke=new je([new je(se,{classes:"ML__sqrt-index",type:"ignore"}),P,de],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return ke.height=P.height,ke.depth=P.depth,this.caret&&(ke.caret=this.caret),this.bind(t,ke)}},Ma=class extends je{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function Ca(e,t){if(!e.parent)return;const r=e.parent.children,n=r.indexOf(e);let i=n-1;for(;i>=0&&r[i].type==="ignore";)i-=1;if(i<0&&e.parent.parent&&e.parent.type==="lift"){Ca(e.parent,t);return}n>0&&r[n-1].type==="skip"?r[n-1].width+=t:r.splice(n,0,new Ma(t))}var Fi={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},Lo={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function no(e){Wa(e,(t,r)=>{r.type==="bin"&&(!t||/^(middle|bin|op|rel|open|punct)$/.test(t.type))&&(r.type="ord"),(t==null?void 0:t.type)==="bin"&&/^(rel|close|punct)$/.test(r.type)&&(t.type="ord"),r.type!=="ignore"&&(t=r)})}function mo(e,t){if(!e.children)return e;const r=e.children;no(r);const n=t.getRegisterAsEm("thinmuskip"),i=t.getRegisterAsEm("medmuskip"),a=t.getRegisterAsEm("thickmuskip");return Wa(r,(s,u)=>{var d,p,h;if(!s)return;const S=s.type,D=u.isTight?(d=Lo[S])!=null?d:null:(p=Fi[S])!=null?p:null,P=(h=D==null?void 0:D[u.type])!=null?h:null;P===3&&Ca(u,n),P===4&&Ca(u,i),P===5&&Ca(u,a)}),e}function Wa(e,t,r=void 0){if(!e)return r;e=[...e];for(const n of e)n.type==="lift"?r=Wa(n.children,t,r):n.type==="ignore"?Wa(n.children,t):(t(r,n),Wa(n.children,t),r=n);return r}var io=class kh extends we{constructor(t){super({type:"tooltip",command:t.command,mode:t.mode,style:t.style,body:t.body,displayContainsHighlight:!0}),this.tooltip=new we({type:"root",mode:t.content,body:t.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(t){return new kh(v(_({},t),{tooltip:ha(t.tooltip)}))}toJson(){var t;const r=(t=this.tooltip.body)==null?void 0:t.filter(n=>n.type!=="first").map(n=>n.toJson());return v(_({},super.toJson()),{tooltip:r})}render(t){const r=we.createBox(new Er,this.body);if(!r)return null;const n=new Er({parent:t,mathstyle:"displaystyle"},{fontSize:jo}),i=Tl(mo(new je(this.tooltip.render(n),{classes:"ML__tooltip-content"}),n)),a=new je([i,r],{classes:"ML__tooltip-container"});return this.caret&&(a.caret=this.caret),this.bind(t,a)}},Xi=class Ah extends we{constructor(t,r){super(v(_({},r),{type:"operator",isFunction:r==null?void 0:r.isFunction})),this.value=t,this.variant=r==null?void 0:r.variant,this.variantStyle=r==null?void 0:r.variantStyle,this.subsupPlacement=r==null?void 0:r.limits}static fromJson(t){return new Ah(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.variantStyle&&(t.variantStyle=this.variantStyle),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.value&&(t.symbol=this.value),t}render(t){var r;const n=new je(this.value,{type:"op",mode:"math",maxFontSize:t.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:t.letterShapeStyle});let i=n;if(this.superscript||this.subscript){const a=(r=this.subsupPlacement)!=null?r:"auto";i=a==="over-under"||a==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:n}):this.attachSupsub(t,{base:n})}return new je(this.bind(t,i),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=or(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const n=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&n.push("\\limits"),this.subsupPlacement==="adjacent"&&n.push("\\nolimits"),this.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(this.supsubToLatex(t)),Cr(n)}};function ha(e){if(L(e))return e.map(n=>ha(n));if(typeof e=="string")return we.fromJson(e);e=_({},e);for(const n of bs)e[n]&&(e[n]=ha(e[n]));e.args&&(e.args=Gl(e.args)),e.array&&(e.array=ha(e.array));const t=e.type;let r;t==="accent"&&(r=Hl.fromJson(e)),t==="array"&&(r=qr.fromJson(e)),t==="box"&&(r=Do.fromJson(e)),t==="chem"&&(r=N.fromJson(e)),t==="composition"&&(r=kd.fromJson(e)),t==="delim"&&(r=oe.fromJson(e)),t==="enclose"&&(r=Ge.fromJson(e)),t==="error"&&(r=ts.fromJson(e)),t==="extensible-symbol"&&(r=Tn.fromJson(e)),t==="genfrac"&&(r=Yt.fromJson(e)),t==="group"&&(r=Ad.fromJson(e)),t==="latex"&&(r=Ft.fromJson(e)),t==="latexgroup"&&(r=mr.fromJson(e)),t==="leftright"&&(r=Cn.fromJson(e)),t==="macro"&&(r=l.fromJson(e)),t==="macro-argument"&&(r=c.fromJson(e)),t==="operator"&&(r=Xi.fromJson(e)),t==="overlap"&&(r=gr.fromJson(e)),t==="overunder"&&(r=Ur.fromJson(e)),t==="placeholder"&&(r=ho.fromJson(e)),t==="prompt"&&(r=f.fromJson(e)),t==="phantom"&&(r=ri.fromJson(e)),t==="sizeddelim"&&(r=We.fromJson(e)),t==="spacing"&&(r=pa.fromJson(e)),t==="subsup"&&(r=m.fromJson(e)),t==="surd"&&(r=Ra.fromJson(e)),t==="text"&&(r=zs.fromJson(e)),t==="tooltip"&&(r=io.fromJson(e)),r||(console.assert(!t||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(t),`MathLive 0.98.5: an unexpected atom type "${t}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),r=we.fromJson(e));for(const n of bs)e[n]&&r.setChildren(e[n],n);return e.verbatimLatex!==void 0&&(r.verbatimLatex=e.verbatimLatex),e.subsupPlacement&&(r.subsupPlacement=e.subsupPlacement),e.explicitSubsupPlacement&&(r.explicitSubsupPlacement=!0),e.isFunction&&(r.isFunction=!0),e.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),e.skipBoundary&&(r.skipBoundary=!0),e.captureSelection&&(r.captureSelection=!0),r}function Gl(e){if(e&&Array.isArray(e))return e.map(t=>t==="<null>"?null:typeof t=="object"&&"group"in t?{group:t.group.map(r=>ha(r))}:typeof t=="object"&&"atoms"in t?t.atoms.map(r=>ha(r)):t)}var Va={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},rs={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},Ws=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,ws=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,ql=[/^[a-z]$/,/^[A-Z]$/,Ws,ws],Xl={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},Dd=class extends Sa{constructor(){super("math")}createAtom(e,t,r){var n,i,a,s;if(t===null)return new we({type:"mord",mode:"math",command:e,value:e,style:r});const u=window.MathfieldElement.isFunction((n=t.command)!=null?n:e);if(t.definitionType==="symbol"){const p=new we({type:(i=t.type)!=null?i:"mord",mode:"math",command:(a=t.command)!=null?a:e,value:String.fromCodePoint(t.codepoint),style:r});return u&&(p.isFunction=!0),e.startsWith("\\")&&(p.verbatimLatex=e),p}const d=new we({type:"mord",mode:"math",command:(s=t.command)!=null?s:e,value:e,style:r});return u&&(d.isFunction=!0),e.startsWith("\\")&&(d.verbatimLatex=e),d}serialize(e,t){const r=J0(e,v(_({},t),{defaultMode:"math"}));return r.length===0||t.defaultMode!=="text"?r:["$ ",...r," $"]}getFont(e,t){console.assert(t.variant!==void 0);let{variant:r}=t,{variantStyle:n}=t;r==="normal"&&!n&&/[\u00A3\u0131\u0237]/.test(e.value)&&(r="main",n="italic"),r==="normal"&&!n&&e.value.length===1&&ql.forEach((u,d)=>{var p;u.test(e.value)&&Xl[(p=t.letterShapeStyle)!=null?p:"tex"][d]==="it"&&(n="italic")}),n==="up"&&(n=void 0);const i=n?r+"-"+n:r;console.assert(Va[i]!==void 0);const[a,s]=Va[i];return rs[r]&&!rs[r].test(e.value)?(e.value=ot(e.value,r,n),null):(Ws.test(e.value)&&(e.classes+=" lcGreek"),s&&(e.classes+=" "+s),a)}};function J0(e,t){const{parent:r}=e[0],n=Vs(r);return Pa(e,"variant").map(i=>{const a=Vs(i[0]);let s="";a&&a!==n&&(s={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[a],console.assert(s!==void 0));const u=Cr(i.map(d=>d._serialize(t)));return s?yn(s,u):u})}function Vs(e){if(!e)return"";const{style:t}=e;if(t.variant===void 0)return"";let r=t.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(t.variant)&&t.variantStyle&&t.variantStyle!=="up"&&(r+="-"+t.variantStyle),r}new Dd;function Y0(e,t){return e.map(r=>r._serialize(t))}function Ld(e,t){return Pa(e,"fontShape").map(r=>{const n=Y0(r,t),{fontShape:i}=r[0].style;let a="";return i==="it"&&(a="\\textit"),i==="sl"&&(a="\\textsl"),i==="sc"&&(a="\\textsc"),i==="n"&&(a="\\textup"),!a&&i?`{${yn("\\fontshape",i)}${Cr(n)}}`:a?yn(a,Cr(n)):Cr(n)})}function Jc(e,t){return Pa(e,"fontSeries").map(r=>{const n=Ld(r,t),{fontSeries:i}=r[0].style;let a="";return i==="b"&&(a="\\textbf"),i==="l"&&(a="\\textlf"),i==="m"&&(a="\\textmd"),i&&!a?`{${yn("\\fontseries",i)}${Cr(n)}}`:a?yn(a,Cr(n)):Cr(n)})}function Jl(e,t){return Pa(e,"fontSize").map(r=>{var n,i;const a=Jc(r,t),s=(i=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(n=r[0].style.fontSize)!=null?n:""])!=null?i:"";return s?`${s} ${Cr(a)}`:Cr(a)})}function Id(e,t,r){return Pa(e,"fontFamily").map(n=>{var i,a;const s=Jl(n,t),u=(a={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(i=n[0].style.fontFamily)!=null?i:""])!=null?a:"";return u?`\\${u}{${Cr(s)}}`:n[0].style.fontFamily?`{\\fontfamily{${n[0].style.fontFamily}} ${Cr(s)}}`:r?`\\text{${Cr(s)}}`:Cr(s)})}var Yl={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Yc=class extends Sa{constructor(){super("text")}createAtom(e,t,r){return t&&t.definitionType==="symbol"?new zs(e,String.fromCodePoint(t.codepoint),r!=null?r:{}):null}serialize(e,t){return Id(e,v(_({},t),{defaultMode:"text"}),t.defaultMode!=="text")}getFont(e,t){var r,n,i,a,s;const{fontFamily:u}=t;if(Yl[u]?e.classes+=" "+Yl[u]:u&&e.setStyle("font-family",u),t.fontShape&&(e.classes+=" ",e.classes+=(r={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape])!=null?r:""),t.fontSeries){const d=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);d&&(e.classes+=" ",e.classes+=(i={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(n=d[1])!=null?n:""])!=null?i:"",e.classes+=" ",e.classes+=(s={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(a=d[2])!=null?a:""])!=null?s:"")}return"Main-Regular"}};new Yc;var Q0=class extends Sa{constructor(){super("latex")}createAtom(e){return new Ft(e)}serialize(e,t){return e.filter(r=>r instanceof Ft&&!r.isSuggestion).map(r=>r.value)}getFont(){return null}};new Q0;var Us={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},Zs={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},zf={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},Kf={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Th={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},$h={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Ph={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},Rh={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Oh={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Nh={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Fh={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},zh={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Kh={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function Hf(e){const t=e.split("+"),r={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:t.pop()};return t.includes("shift")&&(r.shift=!0),t.includes("alt")&&(r.alt=!0),t.includes("ctrl")&&(r.ctrl=!0),t.includes("cmd")&&(r.cmd=!0),t.includes("win")&&(r.win=!0),t.includes("meta")&&(r.meta=!0),r}function Ql(e){let t="";return e.shift&&(t+="shift+"),e.alt&&(t+="alt+"),e.ctrl&&(t+="ctrl+"),e.cmd&&(t+="cmd+"),e.win&&(t+="win+"),e.meta&&(t+="meta+"),t+e.key}var Hh={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},Qc=[],eu;function ef(){switch(Z()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ua(e){(!e.platform||e.platform===ef())&&Qc.push(e)}function Wh(e,t){var r;const n={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return n;for(const[i,a]of Object.entries(t.mapping)){if(a[0]===e)return n.key=`[${i}]`,n;if(a[1]===e)return n.shift=!0,n.key=`[${i}]`,n;if(a[2]===e)return n.alt=!0,n.key=`[${i}]`,n;if(a[3]===e)return n.shift=!0,n.alt=!0,n.key=`[${i}]`,n}return n.key=(r=Hh[e])!=null?r:"",n}function Vh(e){if(e.code)return e;const t=Object.entries(tu().mapping);let r=!1,n=!1,i="";for(let a=0;a<4;a++){for(const[s,u]of t)if(u[a]===e.key){i=s,a===3?(r=!0,n=!0):a===2?r=!0:a===1&&(n=!0);break}if(i)break}return new KeyboardEvent(e.type,v(_({},e),{altKey:r,shiftKey:n,code:i}))}function Uh(e){var t,r;if(!e||e.key==="Unidentified"||e.key==="Dead")return;const n=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;for(const i of Qc)((t=i.mapping[e.code])==null?void 0:t[n])===e.key?i.score+=1:(r=i.mapping[e.code])!=null&&r[n]&&(i.score=0);Qc.sort((i,a)=>a.score-i.score)}function Zh(e){eu=Qc.find(t=>e.startsWith(t.locale))}function tu(){return eu!=null?eu:Qc[0]}function jh(){switch(ef()){case"apple":return Zs;case"windows":return zf;case"linux":return Kf}return Zs}switch(ef()){case"apple":Ua(Zs),Ua(Th),Ua(Fh),Ua(Rh);break;case"windows":Ua(zf),Ua($h),Ua(zh),Ua(Oh);break;case"linux":Ua(Kf),Ua(Ph),Ua(Kh),Ua(Nh);break}Ua(Us);function tf(e){var t;const r=/macos|ios/.test(Z()),n=e.split("+");let i="";for(const a of n)i&&(i+=r?"\u2009":'<span class="ML__shortcut-join">+</span>'),a.startsWith("[Key")?i+=a.slice(4,5):a.startsWith("Key")?i+=a.slice(3,4):a.startsWith("[Digit")?i+=a.slice(6,7):a.startsWith("Digit")?i+=a.slice(5,6):i+=(t={cmd:"\u2318",meta:r?"\u2318":"Ctrl",shift:r?"\u21E7":"Shift",alt:r?"\u2325":"Alt",ctrl:r?"\u2303":"Ctrl","\n":r?"\u23CE":"Return","[return]":r?"\u23CE":"Return","[enter]":r?"\u2324":"Enter","[tab]":r?"\u21E5":"Tab","[escape]":"Esc","[backspace]":r?"\u232B":"Backspace","[delete]":r?"\u2326":"Del","[pageup]":r?"\u21DE":"Page Up","[pagedown]":r?"\u21DF":"Page Down","[home]":r?"\u2912":"Home","[end]":r?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[a.toLowerCase()])!=null?t:a.toUpperCase();return i}function Bd(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const t=[...e.touches].reduce((n,i)=>({x:n.x+i.clientX,y:n.y+i.clientY}),{x:0,y:0}),r=e.touches.length;return{x:t.x/r,y:t.y/r}}}function js(e){const t={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(t.alt=!0),e.ctrlKey&&(t.control=!0),e.metaKey&&(t.meta=!0),e.shiftKey&&(t.shift=!0)),t}function Gh(e,t){return!e&&t||e&&!t?!1:!e||!t?!0:e.alt===t.alt&&e.control===t.control&&e.shift===t.shift&&e.meta===t.meta}var qh=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function Td(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:qh.has(e.code)}function $d(){var e;let t=document.activeElement;for(;(e=t==null?void 0:t.shadowRoot)!=null&&e.activeElement;)t=t.shadowRoot.activeElement;return t}var Io=class os{static get scrim(){return os._scrim||(os._scrim=new os),os._scrim}static open(t){os.scrim.open(t)}static close(){os.scrim.close()}static get state(){return os.scrim.state}static get element(){return os.scrim.element}constructor(t){var r,n;this.lightDismiss=(r=t==null?void 0:t.lightDismiss)!=null?r:!0,this.translucent=(n=t==null?void 0:t.translucent)!=null?n:!1,this.state="closed"}get element(){if(this._element)return this._element;const t=document.createElement("div");return t.setAttribute("role","presentation"),t.style.position="fixed",t.style.contain="content",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.zIndex="var(--scrim-zindex, 10099)",t.style.outline="none",this.translucent?(t.style.background="rgba(255, 255, 255, .2)",t.style.backdropFilter="contrast(40%)"):t.style.background="transparent",this._element=t,t}open(t){var r;if(this.state!=="closed")return;this.state="opening",this.onDismiss=t==null?void 0:t.onDismiss,this.savedActiveElement=$d();const{element:n}=this;((r=t==null?void 0:t.root)!=null?r:document.body).appendChild(n),n.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const i=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const a=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${a+i}px`,t!=null&&t.child&&n.append(t.child),this.state="open"}close(){var t,r,n,i;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:a}=this;a.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),a.remove(),document.body.style.overflow=(t=this.savedOverflow)!=null?t:"",document.body.style.marginRight=(r=this.savedMarginRight)!=null?r:"",$d()!==this.savedActiveElement&&((i=(n=this.savedActiveElement)==null?void 0:n.focus)==null||i.call(n)),a.innerHTML="",this.state="closed"}handleEvent(t){this.lightDismiss&&(t.target===this._element&&t.type==="click"?(this.close(),t.preventDefault(),t.stopPropagation()):t.target===document&&(t.type==="touchmove"||t.type==="scroll")&&(this.close(),t.preventDefault(),t.stopPropagation()))}};function Xh(e,t,r){let n=null,i=null,a=!1,s=!1,u=!1;const d=new AbortController,p=d.signal;return e.addEventListener("keydown",h=>{if(a||h.key==="Process"||h.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(h.code)){n=null;return}n=h,i=null,r.onKeystroke(h)?e.textContent="":n=null},{capture:!0,signal:p}),e.addEventListener("keypress",h=>{a||(n&&i&&r.onKeystroke(n),i=h)},{capture:!0,signal:p}),e.addEventListener("compositionstart",h=>{e.textContent="",a=!0,r.onCompositionStart(h.data)},{capture:!0,signal:p}),e.addEventListener("compositionupdate",h=>{a&&r.onCompositionUpdate(h.data)},{capture:!0,signal:p}),e.addEventListener("compositionend",h=>{e.textContent="",a&&(a=!1,r.onCompositionEnd(h.data))},{capture:!0,signal:p}),e.addEventListener("beforeinput",h=>h.stopImmediatePropagation(),{signal:p}),e.addEventListener("input",h=>{var S;if(!a&&(e.textContent="",h.inputType!=="insertCompositionText")){if(h.inputType==="insertFromPaste"){h.preventDefault(),h.stopPropagation();return}r.onInput((S=h.data)!=null?S:""),h.preventDefault(),h.stopPropagation()}},{signal:p}),e.addEventListener("paste",h=>{e.focus({preventScroll:!0}),e.textContent="",r.onPaste(h)||h.preventDefault(),h.stopImmediatePropagation()},{signal:p}),e.addEventListener("cut",h=>r.onCut(h),{capture:!0,signal:p}),e.addEventListener("copy",h=>r.onCopy(h),{capture:!0,signal:p}),e.addEventListener("blur",h=>{var S,D;if(((D=(S=h.relatedTarget)==null?void 0:S._mathfield)==null?void 0:D.element)===t){e.focus({preventScroll:!0}),h.preventDefault(),h.stopPropagation();return}const P=Io.state;if(P==="open"||P==="opening"){h.preventDefault(),h.stopPropagation();return}if(h.relatedTarget===h.target.getRootNode().host){h.preventDefault(),h.stopPropagation();return}u||s||(u=!0,n=null,i=null,r.onBlur(),u=!1)},{capture:!0,signal:p}),e.addEventListener("focus",h=>{u||s||(s=!0,r.onFocus(),s=!1)},{capture:!0,signal:p}),{dispose:()=>d.abort(),cancelComposition:()=>{a&&(e.blur(),requestAnimationFrame(()=>e.focus({preventScroll:!0})))},blur:()=>{typeof e.blur=="function"&&e.blur()},focus:()=>{!s&&typeof e.focus=="function"&&e.focus({preventScroll:!0})},hasFocus:()=>$d()===e,setAriaLabel:h=>e.setAttribute("aria-label",h),setValue:h=>{var S;e.textContent=h,e.style.left="-1000px",(S=window.getSelection())==null||S.selectAllChildren(e)},moveTo:(h,S)=>{e.style.top=`${S}px`,e.style.left=`${h}px`}}}function ec(e){var t;if(!e||!Td(e))return"";let r;return e.key==="Unidentified"&&e.target&&(r=e.target.value),r=(t=r!=null?r:e.key)!=null?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(r)&&(r=""),r}function Wf(e){e=Vh(e);const t=[];return e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),t.length===0?`[${e.code}]`:(t.push(`[${e.code}]`),t.join("+"))}function Jh(e){if(Re()){const t=Z(),r=e.startsWith("!"),n=e.endsWith(t);if(r&&!n||!r&&n)return!0}return e==="!other"?!1:e==="other"}function Yh(e,t,r){if(e.length===0)return"";const n=Ql(Hf(Wf(r))),i=Ql({key:r.key,shift:r.shiftKey,alt:r.altKey,ctrl:r.ctrlKey,meta:r.metaKey||r.ctrlKey&&/macos|ios/.test(Z()),cmd:!1,win:!1});for(let a=e.length-1;a>=0;a--)if((e[a].key===n||e[a].key===i)&&(!e[a].ifMode||e[a].ifMode===t))return e[a].command;return""}function Vf(e){let t=e;return L(t)&&(t=t.length>0?t[0]+"("+t.slice(1).join("")+")":""),t}function Qh(e,t){let r=[];if(typeof t=="string"){const a=dd[t];L(a)?r=a.slice():a&&r.push(a)}const n=Vf(t),i=new RegExp("^"+n.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const a of e)i.test(Vf(a.command))&&r.push(a.key);return r.map(tf)}function em(e,t){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);if(e.ifLayout!==void 0&&(t.score===0||!e.ifLayout.includes(t.id)))return;const r=Hf(e.key);let n=e.ifPlatform;if(r.cmd){if(n&&n!=="macos"&&n!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+n+`"
|
|
|
"cmd" modifier can only be used with macOS or iOS platform.`);n||(n=Z()==="ios"?"ios":"macos"),r.win=!1,r.cmd=!1,r.meta=!0}if(r.win){if(n&&n!=="windows")throw new Error('Unexpected "win" modifier with platform "'+n+`"
|
|
|
"win" modifier can only be used with Windows platform.`);n="windows",r.win=!1,r.cmd=!1,r.meta=!0}if(n&&!Jh(n))return;if(/^\[.+\]$/.test(r.key))return v(_({},e),{key:Ql(r)});const i=Wh(r.key,t);if(!i)return v(_({},e),{key:Ql(r)});if(i.shift&&r.shift||i.alt&&r.alt)throw new Error(`The keybinding ${e.key} (${rf(e.command)}) is conflicting with the key combination ${Ql(i)} using the ${t.displayName} keyboard layout`);return i.shift=i.shift||r.shift,i.alt=i.alt||r.alt,i.meta=r.meta,i.ctrl=r.ctrl,v(_({},e),{key:Ql(i)})}function rf(e){if(Array.isArray(e)){const t=[...e];return t.shift()+"("+t.map(r=>typeof r=="string"?`"${r}"`:r.toString()).join(", ")+")"}return e}function tm(e,t){const r=[],n=[];for(const i of e)try{const a=em(i,t);if(!a)continue;const s=n.find(u=>u.key===a.key&&u.ifMode===a.ifMode);if(s)throw new Error(`Ambiguous key binding ${i.key} (${rf(i.command)}) matches ${s.key} (${rf(s.command)}) with the ${t.displayName} keyboard layout`);n.push(a)}catch(a){a instanceof Error&&r.push(a.message)}return[n,r]}var rm=class extends ln{constructor(){super("latex")}createAtom(e){return new Ft(e)}onPaste(e,t){if(!t)return!1;const r=typeof t=="string"?t:t.getData("application/x-latex")||t.getData("text/plain");return r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r)&&(e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Un(e)),e.startRecording(),!0):!1}insert(e,t,r){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;r||(r={}),r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder");const{silenceNotifications:n}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const i=e.silenceNotifications;e.silenceNotifications=!0,r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ni(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward");const a=[];for(const d of t)be.test(d)&&a.push(new Ft(d));let s=e.at(e.position);if(s instanceof mr&&(s=s.lastChild),!(s.parent instanceof mr)){const d=new mr("");s.parent.addChildAfter(d,s),s=d.firstChild}const u=s.parent.addChildrenAfter(a,s);return e.silenceNotifications=i,r.selectionMode==="before"||(r.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(u)):u&&(e.position=e.offsetOf(u))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=n,!0}};function nm(e){return e.atoms.find(t=>t.type==="latexgroup")}function ru(e){var t,r;const n=e.atoms.find(i=>i.type==="latexgroup");return n?(r=(t=n.body)==null?void 0:t.filter(i=>i.type==="latex"))!=null?r:[]:[]}function Uf(e,t){var r;let n=0,i=!1;const a=Number.isFinite(t==null?void 0:t.before)?(r=t==null?void 0:t.before)!=null?r:0:e.lastOffset;for(;n<=a&&!i;){const d=e.at(n);i=d instanceof Ft&&d.isSuggestion,i||n++}if(!i)return[void 0,void 0];let s=n,u=!1;for(;s<=a&&!u;){const d=e.at(s);u=!(d instanceof Ft&&d.isSuggestion),u||s++}return[n-1,s-1]}new rm;function Pd(e){const t=ru(e.model).filter(r=>r.isSuggestion);if(t.length!==0){e.model.position=e.model.offsetOf(t[0].leftSibling);for(const r of t)r.parent.removeChild(r)}}function nu(e,t){var r;const{model:n}=e;Pd(e);for(const h of ru(n))h.isError=!1;if(!n.selectionIsCollapsed||e.options.popoverPolicy==="off"){rc(e);return}const i=[];let a=n.at(n.position);for(;a&&a instanceof Ft&&/^[a-zA-Z\*]$/.test(a.value);)a=a.leftSibling;if(a&&a instanceof Ft&&a.value==="\\")for(i.push(a),a=a.rightSibling;a&&a instanceof Ft&&/^[a-zA-Z\*]$/.test(a.value);)i.push(a),a=a.rightSibling;const s=i.map(h=>h.value).join(""),u=ne(e,s);if(u.length===0){if(/^\\[a-zA-Z\*]+$/.test(s))for(const h of i)h.isError=!0;rc(e);return}const d=(r=t==null?void 0:t.atIndex)!=null?r:0;e.suggestionIndex=d<0?u.length-1:d%u.length;const p=u[e.suggestionIndex];if(p!==s){const h=i[i.length-1];h.parent.addChildrenAfter([...p.slice(s.length-p.length)].map(S=>new Ft(S,{isSuggestion:!0})),h),Gs(e,{interactive:!0})}am(e,u)}function Zf(e){const[t,r]=Uf(e,{before:e.position});if(t===void 0||r===void 0)return!1;let n=!1;return e.getAtoms([t,r]).forEach(i=>{i.isSuggestion&&(i.isSuggestion=!1,n=!0)}),n}function tc(e,t="accept",r){var n,i;rc(e);const a=nm(e.model);if(!a)return!1;if(t==="accept-suggestion"||t==="accept-all"){const p=ru(e.model).filter(h=>h.isSuggestion);if(p.length!==0){for(const h of p)h.isSuggestion=!1;e.model.position=e.model.offsetOf(p[p.length-1])}if(t==="accept-suggestion")return p.length!==0}const u=ru(e.model).filter(p=>!p.isSuggestion).map(p=>p.value).join(""),d=a.leftSibling;return a.parent.removeChild(a),e.model.position=e.model.offsetOf(d),e.switchMode((n=r==null?void 0:r.mode)!=null?n:"math"),t==="reject"||(ln.insert(e.model,u,{selectionMode:(i=r==null?void 0:r.selectItem)!=null&&i?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function Rd(e){var t;let r=document.getElementById(e);return r?r.dataset.refcount=Number(Number.parseInt((t=r.dataset.refcount)!=null?t:"0")+1).toString():(r=document.createElement("div"),r.setAttribute("aria-hidden","true"),r.dataset.refcount="1",r.id=e,document.body.append(r)),r}function nf(e){var t;const r=document.getElementById(e);if(!r)return;const n=Number.parseInt((t=r.getAttribute("data-refcount"))!=null?t:"0");n<=1?r.remove():r.dataset.refcount=Number(n-1).toString()}function im(e,t){const r=new Er({from:e.context}),n=new we({mode:"math",type:"root",body:w(t,{context:r})}),i=Tl(mo(new je(n.render(r),{classes:"ML__base"}),r));return $l(i,{classes:"ML__latex"}).toMarkup()}function am(e,t){var r;if(t.length===0){rc(e);return}let n="";for(const[a,s]of t.entries()){const u=s,d=im(e,s),p=Qh(e.keybindings,u).join("<br>");n+=`<li role="button" data-command="${u}" ${a===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${u}</span><span class="ML__popover__command">${d}</span>`,p&&(n+=`<span class="ML__popover__keybinding">${p}</span>`),n+="</li>"}const i=om(e,`<ul>${n}</ul>`);af()&&((r=i.querySelector(".ML__popover__current"))==null||r.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var a;i&&!af()&&(i.classList.add("is-visible"),Od(e),(a=i.querySelector(".ML__popover__current"))==null||a.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function af(){const e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function Od(e,t){var r;if(!e.element||e.element.mathfield!==e||!af())return;if(((r=e.model.at(e.model.position))==null?void 0:r.type)!=="latex"){rc(e);return}if(t!=null&&t.deferred){setTimeout(()=>Od(e),32);return}const n=Fl(e.field);if(!n)return;const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,a=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerWidth-document.documentElement.clientWidth,u=window.innerHeight-document.documentElement.clientHeight,d=window.mathVirtualKeyboard.boundingRect.height,p=document.getElementById("mathlive-suggestion-popover");n.x+p.offsetWidth/2>a-s?p.style.left=`${a-p.offsetWidth-s}px`:n.x-p.offsetWidth/2<0?p.style.left="0":p.style.left=`${n.x-p.offsetWidth/2}px`;const h=n.y-n.height;i-u-d-n.y<h?(p.classList.add("ML__popover--reverse-direction"),p.classList.remove("top-tip"),p.classList.add("bottom-tip"),p.style.top=`${n.y-n.height-p.offsetHeight-15}px`):(p.classList.remove("ML__popover--reverse-direction"),p.classList.add("top-tip"),p.classList.remove("bottom-tip"),p.style.top=`${n.y+15}px`)}function rc(e){e.suggestionIndex=0;const t=document.getElementById("mathlive-suggestion-popover");t&&(t.classList.remove("is-visible"),t.innerHTML="")}function om(e,t){let r=document.getElementById("mathlive-suggestion-popover");return r||(r=Rd("mathlive-suggestion-popover"),Ha("suggestion-popover"),Ha("core"),r.addEventListener("pointerdown",n=>n.preventDefault()),r.addEventListener("click",n=>{let i=n.target;for(;i&&!i.dataset.command;)i=i.parentElement;i&&(tc(e,"reject"),ln.insert(e.model,i.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})),r.innerHTML=window.MathfieldElement.createHTML(t),r}function sm(){document.getElementById("mathlive-suggestion-popover")&&(nf("mathlive-suggestion-popover"),ro("suggestion-popover"),ro("core"))}function lm(){const e=String(new Error().stack).replace(/^Error.*\n/,"").split(`
|
|
|
`);if(e.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let t=e[1],r=t.match(/http.*\.ts[\?:]/);return r&&(t=e[2]),r=t.match(/(https?:.*):[0-9]+:[0-9]+/),r||(r=t.match(/at (.*(\.ts))[\?:]/),r||(r=t.match(/at (.*(\.mjs|\.js))[\?:]/))),r?r[1]:(console.error(e),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${t}").`),"")}var Nd=null,jf,Gf,of=((Gf=(jf=globalThis==null?void 0:globalThis.document)==null?void 0:jf.currentScript)==null?void 0:Gf.src)||lm();function qf(e){return Es(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(Nd===null)try{const t=yield fetch(of,{method:"HEAD"});t.status===200&&(Nd=t.url)}catch(t){console.error(`Invalid URL "${e}" (relative to "${of}")`)}return new URL(e,Nd!=null?Nd:of).href})}function cm(e,t,r={}){return new FontFace(e,`url(${t}.woff2) format('woff2')`,r)}var Za="not-loaded";function um(){return Es(this,null,function*(){return Za="not-loaded",Fd()})}function Fd(){return Es(this,null,function*(){var e;if(Za!=="not-loaded")return;if(Za="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){Za="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const r=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],n=Array.from(document.fonts).map(s=>s.family);if(r.every(s=>n.includes(s))){Za="ready";return}if(!window.MathfieldElement.fontsDirectory){Za="not-loaded";return}const i=yield qf(window.MathfieldElement.fontsDirectory);if(!i){document.body.classList.add("ML__fonts-did-not-load"),Za="error";return}const a=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(s=>cm(s[0].replace(/-[a-zA-Z]+$/,""),`${i}/${s[0]}`,s[1]));try{(yield Promise.all(a.map(u=>{try{return u.load()}catch(d){}}))).forEach(u=>document.fonts.add(u)),Za="ready";return}catch(s){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${i}"`,{cause:s}),document.body.classList.add("ML__fonts-did-not-load")}Za="error"}})}function dm(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r),t=t|0;return Math.abs(t)}function Un(e,t){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame(()=>{Qo(e)&&e.dirty&&(e.atomBoundsCache=new Map,Gs(e,t),e.atomBoundsCache=void 0)})))}function fm(e,t){var r;t=t!=null?t:{};const n=new Er({from:v(_({},e.context),{atomIdsSettings:{seed:t.forHighlighting?dm(we.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:(r=t.forHighlighting)!=null?r:!1},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:e.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),i=e.model.root.render(n);return $l(mo(i,n),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function Xf(e,t){const{model:r}=e;r.root.caret=void 0,r.root.isSelected=!1,r.root.containsCaret=!0;for(const i of r.atoms)i.caret=void 0,i.isSelected=!1,i.containsCaret=!1;if(r.selectionIsCollapsed){const i=r.at(r.position);i.caret=e.model.mode;let a=i.parent;for(;a;)a.containsCaret=!0,a=a.parent}else{const i=r.getAtoms(r.selection,{includeChildren:!0});for(const a of i)a.isSelected=!0}return fm(e,t).toMarkup()}function Gs(e,t){if(!Qo(e))return;t!=null||(t={});const r=e.element.querySelector("[part=virtual-keyboard-toggle]");r&&(r.style.display=e.hasEditableContent?"":"none");const n=e.field;if(!n)return;const i=e.isSelectionEditable&&e.hasFocus(),a=n.classList.contains("ML__focused");a&&!i?n.classList.remove("ML__focused"):!a&&i&&n.classList.add("ML__focused");let s=Xf(e,t);const u=e.element.querySelector("[part=menu-toggle]");if(u&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||e.userSelect==="none"?u.style.display="none":u.style.display=""),e.model.atoms.length<=1){const d=e.options.contentPlaceholder;d&&(s+=`<span part=placeholder class="ML__content-placeholder">${Ei(d)}</span>`)}n.innerHTML=window.MathfieldElement.createHTML(s),zd(e,t.interactive),e.dirty=!1}function zd(e,t){const r=e.field;if(!r)return;for(const u of r.querySelectorAll(".ML__selection, .ML__contains-highlight"))u.remove();!(t!=null&&t)&&Za!=="error"&&Za!=="ready"&&setTimeout(()=>{Za==="ready"?zd(e):setTimeout(()=>zd(e),128)},32);const n=e.model,i=r.offsetWidth,a=r.getBoundingClientRect().width;let s=Math.floor(a)/i;if(s=isNaN(s)?1:s,n.selectionIsCollapsed){Od(e,{deferred:!0});let u=n.at(n.position);for(;u&&u.type!=="prompt"&&!(u.containsCaret&&u.displayContainsHighlight);)u=u.parent;if(u!=null&&u.containsCaret&&u.displayContainsHighlight){const d=pd(e,Hs(e,u),s);if(d){d.left/=s,d.right/=s,d.top/=s,d.bottom/=s;const p=document.createElement("div");p.classList.add("ML__contains-highlight"),p.style.position="absolute",p.style.left=`${d.left+1}px`,p.style.top=`${Math.ceil(d.top)}px`,p.style.width=`${Math.ceil(d.right-d.left)}px`,p.style.height=`${Math.ceil(d.bottom-d.top)}px`,r.insertBefore(p,r.childNodes[0])}}return}for(const u of pm(md(e,{excludeAtomsWithBackground:!0}))){u.left/=s,u.right/=s,u.top/=s,u.bottom/=s;const d=document.createElement("div");d.classList.add("ML__selection"),d.style.position="absolute",d.style.left=`${u.left}px`,d.style.top=`${u.top}px`,d.style.width=`${Math.ceil(u.right-u.left)}px`,d.style.height=`${Math.ceil(u.bottom-u.top-1)}px`,r.insertBefore(d,r.childNodes[0])}}function pm(e){let t=[];for(const r of e){let n=!1;for(const i of t)if(r.left===i.left&&r.right===i.right&&r.top===i.top&&r.bottom===i.bottom){n=!0;break}n||t.push(r)}e=t,t=[];for(const r of e){let n=0;for(const i of e)if(r.left>=i.left&&r.right<=i.right&&r.top>=i.top&&r.bottom<=i.bottom&&(n+=1,n>1))break;n===1&&t.push(r)}return t}var Jf=3,Bo;function Oa(e,t){t=_({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},t!=null?t:{}),Bo||(Bo={});for(const r of Object.keys(e))console.assert(!Bo[r],"Selector already defined: ",r),Bo[r]=v(_({},t),{fn:e[r]})}function sf(e){let t;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return sf(e[1]);t=e[0]}else t=e;return t=t.replace(/-\w/g,r=>r[1].toUpperCase()),Bo[t]}function nc(e){var t;return(t=sf(e))==null?void 0:t.target}function hm(e,t){var r;if(!t)return!1;let n,i=[],a=!1,s=!1;L(t)?(n=t[0],i=t.slice(1)):n=t,n=n.replace(/-\w/g,p=>p[1].toUpperCase());const u=Bo[n],d=u==null?void 0:u.target;if(d==="model"){if(!e.isSelectionEditable&&(u!=null&&u.changeContent))return e.model.announce("plonk"),!1;/^(delete|add)/.test(n)&&(n!=="deleteBackward"&&e.flushInlineShortcutBuffer(),e.snapshot(n)),/^complete/.test(n)||Pd(e),Bo[n].fn(e.model,...i),nu(e),s=!0,a=!0}else if(d==="virtual-keyboard")s=(r=window.mathVirtualKeyboard.executeCommand(t))!=null?r:!1,a=!0;else if(Bo[n]){if(!e.isSelectionEditable&&(u!=null&&u.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(n)&&e.flushInlineShortcutBuffer(),s=Bo[n].fn(e,...i),a=!0}else throw new Error(`Unknown command "${n}"`);return d!=="virtual-keyboard"&&(!e.model.selectionIsCollapsed||u!=null&&u.changeSelection&&t!=="deleteBackward")&&(e.flushInlineShortcutBuffer(),u!=null&&u.changeContent||e.stopCoalescingUndo(),e.defaultStyle={}),s&&Un(e),a}function mm(e,t){var r;if(!e)return!1;e.focus(),Zp.keypressVibration&<()&&navigator.vibrate(Jf);const n=sf(t);window.MathfieldElement.playSound((r=n==null?void 0:n.audioFeedback)!=null?r:"keypress");const i=e.executeCommand(t);return e.scrollIntoView(),i}Oa({performWithFeedback:(e,t)=>mm(e,t)});function gm(e){return nu(e,{atIndex:e.suggestionIndex+1}),!1}function vm(e){return nu(e,{atIndex:e.suggestionIndex-1}),!1}Oa({complete:tc},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Oa({nextSuggestion:gm,previousSuggestion:vm},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Kd="mathlive#virtual-keyboard-message";function lf(e){var t;return e.type!=="message"?!1:((t=e.data)==null?void 0:t.type)===Kd}var bm=class Dh{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new Dh),this._singleton}set alphabeticLayout(t){this.sendMessage("update-setting",{alphabeticLayout:t})}set layouts(t){this.sendMessage("update-setting",{layouts:t})}get normalizedLayouts(){return[]}set editToolbar(t){this.sendMessage("update-setting",{editToolbar:t})}set actionKeycap(t){this.sendMessage("update-setting",{actionKeycap:t})}set shiftKeycap(t){this.sendMessage("update-setting",{shiftKeycap:t})}set backspaceKeycap(t){this.sendMessage("update-setting",{backspaceKeycap:t})}set tabKeycap(t){this.sendMessage("update-setting",{tabKeycap:t})}set container(t){throw new Error("Container inside an iframe cannot be changed")}show(t){this.sendMessage("show",t)}hide(t){this.sendMessage("hide",t)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(t){t?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(t){return this.sendMessage("execute-command",{command:t}),!0}updateToolbar(t){this.sendMessage("update-toolbar",t)}update(t){this.sendMessage("update-setting",t)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(t,r,n){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(r)||this.listeners[t].add(r)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(r=>{typeof r=="function"?r(t):r==null||r.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,r,n){this.listeners[t]&&this.listeners[t].delete(r)}handleEvent(t){if(lf(t)){if(!jc(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");this.handleMessage(t.data)}}handleMessage(t){const{action:r}=t;if(r==="execute-command"){const{command:n}=t;nc(n)==="virtual-keyboard"&&this.executeCommand(n);return}if(r==="synchronize-proxy"){this._boundingRect=t.boundingRect,this._isShifted=t.isShifted;return}if(r==="geometry-changed"){this._boundingRect=t.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(t,r={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(_({type:Kd,action:t},r),this.targetOrigin)}},Yf={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"αβγ",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>φ</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>ς</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>ϵ</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>ρ</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>τ</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>υ</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>θ</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>ι</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>ο</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>π</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>α</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>σ</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>δ</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>γ</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>η</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>ξ</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>κ</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>λ</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>ζ</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>χ</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>ψ</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>ω</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>β</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>ν</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>μ</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>ε</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>ϑ</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>ϰ</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>ϖ</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>ϱ</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"∞\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
|
|
|
.minimalist-backdrop {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
.minimalist-container {
|
|
|
--keycap-height: 40px;
|
|
|
--keycap-max-width: 53px;
|
|
|
--keycap-small-font-size: 12px;
|
|
|
background: var(--keyboard-background);
|
|
|
padding: 20px;
|
|
|
border-top-left-radius: 8px;
|
|
|
border-top-right-radius: 8px;
|
|
|
border: 1px solid var(--keyboard-border);
|
|
|
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
|
|
|
}
|
|
|
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Hd={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},iu;function Qf(e,t){var r,n,i;const a=Ss.singleton;if(!a)return;const s=ic(e),u=(n=(r=a.getKeycap(s==null?void 0:s.id))==null?void 0:r.variants)!=null?n:"";if(typeof u=="string"&&!ep(u)||Array.isArray(u)&&u.length===0){t==null||t();return}const d={};let p="";for(const de of xm(u)){const Ve=rp(de),se=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);d[se]=Ve;const[ke,Xe]=Wd(Ve);p+=`<div id=${se} class="item ${Xe}">${ke}</div>`}const h=document.createElement("div");h.setAttribute("aria-hidden","true"),h.className="MLK__variant-panel",h.style.height="auto";const S=Object.keys(d).length;let D=5;S===1?D=1:S===2||S===4?D=2:S===3||S===5||S===6?D=3:S>=7&&S<14&&(D=4),h.style.width=`calc(var(--variant-keycap-length) * ${D} + 12px)`,h.innerHTML=Zp.createHTML(p),Io.open({root:(i=a==null?void 0:a.container)==null?void 0:i.querySelector(".ML__keyboard"),child:h}),iu=new AbortController;const{signal:P}=iu,O=e==null?void 0:e.getBoundingClientRect();if(O){O.top-h.clientHeight<0&&(h.style.width="auto",S<=6?h.style.height="56px":S<=12?h.style.height="108px":S<=18?h.style.height="205px":h.classList.add("compact"));const de=Math.max(0,Math.min(window.innerWidth-h.offsetWidth,(O.left+O.right-h.offsetWidth)/2)),Ve=O.top-h.clientHeight+5;h.style.transform=`translate(${de}px, ${Ve}px)`,h.classList.add("is-visible"),requestAnimationFrame(()=>{h.addEventListener("pointerup",se=>{const ke=ic(se.target);!(ke!=null&&ke.id)||!d[ke.id]||(cf(d[ke.id]),au(),t==null||t(),se.preventDefault())},{capture:!0,passive:!1,signal:P}),h.addEventListener("pointerenter",se=>{const ke=ic(se.target);!(ke!=null&&ke.id)||!d[ke.id]||ke.classList.add("is-active")},{capture:!0,signal:P}),h.addEventListener("pointerleave",se=>{const ke=ic(se.target);!(ke!=null&&ke.id)||!d[ke.id]||ke.classList.remove("is-active")},{capture:!0,signal:P}),window.addEventListener("pointercancel",()=>{au(),t==null||t()},{signal:P}),window.addEventListener("pointerup",()=>{au(),t==null||t()},{signal:P})})}}function au(){iu==null||iu.abort(),iu=null,Io.state==="open"&&Io.close()}function ym(e){if(e==="foreground-color"){const t=[];for(const r of Object.keys(j))t.push({class:"swatch-button",label:'<span style="border: 3px solid '+j[r]+'"></span>',command:["applyStyle",{color:r}]});return t}if(e==="background-color"){const t=[];for(const r of Object.keys(ie))t.push({class:"swatch-button",label:'<span style="background:'+ie[r]+'"></span>',command:["applyStyle",{backgroundColor:r}]});return t}}function ep(e){return Hd[e]!==void 0}function xm(e){var t;return typeof e!="string"?e:(Hd[e]||(Hd[e]=(t=ym(e))!=null?t:[]),Hd[e])}function wm(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r} !important`).join(";")}function Sm(e){return Object.keys(e).map(t=>`${t} {${wm(e[t])}}`).join("")}function ou(e){if(!e)return"";const t=new Er,r=new we({mode:"math",type:"root",body:w(e,{context:t,args:i=>i==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),n=Tl(mo(new je(r.render(t),{classes:"ML__base"}),t));return $l(n,{classes:"ML__latex"}).toMarkup()}function su(e){var t;if(Array.isArray(e))return e.map(n=>su(n)).flat();const r=typeof e=="string"?{markup:e}:e;return"rows"in r&&Array.isArray(r.rows)&&(r.rows=r.rows.map(n=>n.map(i=>rp(i)))),(t=r.id)!=null||(r.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[r]}function _m(){var e,t;let n=window.mathVirtualKeyboard.alphabeticLayout;if(n==="auto"){const u=tu();u&&(n=u.virtualLayout),(!n||n==="auto")&&(n=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[Se.locale.slice(0,2)])!=null?e:"qwerty")}const i={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},a=(t=i[n])!=null?t:i.qwerty,s=n==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const u of a){const d=[];for(const p of u)/[a-z]/.test(p)?d.push({label:p,class:"hide-shift",shift:{label:p.toUpperCase()},variants:ep(p)?p:void 0}):p==="~"?n!=="dvorak"?d.push("[backspace]"):d.push({label:"[backspace]",width:1}):p==="^"?d.push("[shift]"):p===" "&&d.push("[separator-5]");s.push(d)}return s.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:su({rows:s})}}function tp(e){if(e==="alphabetic")return _m();if(typeof e=="string")return console.assert(Yf[e]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${e}"`),tp(Yf[e]);let t;if("rows"in e&&Array.isArray(e.rows)){console.assert(!("layers"in e||"markup"in e),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const i=e,{rows:a}=i,s=Ne(i,["rows"]);t=v(_({},s),{layers:su({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){const i=e,{markup:a}=i,s=Ne(i,["markup"]);t=v(_({},s),{layers:su(e.markup)})}else t=_({},e),"layers"in e?t.layers=su(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let r=!1,n=!1;for(const i of t.layers)if(i.rows)for(const a of i.rows.flat()){ac(a)&&(r=!0);const s=a.command;typeof s=="string"&&["undo","redo","cut","copy","paste"].includes(s)&&(n=!0)}return(!("displayShiftedKeycaps"in e)||e.displayShiftedKeycaps===void 0)&&(t.displayShiftedKeycaps=r),(!("displayEditToolbar"in e)||e.displayEditToolbar===void 0)&&(t.displayEditToolbar=!n),t}function Mm(e,t){var r,n;let i='<div class="left">';if(e.normalizedLayouts.length>1)for(const[a,s]of e.normalizedLayouts.entries()){const u=s,d=[a===t?"selected":"layer-switch"];u.tooltip&&d.push("MLK__tooltip"),u.labelClass&&d.push(...u.labelClass.split(" ")),i+=`<div class="${d.join(" ")}"`,u.tooltip&&(i+=" data-tooltip='"+((r=pe(u.tooltip))!=null?r:u.tooltip)+"' "),a!==t&&(i+=`data-layer="${u.layers[0].id}"`),i+=`>${(n=u.label)!=null?n:"untitled"}</div>`}return i+="</div>",i}function Cm(e,t){let r="";if(e.editToolbar==="none")return"";const i=[];t.selectionIsCollapsed?i.push("undo","redo","pasteFromClipboard"):i.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const a={undo:`<div class='action ${t.canUndo===!1?"disabled":""}'
|
|
|
data-command='"undo"'
|
|
|
data-tooltip='${pe("tooltip.undo")}'>
|
|
|
<svg><use xlink:href='#svg-undo' /></svg>
|
|
|
</div>`,redo:`<div class='action ${t.canRedo===!1?"disabled":""}'
|
|
|
data-command='"redo"'
|
|
|
data-tooltip='${pe("tooltip.redo")}'>
|
|
|
<svg><use xlink:href='#svg-redo' /></svg>
|
|
|
</div>`,cutToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"cutToClipboard"'
|
|
|
data-tooltip='${pe("tooltip.cut to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-cut' /></svg>
|
|
|
</div>
|
|
|
`,copyToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"copyToClipboard"'
|
|
|
data-tooltip='${pe("tooltip.copy to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-copy' /></svg>
|
|
|
</div>
|
|
|
`,pasteFromClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"pasteFromClipboard"'
|
|
|
data-tooltip='${pe("tooltip.paste from clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-paste' /></svg>
|
|
|
</div>
|
|
|
`};return r+=i.map(s=>a[s]).join(""),r}function Em(e){for(const t of e)km(t)}function km(e){const t=Ss.singleton;if(!t)return;const r={};if(!e.id){if(e.hasAttribute("data-label")&&(r.label=e.dataset.label),e.hasAttribute("data-latex")&&(r.latex=e.dataset.latex),e.hasAttribute("data-key")&&(r.key=e.dataset.key),e.hasAttribute("data-insert")&&(r.insert=e.dataset.insert),e.hasAttribute("data-variants")&&(r.variants=e.dataset.variants),e.hasAttribute("data-aside")&&(r.aside=e.dataset.aside),e.className&&(r.class=e.className),!r.label&&!r.latex&&!r.key&&!r.insert&&(r.latex=e.innerText,r.label=e.innerHTML),e.hasAttribute("data-command"))try{r.command=JSON.parse(e.dataset.command)}catch(n){}e.id=t.registerKeycap(r)}if(!e.innerHTML){const[n,i]=Wd(r);e.innerHTML=window.MathfieldElement.createHTML(n)}}function Am(){Ha("virtual-keyboard"),Ha("core"),Fd()}function Dm(){ro("core"),ro("virtual-keyboard")}var Lm=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
|
|
|
|
|
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
|
|
|
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-shift" viewBox="0 0 384 512">
|
|
|
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-commit" viewBox="0 0 512 512">
|
|
|
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
|
|
|
</symbol>
|
|
|
|
|
|
|
|
|
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
|
|
|
|
|
|
<symbol id="svg-command" viewBox="0 0 640 512">
|
|
|
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-undo" viewBox="0 0 512 512">
|
|
|
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-redo" viewBox="0 0 512 512">
|
|
|
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
|
|
|
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
|
|
|
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-tab" viewBox="0 0 448 512">
|
|
|
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
|
|
|
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
|
|
|
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-trash" viewBox="0 0 448 512">
|
|
|
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
|
|
|
</svg>`;function Im(e){e.resetKeycapRegistry(),Am();const t=document.createElement("div");t.className="ML__keyboard";const r=document.createElement("div");r.className="MLK__plate",r.innerHTML=window.MathfieldElement.createHTML(Lm+e.normalizedLayouts.map((s,u)=>Bm(e,s,u)).join(""));const n=document.createElement("div");n.className="MLK__backdrop",n.appendChild(r),t.appendChild(n),t.addEventListener("pointerdown",$m,{passive:!1});const i=t.querySelectorAll(".ML__edit-toolbar");if(i)for(const s of i)s.addEventListener("click",u=>{var d,p;let h=u.target,S="";for(;h&&!S;)S=(d=h==null?void 0:h.getAttribute("data-command"))!=null?d:"",h=(p=h==null?void 0:h.parentElement)!=null?p:null;S&&e.executeCommand(JSON.parse(S))});Em(t.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const a=t.querySelectorAll(".MLK__layer");console.assert(a.length>0,"No virtual keyboards available");for(const s of a)s.addEventListener("pointerdown",u=>u.preventDefault());return e.currentLayer=e.latentLayer,t}function Bm(e,t,r){const n=[];if(!("layers"in t))return"";for(const i of t.layers)n.push(`<div tabindex="-1" class="MLK__layer" id="${i.id}">`),(e.normalizedLayouts.length>1||t.displayEditToolbar)&&(n.push("<div class='MLK__toolbar' role='toolbar'>"),n.push(Mm(e,r)),t.displayEditToolbar&&n.push('<div class="ML__edit-toolbar right"></div>'),n.push("</div>")),n.push(Tm(e,i)),n.push("</div>");return n.join("")}function Tm(e,t){if(typeof t=="string")return t;let r="";if(typeof t.style=="string"?r+=`<style>${t.style}</style>`:typeof t.style=="object"&&(r+=`<style>${Sm(t.style)}</style>`),t.backdrop&&(r+=`<div class='${t.backdrop}'>`),t.container&&(r+=`<div class='${t.container}'>`),t.rows){r+="<div class=MLK__rows>";for(const n of t.rows){r+="<div dir='ltr' class=MLK__row>";for(const i of n)if(i){const a=e.registerKeycap(i),[s,u]=Wd(i);/(^|\s)separator/.test(u)?r+=`<div class="${u}"`:r+=`<div tabindex="-1" id="${a}" class="${u}"`,i.tooltip&&(r+=` data-tooltip="${i.tooltip}"`),r+=`>${s}</div>`}r+="</div>"}r+="</div>"}else t.markup&&(r+=t.markup);return t.container&&(r+="</div>"),t.backdrop&&(r+="</div>"),r}function Wd(e,t={shifted:!1}){var r,n,i,a,s,u,d;let p="",h=(r=e.class)!=null?r:"";if(t.shifted&&ac(e)&&(h+=" is-active"),t.shifted&&"shift"in e)typeof e.shift=="string"?p=ou(e.shift):typeof e.shift=="object"&&(p=e.shift.label?e.shift.label:(n=ou(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?n:""),typeof e.shift=="object"&&(h=(a=(i=e.shift.class)!=null?i:e.class)!=null?a:"");else{if(p=e.label?e.label:(s=ou(e.latex||e.insert||"")||e.key)!=null?s:"",e.shift){let S;typeof e.shift=="string"?S=ou(e.shift):e.shift.label?S=e.shift.label:S=(u=ou(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?u:"",p+=`<span class="MLK__shift">${S}</span>`}e.aside&&(p+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(h)&&(h+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(h)||(h+=" MLK__keycap"),!/\bw[0-9]+\b/.test(h)&&e.width&&(h+=(d={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])!=null?d:""),[p,h||"MLK__keycap"]}var qs={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"−",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"÷"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"×",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function rp(e){var t;if(typeof e=="string"){if(e==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(e="[,]"),!qs[e])return{latex:e};e={label:e}}let r;return"label"in e&&e.label&&qs[e.label]&&(r=v(_(_({},qs[e.label]),e),{label:qs[e.label].label})),"key"in e&&e.key&&qs[e.key]&&(r=v(_(_({},qs[e.key]),e),{key:qs[e.key].key})),r?(r.command==="insertDecimalSeparator"&&(r.label=(t=window.MathfieldElement.decimalSeparator)!=null?t:"."),e.label==="[action]"&&(r=_(_({},r),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(r=_(_({},r),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(r=_(_({},r),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(r=_(_({},r),window.mathVirtualKeyboard.tabKeycap)),r):e}var lu;function $m(e){var t;if(e.button!==0)return;const r=Ss.singleton;if(!r)return;let n=e.target;for(;n&&!n.getAttribute("data-layer");)n=n.parentElement;if(n){r.currentLayer=(t=n.getAttribute("data-layer"))!=null?t:"",e.preventDefault();return}const i=ic(e.target);if(!(i!=null&&i.id))return;const a=r.getKeycap(i.id);if(!a)return;console.assert(e.type==="pointerdown");const s=new AbortController,u=s.signal;i.classList.add("is-pressed"),i.addEventListener("pointerenter",Vd(s),{capture:!0,signal:u}),i.addEventListener("pointerleave",Vd(s),{capture:!0,signal:u}),i.addEventListener("pointercancel",Vd(s),{signal:u}),i.addEventListener("pointerup",Vd(s),{signal:u}),ac(a)&&(i.classList.add("is-active"),r.shiftPressCount++),a.variants&&(lu&&clearTimeout(lu),lu=setTimeout(()=>{i.classList.contains("is-pressed")&&(i.classList.remove("is-pressed"),i.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),Qf(i,()=>{s.abort(),i==null||i.classList.remove("is-active")}))},300)),e.preventDefault()}function Vd(e){return t=>{const r=ic(t.target);if(!(r!=null&&r.id))return;const n=Ss.singleton;if(!n)return;const i=n.getKeycap(r.id);if(i){if(t.type==="pointerenter"&&t.target===r&&t.isPrimary&&r.classList.add("is-pressed"),t.type==="pointercancel"){r.classList.remove("is-pressed"),ac(i)&&(n.shiftPressCount--,r.classList.toggle("is-active",n.isShifted)),e.abort();return}if(t.type==="pointerleave"&&t.target===r){r.classList.remove("is-pressed"),ac(i)&&(n.shiftPressCount--,r.classList.toggle("is-active",n.isShifted));return}if(t.type==="pointerup"){lu&&clearTimeout(lu),ac(i)?r.classList.toggle("is-active",n.isShifted):r.classList.contains("is-pressed")&&(r.classList.remove("is-pressed"),n.isShifted&&i.shift?typeof i.shift=="string"?n.executeCommand(["insert",i.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):cf(i.shift):cf(i),n.shiftPressCount===1&&!t.shiftKey&&(n.shiftPressCount=0)),e.abort(),t.preventDefault();return}}}}function cf(e){var t;let r=e.command;!r&&e.insert&&(r=["insert",e.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!r&&e.key&&(r=["typedText",e.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!r&&e.latex&&(r=["insert",e.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),r||(r=["typedText",e.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(t=Ss.singleton)==null||t.executeCommand(r)}function Pm(e){if(e.nodeType!==1)return!1;const t=e.classList;return t.contains("MLK__keycap")||t.contains("shift")||t.contains("action")||t.contains("fnbutton")||t.contains("bigfnbutton")}function ic(e){if(!e)return;let t=e;for(;t&&!Pm(t);)t=t.parentElement;return t!=null?t:void 0}function ac(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var Ss=class Lh{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var t,r,n;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(r=(t=window.document)==null?void 0:t.body)!=null?r:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(i=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(n=window.top)==null||n.addEventListener("message",this)}catch(i){window.addEventListener("message",this)}document.body.addEventListener("focusin",i=>{const a=i.target;a!=null&&a.isConnected&&setTimeout(()=>{const s=np();s&&!s.readOnly&&s.mathVirtualKeyboardPolicy==="auto"&&pt()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",i=>{i.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{np()||this.hide()},300)})}get currentLayer(){var t,r,n;return(n=(r=(t=this._element)==null?void 0:t.querySelector(".MLK__layer.is-visible"))==null?void 0:r.id)!=null?n:""}set currentLayer(t){var r;if(!this._element){this.latentLayer=t;return}let n=t?this._element.querySelector(`#${t}.MLK__layer`):null;n||(n=this._element.querySelector(".MLK__layer")),n&&((r=this._element.querySelector(".MLK__layer.is-visible"))==null||r.classList.remove("is-visible"),n.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(t){var r;this._shiftPressCount=t>2||t<0?0:t,(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(t){const r="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[r]=t,r}getKeycap(t){return t?this.keycapRegistry[t]:void 0}getLayer(t){const r=this.normalizedLayouts;for(const n of r)for(const i of n.layers)if(i.id===t)return i}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(t){this._alphabeticLayout=t,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(t){this._actionKeycap=typeof t=="string"?{label:t}:t}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(t){this._shiftKeycap=typeof t=="string"?{label:t}:t}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(t){this._backspaceKeycap=typeof t=="string"?{label:t}:t}get tabKeycap(){return this._tabKeycap}set tabKeycap(t){this._tabKeycap=typeof t=="string"?{label:t}:t}get layouts(){return this._layouts}set layouts(t){this.updateNormalizedLayouts(t),this.rebuild()}updateNormalizedLayouts(t){const r=Array.isArray(t)?[...t]:[t],n=r.findIndex(i=>i==="default");n>=0&&r.splice(n,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(r),this._normalizedLayouts=r.map(i=>tp(i))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(t){this._editToolbar=t,this.rebuild()}get container(){return this._container}set container(t){this._container=t,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new Lh}catch(t){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(t,r,n){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(r)||this.listeners[t].add(r)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(r=>{typeof r=="function"?r(t):r==null||r.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,r,n){this.listeners[t]&&this.listeners[t].delete(r)}get element(){return this._element}set element(t){var r;this._element!==t&&((r=this._element)==null||r.remove(),this._element=t)}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get boundingRect(){var t;if(!this._visible)return new DOMRect;const r=(t=this._element)==null?void 0:t.getElementsByClassName("MLK__plate")[0];return r?r.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var t,r;const n=this.boundingRect.height;if(this.container===document.body){(t=this._element)==null||t.style.setProperty("--_keyboard-height",`calc(${n}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const i=n-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${i}px)`:`${i}px`}else(r=this._element)==null||r.style.setProperty("--_keyboard-height",`${n}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const t=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=t,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const t=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(t&&(t.backdrop||t.container)));const r=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(r)for(const n of r){const i=this.getKeycap(n.id);if(i){const[a,s]=Wd(i,{shifted:this.isShifted});n.innerHTML=window.MathfieldElement.createHTML(a),n.className=s}}}show(t){var r;if(this._visible)return;const n=this.container;if(n&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const i=this._element.getElementsByClassName("MLK__plate")[0];if(i&&this.observer.observe(i),n===window.document.body){const a=n.style.paddingBottom;this.originalContainerBottomPadding=a;const s=i.offsetHeight-1;n.style.paddingBottom=a?`calc(${a} + ${s}px)`:`${s}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,t!=null&&t.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var i;return(i=this._element)==null?void 0:i.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(t){var r;const n=this.container;if(n&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const i=this._element.getElementsByClassName("MLK__plate")[0];i&&this.observer.unobserve(i),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),au(),Dm(),(r=this._element)==null||r.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(n.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var t,r;return(r=(t=this.element)==null?void 0:t.offsetHeight)!=null?r:0}buildAndAttachElement(){var t;console.assert(!this.element),this.element=Im(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",r=>{r.shiftKey||((r.ctrlKey||r.button===2)&&Qf(r.target),r.preventDefault(),r.stopPropagation())},{capture:!0}),(t=this.container)==null||t.appendChild(this.element)}handleEvent(t){if(lf(t)){if(!jc(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");t.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:t.data.action!=="update-setting"&&t.data.action!=="proxy-created"&&t.data.action!=="execute-command"&&(console.assert(t.source!==void 0),this.connectedMathfieldWindow=t.source),this.handleMessage(t.data,t.source)}if(this._element)switch(t.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":t.button!==2&&t.preventDefault();break;case"keydown":{t.key==="Shift"&&!t.repeat&&(this.shiftPressCount=1);break}case"keyup":{(t.key==="Shift"||!t.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(t,r){const{action:n}=t;if(n==="execute-command"){const{command:i}=t,a=nc(i);if(window.top!==void 0&&a!=="virtual-keyboard")return;this.executeCommand(i);return}if((n==="connect"||n==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r),n!=="disconnect"&&window===window.top){if(n==="show"){typeof t.animate!="undefined"?this.show({animate:t.animate}):this.show();return}if(n==="hide"){typeof t.animate!="undefined"?this.hide({animate:t.animate}):this.hide();return}if(n==="update-setting"){t.alphabeticLayout&&(this.alphabeticLayout=t.alphabeticLayout),t.layouts&&(this.layouts=t.layouts),t.editToolbar&&(this.editToolbar=t.editToolbar);return}if(n==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r);return}}}sendMessage(t,r,n){if(n||(n=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||n===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:_({type:Kd,action:t},r)}));return}if(n)n.postMessage(_({type:Kd,action:t},r),{targetOrigin:this.targetOrigin});else if(r.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:r.command})),t==="execute-command"&&Array.isArray(r.command)&&r.command[0]==="insert"){const i=r.command[1].split("");for(const a of i)this.dispatchEvent(new KeyboardEvent("keydown",{key:a,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:a,bubbles:!0}))}}stateWillChange(t){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:t},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(t){const r=this._element;if(!r)return;r.classList.toggle("is-math-mode",t.mode==="math"),r.classList.toggle("is-text-mode",t.mode==="text"),r.classList.toggle("can-undo",t.canUndo),r.classList.toggle("can-redo",t.canRedo),r.classList.toggle("can-copy",!t.selectionIsCollapsed),r.classList.toggle("can-copy",!t.selectionIsCollapsed),r.classList.toggle("can-paste",!0);const n=r.querySelectorAll(".ML__edit-toolbar");if(n)for(const i of n)i.innerHTML=Cm(this,t)}update(t){this._style=t.style,this.updateToolbar(t)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(t){let r,n=[],i=nc(t);return L(t)?(r=t[0],r==="performWithFeedback"&&(t=t.slice(1),i=nc(t)),n=t.slice(1)):r=t,r=r.replace(/-\w/g,a=>a[1].toUpperCase()),i==="virtual-keyboard"?Bo[r].fn(void 0,...n):(this.sendMessage("execute-command",{command:t}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function np(){var e,t;let r=$d(),n=null;for(;r;){if("host"in r&&((t=(e=r.host)==null?void 0:e.tagName)==null?void 0:t.toLowerCase())==="math-field"){n=r.host;break}r=r.parentNode}return n}if(Re()&&!("mathVirtualKeyboard"in window))if(window===window.top){const e=Ss.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>bm.singleton,configurable:!0});function Ud(e){const t={};for(const r of Object.keys(e))switch(r){case"scriptDepth":const n=e.scriptDepth;if(L(n))t.scriptDepth=[n[0],n[1]];else if(typeof n=="number")t.scriptDepth=[n,n];else if(typeof n=="string"){const[a,s]=n.split(",").map(u=>parseInt(u.trim()));t.scriptDepth=[a,s]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let i=e.mathVirtualKeyboardPolicy.toLowerCase();if(i==="sandboxed"){if(window!==window.top){const a=Ss.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}i="manual"}t.mathVirtualKeyboardPolicy=i;break;case"letterShapeStyle":e.letterShapeStyle==="auto"?Se.locale.startsWith("fr")?t.letterShapeStyle="french":t.letterShapeStyle="tex":t.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?t.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),t.defaultMode="math");break;case"macros":t.macros=vr(e.macros);break;default:L(e[r])?t[r]=[...e[r]]:typeof e[r]=="object"&&!(e[r]instanceof Element)&&r!=="computeEngine"?t[r]=_({},e[r]):t[r]=e[r]}return t}function Xs(e,t){let r;typeof t=="string"?r=[t]:t===void 0?r=Object.keys(e):r=t;const n={};for(const i of r)e[i]===null?n[i]=null:L(e[i])?n[i]=[...e[i]]:typeof e[i]=="object"&&!(e[i]instanceof Element)&&i!=="computeEngine"?n[i]=_({},e[i]):n[i]=e[i];return typeof t=="string"?n[t]:n}function Zd(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Nt,backgroundColorMap:gt,letterShapeStyle:Se.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:e=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(e),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:T0,inlineShortcuts:od,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:B0,value:""}}function ip(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function _s(e,t){!e||!t||(L(e)?e.forEach(r=>_s(r,t)):typeof e=="object"&&!e.style.color&&!e.style.backgroundColor&&!e.style.fontFamily&&!e.style.fontShape&&!e.style.fontSeries&&!e.style.fontSize&&!e.style.variant&&!e.style.variantStyle&&(e.applyStyle(t),_s(e.body,t),_s(e.above,t),_s(e.below,t),_s(e.subscript,t),_s(e.superscript,t)))}function uf(e,t,r,n){function i(s,u){for(const d of a)if(d.style[s]!==u)return!1;return!0}if(t=e.normalizeRange(t),t[0]===t[1])return!1;const a=e.getAtoms(t,{includeChildren:!0});n.operation==="toggle"&&(r.color&&i("color",r.color)&&(r.color="none",delete r.verbatimColor),r.backgroundColor&&i("backgroundColor",r.backgroundColor)&&(r.backgroundColor="none",delete r.verbatimBackgroundColor),r.fontFamily&&i("fontFamily",r.fontFamily)&&(r.fontFamily="none"),r.fontSeries&&i("fontSeries",r.fontSeries)&&(r.fontSeries="auto"),r.fontShape&&i("fontShape",r.fontShape)&&(r.fontShape="auto"),r.fontSize&&i("fontSize",r.fontSize)&&(r.fontSize=jo),r.variant&&i("variant",r.variant)&&(r.variant="normal"),r.variantStyle&&i("variantStyle",r.variantStyle)&&(r.variantStyle=""));for(const s of a)s.applyStyle(r);return!0}function Rm(e,t){const r=e.at(e.position);if(r.type==="composition")r.value=t;else{const{caret:n}=r;r.caret=void 0;const i=new kd(t,{mode:r.mode});i.caret=n,r.parent.addChildAfter(i,r),e.position+=1}}function Om(e){const t=e.at(e.position);t.type==="composition"&&(t.parent.removeChild(t),e.position-=1)}kt(["math","displaymath"],ao),kt("center",ao),G("displaylines","",{parse:e=>{const t=[];let r=[];e.beginContext({tabular:!0});do{if(e.end()||e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(t.push([r]),r=[]):r.push(...e.scan(n=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(n)))}while(!0);return e.endContext(),t.push([r]),t},createAtom:e=>new qr("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),$t("array","{columns:colspec}",(e,t,r,n)=>new qr(e,df(t),r,{columns:n[0],mathstyleName:"textstyle"})),$t(["equation","equation*","subequations"],"",(e,t,r)=>new qr(e,df(t),r,{columns:[{align:"c"}]})),$t(["multline","multline*"],"",ao),$t(["align","align*","aligned","eqnarray"],"",ao),$t("split","",ao),$t(["gather","gathered"],"",ao),$t(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",ao),$t(["smallmatrix","smallmatrix*"],"[columns:colspec]",ao),$t(["cases","dcases","rcases"],"",ao);function Nm(e){for(const t of e)for(const r of t)if(r.length>0)return!1;return!0}function df(e,t=1){return Nm(e)?Array(t).fill([[new we({type:"first"}),new ho]]):e.map(r=>r.length===0?[[new we({type:"first"})]]:r.map(n=>n.length===0?[new we({type:"first"})]:(n[0].type!=="first"&&n.unshift(new we({type:"first"})),n)))}function ao(e,t=[[[]]],r=[],n=[]){switch(t=df(t,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new qr(e,t,r,{mathstyleName:"textstyle"});case"displaymath":return new qr(e,t,r,{mathstyleName:"textstyle"});case"center":return new qr(e,t,r,{columns:[{align:"c"}]});case"multline":case"multline*":return new qr(e,t,r,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new qr(e,t,r,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new qr(e,t,r,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new qr(e,t,r,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Js(n[0])});case"bmatrix":case"bmatrix*":return new qr(e,t,r,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Js(n[0])});case"Bmatrix":case"Bmatrix*":return new qr(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Js(n[0])});case"vmatrix":case"vmatrix*":return new qr(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Js(n[0])});case"Vmatrix":case"Vmatrix*":return new qr(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Js(n[0])});case"matrix":case"matrix*":return new qr(e,t,r,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Js(n==null?void 0:n[0])});case"smallmatrix":case"smallmatrix*":return new qr(e,t,r,{mathstyleName:"scriptstyle",columns:Js(n==null?void 0:n[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new qr(e,t,r,{mathstyleName:e==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new qr(e,t,r,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new qr(e,t,r,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let i=0;for(const u of t)i=Math.max(i,u.length);const a=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let s=2;for(;s<i;)a.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),s+=2;return a.push({gap:0}),new qr(e,t,r,{arraycolsep:0,columns:a,minColumns:2})}}return new qr(e,t,r,{mathstyleName:"textstyle"})}function Js(e){return e!=null?e:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function Fm(e,t){let r=e.at(e.position);for(;r&&!(r.parent instanceof qr);)r=r.parent;if(r&&r.type==="array"&&r.environmentName,!r||!(r.parent instanceof qr)){const n=e.at(e.position);if(r=n,!r.parent.parent){let i=e.extractAtoms([e.position,e.lastOffset]),a=e.extractAtoms([0,e.position]);a.length===0&&(a=qd()),i.length===0&&(i=qd());let s;return t.endsWith("column")?(s=ao("split",[[a,i]]),e.root=s,Ys(s,0,0)?Qs(e,s,0,0):Ys(s,0,1)?Qs(e,s,0,1):e.position=e.offsetOf(n)):(s=ao("lines",[[a],[i]]),e.root=s,Ys(s,0,0)?Qs(e,s,0,0):Ys(s,1,0)?Qs(e,s,1,0):e.position=e.offsetOf(n)),[void 0,[0,0]]}if(r.parent instanceof Cn){const i=r.parent;let a=e.extractAtoms([e.position,e.offsetOf(i.lastChild)]),s=e.extractAtoms([e.offsetOf(i.firstChild),e.position]);s.length===0&&(s=qd()),a.length===0&&(a=qd());let u="pmatrix";const d=i.leftDelim,p=i.rightDelim;d==="("&&(p===")"||p==="?")?u="pmatrix":(d==="["||d==="\\lbrack")&&(p==="]"||p==="\\rbrack"||p==="?")?u="bmatrix":d==="\\vert"&&p==="\\vert"?u="vmatrix":d==="\\Vert"&&p==="\\Vert"?u="Vmatrix":(d==="{"||d==="\\lbrace")&&(p==="."||p==="?")&&(u="cases");const h=ao(u,t.endsWith("column")?[[s,a]]:[[s],[a]]);return i.parent.addChildBefore(h,i),i.parent.removeChild(i),Ys(h,0,0)?Qs(e,h,0,0):t.endsWith("column")?Ys(h,0,1)?Qs(e,h,0,1):e.position=e.offsetOf(r):Ys(h,1,0)?Qs(e,h,1,0):e.position=e.offsetOf(r),[void 0,[0,0]]}}return r&&r.parent instanceof qr?[r.parent,r.parentBranch]:[void 0,[0,0]]}function Ys(e,t,r){const n=e.getCell(t,r);return!n||n.length!==2?!1:n[1].type==="placeholder"}function zm(e,t,r,n){const i=t.getCell(r,n);return i?[e.offsetOf(i[0]),e.offsetOf(i[i.length-1])]:-1}function Qs(e,t,r,n){const i=zm(e,t,r,n);typeof i!="number"&&e.setSelection(i)}function jd(e,t,r,n,i){const a=t.getCell(r,n);a&&e.setPositionHandlingPlaceholder(e.offsetOf(a[i==="start"?0:a.length-1]))}function Gd(e,t){const[r,[n,i]]=Fm(e,t);if(r)switch(t){case"after row":r.addRowAfter(n),jd(e,r,n+1,0,"end");break;case"after column":if(r.maxColumns<=r.colCount){e.announce("plonk");return}r.addColumnAfter(i),jd(e,r,n,i+1,"end");break;case"before row":r.addRowBefore(n),jd(e,r,n,0,"start");break;case"before column":if(r.maxColumns<=r.colCount){e.announce("plonk");return}r.addColumnBefore(i),jd(e,r,n,i,"start");break}}function ap(e){return e.contentWillChange({inputType:"insertText"})?(Gd(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Km(e){return e.contentWillChange({inputType:"insertText"})?(Gd(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function op(e){return e.contentWillChange({inputType:"insertText"})?(Gd(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Hm(e){return e.contentWillChange({inputType:"insertText"})?(Gd(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function sp(e,t){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let r=".",n=".";switch(t){case"pmatrix":case"pmatrix*":r="(",n=")";break;case"bmatrix":case"bmatrix*":r="[",n="]";break;case"Bmatrix":case"Bmatrix*":r="\\lbrace",n="\\rbrace";break;case"vmatrix":case"vmatrix*":r="\\vert",n="\\vert";break;case"Vmatrix":case"Vmatrix*":r="\\Vert",n="\\Vert";break;case"matrix":case"matrix*":r=".",n=".";break;case"cases":case"dcases":r="\\lbrace";break;case"rcases":n="\\rbrace";break}const i=e.at(e.position),a=i.type==="array"?i:e.parentEnvironment;return a.environmentName=t,a.leftDelim=r,a.rightDelim=n,e.contentDidChange({}),!0}function lp(e,t){let r=e.at(e.position);for(;r&&!(Array.isArray(r.parentBranch)&&r.parent instanceof qr);)r=r.parent;if(Array.isArray(r==null?void 0:r.parentBranch)&&(r==null?void 0:r.parent)instanceof qr){const n=r.parent,i=r.parentBranch;let a;switch(t){case"row":if(n.rowCount>1){n.removeRow(i[0]);const s=n.getCell(Math.max(0,i[0]-1),i[1]);a=e.offsetOf(s[s.length-1])}break;case"column":if(n.colCount>n.minColumns){n.removeColumn(i[1]);const s=n.getCell(i[0],Math.max(0,i[1]-1));a=e.offsetOf(s[s.length-1])}break}a&&e.setPositionHandlingPlaceholder(a)}}function Wm(e){return e.contentWillChange({inputType:"deleteContent"})?(lp(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}function Vm(e){return e.contentWillChange({inputType:"deleteContent"})?(lp(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}Oa({addRowAfter:ap,addColumnAfter:op,addRowBefore:Km,addColumnBefore:Hm,removeRow:Wm,removeColumn:Vm,setEnvironment:sp},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function qd(){return[new ho]}var cp=class Ih{constructor(t){this.recording=!1,this.model=t,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(t){t&&this.index>=0&&(this.stack[this.index].selection=t),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(t){return this.recording?(t&&t===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>Ih.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=t!=null?t:"",!0):!1}};cp.maximumDepth=1e3;var Um=cp;function ff(e,t,r){if(e.at(t).mode!=="text")return t;const n=r==="backward"?-1:1;let i;if(Q.test(e.at(t).value)){let a=t,s;do s=e.at(a).mode==="text"&&Q.test(e.at(a).value),a+=n;while(e.at(a)&&s);i=e.at(a)?a-2*n:a-n}else if(/\s/.test(e.at(t).value)){let a=t;for(;e.at(a)&&e.at(a).mode==="text"&&/\s/.test(e.at(a).value);)a+=n;if(!e.at(a))i=a-n;else{let s=!0;do s=e.at(a).mode==="text"&&!/\s/.test(e.at(a).value),a+=n;while(e.at(a)&&s);i=e.at(a)?a-2*n:a-n}}else{let a=t;for(;e.at(a)&&e.at(a).mode==="text"&&!/\s/.test(e.at(a).value);)a+=n;i=e.at(a)?a:a-n;let s=!0;for(;e.at(a)&&s;)s=e.at(a).mode==="text"&&/\s/.test(e.at(a).value),s&&(i=a),a+=n;i=e.at(a)?a-2*n:a-n}return i-(n>0?0:1)}function oc(e,t,r){var n,i,a,s,u,d,p;const h=e.position;(n=r==null?void 0:r.extend)!=null&&n||e.collapseSelection(t);let S=e.at(e.position);if(t==="forward"&&(S.type==="subsup"?(S=S.rightSibling,S||(S=e.at(e.position+1))):S=e.at(e.position+1)),!S)return e.announce("plonk"),!1;let D=e.offsetOf(S);if(S instanceof zs)D=ff(e,D,t);else if(S instanceof Ft)if(S.isSuggestion)for(console.assert(t==="forward");S&&S instanceof Ft;)S.isSuggestion=!1,D=e.offsetOf(S),S=S.rightSibling;else if(t==="forward"){if(S=S.rightSibling,!S||!(S instanceof Ft))return e.announce("plonk"),!1;for(;S&&S instanceof Ft&&/[a-zA-Z\*]/.test(S.value);)D=e.offsetOf(S),S=S.rightSibling}else{if(S=S.leftSibling,!S||!(S instanceof Ft))return e.announce("plonk"),!1;for(;S&&S instanceof Ft&&/[a-zA-Z\*]/.test(S.value);)D=e.offsetOf(S),S=S.leftSibling}else if(t==="forward"&&S.type==="mopen"){let P=0;do S.type==="mopen"?P+=1:S.type==="mclose"&&(P-=1),S=S.rightSibling;while(!S.isLastSibling&&P!==0);D=e.offsetOf(S.leftSibling)}else if(t==="backward"&&S.type==="mclose"){let P=0;do S.type==="mopen"?P+=1:S.type==="mclose"&&(P-=1),S=S.leftSibling;while(!S.isFirstSibling&&P!==0);D=e.offsetOf(S)}else if(t==="backward")if(S.type==="first")for(;D>0&&S.type==="first";)D-=1,S=e.at(D);else{const P=S.type;S.type==="subsup"&&(D=e.offsetOf(e.at(D).leftSibling)),D-=1;let O=(i=e.at(D))==null?void 0:i.type;for(;D>=0&&O===P;)((a=e.at(D))==null?void 0:a.type)==="subsup"?D=e.offsetOf(e.at(D).leftSibling):D-=1,O=e.at(D).type}else{const{type:P}=S;let O=(s=e.at(D))==null?void 0:s.type;const{lastOffset:de}=e;for(;D<=de&&(O===P||O==="subsup");){for(;((u=e.at(D).rightSibling)==null?void 0:u.type)==="subsup";)D=e.offsetOf(e.at(D).rightSibling);D+=1,O=(d=e.at(D))==null?void 0:d.type}D-=1}if((p=r==null?void 0:r.extend)!=null&&p){if(!e.setSelection(e.anchor,D))return e.announce("plonk"),!1}else{if(D===e.position)return e.announce("plonk"),!1;e.position=D}return e.announce("move",h),e.mathfield.stopCoalescingUndo(),!0}function To(e,t,r){var n,i;if(r=r!=null?r:{extend:!1},e.mathfield.adoptStyle=t==="backward"?"right":"left",t!=="forward"){const[u,d]=Uf(e);u!==void 0&&d!==void 0&&e.deleteAtoms([u,d])}if(t==="upward")return jm(e,r);if(t==="downward")return Gm(e,r);if(r.extend){let u=Xd(e,e.position,t);u<0&&(u=0),u>e.lastOffset&&(u=e.lastOffset);const d=e.setSelection(e.anchor,u);return e.mathfield.stopCoalescingUndo(),d}if(e.selectionIsPlaceholder){e.collapseSelection(t);const u=To(e,t);return e.mathfield.stopCoalescingUndo(),u}let a=e.position;const s=a;if(e.collapseSelection(t)?(a=e.position,up(e,a)||(a=Xd(e,a,t))):a=Xd(e,a,t),a<0||a>e.lastOffset){let u=!0;return e.silenceNotifications||(u=(i=(n=e.mathfield.host)==null?void 0:n.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))!=null?i:!0),u&&e.announce("plonk"),u}return e.setPositionHandlingPlaceholder(a),e.mathfield.stopCoalescingUndo(),e.announce("move",s),!0}function Xd(e,t,r){return t=t+(r==="forward"?1:-1),t<0||t>e.lastOffset||up(e,t)?t:Xd(e,t,r)}function up(e,t){var r;const n=e.at(t);let i=n.parent;for(;i&&!i.inCaptureSelection;)i=i.parent;return!(i!=null&&i.inCaptureSelection||(r=n.parent)!=null&&r.skipBoundary&&(!n.isFirstSibling&&n.isLastSibling||n.type==="first")||e.mathfield.hasEditablePrompts&&!n.parentPrompt)}function Zm(e,t,r){let n=1/0,i=0;for(;i<t.length;i++){const a=gd(e.getHTMLElement(t[i])).right,s=Math.abs(r-a);if(s<=n)n=s;else break}return t[i-1]}function Jd(e,t,r,n,i){const a=e.mathfield.hasEditablePrompts,s=a?r.filter(p=>p.type==="prompt"&&!p.captureSelection):r,u=gd(e.mathfield.getHTMLElement(t)).right,d=e.offsetOf(Zm(e.mathfield,s,u))-(a?1:0);if(n){const[p,h]=e.selection.ranges[0];let S;d<(i==="up"?p:h)?S={ranges:[[d,h]],direction:"backward"}:S={ranges:[[p,d]],direction:"forward"},e.setSelection(S)}else e.setPositionHandlingPlaceholder(d);e.announce(`move ${i}`)}function jm(e,t){var r,n;const i=(r=t==null?void 0:t.extend)!=null?r:!1;i||e.collapseSelection("backward");const a=()=>{var d,p;let h=!0;return e.silenceNotifications||(h=(p=(d=e.mathfield.host)==null?void 0:d.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?p:!0),e.announce(h?"plonk":"line"),h},s=e.at(e.position);let u=s;for(;u&&u.parentBranch!=="below"&&!(Array.isArray(u.parentBranch)&&u.parent instanceof qr);)u=u.parent;if(Array.isArray(u==null?void 0:u.parentBranch)&&u.parent instanceof qr){const d=u.parent;if(u.parentBranch[0]<1)return a();const p=u.parentBranch[0]-1,h=d.array[p][u.parentBranch[1]];if(!h.some(D=>D.type==="prompt"&&!D.captureSelection)&&e.mathfield.hasEditablePrompts)return a();Jd(e,s,h,i,"up")}else if(u){const d=(n=u.parent.branch("above"))!=null?n:u.parent.createBranch("above");if(!d.some(h=>h.type==="prompt"&&h.placeholderId)&&e.mathfield.hasEditablePrompts)return a();Jd(e,s,d,i,"up")}else return a();return e.mathfield.stopCoalescingUndo(),!0}function Gm(e,t){var r,n;const i=(r=t==null?void 0:t.extend)!=null?r:!1;i||e.collapseSelection("forward");const a=()=>{var d,p;let h=!0;return e.silenceNotifications||(h=(p=(d=e.mathfield.host)==null?void 0:d.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?p:!0),e.announce(h?"plonk":"line"),h},s=e.at(e.position);let u=s;for(;u&&u.parentBranch!=="above"&&!(Array.isArray(u.parentBranch)&&u.parent instanceof qr);)u=u.parent;if(Array.isArray(u==null?void 0:u.parentBranch)&&u.parent instanceof qr){const d=u.parent;if(u.parentBranch[0]+1>d.array.length-1)return a();const p=u.parentBranch[0]+1,h=d.array[p][u.parentBranch[1]];if(!h.some(D=>D.type==="prompt"&&!D.captureSelection)&&e.mathfield.hasEditablePrompts)return a();Jd(e,s,h,i,"down")}else if(u){const d=(n=u.parent.branch("below"))!=null?n:u.parent.createBranch("below");if(!d.some(h=>h.type==="prompt")&&e.mathfield.hasEditablePrompts)return a();Jd(e,s,d,i,"down")}else return a();return!0}function dp(e){const t=e.position,r=e.at(t).parent;return r!=null&&r.parent?(e.position=e.offsetOf(r),e.mathfield.stopCoalescingUndo(),e.announce("move",t),!0):(e.announce("plonk"),!1)}function qm(e){let t=0,r=e.at(e.position),n=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(t+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(n=!1):n=!0,r=r.parent;return n?t:0}function Xm(e){let t=0,r=e.at(e.position),n=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(t+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(n=!0):n=!1,r=r.parent;return n?t:0}function fp(e){var t;if(e.collapseSelection(),qm(e)>=e.mathfield.options.scriptDepth[1])return e.announce("plonk"),!1;let r=e.at(e.position);return r.subsupPlacement===void 0&&(((t=r.rightSibling)==null?void 0:t.type)!=="subsup"&&r.parent.addChildAfter(new m({style:r.computedStyle}),r),r=r.rightSibling),r.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(r.superscript[0]))),!0}function pp(e){var t;if(e.collapseSelection(),Xm(e)>=e.mathfield.options.scriptDepth[0])return e.announce("plonk"),!1;let r=e.at(e.position);return r.subsupPlacement===void 0&&(((t=e.at(e.position+1))==null?void 0:t.type)!=="subsup"&&r.parent.addChildAfter(new m({style:e.at(e.position).computedStyle}),r),r=e.at(e.position+1)),r.createBranch("subscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(r.subscript[0]))),!0}function Jm(){function e(d){const p=[],h=[];return[...d.querySelectorAll(`input, select, textarea, a[href], button,
|
|
|
[tabindex], audio[controls], video[controls],
|
|
|
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(t).forEach((D,P)=>{const O=n(D);O===0?p.push(D):h.push({documentOrder:P,tabIndex:O,node:D})}),h.sort((D,P)=>D.tabIndex===P.tabIndex?D.documentOrder-P.documentOrder:D.tabIndex-P.tabIndex).map(D=>D.node).concat(p)}function t(d){return!(!r(d)||i(d)||n(d)<0)}function r(d){return!(d.disabled||d.type==="hidden"&&d.tagName.toUpperCase()==="INPUT"||u(d))}function n(d){var p;const h=Number.parseInt((p=d.getAttribute("tabindex"))!=null?p:"NaN",10);return Number.isNaN(h)?d.contentEditable==="true"||(d.nodeName==="AUDIO"||d.nodeName==="VIDEO")&&d.getAttribute("tabindex")===null?0:d.tabIndex:h}function i(d){return d.tagName.toUpperCase()==="INPUT"&&d.type==="radio"&&!s(d)}function a(d,p){for(const h of d)if(h.checked&&h.form===p)return h;return null}function s(d){var p;if(!d.name)return!0;const S=((p=d.form)!=null?p:d.ownerDocument).querySelectorAll('input[type="radio"][name="'+d.name+'"]'),D=a(S,d.form);return!D||D===d}function u(d){if(!Re()||d===document.activeElement||d.contains(document.activeElement))return!1;if(getComputedStyle(d).visibility==="hidden")return!0;const p=d.getBoundingClientRect();if(p.width===0||p.height===0)return!0;for(;d;){if(getComputedStyle(d).display==="none")return!0;d=d.parentElement}return!1}return Re()?e(document.body):[]}function ma(e,t,r="forward"){const n=e.position;if(Array.isArray(t)){const i=e.offsetOf(t[0]),a=e.offsetOf(t[t.length-1]);return r==="forward"?e.setSelection(i,a):e.setSelection(a,i),e.announce("move",n),e.mathfield.stopCoalescingUndo(),!0}return r==="forward"?ma(e,[t.leftSibling,t]):ma(e,[t,t.leftSibling])}function go(e,t){const r=e.position;if(typeof t=="number"&&(t=e.at(t)),t.type==="prompt")e.setSelection(e.offsetOf(t.firstChild),e.offsetOf(t.lastChild));else{const n=e.offsetOf(t);t.type==="placeholder"?e.setSelection(n-1,n):e.position=n}return e.announce("move",r),e.mathfield.stopCoalescingUndo(),!0}function Yd(e,t,r=!0){var n,i;const a=t==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&To(e,t);let s;const u=e.at(e.anchor).parentPrompt;u?t==="forward"?s=e.offsetOf(u)+1:s=e.offsetOf(u.leftSibling):s=Math.max(e.position+a,0);const d=pf(e,s,t);if(!d||t==="forward"&&e.offsetOf(d)<s||t==="backward"&&e.offsetOf(d)>s){if(!r||!((i=(n=e.mathfield.host)==null?void 0:n.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))==null||i))return e.announce("plonk"),!1;const h=Jm();if(!document.activeElement||h.length<=1)return e.announce("plonk"),!1;let S=h.indexOf(document.activeElement)+a;return S<0&&(S=h.length-1),S>=h.length&&(S=0),h[S].focus(),e.mathfield.stopCoalescingUndo(),!0}return go(e,d),!0}function pf(e,t=0,r="forward"){return e.findAtom(n=>n.type==="placeholder"||n.type==="prompt"||!e.mathfield.readOnly&&n.treeDepth>2&&n.isFirstSibling&&n.isLastSibling,t,r)}Oa({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},r=e.at(e.position),{parent:n}=r;if(!n)return e.announce("plonk"),!1;const i=r.parentBranch;let a;if(typeof i=="string"&&(a=t[i]),!a){const u=r.subsupPlacement?pp(e):fp(e);return e.mathfield.stopCoalescingUndo(),u}n.branch(a)||n.createBranch(a);const s=e.setSelection(e.getBranchRange(e.offsetOf(n),a));return e.mathfield.stopCoalescingUndo(),s},moveBeforeParent:e=>{const{parent:t}=e.at(e.position);return t?(e.position=e.offsetOf(t),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>dp(e),moveToNextChar:e=>To(e,"forward"),moveToPreviousChar:e=>To(e,"backward"),moveUp:e=>To(e,"upward"),moveDown:e=>To(e,"downward"),moveToNextWord:e=>oc(e,"forward"),moveToPreviousWord:e=>oc(e,"backward"),moveToGroupStart:e=>{const t=e.offsetOf(e.at(e.position).firstSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{const t=e.offsetOf(e.at(e.position).lastSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var t,r,n,i;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return Yd(e,"forward");const a=e.at(e.position);if(a.mode==="text"){if(e.selectionIsCollapsed){let D=a;for(;D&&D.mode==="text";)D=D.leftSibling;let P=a;for(;((t=P.rightSibling)==null?void 0:t.mode)==="text";)P=P.rightSibling;if(D&&P)return ma(e,[D,P])}if(a.rightSibling.mode==="text"){let D=a;for(;D&&D.mode==="text";)D=D.rightSibling;return D?(go(e,(r=D.leftSibling)!=null?r:D),e.mathfield.switchMode("math"),!0):go(e,e.lastOffset)}}const u=e.at(e.anchor).parentPrompt,d=u?e.offsetOf(u)+1:Math.max(e.position+1,0),p=pf(e,d,"forward");if(p)return go(e,p);const h=hp(e,a,D=>D.type==="leftright"||D.type==="text","forward");if(h){if(h.mode==="text"){let D=h;for(;D&&D.mode==="text";)D=D.rightSibling;return ma(e,[(n=h.leftSibling)!=null?n:h,(i=D.leftSibling)!=null?i:D])}return ma(e,h)}const S=a.parent;if(S){if(S.type==="leftright"||S.type==="surd")return ma(e,S);if(a.parentBranch==="superscript"&&S.subscript)return ma(e,S.subscript);if(a.parentBranch==="above"&&S.below)return ma(e,S.below);if(a.parentBranch==="superscript"||a.parentBranch==="subscript")return go(e,S);if(a.parentBranch==="above"||a.parentBranch==="below")return ma(e,S)}return go(e,e.lastOffset)},moveToPreviousGroup:e=>{var t;if(e.position===0&&e.anchor===0)return Yd(e,"backward");let r=e.at(e.position);const n=r.mode;if(n==="text"){if(e.selectionIsCollapsed){let u=r;for(;u&&u.mode==="text";)u=u.leftSibling;let d=r;for(;((t=d.rightSibling)==null?void 0:t.mode)==="text";)d=d.rightSibling;if(u&&d)return ma(e,[u,d])}for(;r&&r.mode==="text";)r=r.leftSibling;return r?go(e,r):go(e,0)}const i=e.at(e.anchor).parentPrompt,a=i?e.offsetOf(i.leftSibling):Math.max(e.position-1,0),s=pf(e,a,"backward");if(s)return go(e,s);if(n==="math"){const u=hp(e,r,p=>p.type==="leftright"||p.type==="text","backward");if(u){if(u.mode==="text"){let p=u;for(;p&&p.mode==="text";)p=p.leftSibling;return ma(e,[u,p])}return ma(e,u)}const d=r.parent;if(d){if(d.type==="leftright"||d.type==="surd")return ma(e,d);if(r.parentBranch==="subscript"&&d.superscript)return ma(e,d.superscript);if(r.parentBranch==="below"&&d.above)return ma(e,d.above);if(r.parentBranch==="superscript"||r.parentBranch==="subscript")return go(e,d);if(r.parentBranch==="above"||r.parentBranch==="below")return ma(e,d)}return go(e,0)}return!1},moveToMathfieldStart:e=>e.selectionIsCollapsed&&e.position===0?(e.announce("plonk"),!1):(e.position=0,e.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:e=>e.selectionIsCollapsed&&e.position===e.lastOffset?(e.announce("plonk"),!1):(e.position=e.lastOffset,e.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:fp,moveToSubscript:pp},{target:"model",changeSelection:!0}),Oa({moveToNextPlaceholder:e=>Yd(e,"forward"),moveToPreviousPlaceholder:e=>Yd(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function hp(e,t,r,n){if(n==="forward"){let a=t.rightSibling;for(;a&&!r(a);)a=a.rightSibling;return a}let i=t.leftSibling;for(;i&&!r(i);)i=i.leftSibling;return i}function Qd(e,t,r){typeof t=="function"&&(r=t,t=1/0),t===void 0&&(t=1/0);let n=e.position,i=!1,a="";for(;!i;){const s=e.at(n);i=t===0||s===void 0||s.type==="first"||s.mode!=="math"||!(s.type&&/mord|mpunct|operator/.test(s.type)||s.type==="mop"&&/[a-zA-Z ]+/.test(s.value))||!s.hasEmptyBranch("superscript")||!s.hasEmptyBranch("subscript")||typeof r=="function"&&!r(s),i||(s.mode="text",s.command=s.value,s.verbatimLatex=void 0,a+=s.value),n-=1,t-=1}e.contentDidChange({data:a,inputType:"insertText"})}function el(e,t,r){typeof t=="function"&&(r=t,t=1/0),t===void 0&&(t=1/0);let n=e.position,i=!1;const a=[];for(;!i;){const s=e.at(n);i=t===0||!s||s.type==="first"||s.isFirstSibling||s.mode!=="text"||s.value===" "||typeof r=="function"&&!r(s),i||(a.push(we.serialize([s],{defaultMode:"math"})),s.mode="math"),n-=1,t-=1}hf(e),e.contentDidChange({data:Cr(a),inputType:"insertText"})}function hf(e){var t;let r=e.position-1;for(;r>=0&&((t=e.at(r))==null?void 0:t.mode)==="math";)r-=1;if(!(r<0)&&e.at(r).mode==="text"&&e.at(r).value===" "&&e.at(r-1).mode==="math"){e.at(r-1).parent.removeChild(e.at(r-1));const n=e.silenceNotifications;e.silenceNotifications=!0,e.position-=1,e.silenceNotifications=n,e.contentDidChange({inputType:"deleteContent"})}}function Ym(e){let t="",r=e.position,n=!1;for(;!n;){const i=e.at(r);n=!(i&&(i.mode==="text"||i.mode==="math"&&i.type&&/mord|mpunct/.test(i.type))),n||(t=i.value+t),r-=1}return t}function Qm(e,t,r){const{model:n}=e;if(n.mode==="latex"||!n.at(n.position).isLastSibling||!r||!Td(r))return!1;const i=ec(r);if(!n.selectionIsCollapsed)return!!(e.model.mode==="text"&&/[/_^]/.test(i));const a=Ym(n)+i;if(e.model.mode==="text"){if(t==="Esc"||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(a)&&el(n,1),!0;const s={")":"(","}":"{","]":"["}[i],{parent:u}=n.at(n.position);if(s&&u instanceof Cn&&u.leftDelim===s)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(a))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z] $/.test(a))return el(n,1),!1;if(/\D\.[^\d\s]$/.test(a)){el(n,1);const d=n.at(n.position);return d.value="\u22C5",d.style.variant="normal",d.command="\\cdot",d.verbatimLatex=void 0,n.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(a)||/\.\d$/.test(a)||/\([\d+\-.]$/.test(a))return el(n,1),!0;if(/\([a-z][,;]$/.test(a))return el(n,2),!0;if(/[\d+\-=><*|]$/.test(i))return hf(n),!0}else{if(t==="[Space]")return Qd(n,void 0,s=>/[a-z][:,;.]$/.test(s.value)),!0;if(/[a-zA-Z]{3,}$/.test(a)&&!/(dxd|abc|xyz|uvw)$/.test(a))return Qd(n,void 0,s=>/[a-zA-Z]/.test(s.value)),!0;if(/(^|\W)(if)$/i.test(a))return Qd(n,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(a)&&!/(αβγ)$/.test(a))return Qd(n,void 0,s=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(s.value)),!0;if(i==="?"||i==="."&&!/[\d-+]\.$/.test(a))return!0}return!1}function eg(e,t){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;const r=mp(),n=e.element.getBoundingClientRect();r.style.left=`${n.left}px`,r.style.top=`${n.top-64}px`,r.innerHTML=window.MathfieldElement.createHTML("<span>"+(tf(t)||t)+"</span>"+r.innerHTML),r.style.visibility="visible",setTimeout(()=>{r.childNodes.length>0&&r.childNodes[r.childNodes.length-1].remove(),r.childNodes.length===0&&(r.style.visibility="hidden")},3e3)}function tg(e){if(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaptionVisible){const t=mp();t.innerHTML=""}else{const t=Rd("mathlive-keystroke-caption-panel");t.style.visibility="hidden"}return!1}function mp(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(Ha("keystroke-caption"),Ha("core"),Rd("mathlive-keystroke-caption-panel"))}function rg(){document.getElementById("mathlive-keystroke-caption-panel")&&(nf("mathlive-keystroke-caption-panel"),ro("core"),ro("keystroke-caption"))}function gp(e,t){var r,n,i;const{model:a}=e,s=Wf(t);if(t.isTrusted){Uh(t);const P=tu();e.keyboardLayout!==P.id&&(e.keyboardLayout=P.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,eg(e,s),t.isTrusted&&t.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let u,d="",p;const h=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(a.mode==="math")if(s==="[Backspace]")h.pop();else if(!Td(t))e.flushInlineShortcutBuffer();else{const P=ec(t),O=[...(n=(r=h[h.length-1])==null?void 0:r.keystrokes)!=null?n:[],P];h.push({state:a.getState(),keystrokes:O,leftSiblings:ng(e)});let de=0,Ve="";for(;!u&&de<O.length;)p=h.length-(O.length-de),Ve=O.slice(de).join(""),u=Vc(h[p].leftSiblings,Ve,e.options.inlineShortcuts),!u&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(Ve)&&(u=e.options.onInlineShortcut(e,Ve)),de+=1;e.flushInlineShortcutBuffer({defer:!0})}e.options.smartMode&&(u?e.switchMode("math"):Qm(e,s,t)&&(e.switchMode({math:"text",text:"math"}[a.mode]),d=""))}if(!u){if(d||(d=Yh(e.keybindings,a.mode,t)),!d&&(s==="[Enter]"||s==="[Return]")){let P=!1;return a.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(P=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),P||t.preventDefault&&(t.preventDefault(),t.stopPropagation()),a.contentDidChange({inputType:"insertLineBreak"})),P}if((!d||s==="[Space]")&&a.mode==="math"){if(s==="[Space]"){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return ln.insert(a,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),d="",e.dirty=!0,e.scrollIntoView(),t.preventDefault&&(t.preventDefault(),t.stopPropagation()),!1;const P=a.at(a.position+1),O=a.at(a.position-1);if((P==null?void 0:P.mode)==="text"||(O==null?void 0:O.mode)==="text")return ln.insert(a," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(i=a.at(a.position))!=null&&i.isDigit()&&window.MathfieldElement.decimalSeparator===","&&ec(t)===","&&(d="insertDecimalSeparator")}}if(!u&&!d){if(a.mathfield.smartFence){if(gf(a,ec(t),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}else{const{parent:P}=a.at(a.position);if(P instanceof Cn&&P.rightDelim==="?"&&a.at(a.position).isLastSibling&&/^[)}\]|]$/.test(s))return e.snapshot(),P.isDirty=!0,P.rightDelim=s,a.position+=1,a.selectionDidChange(),a.contentDidChange({data:ec(t),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1;if(!a.selectionIsCollapsed){const O=ec(t);if(O==="("||O==="{"||O==="["){const de={"(":"(","{":"\\lbrace","[":"\\lbrack"}[O],Ve={"(":")","{":"\\rbrace","[":"\\rbrack"}[O],[se,ke]=Ni(a.selection);return e.snapshot(),a.position=ke,ln.insert(a,Ve,{format:"latex"}),a.position=se,ln.insert(a,de,{format:"latex"}),a.setSelection(se+1,ke+1),a.contentDidChange({data:O,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}}}return!0}const S=a.at(Math.max(a.position,a.anchor)),{parent:D}=S;if(d==="moveAfterParent"&&(D==null?void 0:D.type)==="leftright"&&S.isLastSibling&&e.options.smartFence&&gf(a,".",e.defaultStyle)&&(d="",Un(e)),e.keyboardDelegate.cancelComposition(),d)e.executeCommand(d);else if(u){const P=e.effectiveStyle;a.setState(h[p].state);const O=h[h.length-1].keystrokes;for(const de of O)ln.insert(a,de,{silenceNotifications:!0,style:P});e.snapshot("insert-shortcut"),a.setState(h[p].state),a.deferNotifications({content:!0,selection:!0,data:u,type:"insertText"},()=>(ln.insert(a,u,{format:"latex",style:P}),hf(e.model),u.endsWith(" ")&&(e.switchMode("text"),ln.insert(a," ",{style:P,mode:"text"})),e.snapshot(),a.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0)),e.dirty=!0,a.announce("replacement")}return e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}function mf(e,t,r){const{model:n}=e;if(!e.isSelectionEditable){n.announce("plonk");return}r!=null||(r={}),r.focus&&e.focus(),r.feedback&&window.MathfieldElement.playSound("keypress"),typeof r.mode=="string"&&(e.switchMode(r.mode),e.snapshot());let i=td(t);const a=window.mathVirtualKeyboard;if(a!=null&&a.isShifted&&(i=typeof i=="string"?i.toUpperCase():i.map(d=>d.toUpperCase())),r.simulateKeystroke){let d=!0;for(const p of i)gp(e,new KeyboardEvent("keypress",{key:p}))&&(d=!1);if(d)return}const s=n.at(n.position),u=_(_({},s.computedStyle),e.defaultStyle);if(n.selectionIsCollapsed||(n.deleteAtoms(Ni(n.selection)),e.snapshot("delete")),n.mode==="latex")n.deferNotifications({content:!0,selection:!0,data:t,type:"insertText"},()=>{Pd(e);for(const d of i)ln.insert(n,d);e.snapshot("insert-latex"),nu(e)});else if(n.mode==="text"){for(const d of i)ln.insert(n,d,{style:u});e.snapshot("insert-text")}else if(n.mode==="math")for(const d of i)ig(e,d,u,s);e.dirty=!0,e.scrollIntoView()}function ng(e){const t=e.model,r=[];let n=t.at(Math.min(t.position,t.anchor));for(;n.type!=="first";)r.push(n),n=n.leftSibling;return r}function ig(e,t,r,n){const i=e.model;let a={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(t===" "&&e.options.mathModeSpace&&(a=["insert",e.options.mathModeSpace]),a){e.executeCommand(a);return}if(/\d/.test(t)&&e.options.smartSuperscript&&n.parentBranch==="superscript"&&n.parent.type!=="mop"&&n.parent.type!=="operator"&&n.parent.type!=="extensible-symbol"&&n.hasNoSiblings){ag(i),ln.insert(i,t,{style:r}),e.snapshot(),dp(i),e.snapshot();return}if(/[a-zA-Z0-9]/.test(t)&&e.adoptStyle!=="none"){const s=e.adoptStyle==="left"?n:n.parent?n.rightSibling:null;(s==null?void 0:s.type)==="mord"&&/[a-zA-Z0-9]/.test(s.value)&&(r=_({},r),s.style.variant&&(r.variant=s.style.variant),s.style.variantStyle&&(r.variantStyle=s.style.variantStyle))}ln.insert(i,t,{style:r}),e.snapshot(`insert-${i.at(i.position).type}`)}function ag(e){e.selectionIsCollapsed||(e.deleteAtoms(Ni(e.selection)),e.mathfield.snapshot("delete"))}function gf(e,t,r){if(!t||e.mode!=="math")return!1;const n=e.at(e.position),{parent:i}=n,a={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[t];if(!a)return!1;const s=Vl[a],u=Wl[a];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[d,p]=Ni(e.selection),h=e.extractAtoms([d,p]),S=i.addChildrenAfter([new Cn("left...right",h,{leftDelim:a,rightDelim:u})],e.at(d));return e.setSelection(e.offsetOf(S.firstChild),e.offsetOf(S.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:a,inputType:"insertText"}),!0}if(a==="|"){const d=i instanceof Cn?i.leftDelim+i.rightDelim:"";if(d==="\\lbrace\\rbrace"||d==="\\{\\}"||d==="\\lbrace?")return e.mathfield.snapshot(),ln.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:r}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:a,inputType:"insertText"}),!0}if(u){if(i instanceof Cn&&i.firstChild===n&&(i.leftDelim==="?"||i.leftDelim==="."))return i.leftDelim=a,i.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(i instanceof Cn)){let S=n;for(;S&&!(S.type==="mclose"&&S.value===u);)S=S.rightSibling;if(S){e.mathfield.snapshot();const D=e.extractAtoms([e.offsetOf(n),e.offsetOf(S)]);return D.pop(),i.addChildrenAfter([new Cn("left...right",D,{leftDelim:a,rightDelim:u})],n),e.position=e.offsetOf(i.firstChild)+1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}const d=e.offsetOf(n.lastSibling);let p;for(p=e.position;p<=d;p++){const S=e.at(p);if(S instanceof Cn&&(S.leftDelim==="?"||S.leftDelim===".")&&vp(a,S.rightDelim))break}const h=e.at(p);if(p<=d&&h instanceof Cn){h.leftDelim=a,e.mathfield.snapshot();let S=e.extractAtoms([e.position,p-1]);return S=S.filter(D=>D.type!=="first"),h.addChildren(S,h.parentBranch),e.position+=1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(i instanceof Cn&&(i.leftDelim==="?"||i.leftDelim===".")&&vp(a,i.rightDelim)){i.isDirty=!0,i.leftDelim=a,e.mathfield.snapshot();const S=e.extractAtoms([e.offsetOf(n.firstSibling),e.position]);for(const D of S)i.parent.addChildBefore(D,i);return e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(i instanceof Cn&&i.leftDelim==="|")){if(e.mathfield.snapshot(),ln.insert(e,`\\left${a}\\right?`,{format:"latex",style:r}),n.lastSibling.type!=="first"){const S=e.offsetOf(n.lastSibling),D=e.extractAtoms([e.position,S]);e.at(e.position).body=D,e.position-=1}return e.mathfield.snapshot("insert-fence"),!0}}if(s){let d=n;for(;d;){if(d.type==="mopen"&&d.value===s){e.mathfield.snapshot();const P=d.leftSibling,O=e.extractAtoms([e.offsetOf(d.leftSibling),e.offsetOf(n)]);O.shift();const de=new Cn("left...right",O,{leftDelim:s,rightDelim:a});return i.addChildrenAfter([de],P),e.position=e.offsetOf(de),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}d=d.leftSibling}if(i instanceof Cn&&n.isLastSibling&&vf(i.leftDelim,a))return e.mathfield.snapshot(),i.isDirty=!0,i.rightDelim=a,e.position+=1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const p=e.offsetOf(n.firstSibling);let h;for(h=e.position;h>=p;h--){const P=e.at(h);if(P instanceof Cn&&(P.rightDelim==="?"||P.rightDelim===".")&&vf(P.leftDelim,a))break}const S=e.at(h);if(h>=p&&S instanceof Cn)return e.mathfield.snapshot(),S.rightDelim=a,S.addChildren(e.extractAtoms([h,e.position]),S.parentBranch),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(i instanceof Cn&&(i.rightDelim==="?"||i.rightDelim===".")&&vf(i.leftDelim,a))return e.mathfield.snapshot(),i.isDirty=!0,i.rightDelim=a,i.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(n.lastSibling)]),i.parentBranch),e.position=e.offsetOf(i),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const D=i.parent;return D instanceof Cn&&(D.rightDelim==="?"||D.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(D),gf(e,a,r)):!1}return!1}function vf(e,t){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t):Wl[e]===t:!0}function vp(e,t){return t?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):Vl[t]===e:!0}Oa({undo:e=>(e.undo(),!0),redo:e=>(e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},toggleKeystrokeCaption:tg,toggleContextMenu:e=>{const t=e.toggleContextMenu();return t||e.model.announce("plonk"),t},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,t,r,n)=>(e.switchMode(t,r,n),!0),insert:(e,t,r)=>e.insert(t,r),typedText:(e,t,r)=>(mf(e,t,r),!0),insertDecimalSeparator:e=>{const t=e.model;return t.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&t.at(Math.max(t.position,t.anchor)).isDigit()?(e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0):(e.insert("."),!0)},commit:e=>{var t;return e.model.contentWillChange({inputType:"insertLineBreak"})&&((t=e.host)==null||t.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,t,r)=>{const n=e.getPrompts();let i="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),a=0;for(;n.includes(i)&&a<100;){if(a===99)return console.error("could not find a unique ID after 100 tries"),!1;i="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),a++}return e.insert(`\\placeholder[${t!=null?t:i}]{}`,r),!0}}),Oa({copyToClipboard:e=>(e.focus(),e.model.selectionIsCollapsed&&e.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),Oa({cutToClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(t=>{t&&e.model.contentWillChange({inputType:"insertFromPaste",data:t})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(t,{mode:e.model.mode})&&(nu(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Un(e))):e.model.announce("plonk"),e.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function og(e,t){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();const r=bf(e,t),{model:n}=e;return n.selectionIsCollapsed?(e.defaultStyle.fontSeries&&r.fontSeries===e.defaultStyle.fontSeries&&(r.fontSeries="auto"),r.fontShape&&r.fontShape===e.defaultStyle.fontShape&&(r.fontShape="auto"),r.color&&r.color===e.defaultStyle.color&&(r.color="none"),r.backgroundColor&&r.backgroundColor===e.defaultStyle.backgroundColor&&(r.backgroundColor="none"),r.fontSize&&r.fontSize===e.defaultStyle.fontSize&&(r.fontSize="auto"),e.defaultStyle=_(_({},e.defaultStyle),r)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{n.selection.ranges.forEach(i=>uf(n,i,r,{operation:"toggle"})),e.snapshot("style-change")}),!0}Oa({applyStyle:og},{target:"mathfield",canUndo:!0,changeContent:!0});function bf(e,t){var r,n,i,a,s,u,d,p,h,S;const D={};if(typeof t.color=="string"){const O=(n=e.colorMap((r=t.color)!=null?r:t.verbatimColor))!=null?n:"none";O!==t.color&&(D.verbatimColor=(i=t.verbatimColor)!=null?i:t.color),D.color=O}if(typeof t.backgroundColor=="string"){const O=(s=e.backgroundColorMap((a=t.backgroundColor)!=null?a:t.verbatimBackgroundColor))!=null?s:"none";O!==t.backgroundColor&&(D.verbatimBackgroundColor=(u=t.verbatimBackgroundColor)!=null?u:t.backgroundColor),D.backgroundColor=O}typeof t.fontFamily=="string"&&(D.fontFamily=t.fontFamily),typeof t.series=="string"&&(D.fontSeries=t.series),typeof t.fontSeries=="string"&&(D.fontSeries=t.fontSeries.toLowerCase()),D.fontSeries&&(D.fontSeries=(d={bold:"b",medium:"m",normal:"m"}[D.fontSeries])!=null?d:D.fontSeries),typeof t.shape=="string"&&(D.fontShape=t.shape),typeof t.fontShape=="string"&&(D.fontShape=t.fontShape.toLowerCase()),D.fontShape&&(D.fontShape=(p={italic:"it",up:"n",upright:"n",normal:"n"}[D.fontShape])!=null?p:D.fontShape),t.variant&&(D.variant=t.variant.toLowerCase()),t.variantStyle&&(D.variantStyle=t.variantStyle.toLowerCase());const P=(h=t.size)!=null?h:t.fontSize;return typeof P=="number"?D.fontSize=Math.max(1,Math.min(10,P)):typeof P=="string"&&(D.fontSize=(S={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[P.toLowerCase()])!=null?S:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[P]),D}function yf(e){let[t,r]=Ni(e.selection);if(t=bp(e,t,"backward"),r=bp(e,r,"forward"),t===r){const n=e.at(t);if(n.type==="leftright")return e.setSelection(e.offsetOf(n.firstChild)-1,r);if(n.type==="first"&&(n.parent.type==="leftright"||n.parent.type==="surd"))return e.setSelection(t-1,e.offsetOf(n.parent.lastChild)+1);e.setSelection(t-1,r)}else e.setSelection(t,r);return!0}function bp(e,t,r){var n,i,a;let s=e.at(t);if(!s)return t;const u=r==="forward"?1:-1;if(s.mode==="text"){for(;s&&!(s.mode!=="text"||!Q.test(s.value));)t+=u,s=e.at(t);return r==="backward"?t-1:t}if(s.mode==="latex"){if(/[a-zA-Z\*]/.test(s.value))if(r==="backward")for(;s&&s.mode==="latex"&&s.value!=="\\"&&/[a-zA-Z]/.test(s.value);)t+=u,s=e.at(t);else for(;s&&s.mode==="latex"&&/[a-zA-Z\*]/.test(s.value);)t+=u,s=e.at(t);else if(s.value==="{"){if(r==="forward"){for(;s&&s.mode==="latex"&&s.value!=="}";)t+=u,s=e.at(t);return t}return t-1}else if(s.value==="}"){if(r==="backward"){for(;s&&s.mode==="latex"&&s.value!=="{";)t+=u,s=e.at(t);return t-1}return t}return t-1}if(s.mode==="math"){if(s.isDigit()){for(;(n=e.at(t+u))!=null&&n.isDigit();)t+=u;return r==="backward"?t-1:t}if(s.style.variant||s.style.variantStyle){let d=(i=e.at(t))==null?void 0:i.style;for(;d&&d.variant===s.style.variant&&d.variantStyle===s.style.variantStyle;)d=(a=e.at(t+u))==null?void 0:a.style,t+=u;return r==="backward"?t-1:t}return t}return t}Oa({selectGroup:e=>{const t=yf(e);return t||e.announce("plonk"),t},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>To(e,"forward",{extend:!0}),extendSelectionBackward:e=>To(e,"backward",{extend:!0}),extendToNextWord:e=>oc(e,"forward",{extend:!0}),extendToPreviousWord:e=>oc(e,"backward",{extend:!0}),extendSelectionUpward:e=>To(e,"upward",{extend:!0}),extendSelectionDownward:e=>To(e,"downward",{extend:!0}),extendToNextBoundary:e=>oc(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>oc(e,"backward",{extend:!0}),extendToGroupStart:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return t||e.announce("plonk"),t},extendToGroupEnd:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return t||e.announce("plonk"),t},extendToMathFieldStart:e=>{const t=e.setSelection(e.anchor,0);return t||e.announce("plonk"),t},extendToMathFieldEnd:e=>{const t=e.setSelection(e.anchor,e.lastOffset);return t||e.announce("plonk"),t}},{target:"model",changeSelection:!0});var tl=null,cu=0,e0=class so{static start(t,r,n,i){var a;so.element=t,(a=so.controller)==null||a.abort(),so.controller=new AbortController;const s={signal:so.controller.signal};"PointerEvent"in window?(t.addEventListener("pointermove",n,s),t.addEventListener("pointerup",i,s),t.addEventListener("pointercancel",i,s),xf(r)&&(so.pointerId=r.pointerId,t.setPointerCapture(r.pointerId))):(window.addEventListener("mousemove",n,s),window.addEventListener("blur",i,s),window.addEventListener("mouseup",i,s))}static stop(){var t;(t=so.controller)==null||t.abort(),so.controller=void 0,typeof so.pointerId=="number"&&(so.element.releasePointerCapture(so.pointerId),so.pointerId=void 0)}};function xf(e){return e!==null&&globalThis.PointerEvent!==void 0&&e instanceof PointerEvent}function yp(e,t){var r;if(t.buttons>1)return;e.atomBoundsCache=new Map;const n=e;let i,a=!1,s=!1,u="none",d=!1,p=!1;const h=t.clientX,S=t.clientY,D=Date.now(),P=n.field,O=setInterval(()=>{d?P.scroll({top:0,left:P.scrollLeft-16}):p&&P.scroll({top:0,left:P.scrollLeft+16})},32);function de(){e0.stop(),a=!1,clearInterval(O),e.element.classList.remove("tracking"),t&&t.preventDefault()}function Ve(ke){if(!n.hasFocus()){de();return}const Xe=ke.clientX,$e=ke.clientY,St=xf(ke)&&ke.pointerType==="touch"?20:5;if(Date.now()<D+500&&Math.abs(h-Xe)<St&&Math.abs(S-$e)<St){ke.preventDefault(),ke.stopPropagation();return}const Kt=P.getBoundingClientRect();p=Xe>Kt.right,d=Xe<Kt.left;let Tt=i;xf(ke)&&(ke.isPrimary||(Tt=uu(n,ke.clientX,ke.clientY,{bias:0})));const kr=uu(n,Xe,$e,{bias:Xe<=h?Xe===h?0:-1:1});Tt>=0&&kr>=0&&(n.model.extendSelectionTo(Tt,kr),Un(e)),s&&yf(n.model)}tl&&Math.abs(tl.x-h)<5&&Math.abs(tl.y-S)<5&&Date.now()<tl.time+500?(cu+=1,tl.time=D):(tl={x:h,y:S,time:D},cu=1);const se=P.getBoundingClientRect();if(h>=se.left&&h<=se.right&&S>=se.top&&S<=se.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",i=uu(e,h,S,{bias:0}),i>=0){if(e.element.classList.add("tracking"),t.shiftKey){const ke=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,i),Zf(e.model)||ke?u="all":u="selection"}else e.model.at(i).type==="placeholder"?(e.model.setSelection(i-1,i),u="selection"):((r=e.model.at(i).rightSibling)==null?void 0:r.type)==="placeholder"?(e.model.setSelection(i,i+1),u="selection"):(e.model.position=i,Zf(e.model)?u="all":u="selection");e.defaultStyle={},t.detail===3||cu>2?(de(),(t.detail===3||cu===3)&&(e.model.selection={ranges:[[0,e.model.lastOffset]]},u="all")):a||(a=!0,e0.start(P,t,Ve,de),(t.detail===2||cu===2)&&(s=!0,yf(e.model),u="all"))}e.hasFocus()||(u="none",e.focus({preventScroll:!0}))}else tl=null;e.stopCoalescingUndo(),u!=="none"&&(e.model.selectionIsCollapsed&&(u="all"),Un(e)),t.preventDefault()}function sg(e,t,r){if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return 0;const n=e-(r.left+r.right)/2,i=t-(r.top+r.bottom)/2;return n*n+i*i}function xp(e,t,r,n,i){if(!r.id)return[1/0,null];if(t.has(r.id))return t.get(r.id);const a=Hs(e,r);if(!a)return[1/0,null];let s=[1/0,null];if(r.hasChildren&&!r.captureSelection&&n>=a.left&&n<=a.right)for(const u of r.children){const d=xp(e,t,u,n,i);d[0]<=s[0]&&(s=d)}return s[1]||(s=[sg(n,i,a),r]),t.set(r.id,s),s}function lg(e,t,r){const[,n]=xp(e,new Map,e.model.root,t,r);return n}function uu(e,t,r,n){var i;const a=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!a)return 0;if(t>a.right||r>a.bottom+8)return e.model.lastOffset;if(t<a.left||r<a.top-8)return 0;n=n!=null?n:{},n.bias=(i=n.bias)!=null?i:0;let s=lg(e,t,r);const u=[];let d=s;for(;d;)u.unshift(d),d=d.parent;for(const h of u)if(h.captureSelection){s=h;break}let p=e.model.offsetOf(s);if(p<0)return-1;if(s.leftSibling)if(n.bias===0&&s.type!=="placeholder"){const h=Hs(e,s);h&&t<(h.left+h.right)/2&&(p=e.model.offsetOf(s.leftSibling))}else n.bias<0&&(p=e.model.offsetOf(s.leftSibling));return p}var cg=class extends ln{constructor(){super("math")}onPaste(e,t){if(!t||!e.model.contentWillChange({data:typeof t=="string"?t:null,dataTransfer:typeof t=="string"?null:t,inputType:"insertFromPaste"}))return!1;let r="",n="auto",i=typeof t!="string"?t.getData("application/json+mathlive"):"";if(i)try{const a=JSON.parse(i);if(a&&Array.isArray(a)){e.snapshot();const s=ha(a),{model:u}=e;u.selectionIsCollapsed||u.deleteAtoms(Ni(u.selection));const d=u.at(u.position);if(d.parent instanceof qr){console.assert(d.parentBranch!==void 0);const p=[];let h=[];s[0].type==="first"&&s.shift(),s[s.length-1].type==="first"&&s.pop();for(const O of s)O.type==="first"&&h.length>0?(p.push(h),h=[O]):h.push(O);h.length>0&&p.push(h);let S=Number(d.parentBranch[0]),D=Number(d.parentBranch[1]);const P=d.parent.maxColumns;for(;d.parent.colCount-D<p.length&&d.parent.colCount<P;)d.parent.addColumn();d.parent.addChildrenAfter(p[0],d);for(let O=1;O<p.length;O++)D++,D>=P&&(D=0,d.parent.addRowAfter(S),S++),d.parent.setCell(S,D,p[O])}else d.parent.addChildrenAfter(s.filter(p=>p.type!=="first"),d);return u.position=u.offsetOf(s[s.length-1]),u.contentDidChange({inputType:"insertFromPaste"}),Un(e),!0}}catch(a){}if(i=typeof t!="string"?t.getData("application/json"):"",i&&window.MathfieldElement.computeEngine)try{const a=JSON.parse(i);if(typeof a=="object"&&"latex"in a&&a.latex&&(r=a.latex),!r){const s=window.MathfieldElement.computeEngine.box(a);s&&!s.has("Error")&&(r=s.latex)}r||(n="latex")}catch(a){}if(!r&&typeof t!="string"&&(r=t.getData("application/x-latex"),r&&(n="latex")),r||(r=typeof t=="string"?t:t.getData("text/plain")),r){let a;return[a,r]=cd(r),n==="auto"&&a&&(n="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r,{format:n})&&(e.startRecording(),e.snapshot("paste"),Un(e)),e.startRecording(),!0}return!1}insert(e,t,r){var n,i;const a=typeof t=="string"?t:(i=(n=window.MathfieldElement.computeEngine)==null?void 0:n.box(t).latex)!=null?i:"";if(!r.silenceNotifications&&!e.contentWillChange({data:a,inputType:"insertText"}))return!1;r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder"),r.format||(r.format="auto");const{silenceNotifications:s}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const u=e.silenceNotifications;e.silenceNotifications=!0;const d={"?":"\\placeholder{}","@":"\\placeholder{}"};d[0]=r.insertionMode==="replaceAll"?"":e.getValue(e.selection,"latex-unstyled"),r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ni(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward"),!e.at(e.position).isLastSibling&&e.at(e.position+1).type==="placeholder"?e.deleteAtoms([e.position,e.position+1]):e.at(e.position).type==="placeholder"&&e.deleteAtoms([e.position-1,e.position]);let p=-1;d[0]?d["@"]=d[0]:typeof t=="string"&&/(^|[^\\])#@/.test(t)&&(p=dg(e),p>=0&&(d["@"]=e.getValue(p,e.position,"latex"))),d[0]||(d[0]=d["?"]);let h=!1;const S=Xe=>(h=!0,d[Xe]);let[D,P]=wp(e,t,S,r);if(!P)return!1;const O=P.length===1&&P[0].type==="genfrac";O&&p>=0&&typeof e.mathfield.options.isImplicitFunction=="function"&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(d["@"]=d["?"],h=!1,[D,P]=wp(e,t,S,r)):p>=0&&e.deleteAtoms([p,e.position]);const{parent:de}=e.at(e.position),Ve=de.hasEmptyBranch("body");if(O&&D!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&de instanceof Cn&&de.leftDelim==="("&&Ve){const Xe=de.parent,$e=de.parentBranch;Xe.removeChild(de),Xe.setChildren(P,$e)}const se=e.at(e.position);se.parent.addChildrenAfter(P,se),D==="latex"&&typeof t=="string"&&(de==null?void 0:de.type)==="root"&&Ve&&!h&&(de.verbatimLatex=t),e.silenceNotifications=u;const ke=P[P.length-1];if(r.selectionMode==="placeholder"){const Xe=P.flatMap($e=>[$e,...$e.children]).find($e=>$e.type==="placeholder");if(Xe){const $e=e.offsetOf(Xe);e.setSelection($e-1,$e),e.announce("move")}else ke&&(e.position=e.offsetOf(ke))}else r.selectionMode==="before"||(r.selectionMode==="after"?ke&&(e.position=e.offsetOf(ke)):r.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(ke)));return e.contentDidChange({data:a,inputType:"insertText"}),e.silenceNotifications=s,!0}};function wp(e,t,r,n){var i;let a,s=[];if(typeof t!="string"||n.format==="math-json"){const u=window.MathfieldElement.computeEngine;if(!u)return["math-json",[]];[a,t]=["latex",u.box(t).latex],s=w(t,{context:e.mathfield.context})}else typeof t=="string"&&n.format==="ascii-math"?([a,t]=Mo(t,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),s=w(t,{context:e.mathfield.context}),a!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&t0(s)):(n.format==="auto"||(i=n.format)!=null&&i.startsWith("latex"))&&(n.format==="auto"&&([a,t]=Mo(t,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),n.format==="latex"&&([,t]=cd(t)),s=w(t,{context:e.mathfield.context,args:r}),n.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&t0(s));return _s(s,n.style),[a!=null?a:"latex",s]}function ug(e){if(!e||(console.assert(e[0].type==="first"),e.length>1))return null;const t=e[0];return t instanceof Cn&&t.leftDelim==="("&&t.rightDelim===")"?t.removeBranch("body"):null}function t0(e){if(e){for(let t=0;e[t];t++){const r=e[t];if(r instanceof Cn&&r.leftDelim==="("){let n=0,i=0,a=0;for(let s=0;r.body[s];s++)r.body[s].type==="genfrac"&&(n++,i=s),a++;a===0&&n===1&&(e[t]=r.body[i])}}for(const t of e){for(const r of t.branches)if(!t.hasEmptyBranch(r)){t0(t.branch(r));const n=ug(t.branch(r));n&&t.setChildren(n,r)}if(t instanceof qr)for(const r of t.cells)t0(r)}}}function dg(e){let t=e.at(e.position);if(t.mode==="text"){for(;!t.isFirstSibling&&t.mode==="text";)t=t.leftSibling;return e.offsetOf(t)}const r=t;let n=!1;if(t.type==="mclose"){const i=Vl[t.value];for(;!t.isFirstSibling&&!(t.type==="mopen"&&t.value===i);)t=t.leftSibling;t.isFirstSibling||(t=t.leftSibling),n=!0}else t.type==="leftright"&&(t=t.leftSibling,n=!0);if(n)for(;!t.isFirstSibling&&(t.isFunction||Sp(t));)t=t.leftSibling;else{const i=[];for(;!t.isFirstSibling&&(Sp(t)||i.length>0);)t.type==="mclose"&&i.unshift(t.value),t.type==="mopen"&&i.length>0&&t.value===Vl[i[0]]&&i.shift(),t=t.leftSibling}return r===t?-1:e.offsetOf(t)}function Sp(e){return e.isDigit()?!0:e.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(e.type)?!e.isExtensibleSymbol:!1}new cg;var fg=class extends ln{constructor(){super("text")}onPaste(e,t){if(!t)return!1;const r=typeof t=="string"?t:t.getData("text/plain");return r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r)&&(e.model.contentDidChange({inputType:"insertFromPaste"}),e.startRecording(),e.snapshot("paste"),Un(e)),e.startRecording(),!0):!1}insert(e,t,r={}){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder"),r.format||(r.format="auto");const{silenceNotifications:n}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const i=e.silenceNotifications;e.silenceNotifications=!0,r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ni(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward");const a=pg(t,e.mathfield.context);if(_s(a,r.style),!a)return!1;const s=e.at(e.position),u=s.parent.addChildrenAfter(a,s);return e.silenceNotifications=i,r.selectionMode==="before"||(r.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(u)):u&&(e.position=e.offsetOf(u))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=n,!0}};function pg(e,t){return e=e.replace(/\\/g,"\\textbackslash "),e=e.replace(/#/g,"\\#"),e=e.replace(/\$/g,"\\$"),e=e.replace(/%/g,"\\%"),e=e.replace(/&/g,"\\&"),e=e.replace(/_/g,"\\_"),e=e.replace(/{/g,"\\textbraceleft "),e=e.replace(/}/g,"\\textbraceright "),e=e.replace(/lbrace/g,"\\textbraceleft "),e=e.replace(/rbrace/g,"\\textbraceright "),e=e.replace(/\^/g,"\\textasciicircum "),e=e.replace(/~/g,"\\textasciitilde "),e=e.replace(/£/g,"\\textsterling "),w(e,{context:t,parseMode:"text"})}new fg;function $o(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var xn=4,Ea=20,si=2*(Ea+xn),r0=(e,t)=>`
|
|
|
<line x1="${e+Ea}" y1="${t+Ea}"
|
|
|
x2="${e>t?e+Ea:7*Ea+10*xn}"
|
|
|
y2="${e<t?t+Ea:7*Ea+10*xn}"/>
|
|
|
<svg id="plus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
|
|
|
</svg>`,_p=(e,t)=>`
|
|
|
<line x1="${e+Ea}" y1="${t+Ea}"
|
|
|
x2="${e>t?e+Ea:7*Ea+10*xn}"
|
|
|
y2="${e<t?t+Ea:7*Ea+10*xn}"/>
|
|
|
<svg id="minus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
|
|
|
</svg>`,n0=(e,t,r)=>`
|
|
|
<svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<g transform="rotate(${r})" transform-origin="20 20">
|
|
|
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
|
|
|
</g>
|
|
|
</svg>`,hg=`
|
|
|
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
viewBox=
|
|
|
"-2 -2 ${8*Ea+10*xn+5} ${8*Ea+10*xn+5}">
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background rows"
|
|
|
x="0"
|
|
|
y="${si+xn}"
|
|
|
height="${3*si}"
|
|
|
width="${si}"
|
|
|
rx="${si/2}"/>
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background columns"
|
|
|
x="${si+xn}"
|
|
|
y="0"
|
|
|
height="${si}"
|
|
|
width="${3*si}"
|
|
|
rx="${si/2}"/>
|
|
|
<g data-command='"moveDown"'>
|
|
|
${n0(2*(xn+si),2*xn+3*si,0)}
|
|
|
</g>
|
|
|
<g data-command='"moveUp"'>
|
|
|
${n0(2*(xn+si),2*xn+si,180)}
|
|
|
</g>
|
|
|
<g data-command='"moveToNextWord"'>
|
|
|
${n0(2*xn+3*si,2*(xn+si),-90)}
|
|
|
</g>
|
|
|
<g data-command='"moveToPreviousWord"'>
|
|
|
${n0(2*xn+si,2*(xn+si),90)}
|
|
|
</g>
|
|
|
<g>
|
|
|
|
|
|
<g data-command='"addColumnBefore"'>
|
|
|
${r0(2*xn+si,xn)}
|
|
|
</g>
|
|
|
<g data-command='"removeColumn"'>
|
|
|
${_p(2*xn+2*si,xn)}
|
|
|
</g>
|
|
|
<g data-command='"addColumnAfter"'>
|
|
|
${r0(2*xn+3*si,xn)}
|
|
|
</g>
|
|
|
<g data-command='"addRowBefore"'>
|
|
|
${r0(xn,2*xn+si)}
|
|
|
</g>
|
|
|
<g data-command='"removeRow"'>
|
|
|
${_p(xn,2*xn+2*si)}
|
|
|
</g>
|
|
|
<g data-command='"addRowAfter"'>
|
|
|
${r0(xn,2*xn+3*si)}
|
|
|
</g>
|
|
|
</svg>`,mg=e=>`
|
|
|
<svg id="matrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","matrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/></svg>`,gg=e=>`
|
|
|
<svg id="pmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","pmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
|
|
|
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/></svg>`,Mp=e=>`
|
|
|
<svg id="Bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","Bmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
|
|
|
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
</svg>`,vg=e=>`
|
|
|
<svg id="bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","bmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4h-3v16h3"/>
|
|
|
<path class="cls-2" d="m22,4h3v16h-3"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
</svg>`,bg=e=>`
|
|
|
<svg id="vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","vmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
|
|
|
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
|
|
|
</svg>`,yg=e=>`
|
|
|
<svg id="Vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
|
|
|
data-command='["setEnvironment","Vmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
|
|
|
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
|
|
|
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
|
|
|
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
|
|
|
</svg>`,xg=e=>`
|
|
|
<svg id="cases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","cases"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
|
|
|
<circle cx="13" cy="8" r="1"/>
|
|
|
<circle cx="13" cy="16" r="1"/>
|
|
|
<circle cx="21" cy="8" r="1"/>
|
|
|
<circle cx="21" cy="16" r="1"/>
|
|
|
</svg>`,wg=e=>`
|
|
|
<svg id="rcases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","rcases"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
|
|
|
<circle cx="15" cy="8" r="1"/>
|
|
|
<circle cx="15" cy="16" r="1"/>
|
|
|
<circle cx="7" cy="8" r="1"/>
|
|
|
<circle cx="7" cy="16" r="1"/>
|
|
|
</svg>`,wf={matrix:mg,pmatrix:gg,bmatrix:vg,Bmatrix:Mp,vmatrix:bg,Vmatrix:yg},Sf={cases:xg,rcases:wg,Bmatrix:Mp};function Sg(e){var t,r;const n=(t=e.model.parentEnvironment)==null?void 0:t.array;if(!n)return;let i=0;n.forEach(O=>{(!i||O.length>i)&&(i=O.length)});let a=document.getElementById("mathlive-environment-popover");a||(a=Rd("mathlive-environment-popover"),Ha("environment-popover"),Ha("core"),a.setAttribute("aria-hidden","true"));let s;const u=a.querySelector(".MLEP__environment-controls");u?s=u:(s=document.createElement("div"),a.innerHTML="",a.appendChild(s)),s.className="MLEP__environment-controls",s.style.display="flex",s.style.width="100%",s.style.height="100%",s.style.boxSizing="border-box",s.innerHTML=hg;let d=[],p="";const h=e.model.parentEnvironment.environmentName;if(Md(h)){const O=Mg(h);p=wf[O]("active");const de=wf,{[O]:Ve}=de,se=Ne(de,[De(O)]);d=Object.values(se).map(ke=>ke("inactive"))}else if(q0(h)){const O=Cg(h);p=Sf[O]("active");const de=Sf,{[O]:Ve}=de,se=Ne(de,[De(O)]);d=Object.values(se).map(ke=>ke("inactive"))}else X0(h)&&(p=wf.matrix("active"),d=Object.values(Sf).map(O=>O("inactive")));const S=document.createElement("div");S.className="MLEP__environment-delimiter-controls",S.style.display="flex",S.style.flexDirection="column",S.innerHTML=`
|
|
|
<div class='MLEP__array-delimiter-options'>
|
|
|
${p}
|
|
|
${d.join("")}
|
|
|
</div>`,p&&s.appendChild(S),s.querySelectorAll("[data-command]").forEach(O=>{const de=O.dataset.command;let Ve=de;try{Ve=JSON.parse(de)}catch(se){}O.addEventListener("mousedown",se=>se.preventDefault()),Ve&&O.addEventListener("click",()=>e.executeCommand(Ve))});const P=(r=e.field)==null?void 0:r.getBoundingClientRect();P&&(a.style.top=`${window.scrollY+(P.top-a.clientHeight-15)}px`,a.style.left=`${P.left+20}px`,a.classList.add("is-visible"))}function _f(){const e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function _g(){document.getElementById("mathlive-environment-popover")&&(nf("mathlive-environment-popover"),ro("environment-popover"),ro("core"))}function i0(e){if(!e.hasFocus())return;let t=!1;if(e.model.mode==="math"){const r=e.model.parentEnvironment;if(r!=null&&r.array&&G0(r.environmentName)){const n=e.options.environmentPopoverPolicy;t=n==="auto"||n==="on"}}t?Sg(e):_f()}function Mg(e){return e.replace("*","")}function Cg(e){return e==="dcases"?"cases":e}function Cp(e){const t=getComputedStyle(e).direction;return t==="ltr"||t==="rtl"?t:"ltr"}function Ep(e,t,r){return t==="left"||t==="leading"&&r==="ltr"||t==="trailing"&&r==="rtl"?e.left:e.right}function Mf(e,t,r,n){return r==="middle"?e-t/2:r==="start"&&n==="rtl"||r==="end"&&n==="ltr"||r==="top"||r==="right"?Math.max(0,e-t):e}function Eg(e,t,r,n){return r==="middle"?e-t/2:r==="start"&&n==="ltr"||r==="end"&&n==="rtl"||r==="top"||r==="right"?e:e-t}function kg(e,t){var r,n,i;const a=(r=Cp(e))!=null?r:"ltr";e.style.position="fixed",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.height="",e.style.width="";const s=e.getBoundingClientRect(),u=Number.isFinite(t.maxHeight)?Math.min(t.maxHeight,window.innerHeight):window.innerHeight;let d=Math.min(u,(n=t.height)!=null?n:s.height),p=Mf(t.location.y,d,t.verticalPos,a);p+d>window.innerHeight-8&&(t.alternateLocation?(p=Mf(t.alternateLocation.y,d,t.verticalPos,a),p+d>window.innerHeight-8&&(p=void 0)):p=void 0),Number.isFinite(p)||(p=Math.max(8,window.innerHeight-8-d),8+d>window.innerHeight-8&&(e.style.bottom="8px")),d=Math.min(p+d,window.innerHeight-8)-p;const h=Number.isFinite(t.maxWidth)?Math.min(t.maxWidth,window.innerWidth):window.innerWidth;let S=Math.min(h,(i=t.width)!=null?i:s.width),D=Mf(t.location.x,S,t.horizontalPos,a);D+S>window.innerWidth-8&&(t.alternateLocation?(D=Eg(t.alternateLocation.x,S,t.verticalPos,a),D+S>window.innerWidth-8&&(D=void 0)):D=void 0),Number.isFinite(D)||(D=Math.max(8,window.innerWidth-8-S),8+S>window.innerWidth-8&&(e.style.right="8px")),S=Math.min(D+S,window.innerWidth-8)-D,a==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-D-S).toString()}px`:e.style.left=`${Math.ceil(D).toString()}px`,e.style.top=`${Math.ceil(p).toString()}px`,d!==s.height&&(e.style.height=`${Math.ceil(d).toString()}px`),S!==s.width&&(e.style.width=`${Math.ceil(S).toString()}px`)}function Ag(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function sc(e){return"submenu"in e}function Po(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function Cf(e){return"type"in e&&e.type==="divider"}function Ef(e){return"type"in e&&e.type==="heading"}var kp={};function kf(e){let t=kp[e];if(!t){let r;switch(e){case"checkmark":r=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
|
|
|
</span>`;break;case"trailing-chevron":r='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":r='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(r){const n=document.createElement("template");n.innerHTML=r,kp[e]=n,t=n}}if(t){if("content"in t)return t.content.cloneNode(!0);const r=document.createElement("svg");return r.innerHTML=t.innerHTML,r}}var Ap=80,Dp=class{constructor(e,t){this._element=null;var r;this.parentMenu=t,this._declaration=e,sc(e)?(this.type="submenu",this.submenu=new Lp(e.submenu,{parentMenu:t,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=(r=e.type)!=null?r:"command",this.hasCheck=Po(e)&&e.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var e,t;(e=this._abortController)==null||e.abort(),this._abortController=void 0,(t=this._element)==null||t.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var e;return(e=this._label)!=null?e:""}set label(e){e===void 0&&(e=""),e!==this._label&&(this._label=e,this.dirty=!0)}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.dirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.element&&(e?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(e){this._checked=e,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(e){e!==this._tooltip&&(this._tooltip=e,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){e!==this._ariaLabel&&(this._ariaLabel=e,this.dirty=!0)}get active(){var e,t;return(t=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?t:!1}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var t,r,n;const i=this._declaration;if(Cf(i)){this.enabled=!1,this.checked=!1;return}Ef(i)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Po(i)&&(this.checked=Po(i)&&((t=lc(i.checked,e))!=null?t:!1)),(Po(i)||sc(i))&&(this.enabled=(r=lc(i.enabled,e))!=null?r:!0,this.visible=(n=lc(i.visible,e))!=null?n:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(Po(i)||Ef(i)||sc(i))&&(this.label=lc(i.label,e),this.tooltip=lc(i.tooltip,e),this.ariaLabel=lc(i.ariaLabel,e)),this._element&&this.updateElement()}set dirty(e){console.assert(e===!0),e&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const e=this.element;e.textContent="",this.enabled?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true"),this.checked===!0?(e.setAttribute("aria-checked","true"),e.append(kf("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(kf("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);const t=document.createElement("span");if(t.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&t.classList.add("heading"),t.innerHTML=this.label,e.append(t),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),Po(this._declaration)&&this._declaration.keyboardShortcut){const r=document.createElement("kbd");r.innerHTML=tf(this._declaration.keyboardShortcut),e.append(r)}this.type==="submenu"&&e.append(kf("trailing-chevron"))}get element(){if(this._element)return this._element;if(Cf(this._declaration)){const r=document.createElement("li");return r.setAttribute("part","menu-divider"),r.setAttribute("role","divider"),this._element=r,r}const e=document.createElement("li");this._element=e,(Po(this._declaration)||Ef(this._declaration)||sc(this._declaration))&&this._declaration.class&&(e.className=this._declaration.class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.hasCheck?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),this.type==="submenu"&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const t=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:t}),e.addEventListener("pointerleave",this,{signal:t}),e.addEventListener("pointerup",this,{signal:t}),e.addEventListener("click",this,{signal:t}),this._element}dispatchSelect(){if(!Po(this._declaration))return;const e=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(e)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(e){var t;if(!(!this.visible||!this.enabled)){if(e.type==="click"){this.rootMenu.state==="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}if(e.type==="pointerenter"){const r=e;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((t=this.parentMenu.activeMenuItem)!=null&&t.movingTowardSubmenu(r))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(e.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(e.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},Ap)},Ap)}openSubmenu(e){var t;if(this.type!=="submenu"||!this.element)return;if((t=e==null?void 0:e.withDelay)!=null&&t){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const r=this.element.getBoundingClientRect(),n=Cp(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Ep(r,"trailing",n),y:r.top-4},alternateLocation:{x:Ep(r,"leading",n),y:r.top-4}})}movingTowardSubmenu(e){if(!this.element||this.type!=="submenu")return!1;const t=this.rootMenu.lastMoveEvent;if(!t)return!1;const r=e.timeStamp-t.timeStamp;if(r>500)return!1;const n=e.clientX-t.clientX;if(Dg(n,t.clientY-e.clientY,r)<=.2)return!1;let a="right";if(this.submenu.element){const s=this.submenu.element.getBoundingClientRect(),u=this.element.getBoundingClientRect();s.left<u.left+u.width/2&&(a="left")}return a==="right"?n>0:n<0}};function Dg(e,t,r){return Math.hypot(e,t)/r}function lc(e,t){return e===void 0||typeof e!="function"?e:(t!=null||(t={alt:!1,control:!1,shift:!1,meta:!1}),e(t))}var Lp=class gc{constructor(t,r){this._element=null,this._activeMenuItem=null,this._dirty=!0;var n,i;this.parentMenu=(n=r==null?void 0:r.parentMenu)!=null?n:null,this._submenuClass=r==null?void 0:r.submenuClass,this.columnCount=(i=r==null?void 0:r.columnCount)!=null?i:1,this.isSubmenuOpen=!1,this.menuItems=t}get children(){return this._menuItems}set menuItems(t){const r=this.parentMenu;this.dispose(),this.parentMenu=r,t=[...t],this._menuItems=t.map(n=>n.onCreate?n.onCreate(n,this):new Dp(n,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var t;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(t=this._menuItems)==null||t.forEach(r=>r.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(t){if(t.type==="wheel"&&this._element){const r=t;this._element.scrollBy(0,r.deltaY),t.stopPropagation()}}dispatchEvent(t){return this.rootMenu.dispatchEvent(t)}get rootMenu(){return this.parentMenu.rootMenu}updateState(t){var r,n,i;this._menuItems.forEach(p=>p.updateState(t));const a=this.hasCheck;this.hasCheck=this._menuItems.some(p=>p.visible&&p.hasCheck),this.hasCheck!==a&&this._menuItems.forEach(p=>p.updateState(t));let s,u=0;for(const p of this._menuItems)p.type==="heading"?(s&&u===0&&(s.visible=!1),s=p,u=0):p.type==="divider"&&s?(s.visible=u>0,s=void 0,u=0):s&&p.visible&&(u+=1);s&&(s.visible=u>0);let d=!0;for(const p of this._menuItems)p.type==="divider"?(p.visible=!d,d=!0):p.visible&&(d=!1);(r=this.activeMenuItem)!=null&&r.visible||(this.activeMenuItem=null),!((n=this.activeMenuItem)!=null&&n.enabled)&&((i=this.activeMenuItem)==null?void 0:i.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible&&t.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible)}set dirty(t){console.assert(t===!0),this._dirty!==t&&t&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var t;if(this._element){this._element.textContent="";for(const{element:r,visible:n}of this._menuItems)r&&n&&this._element.append(r);(t=this._element.querySelector("li:first-of-type"))==null||t.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const t=document.createElement("menu");t.setAttribute("role","menu"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-orientation","vertical"),t.setAttribute("part","ui-menu-container"),this._submenuClass&&t.classList.add(this._submenuClass),t.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const r=this._abortController.signal;return t.addEventListener("focus",this,{signal:r}),t.addEventListener("wheel",this,{passive:!0,signal:r}),this._element=t,this.updateElement(),t}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(t){var r,n,i,a;if(this.rootMenu.cancelDelayedOperation(),t!==this._activeMenuItem){if(this.activeMenuItem){const s=this.activeMenuItem;s.active=!1,(r=s.submenu)==null||r.hide()}if(!((n=t==null?void 0:t.visible)==null||n)){this._activeMenuItem=null;return}this._activeMenuItem=t,t&&(t.active=!0)}t?(i=t.element)==null||i.focus({preventScroll:!0}):(a=this._element)==null||a.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let t=0,r=!1;const n=this._menuItems;for(;!r&&t<=n.length-1;){const i=n[t];r=i.type!=="divider"&&i.visible&&i.enabled,t+=1}return r?n[t-1]:null}get lastMenuItem(){this.updateIfDirty();const t=this._menuItems;let r=t.length-1,n=!1;for(;!n&&r>=0;){const i=t[r];n=i.type!=="divider"&&i.visible&&i.enabled,r-=1}return n?t[r+1]:null}nextMenuItem(t){if(t===0)return this._activeMenuItem;if(!this._activeMenuItem)return t>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const r=this._menuItems.indexOf(this.firstMenuItem),n=this._menuItems.indexOf(this.lastMenuItem);let i=this._menuItems.indexOf(this._activeMenuItem),a=1;for(;i>=r&&i<=n;){i+=t>0?1:-1;const s=this._menuItems[i];if(!s)break;if(s.visible&&s.enabled){if(a===Math.abs(t))return this._menuItems[i];a+=1}}return t>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(t){this.updateIfDirty();const n=this._menuItems.filter(i=>i.visible&&i.enabled).indexOf(t);return n<0?-1:n%this.columnCount}static get collator(){return gc._collator||(gc._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),gc._collator}findMenuItem(t){var r;this.updateIfDirty();const n=this._menuItems.filter(u=>u.type!=="divider"&&u.visible&&u.enabled);if(n.length===0)return null;const i=Math.max(...n.map(u=>u.label.length))-t.length;if(i<0)return null;let a=null,s=0;for(;s<i&&!a;)a=(r=n.find(u=>gc.collator.compare(t,u.label.substring(s,t.length))===0))!=null?r:null,s++;return a}show(t){return!this.visible||!t.container?!1:(this.updateElement(),t.container.appendChild(this.element),Ht()&&(this.element.popover="manual",this.element.showPopover()),t.location&&kg(this.element,{location:t.location,alternateLocation:t.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var t,r,n,i,a;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),Ht()&&((t=this._element)!=null&&t.popover)&&this.element.hidePopover(),(n=(r=this.parentMenu)==null?void 0:r.element)==null||n.focus(),(a=(i=this._element)==null?void 0:i.parentNode)==null||a.removeChild(this._element)}set openSubmenu(t){var r,n,i,a;const s=t!==null;((r=this.activeMenuItem)==null?void 0:r.type)==="submenu"&&((n=this.activeMenuItem.element)==null||n.setAttribute("aria-expanded",s.toString())),(a=(i=this.activeMenuItem)==null?void 0:i.element)==null||a.classList.toggle("is-submenu-open",s),this.isSubmenuOpen=s}},Ip=class Bh extends Lp{constructor(t,r){var n;super(t),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(n=r==null?void 0:r.host)!=null?n:null,this.isDynamic=t.some(Bp),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(t){Gh(this._modifiers,t)||(this._modifiers=t,this.dirty=!0)}get activeSubmenu(){let t=this;for(;t.isSubmenuOpen;)t=t.activeMenuItem.submenu;return t}set dirty(t){this._updating||(console.assert(t===!0),this._dirty!==t&&(this._dirty=!0,t&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(t){this._updating=!0,this.modifiers=t!=null?t:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(t){this.isDynamic&&(this.modifiers=js(t)),t.stopImmediatePropagation()}handleKeydownEvent(t){var r,n,i;if(t.key==="Tab"||t.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=js(t));let a=!0;const s=this.activeSubmenu,u=s.activeMenuItem;switch(t.key){case" ":case"Space":case"Return":case"Enter":u==null||u.select(js(t));break;case"ArrowRight":if((u==null?void 0:u.type)==="submenu")u.select(js(t)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!u)s.activeMenuItem=s.firstMenuItem;else{const d=(r=s.getMenuItemColumn(u))!=null?r:-1;if(d>=0&&d<((n=s.columnCount)!=null?n:1)-1){const p=s.nextMenuItem(1);p&&(s.activeMenuItem=p)}}break;case"ArrowLeft":if(s===this.rootMenu)u||(s.activeMenuItem=s.firstMenuItem);else if((u&&(i=s.getMenuItemColumn(u))!=null?i:-1)<=0||!u){s.hide();const p=s.parentMenu.activeMenuItem;if(p){const{element:h}=p;h==null||h.focus(),h==null||h.classList.remove("is-submenu-open")}}else{const p=s.nextMenuItem(-1);p&&(s.activeMenuItem=p)}break;case"ArrowDown":s.activeMenuItem=s.nextMenuItem(s.columnCount);break;case"ArrowUp":s.activeMenuItem=s.nextMenuItem(-s.columnCount);break;case"Home":case"PageUp":s.activeMenuItem=s.firstMenuItem;break;case"End":case"PageDown":s.activeMenuItem=s.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const d=s.findMenuItem(this.typingBuffer);d&&(s.activeMenuItem=d),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Td(t)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=t.key;const d=s.findMenuItem(this.typingBuffer);d&&(s.activeMenuItem=d),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else a=!1}a&&(t.preventDefault(),t.stopPropagation())}handleEvent(t){if(t.type==="keydown")this.handleKeydownEvent(t);else if(t.type==="keyup")this.handleKeyupEvent(t);else if(t.type==="pointermove")this.lastMoveEvent=t;else if(t.type==="pointerup"&&t.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(t.type==="contextmenu"){t.preventDefault(),t.stopPropagation();return}super.handleEvent(t)}dispatchEvent(t){return this._host?this._host.dispatchEvent(t):!0}get scrim(){return Io.element}connectScrim(t){const r=this.scrim;r.addEventListener("pointerup",this),r.addEventListener("contextmenu",this),r.addEventListener("keydown",this),r.addEventListener("keyup",this),r.addEventListener("pointermove",this),Io.open({root:t,onDismiss:()=>this.hide()})}disconnectScrim(){const t=this.scrim;t.removeEventListener("pointerup",this),t.removeEventListener("contextmenu",this),t.removeEventListener("keydown",this),t.removeEventListener("keyup",this),t.removeEventListener("pointermove",this),Io.state==="open"&&Io.scrim.close()}get rootMenu(){return this}show(t){return this._onDismiss=t==null?void 0:t.onDismiss,t!=null&&t.modifiers&&(this.modifiers=t.modifiers),this.updateState(),this.connectScrim(t==null?void 0:t.target),super.show(v(_({},t),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,Io.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(t){this.cancelDelayedOperation();const r=Bh.SUBMENU_DELAY;if(r<=0){t();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,t()},r)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};Ip.SUBMENU_DELAY=120;var Lg=Ip;function Bp(e){return Cf(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(Po(e)||sc(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||Po(e)&&typeof e.checked=="function"?!0:sc(e)?e.submenu.some(Bp):!1}var a0=class{};a0.DELAY=300,a0.MAX_DISTANCE=10;function Ig(e){return new Promise((t,r)=>{const n=Bd(e);n||t(!1);let i=n;const a=setTimeout(()=>{s.abort(),t(Ag(i,n)<a0.MAX_DISTANCE)},a0.DELAY),s=new AbortController,u=s.signal;for(const d of["pointermove","pointerup","pointercancel"])window.addEventListener(d,p=>{if(p.type==="pointerup"||p.type==="pointercancel")clearTimeout(a),s.abort(),t(!1);else if(p.type==="pointermove"){const h=Bd(p);h&&(i=h)}},{passive:!0,signal:u})})}function Tp(e,t,r){return Es(this,null,function*(){if(e.type==="contextmenu"){const n=e;if(r.show({target:t,location:Bd(n),modifiers:js(n)}))return e.preventDefault(),e.stopPropagation(),!0}if(e.type==="keydown"){const n=e;if(n.code==="ContextMenu"||n.code==="F10"&&n.shiftKey){const i=t==null?void 0:t.getBoundingClientRect();if(i&&r.show({target:t,location:{x:Math.ceil(i.left+i.width/2),y:Math.ceil(i.top+i.height/2)},modifiers:js(n)}))return e.preventDefault(),e.stopPropagation(),!0}}if(e.type==="pointerdown"&&e.pointerType!=="mouse"&&e.button===0){let n=e.target;for(;n&&t!==n;)n=n.parentNode;if(!n||!r.visible)return!1;const i=Bd(e);if(yield Ig(e))return r.state!=="closed"?!1:(r.show({target:t,location:i}),!0)}return!1})}var $p={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};G(Object.keys($p),"{body:auto}",{createAtom:e=>new Hl(v(_({},e),{body:xe(e.args[0]),accentChar:$p[e.command.slice(1)]}))}),G(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const t=Ce(xe(e.args[0]));return new Hl(v(_({},e),{body:xe(e.args[0]),svgAccent:e.command.slice(1)+(t.length>5?"4":["1","1","2","2","3","3"][t.length])}))}}),G(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new Hl(v(_({},e),{body:xe(e.args[0]),svgAccent:"overarc"}))}),G(["underarc","underparen"],"{body:auto}",{createAtom:e=>new Ur(v(_({},e),{body:xe(e.args[0]),svgBelow:"underarc"}))}),G("utilde","{body:auto}",{createAtom:e=>{const t=xe(e.args[0]),r=Ce(t),n="widetilde"+(r.length>5?"4":["1","1","2","2","3","3"][r.length]);return new Ur(v(_({},e),{body:t,svgBelow:n,boxType:Ns(t)}))}}),G("^","{:string}",{createAtom:e=>{var t;return new we(v(_({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[e.args[0]])!=null?t:"^"}))}}),G("`","{:string}",{createAtom:e=>{var t;return new we(v(_({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[e.args[0]])!=null?t:"`"}))}}),G("'","{:string}",{createAtom:e=>{var t;return new we(v(_({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[e.args[0]])!=null?t:"'"}))}}),G('"',"{:string}",{createAtom:e=>{var t,r;return new we(v(_({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[e.args[0]])!=null?r:'"'+e.args[0]:'"'}))}}),G(".","{:string}",{createAtom:e=>{var t,r;return new we(v(_({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[e.args[0]])!=null?r:"."+e.args[0]:"."}))}}),G("=","{:string}",{createAtom:e=>{var t,r;return new we(v(_({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[e.args[0]])!=null?r:"="+e.args[0]:"="}))}}),G("~","{:string}",{createAtom:e=>{var t;return new we(v(_({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[e.args[0]])!=null?t:"\xB4"}))}}),G("c","{:string}",{createAtom:e=>{var t;return new we(v(_({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={c:"\xE7",C:"\xC7"}[e.args[0]])!=null?t:""}))}}),G("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var t,r;const n=e.args,i={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(t=e.style)!=null?t:{}};if(n[1]){const s=n[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const u of s){const d=u.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(d)i.strokeWidth=d[1],i.strokeStyle=d[2],i.strokeColor=d[3];else{const p=u.match(/\s*([a-z]*)\s*=\s*"(.*)"/);p&&(p[1]==="mathbackground"?i.backgroundcolor=p[2]:p[1]==="mathcolor"?i.strokeColor=p[2]:p[1]==="padding"?i.padding=p[2]:p[1]==="shadow"&&(i.shadow=p[2]))}}i.strokeStyle==="dashed"?i.svgStrokeStyle="5,5":i.strokeStyle==="dotted"&&(i.svgStrokeStyle="1,5")}i.borderStyle=`${i.strokeWidth} ${i.strokeStyle} ${i.strokeColor}`;const a={};return((r=n[0])!=null?r:"").split(/[, ]/).filter(s=>s.length>0).forEach(s=>{a[s.toLowerCase()]=!0}),new Ge(e.command,xe(n[2]),a,i)}}),G("cancel","{body:auto}",{createAtom:e=>{var t;return new Ge(e.command,xe(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),G("bcancel","{body:auto}",{createAtom:e=>{var t;return new Ge(e.command,xe(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),G("xcancel","{body:auto}",{createAtom:e=>{var t;return new Ge(e.command,xe(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),G(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var t;return new Ur(v(_({},e),{body:xe((t=e.args)==null?void 0:t[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}}),G("overbrace","{:auto}",{createAtom:e=>new Ur(v(_({},e),{body:xe(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))}),G(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new Ur(v(_({},e),{body:xe(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))}),G(["underbrace"],"{:auto}",{createAtom:e=>new Ur(v(_({},e),{body:xe(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))}),G(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:e=>{var t,r,n,i,a;return new Ur(v(_({},e),{svgBody:e.command.slice(1),above:((r=xe((t=e.args)==null?void 0:t[1]))==null?void 0:r.length)===0?void 0:xe((n=e.args)==null?void 0:n[1]),below:(a=xe((i=e.args)==null?void 0:i[0]))!=null?a:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,t)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(t)}]`)+`{${e.aboveToLatex(t)}}${e.supsubToLatex(t)}`}),G(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:e=>new Xi(e.command.slice(1),v(_({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),G(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new Xi({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],v(_({},e),{limits:"over-under",variant:"main"}))}),G(["lim","mod"],"",{ifMode:"math",createAtom:e=>new Xi(e.command.slice(1),v(_({},e),{limits:"over-under",variant:"main"}))}),G(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new Xi(e.command.slice(1),v(_({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),G(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new we(v(_({},e),{body:xe(e.args[0])})),serialize:(e,t)=>`\\ang{${e.bodyToLatex(t)}}`,render:(e,t)=>{const r=e.createBox(t),n=r.caret;r.caret=void 0;const i=new je("\xB0",{style:v(_({},e.style),{variant:"normal",variantStyle:"up"})});return new je([r,i],{type:"inner",isSelected:e.isSelected,caret:n})}}),G("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new Ra(v(_({},e),{body:xe(e.args[1]),index:e.args[0]?xe(e.args[0]):void 0}))}),G(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{const t=_({},e),r=e.command,n=e.args;switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":t.hasBarLine=!0;break;case"\\atopfrac":t.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":t.hasBarLine=!1,t.leftDelim="(",t.rightDelim=")";break;case"\\cfrac":t.hasBarLine=!0,t.continuousFraction=!0;break;default:}switch(r){case"\\dfrac":case"\\dbinom":t.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":t.mathstyleName="textstyle";break;default:}return new Yt(n[0]?xe(n[0]):[new ho],n[1]?xe(n[1]):[new ho],t)},serialize:(e,t)=>{const r=e.aboveToLatex(t),n=e.belowToLatex(t);return/^[0-9]$/.test(r)&&/^[0-9]$/.test(n)?`${e.command}${r}${n}`:yn(e.command,r,n)}}),G(["brace","brack"],"",{infix:!0,createAtom:e=>new Yt(xe(e.args[0]),xe(e.args[1]),v(_({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,t)=>Cr([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),G(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let t,r;const n=e.args;return e.command==="\\choose"&&(t="(",r=")"),new Yt(xe(n[0]),xe(n[1]),v(_({},e),{hasBarLine:e.command==="\\over",leftDelim:t,rightDelim:r}))},serialize:(e,t)=>Cr([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),G(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var t,r;const n=e.args;return new Yt(xe(n[0]),xe(n[1]),v(_({},e),{leftDelim:(t=n[2])!=null?t:".",rightDelim:(r=n[3])!=null?r:".",hasBarLine:!1}))},serialize:(e,t)=>`${e.aboveToLatex(t)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(t)}`}),G("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new Yt(xe(e.args[0]),xe(e.args[1]),v(_({},e),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),G(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new Tn({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[e.command.slice(1)],v(_({},e),{limits:"auto",variant:"main"}))}),G("smallint","",{ifMode:"math",createAtom:e=>new Xi("\u222B",v(_({},e),{limits:"adjacent",variant:"main"}))});var Pp={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};G(Object.keys(Pp),"",{ifMode:"math",createAtom:e=>{const t=e.command,r=Pp[t.slice(1)];return new Tn(r,v(_({},e),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[r]}))}}),G(["Re","Im"],"",{ifMode:"math",createAtom:e=>new Xi({"\\Re":"\u211C","\\Im":"\u2111"}[e.command],v(_({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),G("middle","{:delim}",{ifMode:"math",createAtom:e=>{var t;return new oe(v(_({},e),{delim:(t=e.args[0])!=null?t:"|",size:1}))}}),G("the","{:value}",{createAtom:e=>new we(v(_({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,t)=>{var r;const n=new Er({parent:t},e.style);let i="";e.isSelected&&(i+=" ML__selected");const a=n.evaluate(e.args[0]);return new je(((r=Mi(a))!=null?r:"").split("").map(s=>new je(s,{type:"ord",classes:i,mode:e.mode,isSelected:e.isSelected,style:_({variant:"main"},e.style)})),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:i}).wrap(n)},serialize:e=>{var t;return`\\the${(t=Mi(e.args[0]))!=null?t:"\\relax"}`}}),G("mathtip","{:auto}{:math}",{createAtom:e=>new io(v(_({},e),{body:xe(e.args[0]),tooltip:xe(e.args[1]),content:"math"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${we.serialize([e.tooltip],v(_({},t),{defaultMode:"math"}))}}`}),G("texttip","{:auto}{:text}",{createAtom:e=>new io(v(_({},e),{body:xe(e.args[0]),tooltip:xe(e.args[1]),content:"text"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${we.serialize([e.tooltip],v(_({},t),{defaultMode:"text"}))}}`}),G("error","{:math}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[0])})),serialize:(e,t)=>`\\error{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__error"})}),G("ensuremath","{:math}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(v(_({},t),{defaultMode:"math"}))}}`}),G("color","{:value}",{applyStyle:(e,t,r)=>{var n,i;return{verbatimColor:(n=Mi(t[0]))!=null?n:void 0,color:r.toColor((i=t[0])!=null?i:{string:"red"})}}}),G("textcolor","{:value}{content:auto*}",{applyStyle:(e,t,r)=>{var n,i;return{verbatimColor:(n=Mi(t[0]))!=null?n:void 0,color:r.toColor((i=t[0])!=null?i:{string:"red"})}}}),G("boxed","{content:math}",{createAtom:e=>new Do(v(_({},e),{body:xe(e.args[0]),framecolor:{string:"black"}}))}),G("colorbox","{:value}{:text*}",{applyStyle:(e,t,r)=>{var n,i;return{verbatimBackgroundColor:(n=Mi(t[0]))!=null?n:void 0,backgroundColor:r.toBackgroundColor((i=t[0])!=null?i:{string:"yellow"})}}}),G("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var t,r;return new Do(v(_({},e),{body:xe(e.args[2]),framecolor:(t=e.args[0])!=null?t:{string:"blue"},backgroundcolor:(r=e.args[1])!=null?r:{string:"yellow"}}))},serialize:(e,t)=>{var r,n;return t.skipStyles?e.bodyToLatex(v(_({},t),{defaultMode:"text"})):yn(e.command,(r=Mi(e.framecolor))!=null?r:"",(n=Mi(e.backgroundcolor))!=null?n:"",e.bodyToLatex(v(_({},t),{defaultMode:"text"})))}}),G("bbox","[:bbox]{body:auto}",{createAtom:e=>{var t;const r=e.args[0],n=xe(e.args[1]);return r?new Do(v(_({},e),{body:n,padding:r.padding,border:r.border,backgroundcolor:(t=r.backgroundcolor)!=null?t:void 0})):new Do(v(_({},e),{body:n}))},serialize:(e,t)=>{var r,n;if(t.skipStyles)return e.bodyToLatex(t);let i=e.command;if(Number.isFinite(e.padding)||e.border!==void 0||e.backgroundcolor!==void 0){const a=[];e.padding&&a.push((r=Mi(e.padding))!=null?r:""),e.border&&a.push(`border: ${e.border}`),e.backgroundcolor&&a.push((n=Mi(e.backgroundcolor))!=null?n:""),i+=`[${a.join(",")}]`}return yn(i,e.bodyToLatex(t))}}),G(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[0])})),render:(e,t)=>{const r=new Er({parent:t,mathstyle:e.command.slice(1)},e.style),n=we.createBox(r,e.body,{type:"lift"});return e.caret&&(n.caret=e.caret),e.bind(t,n)},serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{${Cr([e.command,e.bodyToLatex(t)])}}`}),G(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:e=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[e]})}),G("fontseries","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontSeries:(r=t[0])!=null?r:"auto"}}}),G("fontshape","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontShape:(r=t[0])!=null?r:"auto"}}}),G("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontFamily:(r=t[0])!=null?r:"roman"}}}),G("selectfont","",{ifMode:"text",applyStyle:()=>({})}),G("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),G(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new we(v(_({},e),{body:xe(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__boldsymbol"})}),G("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),G("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),G("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),G("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),G("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),G("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),G("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),G("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),G("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),G("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),G("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),G("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),G("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),G("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),G("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),G("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),G("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),G("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),G("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),G("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),G("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),G("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),G("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),G("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),G("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),G("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),G("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),G(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),G(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),G("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),G("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),G("mbox","{:text}",{ifMode:"math",createAtom:e=>new we(v(_({},e),{type:"mord",body:xe(e.args[0]),mode:"math"})),serialize:(e,t)=>yn("\\mbox",e.bodyToLatex(v(_({},t),{defaultMode:"text"})))}),G("text","{:text}",{ifMode:"math",applyMode:"text"}),G(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[1])})),serialize:(e,t)=>!e.args[0]||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`,render:(e,t)=>{var r;return e.createBox(t,{classes:(r=e.args[0])!=null?r:""})}}),G(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const n=e.createBox(t);return n.cssId=(r=e.args[0])!=null?r:"",n}}),G("htmlData","{data:string}{content:auto}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const n=e.createBox(t);return n.htmlData=(r=e.args[0])!=null?r:"",n}}),G(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const n=e.createBox(t);return n.htmlStyle=(r=e.args[0])!=null?r:"",n}}),G("em","{:rest}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[0])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{\\em ${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})}),G("emph","{:auto}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[1])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\emph{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})});var Rp={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};G(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var t;return new We(v(_({},e),{delim:(t=e.args[0])!=null?t:".",size:Rp[e.command].size,delimType:Rp[e.command].mclass}))}}),G(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var t;return new pa(v(_({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),G(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var t;return new pa(v(_({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),G("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new we(e),render:(e,t)=>{let r=0;const n=t.mathstyle.id;(n===Xo||n===yo)&&(r=1),(n===Jo||n===_a)&&(r=2),(n===xo||n===qi)&&(r=3);const i=xe(e.args[r]);return we.createBox(t,i)},serialize:(e,t)=>`\\mathchoice{${we.serialize(e.args[0],t)}}{${we.serialize(e.args[1],t)}}{${we.serialize(e.args[2],t)}}{${we.serialize(e.args[3],t)}}`}),G("mathop","{:auto}",{createAtom:e=>new we(v(_({},e),{type:"mop",body:xe(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,t)=>{var r;let n=we.createBox(t,e.body);if(e.superscript||e.subscript){const i=(r=e.subsupPlacement)!=null?r:"auto";n=i==="over-under"||i==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:n}):e.attachSupsub(t,{base:n})}return new je(e.bind(t,n),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const r=[yn(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&r.push("\\limits"),e.subsupPlacement==="adjacent"&&r.push("\\nolimits"),e.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(e.supsubToLatex(t)),Cr(r)}}),G(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new we(v(_({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:xe(e.args[0])}))}),G(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{const t=xe(e.args[0]).map(r=>{var n;return r.type!=="first"&&(r.type="mord",r.value=(n={"\u2217":"*","\u2212":"-"}[r.value])!=null?n:r.value,r.isFunction=!1,!r.style.variant&&!r.style.variantStyle&&(r.style.variant="main",r.style.variantStyle="up")),r});return new we(v(_({},e),{type:"mop",body:t,isFunction:!0,limits:e.command==="\\operatorname"?"adjacent":"over-under"}))},render:(e,t)=>{var r;let n=we.createBox(t,e.body);if(e.superscript||e.subscript){const i=(r=e.subsupPlacement)!=null?r:"auto";n=i==="over-under"||i==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:n}):e.attachSupsub(t,{base:n})}return e.caret&&(n.caret=e.caret),new je(e.bind(t,n),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const r=[yn(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&r.push("\\limits"),e.subsupPlacement==="adjacent"&&r.push("\\nolimits"),e.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(e.supsubToLatex(t)),Cr(r)}}),G(["char","unicode"],"{charcode:value}",{createAtom:e=>new we(v(_({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var t;return`${e.command}${Mi((t=e.args[0])!=null?t:{number:10067,base:"hexadecimal"})}`},render:(e,t)=>{let r=t.evaluate(e.args[0]);return(!r||!("number"in r))&&(r={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(r.number),e.createBox(t)}}),G("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new we(e),render:(e,t)=>{var r,n,i;const a=new Er({parent:t,mathstyle:"textstyle"},e.style),s=a.toEm((r=e.args[0])!=null?r:{dimension:0}),u=a.toEm((n=e.args[1])!=null?n:{dimension:10}),d=a.toEm((i=e.args[2])!=null?i:{dimension:10}),p=new je(null,{classes:"rule",type:"ord"});return p.width=u,p.height=d+s,p.depth=-s,p.setStyle("border-right-width",u,"em"),p.setStyle("border-top-width",d,"em"),p.setStyle("border-color",e.style.color),p.setStyle("vertical-align",s,"em"),e.isSelected&&p.setStyle("opacity","50%"),e.bind(a,p),e.caret&&(p.caret=e.caret),p.wrap(t)},serialize:e=>`\\rule${e.args[0]?`[${Mi(e.args[0])}]`:""}{${Mi(e.args[1])}}{${Mi(e.args[2])}}`}),G(["overline","underline"],"{:auto}",{createAtom:e=>new we(v(_({},e),{body:xe(e.args[0])})),render:(e,t)=>{const r=e.command.substring(1),n=new Er({parent:t,mathstyle:"cramp"},e.style),i=we.createBox(n,e.body);if(!i)return null;const a=n.metrics.defaultRuleThickness/n.scalingFactor,s=new je(null,{classes:r+"-line"});s.height=a,s.maxFontSize=a*1.125*n.scalingFactor;let u;return r==="overline"?u=new ti({shift:0,children:[{box:i},3*a,{box:s},a]}):u=new ti({top:i.height,children:[a,{box:s},3*a,{box:i}]}),e.caret&&(u.caret=e.caret),new je(u,{classes:r,type:"ignore"})}}),G("overset","{:auto}{base:auto}",{createAtom:e=>{const t=xe(e.args[1]);return new Ur(v(_({},e),{above:xe(e.args[0]),body:t,skipBoundary:!1,boxType:Ns(t)}))},serialize:(e,t)=>yn(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),G("underset","{:auto}{base:auto}",{createAtom:e=>{const t=xe(e.args[1]);return new Ur(v(_({},e),{below:xe(e.args[0]),body:t,skipBoundary:!1,boxType:Ns(t)}))},serialize:(e,t)=>yn(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),G("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{const t=xe(e.args[2]);return new Ur(v(_({},e),{above:xe(e.args[0]),below:xe(e.args[1]),body:t,skipBoundary:!1,boxType:Ns(t)}))},serialize:(e,t)=>yn(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),G(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new Ur(v(_({},e),{body:xe(e.args[2]),above:xe(e.args[1]),below:xe(e.args[0]),skipBoundary:!1,boxType:e.command==="\\stackrel"?"rel":"bin"})),serialize:(e,t)=>yn(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),G("smash","[:string]{:auto}",{createAtom:e=>{var t,r,n,i;return new ri(v(_({},e),{body:xe(e.args[1]),smashHeight:(r=(t=e.args[0])==null?void 0:t.includes("t"))!=null?r:!0,smashDepth:(i=(n=e.args[0])==null?void 0:n.includes("b"))!=null?i:!0}))}}),G(["vphantom"],"{:auto}",{createAtom:e=>new ri(v(_({},e),{body:xe(e.args[0]),isInvisible:!0,smashWidth:!0}))}),G(["hphantom"],"{:auto}",{createAtom:e=>new ri(v(_({},e),{body:xe(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),G(["phantom"],"{:auto}",{createAtom:e=>new ri(v(_({},e),{body:xe(e.args[0]),isInvisible:!0}))}),G("not","{:math}",{createAtom:e=>{const t=xe(e.args[0]);return t.length===0?new we(v(_({},e),{type:"mrel",value:"\uE020"})):new we(v(_({},e),{body:[new gr(v(_({},e),{body:"\uE020",align:"right"})),...t],captureSelection:!0}))},serialize:(e,t)=>{const r=e.args[0],n=r&&typeof r=="object"&&"group"in r;return e.value!=="\uE020"?n?`\\not{${we.serialize(r.group,t)}}`:`\\not${we.serialize(r,t)}`:n?"\\not{}":"\\not"},render:(e,t)=>{if(e.value)return e.createBox(t);const n=e.args[0]&&typeof e.args[0]=="object"&&"group"in e.args[0]?"ord":Ns(xe(e.args[0])),i=we.createBox(t,e.body,{type:n});return e.caret&&(i.caret=e.caret),e.bind(t,i)}}),G(["ne","neq"],"",{createAtom:e=>new we(v(_({},e),{type:"mrel",body:[new gr(v(_({},e),{body:"\uE020",align:"right",boxType:"rel"})),new we(v(_({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),G("rlap","{:auto}",{createAtom:e=>new gr(v(_({},e),{body:xe(e.args[0]),align:"right"}))}),G("llap","{:auto}",{createAtom:e=>new gr(v(_({},e),{body:xe(e.args[0]),align:"left"}))}),G("mathrlap","{:math}",{createAtom:e=>new gr(v(_({},e),{body:xe(e.args[0]),align:"left"}))}),G("mathllap","{:math}",{createAtom:e=>new gr(v(_({},e),{body:xe(e.args[0]),align:"left"}))}),G("raisebox","{:value}{:text}",{createAtom:e=>{var t;return new Do(v(_({},e),{body:xe(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r;return yn("\\raisebox",(r=Mi(e.offset))!=null?r:"0pt",e.bodyToLatex(t))}}),G("raise","{:value}{:auto}",{createAtom:e=>{var t;return new Do(v(_({},e),{body:xe(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r;return yn("\\raise",(r=Mi(e.offset))!=null?r:"0pt",e.bodyToLatex(t))}}),G("lower","{:value}{:auto}",{createAtom:e=>{var t;return new Do(v(_({},e),{body:xe(e.args[1]),padding:{dimension:0},offset:(t=eo(e.args[0],-1))!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r,n;return yn("\\lower",(n=Mi(eo((r=e.offset)!=null?r:{dimension:0},-1)))!=null?n:"0pt",e.bodyToLatex(t))}}),Y("0123456789/@.?!"),ye(65,90),ye(97,122),Y([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Y([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Y([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),Y([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),Y([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),Y([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),Y([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),Y([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),Y([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),Y([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),Y([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),Y([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Y([["\\wp",8472],["\\aleph",8501]]),Y([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),Y([["\\ ",160],["~",160]],"space"),G(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new pa(e)}),G("space","",{createAtom:e=>new pa(e)}),Y([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Y([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Y([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var Op="<mo>⁡</mo>",o0="<mo>⁢</mo>";function s0(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function cn(e,t){return!e||!t.generateID?"":` extid="${e}"`}function Bg(e,t,r){var n,i,a,s,u,d,p,h,S,D,P;let O=!1;t=t!=null?t:e.atoms.length;let de="",Ve="",se=e.atoms[e.index];const ke=(i=(n=se.style)==null?void 0:n.variant)!=null?i:"",Xe=(s=(a=se.style)==null?void 0:a.variantStyle)!=null?s:"";let $e="";if(ke||Xe){const Kt=ot(se.value,(u=se.style)==null?void 0:u.variant,(d=se.style)==null?void 0:d.variantStyle);if(Kt!==se.value)return e.index+=1,de=`<mi${cn(se.id,r)}>${Kt}</mi>`,ns(de,e,r)||(e.mathML+=de,e.lastType="mi"),!0;$e=(p={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[Xe+ke])!=null?p:"",$e=` mathvariant="${$e}"`}const St={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(se.command==="!")return e.index+=1,de="<mo>!</mo>",ns(de,e,r)||(e.mathML+=de,e.lastType="mo"),!0;if(St[se.command]){e.index+=1;let Kt=`<mi${cn(se.id,r)}${$e}>${St[se.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(Kt=o0+Kt),ns(Kt,e,r)||(e.mathML+=Kt,e.lastType="mi"),!0}if(se.command==="\\operatorname")Ve=cc(se.body),e.index+=1;else if(ke||Xe)for(;e.index<t&&(se.type==="mord"||se.type==="macro")&&!se.isDigit()&&ke===((S=(h=se.style)==null?void 0:h.variant)!=null?S:"")&&Xe===((P=(D=se.style)==null?void 0:D.variantStyle)!=null?P:"");)Ve+=cc([se]),e.index+=1,se=e.atoms[e.index];else(se.type==="mord"||se.type==="macro")&&!se.isDigit()&&(Ve+=cc([se]),e.index+=1);if(Ve.length>0){O=!0,de=`<mi${$e}>${Ve}</mi>`;const Kt=e.lastType;de.endsWith(">f</mi>")||de.endsWith(">g</mi>")?(de+=Op,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(de)?"mo":"mi",ns(de,e,r)||((Kt==="mi"||Kt==="mn"||Kt==="mtext"||Kt==="fence")&&(de=o0+de),e.mathML+=de)}return O}function Tg(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&e.atoms[e.index].type==="subsup"}function $g(e){let t=-1,r=e.index,n=!1,i=!1;for(;r<e.atoms.length&&!n&&!i;){const a=e.atoms[r];n=!a.isDigit(),i=!n&&a.superscript!==void 0,r++}return i&&(t=r-1),t}function ns(e,t,r){var n;let i=t.atoms[t.index-1];if(!i)return!1;if(!i.superscript&&!i.subscript)if(((n=t.atoms[t.index])==null?void 0:n.type)==="subsup")i=t.atoms[t.index],t.index+=1;else return!1;const a=t.lastType;t.lastType="";const s=Zr(i.superscript,r);t.lastType="";const u=Zr(i.subscript,r);if(t.lastType=a,!s&&!u)return!1;let d="";return s&&u?d=`<msubsup>${e}${u}${s}</msubsup>`:s?d=`<msup>${e}${s}</msup>`:u&&(d=`<msub>${e}${u}</msub>`),t.mathML+=d,t.lastType="",!0}function Pg(e,t,r){t=t!=null?t:e.atoms.length;const n=e.index;let i="";for(;e.index<t&&e.atoms[e.index].mode==="text";)i+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return i.length>0?(e.mathML+=`<mtext ${cn(e.atoms[n].id,r)}>${i}</mtext>`,e.lastType="mtext",!0):!1}function Rg(e,t,r){t=t!=null?t:e.atoms.length;const n=e.index;let i="",a=$g(e);for(a>=0&&a<t&&(t=a);e.index<t&&e.atoms[e.index].isDigit();)i+=e.atoms[e.index].asDigit(),e.index+=1;return i.length<=0?!1:(i="<mn"+cn(e.atoms[n].id,r)+">"+i+"</mn>",a<0&&Tg(e)&&(a=e.index,e.index+=1),ns(i,e,r)||(e.mathML+=i,e.lastType="mn"),!0)}function Og(e,t,r){let n=!1;t=t!=null?t:e.atoms.length;let i="",a="";if(e.index<t&&e.atoms[e.index].type==="mopen"){let s=!1,u=0;const d=e.index;let p=-1,h=d+1;for(;h<t&&!s;)e.atoms[h].type==="mopen"?u+=1:e.atoms[h].type==="mclose"&&(u-=1),u===-1&&(s=!0,p=h),h+=1;s&&(i="<mrow>",i+=rl(e.atoms[d],r),i+=Zr(e.atoms,r,d+1,p),i+=rl(e.atoms[p],r),i+="</mrow>",e.index=p+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=o0),ns(i,e,r)&&(n=!0,e.lastType="",i=""),a="fence")}return i.length>0&&(n=!0,e.mathML+=i,e.lastType=a),n}function Ng(e,t,r){let n=!1;t=t!=null?t:e.atoms.length;let i="",a="";const s=e.atoms[e.index];if(!s)return!1;const u={"\\ne":"≠","\\neq":"&neq;","\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(u[s.command]){e.index+=1;const d=`<mo${cn(s.id,r)}>${u[s.command]}</mo>`;return ns(d,e,r)||(e.mathML+=d,e.lastType="mo"),!0}if(e.index<t&&(s.type==="mbin"||s.type==="mrel"))i+=Af(e.atoms[e.index],r),e.index+=1,a="mo";else if(e.index<t&&(s.type==="mop"||s.type==="operator"||s.type==="extensible-symbol")){if(s.subsupPlacement==="over-under"&&(s.superscript||s.subscript)){const d=rl(s,r);return s.superscript&&s.subscript?(i+="<munderover>"+d,i+=Zr(s.subscript,r),i+=Zr(s.superscript,r),i+="</munderover>"):s.superscript?(i+="<mover>"+d,i+=Zr(s.superscript,r),i+="</mover>"):s.subscript&&(i+="<munder>"+d,i+=Zr(s.subscript,r),i+="</munder>"),e.mathML+=i,e.lastType="mo",e.index+=1,!0}{const d=e.atoms[e.index],p=d.value==="\\operatorname",h=p?'<mi class="MathML-Unit"'+cn(d.id,r)+">"+cc(d.value)+"</mi>":rl(d,r);i+=h,!p&&!/^<mo>(.*)<\/mo>$/.test(h)?(i+=Op,a="applyfunction"):a=p?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(i)&&(i=o0+i),e.index+=1}return i.length>0&&(n=!0,ns(i,e,r)||(e.mathML+=i,e.lastType=a)),n}function Zr(e,t,r,n){t!=null||(t={});const i={atoms:[],index:r!=null?r:0,mathML:"",lastType:""};if(typeof e=="number"||typeof e=="boolean")i.mathML=e.toString();else if(typeof e=="string")i.mathML=e;else if(e instanceof we)i.mathML=Af(e,t);else if(Array.isArray(e)){i.atoms=e;let a=0;for(n=n||(e?e.length:0);i.index<n;)if(Pg(i,n,t)||Rg(i,n,t)||Bg(i,n,t)||Ng(i,n,t)||Og(i,n,t))a+=1;else if(i.index<n){let s=Af(i.atoms[i.index],t);i.lastType==="mn"&&s.length>0&&i.atoms[i.index].type==="genfrac"&&(s="<mo>⁤</mo>"+s),i.atoms[i.index].type==="genfrac"?i.lastType="mfrac":i.lastType="",i.index+=1,ns(s,i,t)?a+=1:s.length>0&&(i.mathML+=s,a+=1)}a>1&&(i.mathML="<mrow>"+i.mathML+"</mrow>")}return i.mathML}function rl(e,t){let r="";const n=cc(e.value);return n&&(r="<mo"+cn(e.id,t)+">"+n+"</mo>"),r}function cc(e){if(!e)return"";if(typeof e=="string")return s0(e);if(!Array.isArray(e)&&typeof e.body=="string")return s0(e.body);let t="";for(const r of e)typeof r.value=="string"&&(t+=r.value);return s0(t)}function Af(e,t){var r,n,i,a,s,u,d,p,h,S,D,P,O,de,Ve,se,ke,Xe,$e,St,Kt,Tt;if(e.mode==="text")return`<mi${cn(e.id,t)}>${e.value}</mi>`;const kr={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},en={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let it="",ja="",Oo,oo,ki,Ga,ka,un;const{command:Jn}=e;if(e.command==="\\error")return`<merror${cn(e.id,t)}>${Zr(e.body,t)}</merror>`;const Ai={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},No={"\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};switch(e.type){case"first":break;case"group":case"root":it=Zr(e.body,t);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(it+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(it+="<mo>"+(Ai[e.leftDelim]||e.leftDelim)+"</mo>")),it+="<mtable",e.colFormat){for(it+=' columnalign="',ki=0;ki<e.colFormat.length;ki++)e.colFormat[ki].align&&(it+={l:"left",c:"center",r:"right"}[e.colFormat[ki].align]+" ");it+='"'}for(it+=">",oo=0;oo<e.array.length;oo++){for(it+="<mtr>",Oo=0;Oo<e.array[oo].length;Oo++)it+="<mtd>"+Zr(e.array[oo][Oo],t)+"</mtd>";it+="</mtr>"}it+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(it+="<mo>"+(Ai[e.leftDelim]||e.rightDelim)+"</mo>"),it+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(it+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(it+="<mo"+cn(e.id,t)+">"+(Ai[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(it+="<mfrac>",it+=Zr(e.above,t)||"<mi> </mi>",it+=Zr(e.below,t)||"<mi> </mi>",it+="</mfrac>"):(it+="<mtable"+cn(e.id,t)+">",it+="<mtr>"+Zr(e.above,t)+"</mtr>",it+="<mtr>"+Zr(e.below,t)+"</mtr>",it+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(it+="<mo"+cn(e.id,t)+">"+(Ai[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(it+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(it+="<msqrt"+cn(e.id,t)+">",it+=Zr(e.body,t),it+="</msqrt>"):(it+="<mroot"+cn(e.id,t)+">",it+=Zr(e.body,t),it+=Zr(e.above,t),it+="</mroot>");break;case"leftright":const Fo=e,zo=Fo.leftDelim;it="<mrow>",zo&&zo!=="."&&(it+=`<mo${cn(e.id,t)}>${(r=Ai[zo])!=null?r:zo}</mo>`),e.body&&(it+=Zr(e.body,t));const Ko=Fo.matchingRightDelim();Ko&&Ko!=="."&&(it+=`<mo${cn(e.id,t)}>${(n=Ai[Ko])!=null?n:Ko}</mo>`),it+="</mrow>";break;case"sizeddelim":case"delim":it+=`<mo${cn(e.id,t)}>${Ai[e.value]||e.value}</mo>`;break;case"accent":it+='<mover accent="true"'+cn(e.id,t)+">",it+=Zr(e.body,t),it+="<mo>"+(No[Jn]||e.accent)+"</mo>",it+="</mover>";break;case"line":case"overlap":break;case"overunder":ka=e.above,Ga=e.below,(e.svgAbove||ka)&&(e.svgBelow||Ga)?un=e.body:ka&&ka.length>0?(un=e.body,(a=(i=e.body)==null?void 0:i[0])!=null&&a.below?(Ga=e.body[0].below,un=e.body[0].body):((u=(s=e.body)==null?void 0:s[0])==null?void 0:u.type)==="first"&&((p=(d=e.body)==null?void 0:d[1])!=null&&p.below)&&(Ga=e.body[1].below,un=e.body[1].body)):Ga&&Ga.length>0&&(un=e.body,(S=(h=e.body)==null?void 0:h[0])!=null&&S.above?(ka=e.body[0].above,un=e.body[0].body):((P=(D=e.body)==null?void 0:D[0])==null?void 0:P.type)==="first"&&((de=(O=e.body)==null?void 0:O[1])!=null&&de.above)&&(ka=e.body[1].overscript,un=e.body[1].body)),(e.svgAbove||ka)&&(e.svgBelow||Ga)?(it+=`<munderover ${cn(e.id,t)}>`,it+=(Ve=kr[e.svgBody])!=null?Ve:Zr(un,t),it+=(se=kr[e.svgBelow])!=null?se:Zr(Ga,t),it+=(ke=kr[e.svgAbove])!=null?ke:Zr(ka,t),it+="</munderover>"):e.svgAbove||ka?(it+=`<mover ${cn(e.id,t)}>`+((Xe=kr[e.svgBody])!=null?Xe:Zr(un,t)),it+=($e=kr[e.svgAbove])!=null?$e:Zr(ka,t),it+="</mover>"):(e.svgBelow||Ga)&&(it+=`<munder ${cn(e.id,t)}>`+((St=kr[e.svgBody])!=null?St:Zr(un,t)),it+=(Kt=kr[e.svgBelow])!=null?Kt:Zr(Ga,t),it+="</munder>");break;case"placeholder":it+="?";break;case"mord":{it=typeof e.value=="string"?e.value:Jn,Jn==="\\char"?it="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":it.length>0&&it.startsWith("\\")&&(typeof e.value=="string"&&e.value.charCodeAt(0)>255?it="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof e.value=="string"?it=e.value.charAt(0):(console.error("Did not expect this"),it=""));const vo=/\d/.test(it)?"mn":"mi";it=`<${vo}${cn(e.id,t)}>${s0(it)}</${vo}>`;break}case"mbin":case"mrel":case"minner":it=rl(e,t);break;case"mpunct":it='<mo separator="true"'+cn(e.id,t)+">"+Jn+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(it="<mo"+cn(e.id,t)+">",it+=Jn==="\\operatorname"?e.body:Jn||e.body,it+="</mo>");break;case"box":it='<menclose notation="box"',e.backgroundcolor&&(it+=' mathbackground="'+e.backgroundcolor+'"'),it+=cn(e.id,t)+">"+Zr(e.body,t)+"</menclose>";break;case"spacing":it+='<mspace width="'+((Tt=en[Jn])!=null?Tt:0)+'em"/>';break;case"enclose":it='<menclose notation="';for(const vo in e.notation)Object.prototype.hasOwnProperty.call(e.notation,vo)&&e.notation[vo]&&(it+=ja+vo,ja=" ");it+=cn(e.id,t)+'">'+Zr(e.body,t)+"</menclose>";break;case"prompt":it='<menclose notation="roundexbox""">'+Zr(e.body,t)+"</menclose>";break;case"space":it+=" ";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":it+=rl(e,t);break;case"mclose":it+=rl(e,t);break;case"macro":{const vo=e.command+cc(e.macroArgs);vo&&(it+=`<mo ${cn(e.id,t)}>${vo}</mo>`)}break;case"latexgroup":it+=Zr(e.body,t);break;case"latex":it+="<mtext"+cn(e.id,t)+">"+e.value+"</mtext>";break;case"tooltip":it+=Zr(e.body,t);break;case"text":it+=`<mtext ${cn(e.id,t)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${cn(e.id,t)} displaystyle="true">${Zr(e.body,t)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${cn(e.id,t)} displaystyle="false">${Zr(e.body,t)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return it}var uc={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},Df={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function Fg(e){let t="";return e.startsWith("\\")&&(t=" "+e.replace("\\","")+" "),t}function du(e){let t=0;if(L(e))for(const r of e)r.type!=="first"&&(t+=1);return t===1}function zg(e){if(L(e)){for(const t of e)if(t.type!=="first"&&t.id)return t.id.toString()}return""}function Np(e){let t="";if(L(e))for(const r of e)r.type!=="first"&&typeof r.value=="string"&&(t+=r.value);return t}function Kg(e){return e?e.map(t=>t.value).join(""):""}function Sr(e,t){var r,n,i,a,s;function u(h){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(h)?` <say-as interpret-as="character">${h}</say-as>`:/[A-Z]/.test(h)?`capital <say-as interpret-as="character">${h.toLowerCase()}</say-as>`:h:/[a-z]/.test(h)?" '"+h.toUpperCase()+"'":/[A-Z]/.test(h)?" 'capital "+h.toUpperCase()+"'":h}function d(h){return"<emphasis>"+h+"</emphasis>"}if(!t)return"";let p="";if(L(t)){let h=!1,S=!1;for(let D=0;D<t.length;D++)t[D].type!=="first"&&(t[D].mode!=="text"&&(S=!1),D<t.length-2&&t[D].type==="mopen"&&t[D+2].type==="mclose"&&t[D+1].type==="mord"?(p+=" of ",p+=d(Sr(e,t[D+1])),D+=2):t[D].mode==="text"?S?p+=(r=t[D].value)!=null?r:" ":(S=!0,p+=Sr("text",t[D])):t[D].isDigit()?h?p+=t[D].asDigit():(h=!0,p+=Sr(e,t[D])):(h=!1,p+=Sr(e,t[D])))}else if(t.mode==="text")t.id&&e==="math"&&(p+='<mark name="'+t.id.toString()+'"/>'),p+=t.value;else{t.id&&e==="math"&&(p+='<mark name="'+t.id.toString()+'"/>');let h="",S="",D="",P=!1;const{command:O}=t;switch(O){case"\\vec":return"vector "+Sr(e,t.body);case"\\acute":return Sr(e,t.body)+" acute";case"\\grave":return Sr(e,t.body)+" grave";case"\\dot":return"dot over"+Sr(e,t.body);case"\\ddot":return"double dot over"+Sr(e,t.body);case"\\mathring":return"ring over"+Sr(e,t.body);case"\\tilde":case"\\widetilde":return"tilde over"+Sr(e,t.body);case"\\bar":return Sr(e,t.body)+" bar";case"\\breve":return Sr(e,t.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Sr(e,t.body);case"\\hat":case"\\widehat":return"hat over"+Sr(e,t.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Sr(e,t.body);case"\\underarc":case"\\underparen":return"arc under "+Sr(e,t.body)}switch(t.type){case"prompt":const de=t.body.length>1?'start input . <break time="500ms"/> '+Sr(e,t.body)+'. <break time="500ms"/> end input':"blank";p+=' <break time="300ms"/> '+de+'. <break time="700ms"/>'+((n=t.correctness)!=null?n:"")+' . <break time="700ms"/> ';break;case"array":const Ve=t.array,se=t.environmentName;if(Object.keys(Df).includes(se)){p+=` begin ${Df[se]} `;for(let $e=0;$e<Ve.length;$e++){$e>0&&(p+=","),p+=` row ${$e+1} `;for(let St=0;St<Ve[$e].length;St++)St>0&&(p+=","),p+=` column ${St+1}: `,p+=Sr("math",Ve[$e][St])}p+=` end ${Df[se]} `}break;case"group":O==="\\ne"?p+=" not equal ":(O==="\\not"&&(p+=" not "),p+=Sr("math",t.body));break;case"root":p+=Sr("math",t.body);break;case"genfrac":if(h=Sr("math",t.above),S=Sr("math",t.below),du(t.above)&&du(t.below)){const St={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[Np(t.above)+"/"+Np(t.below)];St?p=St:p+=h+" over "+S}else p+=' the fraction <break time="150ms"/>'+h+' over <break time="150ms"/>'+S+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(D=Sr("math",t.body),t.hasEmptyBranch("above"))p+=du(t.body)?" the square root of "+D+" , ":' the square root of <break time="200ms"/>'+D+'. <break time="200ms"/> End square root';else{let $e=Sr("math",t.above);$e=$e.trim();const St=$e.replace(/<mark([^/]*)\/>/g,"");St==="3"?p+=' the cube root of <break time="200ms"/>'+D+'. <break time="200ms"/> End cube root':St==="n"?p+=' the nth root of <break time="200ms"/>'+D+'. <break time="200ms"/> End root':p+=' the root with index: <break time="200ms"/>'+$e+', of <break time="200ms"/>'+D+'. <break time="200ms"/> End root'}break;case"leftright":{const $e=t;p+=(i=$e.leftDelim?uc[$e.leftDelim]:void 0)!=null?i:$e.leftDelim,p+=Sr("math",t.body),p+=(a=$e.rightDelim?uc[$e.rightDelim]:void 0)!=null?a:$e.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const ke=O.replace(/^\\/g,""),Xe=dt()[ke];Xe&&(Xe!=null&&Xe.expand?p+=Sr("math",t.body):p+=`${ke} `);break;case"placeholder":p+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(O==="\\mathbin"||O==="\\mathrel"||O==="\\mathopen"||O==="\\mathclose"||O==="\\mathpunct"||O==="\\mathord"||O==="\\mathinner"){p=Sr(e,t.body);break}let $e=t.isDigit()?t.asDigit():t.value,St=t.command;if((t.type==="delim"||t.type==="sizeddelim")&&(St=t.value,$e=St),e==="text")p+=$e;else{if(t.type==="mbin"&&(p+='<break time="150ms"/>'),$e){const Kt=uc[$e]||(St?uc[St.trim()]:"");if(Kt)p+=" "+Kt;else{const Tt=St?Fg(St.trim()):"";p+=Tt||u($e)}}else p+=Sr("math",t.body);t.type==="mbin"&&(p+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(t.value!=="\u200B"){const $e=t.command;if($e==="\\sum")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let St=Sr("math",t.superscript);St=St.trim();let Kt=Sr("math",t.subscript);Kt=Kt.trim(),p+=' the summation from <break time="200ms"/>'+Kt+'<break time="200ms"/> to <break time="200ms"/>'+St+'<break time="200ms"/> of <break time="150ms"/>',P=!0}else if(t.hasEmptyBranch("subscript"))p+=" the summation of";else{let St=Sr("math",t.subscript);St=St.trim(),p+=' the summation from <break time="200ms"/>'+St+'<break time="200ms"/> of <break time="150ms"/>',P=!0}else if($e==="\\prod")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let St=Sr("math",t.superscript);St=St.trim();let Kt=Sr("math",t.subscript);Kt=Kt.trim(),p+=' the product from <break time="200ms"/>'+Kt+'<break time="200ms"/> to <break time="200ms"/>'+St+'<break time="200ms"/> of <break time="150ms"/>',P=!0}else if(t.hasEmptyBranch("subscript"))p+=" the product of ";else{let St=Sr("math",t.subscript);St=St.trim(),p+=' the product from <break time="200ms"/>'+St+'<break time="200ms"/> of <break time="150ms"/>',P=!0}else if($e==="\\int")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let St=Sr("math",t.superscript);St=St.trim();let Kt=Sr("math",t.subscript);Kt=Kt.trim(),p+=' the integral from <break time="200ms"/>'+d(Kt)+'<break time="200ms"/> to <break time="200ms"/>'+d(St)+' <break time="200ms"/> of ',P=!0}else p+=' the integral of <break time="200ms"/> ';else if(typeof t.value=="string"){const St=(s=uc[t.value])!=null?s:t.command?uc[t.command]:void 0;p+=St||" "+t.value}else t.command&&(t.command==="\\mathop"?p+=Sr("math",t.body):t.command==="\\operatorname"?p+=Kg(t.body):p+=t.command.startsWith("\\")?" "+t.command.slice(1):" "+t.command)}break;case"enclose":D=Sr("math",t.body),p+=" crossed out "+D+". End crossed out.";break;case"space":case"spacing":break}if(!P&&!t.hasEmptyBranch("superscript")){let de=Sr(e,t.superscript);de=de.trim();const Ve=de.replace(/<[^>]*>/g,"");if(du(t.superscript)){if(e==="math"){const se=zg(t.superscript);se&&(p+='<mark name="'+se+'"/>')}Ve==="\u2032"?p+=" prime ":Ve==="2"?p+=" squared ":Ve==="3"?p+=" cubed ":Number.isNaN(Number.parseInt(Ve))?p+=" to the "+de+"; ":p+=' to the <say-as interpret-as="ordinal">'+Ve+"</say-as> power; "}else Number.isNaN(Number.parseInt(Ve))?p+=" raised to the "+de+"; ":p+=' raised to the <say-as interpret-as="ordinal">'+Ve+"</say-as> power; "}if(!P&&!t.hasEmptyBranch("subscript")){let de=Sr("math",t.subscript);de=de.trim(),p+=du(t.subscript)?" sub "+de:" subscript "+de+". End subscript. "}}return p}function dc(e){var t,r;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const i=Zr(e);if(i){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(t=window.MathfieldElement.textToSpeechRulesOptions)!=null?t:{},window.MathfieldElement.textToSpeechRulesOptions=v(_({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=v(_({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=v(_({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const a=(r=window.SRE)!=null?r:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&a.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let s="";try{s=a.toSpeech(i)}catch(u){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",u)}return s}return""}let n=Sr("math",e);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let i="";window.MathfieldElement.speechEngineRate&&(i='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),n='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+i+"<p><s>"+n+"</s></p>"+(i?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&Z()==="macos"?n=n.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):n=n.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return n}var fu={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},pu={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function Hg(e){let t="";for(const r of e){const n=t[t.length-1];n!==void 0&&/\d/.test(n)&&/^\d/.test(r)&&(t+=" "),t+=r}return t}function Xn(e){var t,r,n,i,a,s,u,d,p,h,S,D,P;if(!e)return"";if(L(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(Xn).join("");if(e[0].mode==="text"){let Xe=0,$e="";for(;((t=e[Xe])==null?void 0:t.mode)==="text";)$e+=e[Xe].body?Xn(e[Xe].body):e[Xe].value,Xe++;return`"${$e}" ${Xn(e.slice(Xe))}`}let se=0;const ke=[];for(;e[se]&&e[se].mode==="math";){let Xe="";for(;e[se]&&e[se].type==="mord"&&/\d/.test(e[se].value);)Xe+=e[se++].value;Xe?ke.push(Xe):ke.push(Xn(e[se++]))}return ke.push(Xn(e.slice(se))),Hg(ke)}if(e.mode==="text")return`"${e.value}"`;let O="";const{command:de}=e;let Ve;if(de==="\\placeholder")return`(${Xn(e.body)})`;switch(e.type){case"accent":const se={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[de];O=`${se!=null?se:""} ${Xn(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(Tt=>Tt.value).join("");case"group":case"root":O=(r=fu[de])!=null?r:Xn(e.body);break;case"genfrac":{const Tt=e;(Tt.leftDelim||Tt.rightDelim)&&(O=Tt.leftDelim==="."||!Tt.leftDelim?"{:":Tt.leftDelim),Tt.hasBarLine?(O+="(",O+=Xn(Tt.above),O+=")/(",O+=Xn(Tt.below),O+=")"):(O+="("+Xn(Tt.above)+"),",O+="("+Xn(Tt.below)+")"),(Tt.leftDelim||Tt.rightDelim)&&(O+=Tt.rightDelim==="."||!Tt.rightDelim?"{:":Tt.rightDelim)}break;case"surd":O+=e.hasEmptyBranch("above")?"sqrt("+Xn(e.body)+")":"root("+Xn(e.above)+")("+Xn(e.body)+")";break;case"latex":O=e.value;break;case"leftright":{const Tt=e,kr=Tt.leftDelim;O+=kr==="."||!kr?"{:":kr,O+=Xn(Tt.body);const en=Tt.matchingRightDelim();O+=en==="."||!en?":}":en}break;case"sizeddelim":case"delim":O=e.value;break;case"overlap":break;case"overunder":break;case"mord":O=(i=(n=fu[de])!=null?n:de)!=null?i:typeof e.value=="string"?e.value:"",O.startsWith("\\")&&(O+=" "),Ve=de?de.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,Ve?O=String.fromCodePoint(Number.parseInt("0x"+Ve[1])):O.length>0&&O.startsWith("\\")&&(O=typeof e.value=="string"?e.value.charAt(0):e.command),O=Wg(O,e.style);break;case"mbin":case"mrel":case"minner":O=(s=(a=fu[de])!=null?a:pu[de])!=null?s:e.value;break;case"mopen":case"mclose":O=e.value;break;case"mpunct":O=(u=pu[de])!=null?u:de;break;case"mop":case"operator":case"extensible-symbol":e.value!=="\u200B"&&(pu[de]?O=pu[de]:O=de==="\\operatorname"?Xn(e.body):(d=e.value)!=null?d:de,O+=" ");break;case"array":const ke=e.array,Xe=e.environmentName,$e=(p={bmatrix:["[","]"],"bmatrix*":["[","]"]}[Xe])!=null?p:["(",")"],St=[];for(const Tt of ke){const kr=[];for(const en of Tt)kr.push($e[0]+Xn(en)+$e[1]);St.push(kr.join(","))}const Kt=(h={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[Xe])!=null?h:["(",")"];O=Kt[0]+St.join(",")+Kt[1];break;case"box":break;case"spacing":O=(S=fu[de])!=null?S:" ";break;case"enclose":O="("+Xn(e.body)+")";break;case"space":O=" ";break;case"subsup":O="";break;case"macro":O=(P=(D=fu[de])!=null?D:pu[de])!=null?P:Xn(e.body);break}if(!e.hasEmptyBranch("subscript")){O+="_";const se=Xn(e.subscript);O+=se.length!==1?`(${se})`:se}if(!e.hasEmptyBranch("superscript")){O+="^";const se=Xn(e.superscript);O+=se.length!==1?`(${se})`:se}return O}function Wg(e,t){if(!t)return e;let r=e;return t.variant==="double-struck"&&(r=`bbb "${r}"`),t.variant==="script"&&(r=`cc "${r}"`),t.variant==="fraktur"&&(r=`fr "${r}"`),t.variant==="sans-serif"&&(r=`sf "${r}"`),t.variant==="monospace"&&(r=`tt "${r}"`),t.variantStyle==="bold"&&(r=`bb "${r}"`),t.color?`color({${t.color}})(${r})`:r}function Ei(e,t){var r,n;t!=null||(t={}),t.mathstyle=(r=t.mathstyle)!=null?r:"displaystyle";const i=new Er({from:v(_({},Wc()),{renderPlaceholder:()=>new je(160,{maxFontSize:1}),letterShapeStyle:(n=t==null?void 0:t.letterShapeStyle)!=null?n:"tex"}),mathstyle:t.mathstyle}),s=new we({mode:"math",type:"root",body:w(e,{context:i,parseMode:"math",mathstyle:t.mathstyle})}).render(i);return s?(Tl(mo(s,i)),$l(s,{classes:"ML__latex"}).toMarkup()):""}function Tv(e){return B(e,{context:Wc()})}function Vg(e,t={}){return Zr(w(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),t)}function Ug(e){const t=w(e,{parseMode:"math",mathstyle:"displaystyle"});return dc(t)}var l0;function Zg(e){var t,r;if(!l0){const n=(t=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;n?l0=new n:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(r=l0==null?void 0:l0.box(e).latex)!=null?r:""}function $v(e,t="math"){return Xn(new we({type:"root",body:w(e,{parseMode:t})}))}function Pv(e){return Mo(e,{format:"ascii-math"})[1]}function Lf(e){if(typeof e=="string"){const t=jg(e);if(!t)throw new Error(`Invalid color: ${e}`);return t}return"C"in e?qg(e):"a"in e?Fp(e):e}function fc(e){return e<0?0:e>255?255:Math.round(e)}function jg(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&typeof t.a=="undefined"&&(t.a=1),t}function If(e){const[t,r,n]=[e.L,e.C,e.H],i=n*Math.PI/180,a={L:t,a:r*Math.cos(i),b:r*Math.sin(i)};return e.alpha!==void 0&&(a.alpha=e.alpha),a}function Gg(e){const[t,r,n]=[e.L,e.a,e.b],i=Math.sqrt(r*r+n*n),s=Math.atan2(n,r)*180/Math.PI,u={L:t,C:i,H:s};return e.alpha!==void 0&&(u.alpha=e.alpha),u}function Bf(e){const[t,r,n]=[e.L,e.a,e.b],i=Math.pow(.9999999984505198*t+.39633779217376786*r+.2158037580607588*n,3),a=Math.pow(1.00000000888176*t-.10556134232365635*r-.0638541747717059*n,3),s=Math.pow(t*1.000000054672411-.0894841820949657*r-1.2914855378640917*n,3),u=4.076741661347994*i-3.307711590408193*a+.230969928729428*s,d=-1.2684380040921763*i+2.6097574006633715*a-.3413193963102197*s,p=-.004196086541837188*i-.7034186144594493*a+1.7076147009309444*s,h=S=>{const D=Math.abs(S);return D<=.0031308?S*12.92:(Math.sign(S)||1)*(1.055*Math.pow(D,1/2.4)-.055)};return[h(u),h(d),h(p)]}function Tf(e){const[t,r,n]=e;return t>=0&&t<=1&&r>=0&&r<=1&&n>=0&&n<=1}function $f(e,t){let[r,n,i]=e;return r=fc(r*255),n=fc(n*255),i=fc(i*255),t!==void 0?{r,g:n,b:i,alpha:t}:{r,g:n,b:i}}function Fp(e){let[t,r,n]=Bf(e);if(Tf([t,r,n]))return $f([t,r,n],e.alpha);const i=Gg(e);if(i.C=0,[t,r,n]=Bf(If(i)),!Tf([t,r,n]))return $f([t,r,n],e.alpha);let a=0,s=e.L,u=(a+s)/2;i.C=u;const d=.36/Math.pow(2,12);for(;s-a>d;)u=(a+s)/2,i.C=u,[t,r,n]=Bf(If(i)),Tf([t,r,n])?a=u:s=u;return $f([t,r,n],e.alpha)}function qg(e){return Fp(If(e))}function zp(e,t){const r=Lf(e),n=Lf(t),i=.56,a=.57,s=.62,u=.65,d=.022,p=1.414,h=.1,S=5e-4,D=1.14,P=.027,O=1.14,de=.027;function Ve(Tt){return Tt>=d?Tt:Tt+Ho(d-Tt,p)}function se(Tt){return(Tt<0?-1:1)*Math.pow(Math.abs(Tt),2.4)}const ke=Ve(se(n.r/255)*.2126729+se(n.g/255)*.7151522+se(n.b/255)*.072175),Xe=Ve(se(r.r/255)*.2126729+se(r.g/255)*.7151522+se(r.b/255)*.072175);let $e,St,Kt;return Math.abs(Xe-ke)<S?St=0:Xe>ke?($e=Ho(Xe,i)-Ho(ke,a),St=$e*D):($e=Ho(Xe,u)-Ho(ke,s),St=$e*O),Math.abs(St)<h?Kt=0:St>0?Kt=St-de:Kt=St+P,Kt*100}function Kp(e,t,r){r!=null||(r="#fff"),t!=null||(t="#000");const n=zp(e,r),i=zp(e,t);return Math.abs(n)>Math.abs(i)?r:t}function Xg(e){const t=Lf(e);let r=((1<<24)+(fc(t.r)<<16)+(fc(t.g)<<8)+fc(t.b)).toString(16).slice(1);return t.alpha!==void 0&&t.alpha<1&&(r+=("00"+Math.round(t.alpha*255).toString(16)).slice(-2)),r[0]===r[1]&&r[2]===r[3]&&r[4]===r[5]&&r[6]===r[7]&&(r=r[0]+r[2]+r[4]+(t.alpha!==void 0&&t.alpha<1?r[6]:"")),"#"+r}function En(e){const t=Hp(e);let r="";for(const n of t){if(typeof n.value!="string")return"";r+=n.value}return r}function Hp(e){const r=e.model.selection.ranges;return r.length!==1?[]:e.model.getAtoms(r[0])}function Jg(e,t){const r=Hp(e);if(r.length!==1)return!1;const n=rs[t];return n?!!n.test(r[0].value):!1}function Yg(e,t){return En(e).length>0}function Qg(e){return[Pf(e,"double-struck","mathbb","tooltip.blackboard"),Pf(e,"fraktur","mathfrak","tooltip.fraktur"),Pf(e,"calligraphic","mathcal","tooltip.caligraphic"),Rf(e,"up","mathrm","tooltip.roman-upright"),Rf(e,"bold","mathbf","tooltip.bold"),Rf(e,"italic","mathit","tooltip.italic")]}function ev(e){return[{label:()=>Ei(`\\vec{${En(e)}}`),visible:()=>En(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\overrightarrow{${En(e)}}`),visible:()=>En(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\overleftarrow{${En(e)}}`),visible:()=>En(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\dot{${En(e)}}`),visible:()=>En(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\ddot{${En(e)}}`),visible:()=>En(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\bar{${En(e)}}`),visible:()=>En(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\overline{${En(e)}}`),visible:()=>En(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\overgroup{${En(e)}}`),visible:()=>En(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\overbrace{${En(e)}}`),visible:()=>En(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\underline{${En(e)}}`),visible:()=>En(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\undergroup{${En(e)}}`),visible:()=>En(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\underbrace{${En(e)}}`),visible:()=>En(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function tv(e){return[{label:()=>Ei(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Ei(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function rv(e){const t=[];for(const r of Object.keys(ie))t.push({class:(Xg(Kp(ie[r]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${ie[r]} "></span>`,ariaLabel:()=>{var n;return(n=pe(r))!=null?n:r},checked:()=>{var n;return{some:"mixed",all:!0}[(n=e.queryStyle({backgroundColor:r}))!=null?n:!1]},onMenuSelect:()=>{e.applyStyle({backgroundColor:r},{operation:"toggle"}),e.adoptStyle="none"}});return t}function nv(e){const t=[];for(const r of Object.keys(j))t.push({class:(Kp(j[r])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${j[r]} "></span>`,ariaLabel:()=>{var n;return(n=pe(r))!=null?n:r},checked:()=>{var n;return{some:"mixed",all:!0}[(n=e.queryStyle({color:r}))!=null?n:!1]},onMenuSelect:()=>{e.applyStyle({color:r},{operation:"toggle"}),e.adoptStyle="none"}});return t}var iv=class extends Dp{constructor(e,t,r,n){super(e,t),this.row=r,this.col=n}set active(e){const t=this.parentMenu.children;if(e)for(const r of t)r.element.classList.toggle("active",r.row<=this.row&&r.col<=this.col);else for(const r of t)r.element.classList.remove("active")}};function av(e){const t=[];for(let r=1;r<=5;r++)for(let n=1;n<=5;n++)t.push({onCreate:(i,a)=>new iv(i,a,r,n),label:"\u2610",tooltip:()=>pe("tooltip.row-by-col",r,n),data:{row:r,col:n},onMenuSelect:()=>{e.insert(`\\begin{pmatrix}${Array(r).fill(Array(n).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return t}function ov(e){return[{label:()=>pe("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>nl(e)},{label:()=>pe("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>nl(e)},{label:()=>pe("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>nl(e),enabled:()=>{const t=e.model.parentEnvironment;if(!t)return!1;const[r,n]=lv(e);return r<t.maxColumns}},{label:()=>pe("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>nl(e)},{type:"divider"},{label:()=>pe("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>nl(e)},{label:()=>pe("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>nl(e)},{type:"divider"},{label:()=>pe("menu.borders"),visible:()=>(sv(e)||nl(e))&&e.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>hu(e,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>hu(e,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>hu(e,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>hu(e,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>hu(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>pe("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:av(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>pe("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>pe("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{tc(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>pe("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{tc(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>e.model.mode==="text"},{label:()=>pe("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>e.model.mode==="latex"}]},{type:"divider"},{label:()=>pe("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:Qg(e),submenuClass:"variant-submenu"},{label:()=>pe("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:nv(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>pe("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:rv(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>pe("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:ev(e),submenuClass:"variant-submenu"},{label:()=>pe("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&En(e).length>0,submenu:tv(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>pe("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const t=cv(e);if(!t){e.model.announce("plonk");return}e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${t}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(t,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>pe("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var t,r;if(e.model.selectionIsCollapsed){const n=(t=e.expression)==null?void 0:t.simplify();if(e.model.position=e.model.lastOffset,!n){e.model.announce("plonk");return}e.insert(`=${n.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const n=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(e.model.selection)).simplify();if(!n){e.model.announce("plonk");return}e.insert(n.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var t;if(window.MathfieldElement.computeEngine===null)return"";const r=(t=e.expression)==null?void 0:t.unknowns[0];return r?pe("menu.solve-for",Ei(r)):pe("menu.solve")},id:"ce-solve",visible:()=>{var t;return e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((t=e.expression)==null?void 0:t.unknowns.length)===1&&e.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var t;const r=e.expression,n=r==null?void 0:r.unknowns[0],i=(t=r.solve(n))==null?void 0:t.map(a=>{var s;return(s=a.simplify().latex)!=null?s:""});if(!i){e.model.announce("plonk");return}e.insert(`${n}=${i.length===1?i[0]:"\\left\\lbrace"+(i==null?void 0:i.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>pe("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>pe("menu.copy"),id:"copy",submenu:[{label:()=>pe("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>ln.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>pe("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>ln.copyToClipboard(e,"ascii-math")},{label:()=>pe("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>ln.copyToClipboard(e,"math-ml")}]},{label:()=>pe("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>pe("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function nl(e){var t;return!!((t=e.model.parentEnvironment)!=null&&t.array)}function sv(e){return e.model.at(e.model.position).type==="array"}function lv(e){var t;const r=(t=e.model.parentEnvironment)==null?void 0:t.array;return r?[r.length,r.reduce((n,i)=>Math.max(n,i.length),0)]:[0,0]}function hu(e,t){Pd(e),e.flushInlineShortcutBuffer(),sp(e.model,t),Un(e)}function cv(e){var t,r;let n;if(e.model.selectionIsCollapsed?n=(t=window.MathfieldElement.computeEngine)==null?void 0:t.parse(e.getValue(),{canonical:!1}):n=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(e.model.selection),{canonical:!1}),!n)return"";let i=n.evaluate();return i.isSame(n)&&(i=n.N()),i.latex}function Pf(e,t,r,n){return{label:()=>Ei(`\\${r}{${En(e)}}`),tooltip:()=>{var i;return(i=pe(n))!=null?i:n},visible:()=>Jg(e,t),checked:()=>{var i;return{some:"mixed",all:!0}[(i=e.queryStyle({variant:t}))!=null?i:!1]},onMenuSelect:()=>{e.applyStyle({variant:t},{operation:"toggle"}),e.adoptStyle="none"}}}function Rf(e,t,r,n){return{label:()=>Ei(`\\${r}{${En(e)}}`),tooltip:()=>{var i;return(i=pe(n))!=null?i:n},visible:()=>Yg(e,t),checked:()=>{var i;return{some:"mixed",all:!0}[(i=e.queryStyle({variantStyle:t}))!=null?i:!1]},onMenuSelect:()=>{e.applyStyle({variantStyle:t},{operation:"toggle"}),e.adoptStyle="none"}}}function pc(e,t){return e+dc(t)}Oa({speak:(e,t,r)=>uv(e,t,r)},{target:"mathfield"});function uv(e,t,r){var n,i;r=r!=null?r:{withHighlighting:!1};const{model:a}=e;function s(h){let S=null;switch(h){case"all":S=a.root;break;case"selection":S=a.getAtoms(a.selection);break;case"left":{S=a.getAtoms(a.offsetOf(a.at(a.position).leftSibling),a.position);break}case"right":{S=a.getAtoms(a.position,a.offsetOf(a.at(a.position).rightSibling));break}case"group":S=a.getAtoms(a.getSiblingsRange(a.position));break;case"parent":{const{parent:D}=a.at(a.position);D!=null&&D.parent?S=D:S=a.root;break}default:S=a.root}return S}function u(h){let S="";switch(h){case"all":console.log("Internal failure: speak all failed");break;case"selection":S="no selection";break;case"left":S="at start";break;case"right":S="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":S="no parent";break;default:console.log('unknown speak_ param value: "'+h+'"');break}return S}const d=s(t);if(d===null)return(i=(n=window.MathfieldElement).speakHook)==null||i.call(n,u(t)),!1;(r.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const p=dc(d);return Re()&&r.withHighlighting?(Cs().readAloudMathfield=e,Gs(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,p)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(p),!1}function dv(e){var t,r;if(!Re()){console.log("Speak:",e);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const n=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(n)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const n=new window.AWS.Polly({apiVersion:"2016-06-10"}),i={OutputFormat:"mp3",VoiceId:(t=window.MathfieldElement.speechEngineVoice)!=null?t:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna")?"neural":"standard",Text:e,TextType:"ssml"};n.synthesizeSpeech(i,(a,s)=>{if(a)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${a}`);else if(s!=null&&s.AudioStream){const u=new Uint8Array(s.AudioStream),d=new Blob([u.buffer],{type:"audio/mpeg"}),p=URL.createObjectURL(d);new Audio(p).play().catch(S=>console.log(S))}else console.log("polly.synthesizeSpeech():",s)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function Wp(e){var t;let r;if(e.parent.type==="prompt")e.parentBranch==="body"&&(r="prompt");else if(e.parentBranch==="body")r=e.type&&(t={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])!=null?t:"parent";else if(e.parent.type==="genfrac"){if(e.parentBranch==="above")return"numerator";if(e.parentBranch==="below")return"denominator"}else e.parent.type==="surd"?e.parentBranch==="above"&&(r="index"):e.parentBranch==="superscript"?r="superscript":e.parentBranch==="subscript"&&(r="subscript");return r||console.log("unknown relationship"),r!=null?r:"parent"}function fv(e,t,r,n){let i="";if(t==="plonk")window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if(t==="delete")i=pc("deleted: ",n);else if(t==="focus"||t.includes("move"))i=pv(e.model,r)+(e.model.selectionIsCollapsed?"":"selected: ")+hv(e.model);else if(t==="replacement")i=pc("",e.model.at(e.model.position));else if(t==="line"){const a=pc("",e.model.root);e.keyboardDelegate.setAriaLabel(a)}else i=n?pc(t+" ",n):t;if(i){const a=e.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";e.ariaLiveText.textContent=i+a}}function pv(e,t){if(Number.isNaN(t))return"";const r=e.at(t);if(!r||r.treeDepth<=e.at(e.position).treeDepth)return"";let n="",i=r.parent;const a=e.at(e.position).parent;for(;i!==e.root&&i!==a;)n+=`out of ${Wp(i)};`,i=i.parent;return n}function hv(e){if(!e.selectionIsCollapsed)return pc("",e.getAtoms(e.selection));let t="";const r=e.at(e.position),n=Wp(r);return r.isFirstSibling&&(t=(n?"start of "+n:"unknown")+": "),r.isLastSibling?r.isFirstSibling||(t+=n?"end of "+n:"unknown"):t+=pc("",r),t}var mv=class{constructor(e,t,r){this.mathfield=e,this.mode=t,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=r}dispose(){this.mathfield=void 0}getState(){const e={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(e.direction=this.selection.direction),{content:this.root.toJson(),selection:e,mode:this.mode}}setState(e,t){var r;const n=this.silenceNotifications;this.silenceNotifications=(r=t==null?void 0:t.silenceNotifications)!=null?r:!0;let i={};if((t==null?void 0:t.type)==="undo"&&(i={inputType:"historyUndo"}),(t==null?void 0:t.type)==="redo"&&(i={inputType:"historyRedo"}),this.contentWillChange(i)){const a=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=ha(e.content),this.selection=e.selection,this.silenceNotifications=a,this.contentDidChange(i)}this.silenceNotifications=n}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var r,n,i;const a=this.normalizeSelection(e,t);if(a===void 0)throw new TypeError("Invalid selection");if(a.ranges.length===1&&a.ranges[0][0]===a.ranges[0][1]){const h=a.ranges[0][0];if(!this.mathfield.dirty&&!((r=this.at(h))!=null&&r.parentPrompt)&&this.mathfield.hasEditablePrompts){if((n=this.at(h-1))!=null&&n.parentPrompt){this._anchor=this.normalizeOffset(h-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((i=this.at(h+1))!=null&&i.parentPrompt){this._anchor=this.normalizeOffset(h+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=h,this._position=h,this._selection=a;return}const s=Ni(a);a.direction==="backward"?[this._position,this._anchor]=s:[this._anchor,this._position]=s;const u=this.at(s[0]+1),d=this.at(s[1]),p=we.commonAncestor(u,d);(p==null?void 0:p.type)==="array"&&u.parent===p&&d.parent===p?this._selection={ranges:[s],direction:a.direction}:this._selection={ranges:[s],direction:a.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(e){var t;const r=this.at(e);(r==null?void 0:r.type)==="placeholder"?this.setSelection(e-1,e):((t=r==null?void 0:r.rightSibling)==null?void 0:t.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,r instanceof Ft&&r.isSuggestion&&(r.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(e){this.setSelection(e,e)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(e="forward"){return this._anchor===this._position?!1:(e==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(e){return this.atoms[e]}offsetOf(e){return this.atoms.indexOf(e)}getSiblingsRange(e){const t=this.at(e),{parent:r}=t;if(!r)return[0,this.lastOffset];const n=t.parent.branch(t.parentBranch);return[this.offsetOf(n[0]),this.offsetOf(n[n.length-1])]}getBranchRange(e,t){const r=this.at(e).branch(t);return[this.offsetOf(r[0]),this.offsetOf(r[r.length-1])]}getAtoms(e,t,r){let n=r!=null?r:{};if(Ks(e)){if(n=t!=null?t:{},e.ranges.length>1)return e.ranges.reduce((p,h)=>[...p,...this.getAtoms(h,n)],[]);e=e.ranges[0]}let i,a;if(_o(e)){if(i=e,!_o(t))return[];a=t}else[i,a]=e,n=t!=null?t:{};if(!Number.isFinite(i))return[];n.includeChildren===void 0&&(n.includeChildren=!1),i<0&&(i=this.lastOffset-i+1),a<0&&(a=this.lastOffset-a+1);const s=Math.min(i,a)+1,u=Math.max(i,a);if(!n.includeChildren&&s===1&&u===this.lastOffset)return[this.root];let d=[];for(let p=s;p<=u;p++){const h=this.atoms[p];Vp(this,h,s,u)&&d.push(h)}return n.includeChildren||(d=d.filter(p=>{let h=!1,{parent:S}=p;for(;S&&!h;)h=Vp(this,S,s,u),S=S.parent;return!h})),d}getAllAtoms(e=0){const t=[],r=this.lastOffset;for(let n=e;n<=r;n++)t.push(this.atoms[n]);for(let n=0;n<e;n++)t.push(this.atoms[n]);return t}findAtom(e,t=0,r="forward"){let n;const i=this.lastOffset;if(r==="forward"){for(let a=t;a<=i;a++)if(n=this.atoms[a],e(n))return n;for(let a=0;a<t;a++)if(n=this.atoms[a],e(n))return n;return}for(let a=t;a>=0;a--)if(n=this.atoms[a],e(n))return n;for(let a=i;a>t;a--)if(n=this.atoms[a],e(n))return n}extractAtoms(e){let t=this.getAtoms(e);if(t.length===1&&!t[0].parent)if(t[0].type==="root")t=[...t[0].body],t.shift();else return t=this.root.cells.flat(),this.root=new we({type:"root",body:[]}),t;for(const r of t)r.parent.removeChild(r);return t}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,t){const r=t!=null?t:"latex";if(r.startsWith("latex"))return we.serialize([e],{expandMacro:r==="latex-expanded",skipStyles:r==="latex-unstyled",skipPlaceholders:r==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(r==="math-ml")return Zr(e);if(r==="spoken")return dc(e);if(r==="spoken-text"){const n=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const i=dc(e);return window.MathfieldElement.textToSpeechMarkup=n,i}if(r==="spoken-ssml"||r==="spoken-ssml-with-highlighting"){const n=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const i=dc(e);return window.MathfieldElement.textToSpeechMarkup=n,i}return r==="ascii-math"?Xn(e):(console.error(`MathLive 0.98.5: Unexpected format "${r}`),"")}getValue(e,t,r){if(e===void 0)return this.atomToString(this.root,"latex");if(typeof e=="string"&&e!=="math-json")return this.atomToString(this.root,e);let n,i;if(_o(e)&&_o(t)?(n=[this.normalizeRange([e,t])],i=r):Yo(e)?(n=[this.normalizeRange(e)],i=t):Ks(e)?(n=e.ranges,i=t):(n=[this.normalizeRange([0,-1])],i=e),i!=null||(i="latex"),i==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
|
|
|
Load the library, for example with:
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const a=this.getValue({ranges:n},"latex-unstyled");try{const s=window.MathfieldElement.computeEngine.parse(a);return JSON.stringify(s.json)}catch(s){return JSON.stringify(["Error",`'${s.toString()}'`])}}if(i.startsWith("latex")){const a={expandMacro:i==="latex-expanded",skipStyles:i==="latex-unstyled",skipPlaceholders:i==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return Cr(n.map(s=>we.serialize(this.getAtoms(s),a)))}return n.map(a=>this.getAtoms(a).map(s=>this.atomToString(s,i)).join("")).join("")}extendSelectionTo(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const r=this.normalizeRange([e,t]);let[n,i]=r,{parent:a}=this.at(i);if(a&&(a.type==="genfrac"||a.type==="subsup"))for(;a!==this.root&&Of(this,a,[n,i]);)i=this.offsetOf(a),a=a.parent;for(a=this.at(n).parent;a!==this.root&&Of(this,a,[n,i]);)n=this.offsetOf(a.leftSibling),a=a.parent;if(a=this.at(i).parent,(a==null?void 0:a.type)==="genfrac")for(;a!==this.root&&Of(this,a,[n,i]);)i=this.offsetOf(a),console.assert(i>=0),a=a.parent;this._position=this.normalizeOffset(t),this._selection={ranges:[[n,i]],direction:"none"}})}announce(e,t,r=[]){var n,i;((i=(n=this.mathfield.host)==null?void 0:n.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:t,atoms:r},cancelable:!0,bubbles:!0,composed:!0})))!=null?i:!0)&&fv(this.mathfield,e,t,r)}deferNotifications(e,t){const r=this._selection,n=this._anchor,i=this._position,a=this.silenceNotifications;this.silenceNotifications=!0;const s=this.root.changeCounter;t();const u=this.root.changeCounter!==s,d=n!==this._anchor||i!==this._position||E0(this._selection,r)==="different";return this.silenceNotifications=a,e.content&&u&&this.contentDidChange({inputType:e.type}),e.selection&&d&&this.selectionDidChange(),u||d}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[t,r]=e;return t=this.normalizeOffset(t),r=this.normalizeOffset(r),t<r?[t,r]:[r,t]}normalizeSelection(e,t){var r;let n;if(_o(e)){const i=this.normalizeOffset(e);if(_o(t)){const a=this.normalizeOffset(t);n=i<=a?{ranges:[[i,a]],direction:"none"}:{ranges:[[a,i]],direction:"backward"}}else n={ranges:[[i,i]],direction:"none"}}else if(Yo(e)){const i=this.normalizeOffset(e[0]),a=this.normalizeOffset(e[1]);n=i<=a?{ranges:[[i,a]],direction:"none"}:{ranges:[[a,i]],direction:"backward"}}else Ks(e)&&(n={ranges:e.ranges.map(i=>this.normalizeRange(i)),direction:(r=e.direction)!=null?r:"none"});return console.assert(n!==void 0),n}get parentEnvironment(){let e=this.at(this.position).parent;if(e){for(;e.parent&&e.type!=="array";)e=e.parent;if(e.type==="array")return e}}get cell(){var e;let t=this.at(this.position);if(t){for(;t&&((e=t.parent)==null?void 0:e.type)!=="array";)t=t.parent;if(!(!(t!=null&&t.parent)||t.parent.type!=="array"))return t.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;const t=this.silenceNotifications;this.silenceNotifications=!0;const r=this.mathfield.onContentWillChange(e);return this.silenceNotifications=t,r}contentDidChange(e){var t;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update($o(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const r=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",v(_({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",bubbles:!0,composed:!0}))),this.silenceNotifications=r}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update($o(this.mathfield)),this.silenceNotifications))return;const e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function Vp(e,t,r,n){const i=e.offsetOf(t);if(i<r||i>n)return!1;if(!t.hasChildren)return!0;const a=e.offsetOf(t.firstChild);if(a>=r&&a<=n){const s=e.offsetOf(t.lastChild);if(s>=r&&s<=n)return!0}return!1}function Of(e,t,r){if(!(t!=null&&t.hasChildren))return!1;const[n,i]=r,a=e.offsetOf(t.firstChild),s=e.offsetOf(t.lastChild);return a>=n&&a<=i&&s>=a&&s<=i}function mu(e,t,r,n){var i,a,s,u,d,p;const h=r.parent;if(h&&r instanceof Cn){const S=!n&&t==="forward"||n==="body"&&t==="backward";let D=S?e.offsetOf(r.firstChild):e.offsetOf(r.lastChild);return S?r.rightDelim!=="?"&&r.rightDelim!=="."?(r.leftDelim=".",r.isDirty=!0):(h.addChildrenAfter(r.removeBranch("body"),r),h.removeChild(r),D--):r.leftDelim!=="?"&&r.leftDelim!=="."?(r.rightDelim=".",r.isDirty=!0):(h.addChildrenAfter(r.removeBranch("body"),r),h.removeChild(r),D--),e.position=D,!0}if(h&&r.type==="surd"){if(t==="forward"&&!n||t==="backward"&&n==="body"){const S=r.leftSibling;r.hasChildren&&h.addChildrenAfter(r.removeBranch("body"),r),h.removeChild(r),e.position=e.offsetOf(S)}else t==="forward"&&n==="body"?e.position=e.offsetOf(r):!n&&t==="backward"?r.hasChildren?e.position=e.offsetOf(r.lastChild):(e.position=Math.max(0,e.offsetOf(r)-1),h.removeChild(r)):n==="above"&&(r.hasEmptyBranch("above")&&r.removeBranch("above"),t==="backward"?e.position=e.offsetOf(r.leftSibling):e.position=e.offsetOf(r.body[0]));return!0}if(h&&(r.type==="box"||r.type==="enclose")){const S=n&&t==="backward"||!n&&t==="forward"?r.leftSibling:r.lastChild;return h.addChildrenAfter(r.removeBranch("body"),r),h.removeChild(r),e.position=e.offsetOf(S),!0}if(r.type==="genfrac"||r.type==="overunder"){if(!n)return r.type==="overunder"&&r.hasEmptyBranch("body")||r.type==="genfrac"&&r.hasEmptyBranch("below")&&r.hasEmptyBranch("above")?!1:(e.position=e.offsetOf(t==="forward"?r.firstChild:r.lastChild),!0);const S=gu.fractionNavigationOrder==="numerator-denominator"?"above":"below",D=S==="above"?"below":"above";if(h&&(t==="forward"&&n===S||t==="backward"&&n===D)){const P=r.removeBranch(S),O=r.removeBranch(D);return h.addChildrenAfter([...P,...O],r),h.removeChild(r),e.position=e.offsetOf(P.length>0?P[P.length-1]:O[0]),!0}return t==="backward"?e.position=e.offsetOf(r.leftSibling):e.position=e.offsetOf(r),!0}if(r.isExtensibleSymbol||r.type==="subsup"){if(!n&&t==="forward")return!1;if(!n){if(r.subscript||r.superscript){const S=t==="forward"?(s=(i=r.superscript)==null?void 0:i[0])!=null?s:(a=r.subscript)==null?void 0:a[0]:(p=(u=r.subscript)==null?void 0:u[0].lastSibling)!=null?p:(d=r.superscript)==null?void 0:d[0].lastSibling;return S&&(e.position=e.offsetOf(S)),!0}return!1}if(!r.hasChildren&&r.type==="subsup"){const S=t==="forward"?e.offsetOf(r):Math.max(0,e.offsetOf(r)-1);return r.parent.removeChild(r),e.position=S,!0}if(n==="superscript")if(t==="backward"){const S=e.offsetOf(r.firstChild)-1;console.assert(S>=0),e.position=S}else r.subscript?e.position=e.offsetOf(r.subscript[0]):e.position=e.offsetOf(r);else n==="subscript"&&(t==="backward"&&r.superscript?e.position=e.offsetOf(r.superscript[0].lastSibling):t==="backward"?e.position=e.offsetOf(r.firstChild)-1:e.position=e.offsetOf(r));if(n&&r.hasEmptyBranch(n)&&(r.removeBranch(n),r.type==="subsup"&&!r.subscript&&!r.superscript)){const S=t==="forward"?e.offsetOf(r):Math.max(0,e.offsetOf(r)-1);r.parent.removeChild(r),e.position=S}return!0}if((h==null?void 0:h.type)==="genfrac"&&!n&&r.type!=="first"){let S=e.offsetOf(r.leftSibling);return h.removeChild(r),h.hasEmptyBranch("above")&&h.hasEmptyBranch("below")?(S=e.offsetOf(h.leftSibling),h.parent.removeChild(h),e.announce("delete",void 0,[h]),e.position=S,!0):(e.announce("delete",void 0,[r]),e.position=S,!0)}if(t==="backward"&&((h==null?void 0:h.command)==="\\ln"||(h==null?void 0:h.command)==="\\log")&&r.parentBranch!=="body"){const S=e.offsetOf(h.leftSibling);return h.parent.removeChild(h),e.announce("delete",void 0,[h]),e.position=S,!0}return!1}function gv(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentBackward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let t=e.at(e.position);if(!(t&&mu(e,"backward",t))){if(t!=null&&t.isFirstSibling){if(mu(e,"backward",t.parent,t.parentBranch))return;t=null}if(!t){e.announce("plonk");return}e.position=e.offsetOf(t.leftSibling),t.parent.removeChild(t),e.announce("delete",void 0,[t])}}):Ro(e,Ni(e.selection),"deleteContentBackward")}function vv(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentForward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var t,r;let n=e.at(e.position).rightSibling;if(n&&mu(e,"forward",n))return;if(n){if(e.at(e.position).isLastSibling&&mu(e,"forward",n.parent,n.parentBranch))return}else{if(n=e.at(e.position),n.isLastSibling&&mu(e,"forward",n.parent,n.parentBranch))return;n=void 0}if(e.position===e.lastOffset||!n){e.announce("plonk");return}n.parent.removeChild(n);let i=(t=e.at(e.position))==null?void 0:t.rightSibling;for(;(i==null?void 0:i.type)==="subsup";)i.parent.removeChild(i),i=(r=e.at(e.position))==null?void 0:r.rightSibling;e.announce("delete",void 0,[n])}):Ro(e,Ni(e.selection),"deleteContentForward")}function Ro(e,t,r){const n=e.getAtoms(t);if(n.length>0&&n[0].parent){let i=n[0].parent.firstChild;i.type==="first"&&(i=i.rightSibling);const a=n[n.length-1].parent.lastChild;let s=n[0];s.type==="first"&&(s=s.rightSibling);const u=n[n.length-1];if(s===i&&u===a){const d=n[0].parent;d.parent&&d.type!=="prompt"&&(t=[e.offsetOf(d.leftSibling),e.offsetOf(d)])}if(n.length===1&&n[0].type==="placeholder"&&n[0].parent.type==="genfrac"){const d=n[0].parent,p=n[0].parentBranch==="below"?"above":"below",h=e.offsetOf(d.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:r},()=>{var S,D;const P=d.removeBranch(p);if(P.length===1&&P[0].type==="placeholder")(D=d.parent)==null||D.removeChild(d),e.position=Math.max(0,h);else{const O=d.parent.addChildrenAfter(P,d);(S=d.parent)==null||S.removeChild(d),e.position=e.offsetOf(O)}})}}return e.deferNotifications({content:!0,selection:!0,type:r},()=>e.deleteAtoms(t))}Oa({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&Ro(e,[0,-1],"deleteContent"),deleteForward:e=>vv(e),deleteBackward:e=>gv(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&Ro(e,[e.anchor,ff(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&Ro(e,[e.anchor,ff(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&Ro(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&Ro(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&Ro(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&Ro(e,[e.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var bv=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${pe("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,yv=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${pe("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,xv=class{constructor(e,t){this.focusBlurInProgress=!1;var r,n,i;this.options=_(v(_({},Zd()),{macros:dt(),registers:ad()}),Ud(t)),this.eventController=new AbortController;const a=this.eventController.signal;t.eventSink&&(this.host=t.eventSink),this.element=e,e.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let s=(n=(r=t.value)!=null?r:this.element.textContent)!=null?n:"";s=s.trim();const u=ip(this.options),d=new we({type:"root",mode:u,body:w(s,{context:this.context})});this.model=new mv(this,u,d),this.undoManager=new Um(this.model);const p=[];if(p.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),p.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),p.push("<span part=content class=ML__content>"),p.push(Xf(this)),p.push("</span>"),window.mathVirtualKeyboard&&(p.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),p.push(bv),p.push("</div>")),p.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),p.push(yv),p.push("</div>"),p.push("</span>"),p.push("<span class=ML__sr-only>"),p.push("<span role=status aria-live=assertive aria-atomic=true></span>"),p.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(p.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=Se.subscribe(()=>Se.update(this.element)),Se.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",S=>S.stopImmediatePropagation(),{capture:!1,signal:a}),this.field.addEventListener("wheel",this,{passive:!1,signal:a}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:a}):this.field.addEventListener("mousedown",this,{signal:a}),(i=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||i.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update($o(this)))},{signal:a}),this._menu=new Lg(ov(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:a});const h=this.element.querySelector("[part=menu-toggle]");h==null||h.addEventListener("pointerdown",S=>{if(S.currentTarget!==h||this._menu.state!=="closed")return;this.element.classList.add("tracking");const D=h.getBoundingClientRect();this._menu.modifiers=js(S),this._menu.show({target:h,location:{x:D.left,y:D.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),S.preventDefault(),S.stopPropagation()},{signal:a}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(h.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=Xh(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:a}),document.addEventListener("scroll",this,{signal:a}),this.resizeObserver=new ResizeObserver(()=>Un(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:a}),eu&&!Se.locale.startsWith(eu.locale)&&Zh(Se.locale),Za!=="ready"&&document.fonts.ready.then(()=>zd(this)),e.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(e){this._defaultStyle=e}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const e=this.model.at(this.model.position),t=this.adoptStyle==="right"?e.rightSibling:e;if(!t)return this.defaultStyle;if(t.type==="group"){const r=t.branch("body");return!r||r.length<2?{}:this.adoptStyle==="right"?r[1].computedStyle:r[r.length-1].computedStyle}return t.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update($o(this)),i0(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,_f())}showMenu(e){var t,r;const n=(r=(t=e==null?void 0:e.location)!=null?t:Fl(this.field))!=null?r:void 0,i=e==null?void 0:e.modifiers,a=this.element.querySelector("[part=container]");return this._menu.show({target:a,location:n,modifiers:i})}get colorMap(){return e=>{var t,r,n;return(n=(r=(t=this.options).colorMap)==null?void 0:r.call(t,e))!=null?n:Nt(e)}}get backgroundColorMap(){return e=>{var t,r,n,i,a,s;return(s=(a=(r=(t=this.options).backgroundColorMap)==null?void 0:r.call(t,e))!=null?a:(i=(n=this.options).colorMap)==null?void 0:i.call(n,e))!=null?s:gt(e)}}get smartFence(){var e;return(e=this.options.smartFence)!=null?e:!1}get readOnly(){var e;return(e=this.options.readOnly)!=null?e:!1}get disabled(){var e,t;return(t=(e=this.host)==null?void 0:e.disabled)!=null?t:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const e=getComputedStyle(this.host);return e.getPropertyValue("user-select")||e.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(e=>e.type==="prompt"&&!e.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const e=this.model.at(this.model.anchor),t=this.model.at(this.model.position),r=we.commonAncestor(e,t);return!!((r==null?void 0:r.type)==="prompt"||r!=null&&r.parentPrompt)}get letterShapeStyle(){var e;return(e=this.options.letterShapeStyle)!=null?e:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const e=this.model.getAtoms(this.model.selection);if(e.length===0)return{};const t=_({},e[0].style);for(const r of e)for(const[n,i]of Object.entries(r.style))t[n]!==i&&delete t[n];return t}queryStyle(e){const t=bf(this,e);"verbatimColor"in t&&delete t.verbatimColor,"verbatimBackgroundColor"in t&&delete t.verbatimBackgroundColor;const r=Object.keys(t).length;if(r===0)return"all";if(r>1){for(const d of Object.keys(t)){const p=this.queryStyle({[d]:t[d]});if(p==="none")return"none";if(p==="some")return"some"}return"all"}const n=Object.keys(t)[0],i=t[n];if(this.model.selectionIsCollapsed)return this.effectiveStyle[n]===i?"all":"none";const a=this.model.getAtoms(this.model.selection,{includeChildren:!0});let s=a.length;if(s===0)return"none";let u=0;for(const d of a){if(d.type==="first"){s-=1;continue}d.style[n]===i&&(u+=1)}return u===0?"none":u===s?"all":"some"}get keybindings(){var e,t;if(this._keybindings)return this._keybindings;const[r,n]=tm(this.options.keybindings,(e=tu())!=null?e:jh());return((t=tu())==null?void 0:t.score)>0&&(this._keybindings=r,n.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",n)),r}get menu(){return this._menu}setOptions(e){var t;this.options=_(_({},this.options),Ud(e)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let r=this.options.defaultMode;r==="inline-math"&&(r="math"),((t=this.model.root.firstChild)==null?void 0:t.mode)!==r&&(this.model.root.firstChild.mode=r),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const n=we.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==n)&&ln.insert(this.model,n,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in e||"macros"in e||"registers"in e||"colorMap"in e||"backgroundColorMap"in e||"letterShapeStyle"in e||"minFontScale"in e||"readOnly"in e||"placeholderSymbol"in e)&&Un(this)}getOptions(e){return Xs(this.options,e)}getOption(e){return Xs(this.options,e)}handleEvent(e){return Es(this,null,function*(){var t;if(Qo(this)){if(lf(e)){if(!jc(e.origin,(t=this.options.originValidator)!=null?t:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");const{action:r}=e.data;if(r==="execute-command"){const n=e.data.command;if(nc(n)==="virtual-keyboard")return;this.executeCommand(n)}else r==="update-state"||(r==="focus"?this.focus({preventScroll:!0}):r==="blur"&&this.blur());return}switch(e.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&yp(this,e);break;case"pointerdown":this.userSelect!=="none"&&(yp(this,e),e.shiftKey===!1&&(yield Tp(e,this.element.querySelector("[part=container]"),this._menu))&&e0.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&(yield Tp(e,this.element.querySelector("[part=container]"),this._menu))&&e0.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&i0(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Qo(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Qo(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}})}dispose(){if(!Qo(this))return;Se.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const e=this.element;delete e.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,rg(),sm(),_g()}flushInlineShortcutBuffer(e){if(e!=null||(e={defer:!1}),!e.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(e){return nc(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update($o(this))),!1):hm(this,e)}get errors(){return B(this.model.getValue(),{context:this.context})}getValue(e,t,r){return this.model.getValue(e,t,r)}setValue(e,t){var r;t=t!=null?t:{mode:"math"},t.insertionMode===void 0&&(t.insertionMode="replaceAll"),(t.format===void 0||t.format==="auto")&&(t.format="latex"),(t.mode===void 0||t.mode==="auto")&&(t.mode=(r=A0(this.model,this.model.position))!=null?r:"math");const n=this.undoManager.canUndo();ln.insert(this.model,e,t)&&(Un(this),n||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const e=window.MathfieldElement.computeEngine;return e?e.box(e.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var e;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const n=window.mathVirtualKeyboard.boundingRect,i=this.host.getBoundingClientRect();i.bottom>n.top&&((e=window.document.scrollingElement)==null||e.scrollBy(0,i.bottom-n.top+8))}}this.dirty&&Gs(this,{interactive:!0});const t=this.field.getBoundingClientRect();let r=null;if(this.model.selectionIsCollapsed)r=Fl(this.field);else{const n=md(this);if(n.length>0){let i=-1/0,a=-1/0;for(const s of n)s.right>i&&(i=s.right),s.top<a&&(a=s.top);r={x:i+t.left-this.field.scrollLeft,y:a+t.top-this.field.scrollTop,height:0}}}if(this.host&&r){const n=this.host.getBoundingClientRect(),i=r.y;let a=this.host.scrollTop;i<n.top?a=i-n.top+this.host.scrollTop:i>n.bottom&&(a=i-n.bottom+this.host.scrollTop+r.height),this.host.scroll({top:a,left:0})}if(r){const n=r.x-window.scrollX;let i=this.field.scrollLeft;n<t.left?i=n-t.left+this.field.scrollLeft-20:n>t.right&&(i=n-t.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:i})}}insert(e,t){return typeof e!="string"||e.length===0&&((t==null?void 0:t.insertionMode)==="insertBefore"||(t==null?void 0:t.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),t=t!=null?t:{mode:"math"},t.focus&&this.focus(),t.feedback&&(window.MathfieldElement.keypressVibration&<()&&navigator.vibrate(Jf),window.MathfieldElement.playSound("keypress")),e==="\\\\"?ap(this.model):e==="&"?op(this.model):this.model.selectionIsCollapsed?ln.insert(this.model,e,_({style:this.model.at(this.model.position).computedStyle},t)):ln.insert(this.model,e,t),this.snapshot(`insert-${this.model.at(this.model.position).type}`),Un(this),t.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(e,t="",r=""){var n;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const i=this.model.mode;if(this.model.mode=e,!((n=this.host)!=null&&n.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=i;return}const a=this.model.mode,{model:s}=this;s.deferNotifications({content:!!r||!!t,selection:!0,type:"insertText"},()=>{let u=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),t&&e!=="latex"){const d=w(t,{context:this.context,parseMode:e});s.collapseSelection("forward");const p=s.at(s.position);s.position=s.offsetOf(p.parent.addChildrenAfter(d,p)),u=!0}if(this.model.mode=e,e==="latex"){let d=s.selectionIsCollapsed;tc(this,"accept");let p,h=s.at(s.position);if(d)p="\\";else{const D=Ni(s.selection);p=this.model.getValue(D,"latex");const P=this.model.extractAtoms(D);P.length===1&&P[0].type==="placeholder"&&(p=t,d=!0),h=s.at(D[0])}const S=new mr(p);h.parent.addChildAfter(S,h),d?s.position=s.offsetOf(S.lastChild):s.setSelection(s.offsetOf(S.firstChild),s.offsetOf(S.lastChild))}else ru(s).forEach(d=>{d.isError=!1});if(r){const d=w(r,{context:this.context,parseMode:a});s.collapseSelection("forward");const p=s.at(s.position);s.position=s.offsetOf(p.parent.addChildrenAfter(d,p)),u=!0}return Un(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),u}),this.model.mode=e,window.mathVirtualKeyboard.update($o(this))}hasFocus(){return!this.blurred}focus(e){var t;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(t=e==null?void 0:e.preventScroll)!=null&&t||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,t={}){var r,n;const i={operation:"set",silenceNotifications:!1};Yo(t)?i.range=t:(t.operation==="toggle"&&(i.operation="toggle"),i.range=t.range,i.silenceNotifications=(r=t.silenceNotifications)!=null?r:!1);const a=bf(this,e),s=(n=i.operation)!=null?n:"set";if(i.range===void 0&&this.model.selectionIsCollapsed){if(s==="set"){this.defaultStyle=_(_({},this.defaultStyle),a);return}const u=_({},this.defaultStyle);for(const d of Object.keys(a))u[d]===a[d]?(d==="color"&&delete u.verbatimColor,d==="backgroundColor"&&delete u.verbatimBackgroundColor,delete u[d]):u[d]=a[d];this.defaultStyle=u;return}this.model.deferNotifications({content:!i.silenceNotifications,type:"insertText"},()=>{if(i.range===void 0)for(const u of this.model.selection.ranges)uf(this.model,u,a,{operation:s});else uf(this.model,i.range,a,{operation:s})}),Un(this)}toggleContextMenu(){var e;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(e=this.getCaretPoint())!=null?e:void 0,onDismiss:()=>{var t;return(t=this.element)==null?void 0:t.focus()}}),!0):!1}getCaretPoint(){const e=Fl(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,t){const r=uu(this,e,t,{bias:0});if(r<0)return!1;const n=this.model.position;return this.model.position=r,this.model.announce("move",n),Un(this),!0}getPrompt(e){const t=this.model.findAtom(r=>r.type==="prompt"&&r.placeholderId===e);return console.assert(t!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),t}getPromptValue(e,t){const r=this.getPrompt(e);if(!r)return"";const n=this.model.offsetOf(r.firstChild),i=this.model.offsetOf(r.lastChild);return this.model.getValue(n,i,t)}getPrompts(e){return this.model.getAllAtoms().filter(t=>t.type!=="prompt"?!1:e?!(e.id&&t.placeholderId!==e.id||e.locked&&t.locked!==e.locked||e.correctness==="undefined"&&t.correctness||e.correctness&&t.correctness!==e.correctness):!0).map(t=>t.placeholderId)}setPromptValue(e,t,r){if(t!==void 0){const n=this.getPrompt(e);if(!n){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}const i=this.model.getBranchRange(this.model.offsetOf(n),"body");this.model.setSelection(i),this.insert(t,v(_({},r),{insertionMode:"replaceSelection"}))}r!=null&&r.silenceNotifications&&(this.valueOnFocus=this.getValue()),Un(this)}setPromptState(e,t,r){const n=this.getPrompt(e);if(!n){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}t==="undefined"?n.correctness=void 0:typeof t=="string"&&(n.correctness=t),typeof r=="boolean"&&(n.locked=r,n.captureSelection=r),Un(this)}getPromptState(e){const t=this.getPrompt(e);return t?[t.correctness,t.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){const t=this.getPrompt(e);return t?this.model.getBranchRange(this.model.offsetOf(t),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var t;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update($o(this)),(t=this.host)==null||t.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var e;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update($o(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var e;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update($o(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var e;(e=this.undoManager)==null||e.reset()}onSelectionDidChange(){var e,t;const r=this.model;this.keyboardDelegate.setValue(r.getValue(this.model.selection,"latex-expanded"));{const n=r.at(r.position),i=(e=n.mode)!=null?e:ip(this.options);this.model.mode!==i&&(this.model.mode==="latex"?(tc(this,"accept",{mode:i}),r.position=r.offsetOf(n)):this.switchMode(i))}(t=this.host)==null||t.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update($o(this)),i0(this)}onContentWillChange(e){var t,r,n;return(n=(r=this.host)==null?void 0:r.dispatchEvent(new InputEvent("beforeinput",v(_({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?n:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),Gs(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var e,t,r;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",rc(this),this.model.getValue()!==this.valueOnFocus&&((e=this.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(t=this.host)==null||t.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(r=this.host)==null||r.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),Un(this),this.focusBlurInProgress=!1,_f();const n=new AbortController,i=n.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Qo(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:i})},{once:!0,signal:i}),setTimeout(()=>n.abort(),100)}onInput(e){mf(this,e)}onKeystroke(e){return gp(this,e)}onCompositionStart(e){this.model.deleteAtoms(Ni(this.model.selection));const t=Fl(this.field);t&&requestAnimationFrame(()=>{Gs(this),this.keyboardDelegate.moveTo(t.x,t.y-t.height)})}onCompositionUpdate(e){Rm(this.model,e),Un(this)}onCompositionEnd(e){Om(this.model),mf(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),ln.onCopy(this,e),Ro(this.model,Ni(this.model.selection),"deleteByCut"),this.snapshot("cut"),Un(this))}onCopy(e){ln.onCopy(this,e)}onPaste(e){let t=this.isSelectionEditable;return t&&(t=ln.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),t||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),t}onGeometryChange(){this._menu.hide(),Od(this),i0(this)}onWheel(e){const t=5*e.deltaX;if(!Number.isFinite(t)||t===0)return;const r=this.field;t<0&&r.scrollLeft===0||t>0&&r.offsetWidth+r.scrollLeft>=r.scrollWidth||(r.scrollBy({top:0,left:t}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let t=e;for(;!t.id&&t.hasChildren;)t=e.children[0];return this.field.querySelector(`[data-atom-id="${t.id}"]`)}get context(){var e,t;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(t=this.options.placeholderSymbol)!=null?t:"\u25A2",colorMap:r=>this.colorMap(r),backgroundColorMap:r=>this.backgroundColorMap(r),getMacro:r=>tn(r,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function Up(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(const t of e.children)Up(t)}function Nf(e,t){var r;e&&(!t||((r=e.dataset)==null?void 0:r.atomId)===t?(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(n=>{n instanceof HTMLElement&&Nf(n)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(n=>{n instanceof HTMLElement&&Nf(n,t)})))}function wv(e,t){var r;if(!Re())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(t);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const n=new window.AWS.Polly({apiVersion:"2016-06-10"}),i={OutputFormat:"json",VoiceId:(r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna",Engine:"standard",Text:t,TextType:"ssml",SpeechMarkTypes:["ssml"]};Cs().readAloudElement=e,n.synthesizeSpeech(i,(a,s)=>{if(a){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${a}`);return}if(!(s!=null&&s.AudioStream)){console.log("polly.synthesizeSpeech():",s);return}const u=new TextDecoder("utf-8").decode(new Uint8Array(s.AudioStream));Cs().readAloudMarks=u.split(`
|
|
|
`).map(d=>d?JSON.parse(d):{}),Cs().readAloudTokens=[];for(const d of Cs().readAloudMarks)d.value&&Cs().readAloudTokens.push(d.value);Cs().readAloudCurrentMark="",i.OutputFormat="mp3",i.SpeechMarkTypes=[],n.synthesizeSpeech(i,(d,p)=>{if(d){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${t}") error:${d}`);return}if(!(p!=null&&p.AudioStream))return;const h=new Uint8Array(p.AudioStream),S=new Blob([h.buffer],{type:"audio/mpeg"}),D=URL.createObjectURL(S),P=Cs();P.readAloudAudio?P.readAloudAudio.pause():(P.readAloudAudio=new Audio,P.readAloudAudio.addEventListener("ended",()=>{const O=P.readAloudMathfield;P.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),O?(Gs(O),P.readAloudElement=null,P.readAloudMathfield=null,P.readAloudTokens=[],P.readAloudMarks=[],P.readAloudCurrentMark=""):Up(P.readAloudElement)}),P.readAloudAudio.addEventListener("timeupdate",()=>{let O="";const de=P.readAloudAudio.currentTime*1e3+100;for(const Ve of P.readAloudMarks)Ve.time<de&&(O=Ve.value);P.readAloudCurrentMark!==O&&(P.readAloudCurrentToken=O,O&&O===P.readAloudFinalToken?P.readAloudAudio.pause():(P.readAloudCurrentMark=O,Nf(P.readAloudElement,P.readAloudCurrentMark)))})),P.readAloudAudio.src=D,P.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),P.readAloudAudio.play()})})}Re()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var Nr=new WeakMap,Sv=.5,Ms={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},zi=class il extends HTMLElement{static get formAssociated(){return hc()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(t){t!==this._fontsDirectory&&(this._fontsDirectory=t,um())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(t){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(t){this._soundsDirectory=t,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(t){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(t){var r,n,i;this.audioBuffers={},t===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof t=="string"?this._keypressSound={spacebar:t,return:t,delete:t,default:t}:typeof t=="object"&&"default"in t&&(this._keypressSound={spacebar:(r=t.spacebar)!=null?r:t.default,return:(n=t.return)!=null?n:t.default,delete:(i=t.delete)!=null?i:t.default,default:t.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(t){this.audioBuffers={},this._plonkSound=t}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(t){this._speechEngine=t}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(t){this._speechEngineRate=t}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(t){this._speechEngineVoice=t}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(t){this._textToSpeechMarkup=t}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(t){this._textToSpeechRules=t}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(t){this._textToSpeechRulesOptions=t}static get locale(){return Se.locale}static set locale(t){t==="auto"&&(t=navigator.language.slice(0,5)),Se.locale=t}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(t){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return Se.strings}static set strings(t){Se.merge(t)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(t){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(t){this._decimalSeparator=t,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(t){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var t,r;if(this._computeEngine===void 0){const n=(t=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;if(!n)return null;this._computeEngine=new n,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(r=this._computeEngine)!=null?r:null}static set computeEngine(t){this._computeEngine=t}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(t){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(t){this._isFunction=t}static loadSound(t){return Es(this,null,function*(){delete this.audioBuffers[t];let r="";switch(t){case"keypress":r=this._keypressSound.default;break;case"return":r=this._keypressSound.return;break;case"spacebar":r=this._keypressSound.spacebar;break;case"delete":r=this._keypressSound.delete;break;case"plonk":r=this.plonkSound;break}if(typeof r!="string")return;r=r.trim();const n=this.soundsDirectory;if(!(n==null||n==="null"||r==="none"||r==="null"))try{const a=yield(yield fetch(yield qf(`${n}/${r}`))).arrayBuffer(),s=yield this.audioContext.decodeAudioData(a);this.audioBuffers[t]=s}catch(i){}})}static playSound(t){return Es(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[t]||(yield this.loadSound(t)),!this.audioBuffers[t])return;const r=this.audioContext.createBufferSource();r.buffer=this.audioBuffers[t];const n=this.audioContext.createGain();n.gain.value=Sv,r.connect(n).connect(this.audioContext.destination),r.start()})}constructor(t){if(super(),t){const r=[];for(const n of Object.keys(t))if(Ms[n])if(Ms[n].startsWith("mf."))if(Ms[n].startsWith(`mf.${n}`))r.push(`Option \`${n}\` cannot be used as a constructor option. Use ${Ms[n]}`);else{const i=Ms[n].match(/([a-zA-Z]+) =/);r.push(`Option \`${n}\` has been renamed \`${i[1]}\``)}else r.push(`Option \`${n}\` cannot be used as a constructor option. Use ${Ms[n]}`);if(r.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const n of r)console.warn(n);console.groupEnd()}}if(hc()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[ko("core"),ko("mathfield"),ko("mathfield-element"),ko("ui"),ko("menu")],this.shadowRoot.appendChild(document.createElement("span"));const r=document.createElement("slot");r.style.display="none",this.shadowRoot.appendChild(r)}else this.shadowRoot.innerHTML="<style>"+es("core")+es("mathfield")+es("mathfield-element")+es("ui")+es("menu")+'</style><span></span><slot style="display:none"></slot>';t&&this._setOptions(t),this.shadowRoot.addEventListener("slotchange",()=>{var r;const n=this.shadowRoot.querySelector("slot:not([name])");this.value=(r=n==null?void 0:n.assignedNodes().map(i=>i.nodeType===3?i.textContent:"").join("").trim())!=null?r:""})}showMenu(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.showMenu(t))!=null?n:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",t=>{var r;t.target===this&&!((r=this._mathfield)!=null&&r.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,movementX:t.movementX,movementY:t.movementY,relatedTarget:t.relatedTarget,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey}))},{once:!0})}getPromptValue(t,r){var n,i;return(i=(n=this._mathfield)==null?void 0:n.getPromptValue(t,r))!=null?i:""}setPromptValue(t,r,n){var i;(i=this._mathfield)==null||i.setPromptValue(t,r,n)}getPromptRange(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.getPromptRange(t))!=null?n:null}getPrompts(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.getPrompts(t))!=null?n:[]}get form(){var t;return(t=this._internals)==null?void 0:t.form}get name(){var t;return(t=this.getAttribute("name"))!=null?t:""}get type(){return this.localName}get mode(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.model.mode)!=null?r:this.defaultMode==="text"?"text":"math"}set mode(t){var r;(r=this._mathfield)==null||r.switchMode(t)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(t){var r,n;if(!this._mathfield)return;const i=(n=(r=il.computeEngine)==null?void 0:r.box(t).latex)!=null?n:null;i!==null&&this._mathfield.setValue(i),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.errors)!=null?r:[]}_getOptions(t){return this._mathfield?Xs(this._mathfield.options,t):Nr.has(this)?_({},Xs(_(_({},Zd()),Ud(Nr.get(this).options)),t)):null}getOptions(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?Xs(this._mathfield.options,t):Nr.has(this)?Xs(_(_({},Zd()),Ud(Nr.get(this).options)),t):null}reflectAttributes(){const t=Zd(),r=this._getOptions();Object.keys(il.optionsAttributes).forEach(n=>{const i=is(n);il.optionsAttributes[n]==="on/off"?t[i]!==r[i]?this.setAttribute(n,r[i]?"on":"off"):this.removeAttribute(n):t[i]!==r[i]&&(il.optionsAttributes[n]==="boolean"?r[i]?this.setAttribute(n,""):this.removeAttribute(n):(typeof r[i]=="string"||typeof r[i]=="number")&&this.setAttribute(n,r[i].toString()))})}getOption(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([t])[t]}_getOption(t){return this._getOptions([t])[t]}_setOptions(t){if(this._mathfield)this._mathfield.setOptions(t);else if(Nr.has(this)){const r=_(_({},Nr.get(this).options),t);Nr.set(this,v(_({},Nr.get(this)),{selection:{ranges:r.readOnly?[[0,0]]:[[0,-1]]},options:r}))}else Nr.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:t,menuItems:void 0});this.reflectAttributes()}setOptions(t){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const r of Object.keys(t))Ms[r]&&console.warn(`\`mf.setOptions({${r}:...})\` -> ${Ms[r]}`);console.groupEnd(),this._setOptions(t)}executeCommand(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.executeCommand(t))!=null?n:!1}getValue(t,r,n){var i,a;if(this._mathfield)return this._mathfield.model.getValue(t,r,n);if(Nr.has(this)){let s,u,d;if(Ks(t)?([s,u]=t.ranges[0],d=r):Yo(t)?([s,u]=t,d=r):_o(t)&&_o(r)?(s=t,u=r,d=n):(s=0,u=-1,d=t),(d===void 0||d==="latex")&&s===0&&u===-1)return(a=(i=Nr.get(this).value)!=null?i:this.textContent)!=null?a:""}return""}setValue(t,r){if(this._mathfield&&t!==void 0){r!=null||(r={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(t,r);return}if(Nr.has(this)){const i=Nr.get(this).options;Nr.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:i,menuItems:void 0});return}const n=vu(this);Nr.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:n,menuItems:void 0})}hasFocus(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.hasFocus())!=null?r:!1}focus(){var t;(t=this._mathfield)==null||t.focus()}blur(){var t;(t=this._mathfield)==null||t.blur()}select(){var t;(t=this._mathfield)==null||t.select()}insert(t,r){var n,i;return(i=(n=this._mathfield)==null?void 0:n.insert(t,r))!=null?i:!1}applyStyle(t,r){var n;return(n=this._mathfield)==null?void 0:n.applyStyle(t,r)}queryStyle(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.queryStyle(t))!=null?n:"none"}get caretPoint(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.getCaretPoint())!=null?r:null}set caretPoint(t){var r;t&&((r=this._mathfield)==null||r.setCaretPoint(t.x,t.y))}setCaretPoint(t,r){var n,i;return(i=(n=this._mathfield)==null?void 0:n.setCaretPoint(t,r))!=null?i:!1}offsetFromPoint(t,r,n){return this._mathfield?uu(this._mathfield,t,r,n):-1}hitboxFromOffset(t){if(!this._mathfield)return null;const r=this._mathfield.model.at(t);if(!r)return null;const n=Hs(this._mathfield,r);return n?new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top):null}resetUndo(){var t;(t=this._mathfield)==null||t.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(t){var r,n,i,a;Io.state==="closed"&&((n=(r=this._mathfield)==null?void 0:r.menu)==null?void 0:n.state)==="closed"&&(t.type==="pointerdown"&&this.onPointerDown(),t.type==="focus"&&((i=this._mathfield)==null||i.focus()),t.type==="blur"&&((a=this._mathfield)==null||a.blur()))}connectedCallback(){var t,r,n,i;const a=window.getComputedStyle(this),s=this.shadowRoot,u=a.userSelect!=="none";if(u)s.host.addEventListener("pointerdown",this,!0);else{const h=s.querySelector("span");h.style.pointerEvents="none"}s.host.addEventListener("focus",this,!0),s.host.addEventListener("blur",this,!0),hc()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),u&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const d=s.querySelector("slot:not([name])");if(d)try{this._style=d.assignedElements().filter(h=>h.tagName.toLowerCase()==="style").map(h=>h.textContent).join("")}catch(h){console.error(h)}if(this._style){const h=document.createElement("style");h.textContent=this._style,s.appendChild(h)}let p="";if(this.hasAttribute("value")?p=this.getAttribute("value"):p=(t=d==null?void 0:d.assignedNodes().map(h=>h.nodeType===3?h.textContent:"").join("").trim())!=null?t:"",this._mathfield=new xv(s.querySelector(":host > span"),v(_({},(n=(r=Nr.get(this))==null?void 0:r.options)!=null?n:vu(this)),{eventSink:this,value:p})),!Nr.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const h of Object.keys(il.optionsAttributes))this.upgradeProperty(is(h))}if(!((i=this._mathfield)!=null&&i.model)){this._mathfield=null;return}if(Nr.has(this)){const h=this._mathfield,S=Nr.get(this),D=S.menuItems;h.model.deferNotifications({content:!1,selection:!1},()=>{const P=S.value;P!==void 0&&h.setValue(P),h.model.selection=S.selection,Nr.delete(this)}),D&&(this.menuItems=D)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Fd()}disconnectedCallback(){var t,r;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const n=Xs(this._mathfield.options,Object.keys(il.optionsAttributes).map(i=>is(i)));Nr.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(r=(t=this._mathfield.menu)==null?void 0:t.menuItems)!=null?r:void 0,options:n}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(t){if(this.hasOwnProperty(t)){const r=this[t];delete this[t],(t==="readonly"||t==="read-only")&&(t="readOnly"),this[t]=r}}attributeChangedCallback(t,r,n){if(r===n)return;const i=n!==null;switch(t){case"contenteditable":Un(this._mathfield);break;case"disabled":this.disabled=i;break;case"read-only":case"readonly":this.readOnly=i;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(t){const r=!!t;r?(this.setAttribute("readonly",""),hc()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(hc()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:r})}get disabled(){return this.hasAttribute("disabled")}set disabled(t){var r;const n=!!t;n?this.setAttribute("disabled",""):this.removeAttribute("disabled"),hc()?this._internals.ariaDisabled=n?"true":"false":this.setAttribute("aria-disabled",n?"true":"false"),n&&((r=this._mathfield)!=null&&r.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(t){this.setValue(t)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(t){this._setOptions({defaultMode:t})}get macros(){return this._getOption("macros")}set macros(t){this._setOptions({macros:t})}get registers(){const t=this;return new Proxy({},{get:(r,n)=>{if(typeof n=="string")return t._getOption("registers")[n]},set(r,n,i){return typeof n!="string"?!1:(t._setOptions({registers:v(_({},t._getOption("registers")),{[n]:i})}),!0)}})}set registers(t){this._setOptions({registers:t})}get colorMap(){return this._getOption("colorMap")}set colorMap(t){this._setOptions({colorMap:t})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(t){this._setOptions({backgroundColorMap:t})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(t){this._setOptions({letterShapeStyle:t})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(t){this._setOptions({minFontScale:t})}get smartMode(){return this._getOption("smartMode")}set smartMode(t){this._setOptions({smartMode:t})}get smartFence(){return this._getOption("smartFence")}set smartFence(t){this._setOptions({smartFence:t})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(t){this._setOptions({smartSuperscript:t})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(t){this._setOptions({scriptDepth:t})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(t){this._setOptions({removeExtraneousParentheses:t})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(t){this._setOptions({mathModeSpace:t})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(t){this._setOptions({placeholderSymbol:t})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(t){this._setOptions({popoverPolicy:t})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(t){this._setOptions({environmentPopoverPolicy:t})}get menuItems(){var t,r,n;return this._mathfield?(t=this._mathfield.menu._menuItems.map(i=>i.menuItem))!=null?t:[]:(n=(r=Nr.get(this))==null?void 0:r.menuItems)!=null?n:[]}set menuItems(t){var r;if(this._mathfield){const n=(r=this._mathfield.element)==null?void 0:r.querySelector("[part=menu-toggle]");n&&(n.style.display=t.length===0?"none":""),this._mathfield.menu.menuItems=t}Nr.has(this)?Nr.set(this,v(_({},Nr.get(this)),{menuItems:t})):Nr.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:vu(this),menuItems:t})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(t){this._setOptions({mathVirtualKeyboardPolicy:t})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(t){this._setOptions({inlineShortcuts:t})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(t){this._setOptions({inlineShortcutTimeout:t})}get keybindings(){return this._getOption("keybindings")}set keybindings(t){this._setOptions({keybindings:t})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(t){this._setOptions({onInlineShortcut:t})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(t){this._setOptions({onScrollIntoView:t})}get onExport(){return this._getOption("onExport")}set onExport(t){this._setOptions({onExport:t})}get readOnly(){return this._getOption("readOnly")}set readOnly(t){this._setOptions({readOnly:t})}get isSelectionEditable(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.isSelectionEditable)!=null?r:!1}setPromptState(t,r,n){var i;(i=this._mathfield)==null||i.setPromptState(t,r,n)}getPromptState(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.getPromptState(t))!=null?n:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(t){this._setOptions({virtualKeyboardTargetOrigin:t})}get selection(){return this._mathfield?this._mathfield.model.selection:Nr.has(this)?Nr.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(t){if(typeof t=="number"&&(t={ranges:[[t,t]]}),this._mathfield){this._mathfield.model.selection=t,Un(this._mathfield);return}if(Nr.has(this)){Nr.set(this,v(_({},Nr.get(this)),{selection:t}));return}Nr.set(this,{value:void 0,selection:t,options:vu(this),menuItems:void 0})}get selectionIsCollapsed(){const t=this.selection;return t.ranges.length===1&&t.ranges[0][0]===t.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:Nr.has(this)?Nr.get(this).selection.ranges[0][0]:0}set position(t){if(this._mathfield&&(this._mathfield.model.position=t,Un(this._mathfield)),Nr.has(this)){Nr.set(this,v(_({},Nr.get(this)),{selection:{ranges:[[t,t]]}}));return}Nr.set(this,{value:void 0,selection:{ranges:[[t,t]]},options:vu(this),menuItems:void 0})}getOffsetDepth(t){var r,n;return this._mathfield?((n=(r=this._mathfield.model.at(t))==null?void 0:r.treeDepth)!=null?n:2)-2:0}get lastOffset(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.model.lastOffset)!=null?r:-1}};zi.version="0.98.5",zi._fontsDirectory="./fonts",zi._soundsDirectory="./sounds",zi.keypressVibration=!0,zi._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},zi._plonkSound="plonk.wav",zi.audioBuffers={},zi.createHTML=e=>e,zi._speechEngineRate="100%",zi._speechEngineVoice="Joanna",zi._textToSpeechMarkup="",zi._textToSpeechRules="mathlive",zi._textToSpeechRulesOptions={},zi.speakHook=dv,zi.readAloudHook=wv,zi._decimalSeparator=".",zi.fractionNavigationOrder="numerator-denominator",zi._isFunction=e=>{var t,r;const n=window.MathfieldElement.computeEngine;return(r=(t=n==null?void 0:n.parse(e).domain)==null?void 0:t.isFunction)!=null?r:!1};var gu=zi;function is(e){return e.replace(/[^a-zA-Z\d]+(.)/g,(t,r)=>r.toUpperCase())}function vu(e){const t={readOnly:!1},r=gu.optionsAttributes;return Object.keys(r).forEach(n=>{if(e.hasAttribute(n)){const i=e.getAttribute(n);n==="placeholder"?t.contentPlaceholder=i!=null?i:"":r[n]==="boolean"?t[is(n)]=!0:r[n]==="on/off"?i==="on"?t[is(n)]=!0:i==="off"?t[is(n)]=!1:t[is(n)]=void 0:r[n]==="number"?t[is(n)]=Number.parseFloat(i!=null?i:"0"):t[is(n)]=i}}),t}function hc(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var Zp=gu,jp,Gp,qp,Xp;if(Re()&&!((jp=window.customElements)!=null&&jp.get("math-field"))){(qp=window[Gp=Symbol.for("io.cortexjs.mathlive")])!=null||(window[Gp]={});const e=window[Symbol.for("io.cortexjs.mathlive")];e.version="0.98.5",window.MathfieldElement=gu,(Xp=window.customElements)==null||Xp.define("math-field",gu)}function _v(e,t,r){let n=r,i=0;const a=e.length;for(;n<t.length;){const s=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;s==="\\"?n++:s==="{"?i++:s==="}"&&i--,n++}return-1}function c0(e,t,r,n,i="latex"){const a=[];for(const s of e)if(s.type==="text"){const u=s.data;let d=!0,p=0,h;h=u.indexOf(t),h!==-1&&(p=h,p>0&&a.push({type:"text",data:u.slice(0,p)}),d=!1);let S=!1;for(;!S;){if(d){if(h=u.indexOf(t,p),h===-1){S=!0;break}p!==h&&a.push({type:"text",data:u.slice(p,h)}),p=h}else{if(h=_v(r,u,p+t.length),h===-1){S=!0;break}let D=u.slice(p+t.length,h);i==="ascii-math"&&([,D]=Mo(D,{format:"ascii-math"})),a.push({type:"math",data:D,rawData:u.slice(p,h+r.length),mathstyle:n}),p=h+r.length}d=!d}p<u.length&&a.push({type:"text",data:u.slice(p)})}else a.push(s);return a}function Jp(e,t,r){let n=[{type:"text",data:e}];return t!=null&&t.inline&&t.inline.forEach(([i,a])=>{n=c0(n,i,a,"textstyle")}),t!=null&&t.display&&t.display.forEach(([i,a])=>{n=c0(n,i,a,"displaystyle")}),r!=null&&r.inline&&r.inline.forEach(([i,a])=>{n=c0(n,i,a,"textstyle","ascii-math")}),r!=null&&r.display&&r.display.forEach(([i,a])=>{n=c0(n,i,a,"displaystyle","ascii-math")}),n}function Mv(e,t){const r=document.createElement("span");r.setAttribute("translate","no");try{const n="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+t.renderToMathML(e)+"</math>";r.innerHTML=window.MathfieldElement.createHTML(n)}catch(n){console.error(`MathLive 0.98.5: Could not convert "${e}"' to MathML with ${n}`),r.textContent=e}return r.className="ML__sr-only",r}function Cv(e,t,r,n){try{const i=t.renderToMarkup(e,{mathstyle:r,format:"html"}),a=document.createElement("span");return a.dataset.latex=e,a.style.display=r==="displaystyle"?"flex":"inline-flex",a.setAttribute("aria-hidden","true"),a.setAttribute("translate","no"),a.innerHTML=window.MathfieldElement.createHTML(i),a}catch(i){if(console.error("Could not parse'"+e+"' with ",i),n)return document.createTextNode(e)}return null}function mc(e,t,r,n){var i;const a=Cv(e,r,t||"textstyle",n),s=(i=r.renderAccessibleContent)!=null?i:"";if(a&&/\b(mathml|speakable-text)\b/i.test(s)){const u=document.createElement("span");if(/\bmathml\b/i.test(s)&&r.renderToMathML&&u.append(Mv(e,r)),/\bspeakable-text\b/i.test(s)&&r.renderToSpeakableText){const d=document.createElement("span");d.setAttribute("translate","no");const p=r.renderToSpeakableText(e);d.innerHTML=window.MathfieldElement.createHTML(p),d.className="ML__sr-only",u.append(d)}return u.append(a),u}return a}function Ev(e,t){var r,n,i;let a=null;if((r=t.TeX)!=null&&r.processEnvironments&&/^\s*\\begin/.test(e)){a=document.createDocumentFragment();const s=mc(e,"",t,!0);s&&a.appendChild(s)}else{if(!e.trim())return null;const s=Jp(e,(n=t.TeX)==null?void 0:n.delimiters,(i=t.asciiMath)==null?void 0:i.delimiters);if(s.length===1&&s[0].type==="text")return null;a=document.createDocumentFragment();for(const u of s)if(u.type==="text")a.appendChild(document.createTextNode(u.data));else{const d=mc(u.data,u.mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);d&&a.appendChild(d)}}return a}function Yp(e,t){var r,n,i,a,s,u,d,p,h,S,D,P,O,de,Ve,se;if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const ke=(r=e.childNodes[0].textContent)!=null?r:"";if((n=t.TeX)!=null&&n.processEnvironments&&/^\s*\\begin/.test(ke)){e.textContent="";const $e=mc(ke,"",t,!0);$e&&e.append($e);return}const Xe=Jp(ke,(i=t.TeX)==null?void 0:i.delimiters,(a=t.asciiMath)==null?void 0:a.delimiters);if(Xe.length===1&&Xe[0].type==="math"){e.textContent="";const $e=mc(Xe[0].data,Xe[0].mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);$e&&e.append($e);return}if(Xe.length===1&&Xe[0].type==="text")return}for(let ke=e.childNodes.length-1;ke>=0;ke--){const Xe=e.childNodes[ke];if(Xe.nodeType===3){const $e=Ev((s=Xe.textContent)!=null?s:"",t);$e&&(ke+=$e.childNodes.length-1,Xe.replaceWith($e))}else if(Xe.nodeType===1){const $e=Xe,St=Xe.nodeName.toLowerCase();if(St==="script"){const Kt=Xe;let Tt;if((u=t.processScriptTypePattern)!=null&&u.test(Kt.type))Tt=(d=Kt.textContent)!=null?d:"";else if((p=t.processMathJSONScriptTypePattern)!=null&&p.test(Kt.type))try{Tt=(S=t.serializeToLatex)==null?void 0:S.call(t,JSON.parse((h=Kt.textContent)!=null?h:""))}catch(kr){console.error(kr)}if(Tt){let kr="textstyle";for(const it of Kt.type.split(";")){const[ja,Oo]=it.toLowerCase().split("=");ja.trim()==="mode"&&(kr=Oo.trim()==="display"?"displaystyle":"textstyle")}const en=mc(Tt,kr,t,!0);en&&Kt.parentNode.replaceChild(en,Kt)}}else if(((P=(D=t.processClassPattern)==null?void 0:D.test($e.className))!=null?P:!1)||!((de=(O=t.skipTags)==null?void 0:O.includes(St))!=null&&de||(se=(Ve=t.ignoreClassPattern)==null?void 0:Ve.test($e.className))!=null&&se))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const Tt=e.textContent;e.textContent="";const kr=mc(Tt!=null?Tt:"","displaystyle",t,!0);kr&&e.append(kr)}else Yp($e,t)}}}var kv={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function Av(e,t){var r,n,i,a;try{const s=_(_({},kv),t);s.ignoreClassPattern=new RegExp((r=s.ignoreClass)!=null?r:""),s.processClassPattern=new RegExp((n=s.processClass)!=null?n:""),s.processScriptTypePattern=new RegExp((i=s.processScriptType)!=null?i:""),s.processMathJSONScriptTypePattern=new RegExp((a=s.processMathJSONScriptType)!=null?a:""),Fd(),Ha("core"),Yp(e,s)}catch(s){s instanceof Error?console.error("renderMathInElement(): "+s.message):console.error("renderMathInElement(): Could not render math for element",e)}}function Dv(e,t){const r=Ss.singleton;return r?(r.show(),au(),r.currentLayer=t,r.render(),r.focus(),!0):!1}function Lv(){const e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1}Oa({switchKeyboardLayer:Dv,toggleVirtualKeyboard:Lv,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function Cs(){var e,t;return(t=globalThis[e=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[e]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function Rv(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function Ov(e){Bv(document.body,e)}function Iv(e){if(typeof e=="string"){const t=document.getElementById(e);if(t===null)throw new Error(`The element with ID "${e}" could not be found.`);return t}return typeof e=="string"?null:e}function Bv(e,t){var r,n,i,a;const s=Iv(e);if(!s)return;const u=t!=null?t:{};(r=u.renderToMarkup)!=null||(u.renderToMarkup=Ei),(n=u.renderToMathML)!=null||(u.renderToMathML=Vg),(i=u.renderToSpeakableText)!=null||(u.renderToSpeakableText=Ug),(a=u.serializeToLatex)!=null||(u.serializeToLatex=Zg),Av(s,u)}var Nv={mathlive:"0.98.5"}}}]);
|
|
|
}()); |