formula-composer 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +122 -2
- package/angular/esm2020/formula-composer-tinymce-angular.mjs +4 -0
- package/angular/esm2020/lib/formula-composer.directive.mjs +52 -0
- package/angular/esm2020/lib/formula-composer.module.mjs +21 -0
- package/angular/esm2020/lib/init.mjs +9 -0
- package/angular/esm2020/lib/provide.mjs +11 -0
- package/angular/esm2020/public-api.mjs +8 -0
- package/angular/fesm2015/formula-composer-tinymce-angular.mjs +99 -0
- package/angular/fesm2020/formula-composer-tinymce-angular.mjs +101 -0
- package/angular/formula-composer-tinymce-angular.d.ts +5 -0
- package/angular/lib/formula-composer.directive.d.ts +22 -0
- package/angular/lib/formula-composer.module.d.ts +15 -0
- package/angular/lib/init.d.ts +23 -0
- package/angular/lib/provide.d.ts +10 -0
- package/angular/package.json +10 -0
- package/angular/public-api.d.ts +5 -0
- package/dist/editor-ui/catalog-types.d.ts +30 -0
- package/dist/editor-ui/catalog.generated.d.ts +2 -0
- package/dist/editor-ui/commands.d.ts +44 -0
- package/dist/editor-ui/dom.d.ts +8 -0
- package/dist/editor-ui/editor.d.ts +86 -0
- package/dist/editor-ui/icons.d.ts +5 -0
- package/dist/editor-ui/index.d.ts +9 -0
- package/dist/editor-ui/index.js +119 -0
- package/dist/editor-ui/modal.d.ts +81 -0
- package/dist/editor-ui/periodic.d.ts +8 -0
- package/dist/editor-ui/pickers.d.ts +23 -0
- package/dist/editor-ui/popover.d.ts +24 -0
- package/dist/editor-ui/special-chars.generated.d.ts +10 -0
- package/dist/editor-ui/strings.d.ts +48 -0
- package/dist/editor-ui/styles.d.ts +3 -0
- package/dist/editor-ui/toolbar.d.ts +47 -0
- package/dist/integration/content.d.ts +52 -0
- package/dist/integration/controller.d.ts +76 -0
- package/dist/integration/index.d.ts +3 -0
- package/dist/integration/index.js +1 -0
- package/dist/integration/options.d.ts +46 -0
- package/dist/math-core/a11y.d.ts +3 -0
- package/dist/math-core/caret-speech.d.ts +3 -0
- package/dist/math-core/editor.d.ts +212 -0
- package/dist/math-core/functions.d.ts +8 -0
- package/dist/math-core/history.d.ts +16 -0
- package/dist/math-core/index.d.ts +17 -0
- package/dist/math-core/index.js +3 -0
- package/dist/math-core/latex/parse.d.ts +11 -0
- package/dist/math-core/latex/serialize.d.ts +4 -0
- package/dist/math-core/latex/symbols.d.ts +32 -0
- package/dist/math-core/mathml.d.ts +33 -0
- package/dist/math-core/model.d.ts +69 -0
- package/dist/math-core/safe-xml.d.ts +7 -0
- package/dist/math-core/sanitize.d.ts +6 -0
- package/dist/math-core/tree-index.d.ts +26 -0
- package/dist/math-core/xml.d.ts +21 -0
- package/dist/renderer/alphanumerics.d.ts +3 -0
- package/dist/renderer/attributes.d.ts +10 -0
- package/dist/renderer/core.d.ts +13 -0
- package/dist/renderer/image.d.ts +29 -0
- package/dist/renderer/index.d.ts +22 -0
- package/dist/renderer/index.js +9 -0
- package/dist/renderer/layout.d.ts +14 -0
- package/dist/renderer/styles.d.ts +9 -0
- package/dist/renderer/view.d.ts +30 -0
- package/dist/renderer/vnode.d.ts +25 -0
- package/dist/tinymce/browser/plugin.min.js +129 -0
- package/dist/tinymce/compat.d.ts +24 -0
- package/dist/tinymce/index.d.ts +5 -0
- package/dist/tinymce/index.js +1 -0
- package/dist/tinymce/init.d.ts +22 -0
- package/dist/tinymce/plugin.d.ts +30 -0
- package/dist/tinymce/tinymce-types.d.ts +127 -0
- package/dist/tinymce-react/editor.d.ts +19 -0
- package/dist/tinymce-react/index.d.ts +3 -0
- package/dist/tinymce-react/index.js +1 -0
- package/dist/tinymce-react/init.d.ts +23 -0
- package/editor-ui/package.json +6 -0
- package/images/edit-formula.png +0 -0
- package/images/editor-content.png +0 -0
- package/integration/package.json +6 -0
- package/math-core/package.json +6 -0
- package/package.json +101 -4
- package/react/package.json +6 -0
- package/renderer/package.json +6 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";(()=>{var Bl=Object.defineProperty;var Al=(e,t,i)=>t in e?Bl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var p=(e,t,i)=>Al(e,typeof t!="symbol"?t+"":t,i);var io=1;function Lt(){return io+=1,io}function k(e=[],t="mrow",i={}){return{kind:"row",id:Lt(),tag:t,attrs:{...i},children:e}}function v(e,t,i={}){return{kind:"token",id:Lt(),tag:e,attrs:{...i},text:t}}function F(e,t={}){return{kind:"leaf",id:Lt(),tag:e,attrs:{...t}}}function T(e,t,i={}){return{kind:"element",id:Lt(),tag:e,attrs:{...i},children:t}}function oo(){return{attrs:{},root:k()}}function gt(e,t=!1){let i=t?Lt():e.id;switch(e.kind){case"row":{let o={...e,id:i,attrs:{...e.attrs},children:e.children.map(n=>gt(n,t))};return e.tokenHint&&(o.tokenHint={tag:e.tokenHint.tag,attrs:{...e.tokenHint.attrs}}),o}case"token":case"leaf":return{...e,id:i,attrs:{...e.attrs}};case"element":return{...e,id:i,attrs:{...e.attrs},children:e.children.map(o=>gt(o,t))}}}function It(e,t=!1){return{attrs:{...e.attrs},root:gt(e.root,t)}}var ni=new Set(["mrow","msqrt","mstyle","menclose","mphantom","mpadded","merror","mtd","maction","mscarry"]),no={mfrac:2,mroot:2,msub:2,msup:2,msubsup:3,munder:2,mover:2,munderover:3,mfenced:1,msqrt:1,mstyle:1,menclose:1,mphantom:1,mpadded:1,merror:1,mtd:1,maction:1};function ri(e,t,i=null){if(t(e,i)!==!1&&(e.kind==="row"||e.kind==="element"))for(let o of e.children)ri(o,t,e)}var _=class extends Error{constructor(i,o){super(`${i} at ${o}`);p(this,"position",o);this.name="XmlParseError"}},Sl={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0",InvisibleTimes:"\u2062",ApplyFunction:"\u2061",InvisibleComma:"\u2063",it:"\u2062",af:"\u2061",ic:"\u2063",minus:"\u2212",plus:"+",times:"\xD7",divide:"\xF7",PlusMinus:"\xB1",pm:"\xB1",infin:"\u221E",int:"\u222B",sum:"\u2211",prod:"\u220F",rarr:"\u2192",larr:"\u2190",le:"\u2264",ge:"\u2265",ne:"\u2260",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",pi:"\u03C0",theta:"\u03B8",lambda:"\u03BB",mu:"\u03BC",sigma:"\u03C3",omega:"\u03C9",middot:"\xB7",sdot:"\u22C5",deg:"\xB0",ThinSpace:"\u2009",VeryThinSpace:"\u200A",NegativeThinSpace:"\u200B",laquo:"\xAB",raquo:"\xBB",uml:"\xA8",sect:"\xA7"};function ro(e){return e.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[A-Za-z][A-Za-z0-9]*);/g,(t,i)=>{if(i.startsWith("#x")||i.startsWith("#X")){let o=Number.parseInt(i.slice(2),16);return Number.isFinite(o)?String.fromCodePoint(o):t}if(i.startsWith("#")){let o=Number.parseInt(i.slice(1),10);return Number.isFinite(o)?String.fromCodePoint(o):t}return Sl[i]??t})}var Ml=127;function nt(e,t=!1){let i="";for(let o of e){let n=o.codePointAt(0)??0;o==="&"?i+="&":o==="<"?i+="<":o===">"?i+=">":t&&o==='"'?i+=""":n>Ml?i+=`&#x${n.toString(16).toUpperCase()};`:i+=o}return i}var li=/[A-Za-z_:][-A-Za-z0-9_:.]*/y,si=/\s*/y;function lo(e){let t=0,i=e.length,o=()=>{si.lastIndex=t,si.exec(e),t=si.lastIndex},n=()=>{li.lastIndex=t;let a=li.exec(e);if(!a)throw new _("Expected name",t);return t=li.lastIndex,a[0]},r=a=>{let m=a.indexOf(":");return m>=0?a.slice(m+1):a},l=a=>{let m=[];for(;t<i;){if(e.startsWith("</",t)){t+=2;let u=r(n());if(o(),e[t]!==">")throw new _("Expected >",t);if(t+=1,a===null||u!==a)throw new _(`Unexpected closing tag ${u}`,t);return m}if(e.startsWith("<!--",t)){let u=e.indexOf("-->",t+4);if(u<0)throw new _("Unterminated comment",t);t=u+3;continue}if(e.startsWith("<![CDATA[",t)){let u=e.indexOf("]]>",t+9);if(u<0)throw new _("Unterminated CDATA",t);m.push({type:"text",text:e.slice(t+9,u)}),t=u+3;continue}if(e.startsWith("<?",t)||e.startsWith("<!",t)){let u=e.indexOf(">",t);if(u<0)throw new _("Unterminated declaration",t);t=u+1;continue}if(e[t]==="<"){t+=1;let u=r(n()),f={};for(;;){o();let b=e[t];if(b==="/"&&e[t+1]===">"){t+=2,m.push({type:"element",name:u,attrs:f,children:[]});break}if(b===">"){t+=1;let X=l(u);m.push({type:"element",name:u,attrs:f,children:X});break}if(t>=i)throw new _("Unterminated tag",t);let h=n();if(o(),e[t]!=="="){f[h]="";continue}t+=1,o();let w=e[t];if(w!=='"'&&w!=="'")throw new _("Expected quoted attribute value",t);let x=e.indexOf(w,t+1);if(x<0)throw new _("Unterminated attribute value",t);f[h]=ro(e.slice(t+1,x)),t=x+1}continue}let d=e.indexOf("<",t),c=d<0?i:d;m.push({type:"text",text:ro(e.slice(t,c))}),t=c}if(a!==null)throw new _(`Missing closing tag ${a}`,t);return m};return l(null).filter(a=>a.type==="element")}function te(e){return e.type==="text"?e.text:e.children.map(te).join("")}var so=[["<","\xAB"],[">","\xBB"],['"',"\xA8"],["&","\xA7"],["'","`"]],Nl=/[\u00AB\u00BB\u00A8\u00A7`]/;function ao(e){return e.trimStart().startsWith("\xABmath")}function Xt(e){let t=e;Nl.test(t)&&(t=t.replace(/[\u00AB\u00BB\u00A8\u00A7`]/g,i=>`&#x${(i.codePointAt(0)??0).toString(16).toUpperCase()};`));for(let[i,o]of so)t=t.split(i).join(o);return t}function mo(e){let t=e;for(let[i,o]of so)t=t.split(o).join(i);return t}var Gt={alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03F5",varepsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",vartheta:"\u03D1",iota:"\u03B9",kappa:"\u03BA",varkappa:"\u03F0",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",varpi:"\u03D6",rho:"\u03C1",varrho:"\u03F1",sigma:"\u03C3",varsigma:"\u03C2",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03D5",varphi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",Gamma:"\u0393",Delta:"\u0394",Theta:"\u0398",Lambda:"\u039B",Xi:"\u039E",Pi:"\u03A0",Sigma:"\u03A3",Upsilon:"\u03A5",Phi:"\u03A6",Psi:"\u03A8",Omega:"\u03A9",Alpha:"A",Beta:"B",Epsilon:"E",Zeta:"Z",Eta:"H",Iota:"I",Kappa:"K",Mu:"M",Nu:"N",Omicron:"O",Rho:"P",Tau:"T",Chi:"X",digamma:"\u03DD",aleph:"\u2135",beth:"\u2136",gimel:"\u2137",hbar:"\u210F",hslash:"\u210F",ell:"\u2113",wp:"\u2118",imath:"\u0131",jmath:"\u0237",i:"\u0131"},mi={infty:"\u221E",partial:"\u2202",nabla:"\u2207",emptyset:"\u2205",varnothing:"\u2205",pm:"\xB1",mp:"\u2213",times:"\xD7",div:"\xF7",cdot:"\xB7",ast:"\u2217",star:"\u22C6",circ:"\u2218",bullet:"\u2022",cap:"\u2229",cup:"\u222A",setminus:"\u2216",smallsetminus:"\u2216",wedge:"\u2227",land:"\u2227",vee:"\u2228",lor:"\u2228",oplus:"\u2295",ominus:"\u2296",otimes:"\u2297",oslash:"\u2298",odot:"\u2299",uplus:"\u228E",sqcap:"\u2293",sqcup:"\u2294",triangleleft:"\u25C1",triangleright:"\u25B7",dagger:"\u2020",ddagger:"\u2021",amalg:"\u2A3F",diamond:"\u22C4",bigtriangleup:"\u25B3",bigtriangledown:"\u25BD",wr:"\u2240",boxplus:"\u229E",boxminus:"\u229F",boxtimes:"\u22A0",centerdot:"\u22C5",leq:"\u2264",le:"\u2264",geq:"\u2265",ge:"\u2265",neq:"\u2260",ne:"\u2260",equiv:"\u2261",approx:"\u2248",sim:"\u223C",simeq:"\u2243",cong:"\u2245",propto:"\u221D",ll:"\u226A",gg:"\u226B",subset:"\u2282",supset:"\u2283",subseteq:"\u2286",supseteq:"\u2287",subsetneq:"\u228A",supsetneq:"\u228B",nsubseteq:"\u2288",nsupseteq:"\u2289",sqsubset:"\u228F",sqsupset:"\u2290",sqsubseteq:"\u2291",sqsupseteq:"\u2292",in:"\u2208",notin:"\u2209",ni:"\u220B",owns:"\u220B",perp:"\u22A5",parallel:"\u2225",nparallel:"\u2226",mid:"\u2223",nmid:"\u2224",models:"\u22A8",vdash:"\u22A2",dashv:"\u22A3",prec:"\u227A",succ:"\u227B",preceq:"\u2AAF",succeq:"\u2AB0",doteq:"\u2250",asymp:"\u224D",bowtie:"\u22C8",lessgtr:"\u2276",leqslant:"\u2A7D",geqslant:"\u2A7E",lesssim:"\u2272",gtrsim:"\u2273",nless:"\u226E",ngtr:"\u226F",nleq:"\u2270",ngeq:"\u2271",ncong:"\u2247",nsim:"\u2241",approxeq:"\u224A",triangleq:"\u225C",to:"\u2192",rightarrow:"\u2192",leftarrow:"\u2190",gets:"\u2190",leftrightarrow:"\u2194",Rightarrow:"\u21D2",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",uparrow:"\u2191",downarrow:"\u2193",updownarrow:"\u2195",Uparrow:"\u21D1",Downarrow:"\u21D3",Updownarrow:"\u21D5",mapsto:"\u21A6",longrightarrow:"\u27F6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",Longrightarrow:"\u27F9",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",iff:"\u21D4",implies:"\u21D2",impliedby:"\u21D0",longmapsto:"\u27FC",nearrow:"\u2197",searrow:"\u2198",swarrow:"\u2199",nwarrow:"\u2196",hookrightarrow:"\u21AA",hookleftarrow:"\u21A9",rightleftharpoons:"\u21CC",leftrightharpoons:"\u21CB",rightharpoonup:"\u21C0",rightharpoondown:"\u21C1",leftharpoonup:"\u21BC",leftharpoondown:"\u21BD",rightleftarrows:"\u21C4",leftrightarrows:"\u21C6",twoheadrightarrow:"\u21A0",curvearrowright:"\u21B7",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",forall:"\u2200",exists:"\u2203",nexists:"\u2204",neg:"\xAC",lnot:"\xAC",angle:"\u2220",measuredangle:"\u2221",sphericalangle:"\u2222",triangle:"\u2206",square:"\u25A1",Box:"\u25A1",prime:"'",Re:"\u211C",Im:"\u2111",therefore:"\u2234",because:"\u2235",ldots:"\u2026",dots:"\u2026",cdots:"\u22EF",vdots:"\u22EE",ddots:"\u22F1",degree:"\xB0",top:"\u22A4",bot:"\u22A5",surd:"\u221A",complement:"\u2201",clubsuit:"\u2663",diamondsuit:"\u2662",heartsuit:"\u2661",spadesuit:"\u2660",flat:"\u266D",natural:"\u266E",sharp:"\u266F",checkmark:"\u2713",S:"\xA7",P:"\xB6",colon:":",vert:"|",Vert:"\u2016",Arrowvert:"\u2016",lbrace:"{",rbrace:"}",lbrack:"[",rbrack:"]",langle:"\u27E8",rangle:"\u27E9",lfloor:"\u230A",rfloor:"\u230B",lceil:"\u2308",rceil:"\u2309",lvert:"|",rvert:"|",lVert:"\u2016",rVert:"\u2016",backslash:"\\","|":"\u2016","{":"{","}":"}","#":"#",$:"$","%":"%","&":"&",_:"_"},ee={sum:"\u2211",prod:"\u220F",coprod:"\u2210",bigcup:"\u22C3",bigcap:"\u22C2",bigvee:"\u22C1",bigwedge:"\u22C0",bigoplus:"\u2A01",bigotimes:"\u2A02",bigodot:"\u2A00",biguplus:"\u2A04",bigsqcup:"\u2A06",int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230"},ie={bigcup:"\u222A",bigcap:"\u2229"},bt={B:"\u212C",E:"\u2130",F:"\u2131",H:"\u210B",I:"\u2110",L:"\u2112",M:"\u2133",R:"\u211B"},co=new Set(["\u222B","\u222C","\u222D","\u222E","\u222F","\u2230","\u2232","\u2233"]),uo=new Set(Object.values(ee).filter(e=>!co.has(e))),oe=["sin","cos","tan","cot","sec","csc","sinh","cosh","tanh","coth","arcsin","arccos","arctan","log","ln","lg","exp","lim","limsup","liminf","max","min","sup","inf","det","gcd","Pr","deg","dim","ker","hom","arg"],po=new Set(["lim","limsup","liminf","max","min","sup","inf","det","gcd","Pr"]),ne={",":{char:"\u200A"},":":{char:"\u2009"},">":{char:"\u2009"},";":{char:"\xA0"}," ":{char:"\xA0"},quad:{char:"\xA0\xA0"},qquad:{char:"\xA0\xA0\xA0\xA0"},"!":{width:"-0.2em"},enspace:{char:"\u2002"},thinspace:{char:"\u2009"}},re={hat:"^",widehat:"^",check:"\u02C7",tilde:"~",widetilde:"~",acute:"\xB4",grave:"`",dot:"\u02D9",ddot:"\u2025",dddot:"\u20DB",breve:"\u02D8",bar:"\xAF",vec:"\u2192",mathring:"\u02DA"},ho=new Set(["vec"]),le={overline:"\xAF",overrightarrow:"\u2192",overleftarrow:"\u2190",overleftrightarrow:"\u2194",overbrace:"\u23DE",overparen:"\u23DC"},se={underline:"\xAF",underbrace:"\u23DF",underparen:"\u23DD",underrightarrow:"\u2192",underleftarrow:"\u2190"},ae={mathbf:"bold",mathit:"italic",mathrm:"normal",mathbb:"double-struck",mathcal:"script",mathscr:"script",mathfrak:"fraktur",mathsf:"sans-serif",mathtt:"monospace",boldsymbol:"bold-italic",bm:"bold-italic",textbf:"bold",textit:"italic",textrm:"normal",textsf:"sans-serif",texttt:"monospace",mathbfit:"bold-italic",mathsfit:"sans-serif-italic"},Dt={C:"\u2102",H:"\u210D",N:"\u2115",P:"\u2119",Q:"\u211A",R:"\u211D",Z:"\u2124"},fo={"(":"(",")":")","[":"[","]":"]","\\{":"{","\\}":"}","|":"|","\\|":"||",".":"","\\langle":"<","\\rangle":">","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309","\\vert":"|","\\Vert":"||","\\lvert":"|","\\rvert":"|","\\lVert":"||","\\rVert":"||","<":"<",">":">","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\llbracket":"\u27E6","\\rrbracket":"\u27E7","/":"/","\\backslash":"\\"},me={black:"#000000",white:"#FFFFFF",red:"#FF0000",green:"#00FF00",blue:"#0000FF",cyan:"#00FFFF",magenta:"#FF00FF",yellow:"#FFFF00",gray:"#808080",grey:"#808080",orange:"#FF8000",purple:"#800080",brown:"#A52A2A",pink:"#FFC0CB",lime:"#BFFF00",olive:"#808000",teal:"#008080",violet:"#800080",darkgray:"#404040",lightgray:"#BFBFBF"};function ai(e){let t=new Map;for(let[i,o]of Object.entries(e))o.length>0&&!t.has(o)&&/^[A-Za-z]+$/.test(i)&&t.set(o,i);return t}var Ft=(()=>{let e=ai(Gt);for(let[t,i]of ai(ee))e.has(t)||e.set(t,i);for(let[t,i]of ai(mi))e.has(t)||e.set(t,i);for(let t of["A","B","E","Z","H","I","K","M","N","O","P","T","X",":","'"])e.delete(t);return e.set("|","vert"),e.set("[","lbrack"),e.set("]","rbrack"),e.set("\u2016","Arrowvert"),e.set("\u210F","hslash"),e.set("\u0131","i"),e.set("\u2209","not\\in"),e.set("\u2192","rightarrow"),e.set("\u2190","leftarrow"),e.set("\u2264","leq"),e.set("\u2265","geq"),e.set("\u2260","neq"),e.set("\xAC","neg"),e.set("\u2205","varnothing"),e.set("\u2227","wedge"),e.set("\u2228","vee"),e.set("\u220B","ni"),e.set("\u27FA","Longleftrightarrow"),e.set("\u27F9","Longrightarrow"),e.set("\u27F8","Longleftarrow"),e.set("\u2026","dots"),e.set("\xA7","S"),e})();var O="http://www.w3.org/1998/Math/MathML",wo=new Set(["mi","mn","mo","mtext","ms"]),Ll=new Set(["mspace","none","mprescripts","msline","malignmark","maligngroup","mglyph"]),To=new Set(["mn","mtext"]),ui=new Set(["mstack","mlongdiv","msgroup","mscarries"]),Il=new Set(["mtr","mlabeledtr"]),ko=/^[ \t\n\r]+|[ \t\n\r]+$/g,di=2,Ot="mathsize",Xl={"\u223C":"~","\u2025":"\xA8"},Gl={...Object.fromEntries(Object.entries(bt).map(([e,t])=>[t,{base:e,variant:"script"}])),\u211C:{base:"R",variant:"fraktur"},\u2111:{base:"I",variant:"fraktur"}},ci=class extends Error{constructor(t){super(t),this.name="MathMLParseError"}};function z(e){return e.children.filter(t=>t.type==="element")}function yo(e){return te(e).replace(ko,"")}function Dl(e){if(e.type!=="text")return[];let t=e.text.replace(ko,"");return t?[...t].map(i=>v("mtext",i)):[]}function Fl(e){let t=e.name,i=yo(e);return To.has(t)&&i.length>0?[...i].map(o=>v(t,o,e.attrs)):[v(t,i,e.attrs)]}function go(e){let t=e.mathcolor?me[e.mathcolor.toLowerCase()]:void 0;t&&(e.mathcolor=t)}function xo(e){let t=i=>{if(i.kind==="token"){if(go(i.attrs),i.tag!=="mo")return;let o=Gl[i.text];o&&!i.attrs.mathvariant?(i.text=o.base,i.attrs.mathvariant=o.variant):i.text=Xl[i.text]??i.text;return}if(i.kind!=="leaf"){i.kind==="element"&&go(i.attrs);for(let o of i.children)t(o)}};t(e.root),Ol(e)}function Ol(e){let t=e.root.children.length===1?e.root.children[0]:void 0;if(t?.kind!=="element"||t.tag!=="mstyle"||e.attrs[Ot]!==void 0)return;let i=t.attrs[Ot],o=t.children[0];i===void 0||Object.keys(t.attrs).length!==1||t.children.length!==1||o?.kind!=="row"||(e.attrs[Ot]=i,e.root.children=o.children)}function _l(e){if(!wo.has(e.name)||yo(e)!=="")return null;let t=k();return t.tokenHint={tag:e.name,attrs:{...e.attrs}},t}var ce=null;function vo(e){return e.name==="maction"&&e.attrs.actiontype==="argument"}function Q(e){if(e.name==="mrow"&&Object.keys(e.attrs).length===0)return k(H(e.children));if(vo(e)){let i=z(e),o=i[0],n=i.length===1&&o?Q(o):k(H(e.children));return ce?.add(n.id),n}if(e.name==="none")return k();let t=_l(e);return t||k(lt(e))}function Kl(e,t){let i=z(e),o=[];for(let r=0;r<t;r+=1){let l=i[r];o.push(l?Q(l):k())}let n=o[t-1];if(n&&i.length>t)for(let r of i.slice(t))n.children.push(...lt(r));return T(e.name,o,e.attrs)}function de(e){return T(e.name,[k(H(e.children))],e.attrs)}function Pl(e){let t=z(e),i={...e.attrs};if(t.length<=1){let r=t[0];return T("mfenced",[r?Q(r):k()],i)}let o=(i.separators??",").replace(/\s+/g,""),n=[];return t.forEach((r,l)=>{if(l>0&&o.length>0){let s=o[Math.min(l-1,o.length-1)]??",";n.push(v("mo",s))}n.push(...lt(r))}),delete i.separators,T("mfenced",[k(n)],i)}function $l(e){let t=[];for(let i of z(e))if(Il.has(i.name)){let o=z(i).map(n=>n.name==="mtd"?de(n):T("mtd",[k(lt(n))]));t.push(T(i.name,o,i.attrs))}else t.push(T("mtr",[T("mtd",[k(lt(i))])]));return T("mtable",t,e.attrs)}function bo(e){return e.name==="msrow"?k(H(e.children),"msrow",e.attrs):e.name==="mscarry"?k(H(e.children),"mscarry",e.attrs):e.name==="msline"?F("msline",e.attrs):e.name==="none"?F("none",e.attrs):ui.has(e.name)?Ro(e):Q(e)}function Ro(e){let t=z(e);if(e.name==="mlongdiv"){let i=t.slice(0,di).map(Q);for(;i.length<di;)i.push(k());return T("mlongdiv",[...i,...t.slice(di).map(bo)],e.attrs)}return T(e.name,t.map(bo),e.attrs)}function Hl(e){let t=z(e).map(i=>i.name==="mprescripts"||i.name==="none"?F(i.name==="none"?"none":"mprescripts"):Q(i));return t.length===0&&t.push(k()),T("mmultiscripts",t,e.attrs)}function lt(e){let t=e.name;if(wo.has(t))return Fl(e);if(Ll.has(t))return[F(t,e.attrs)];if(t==="mrow"){if(Object.keys(e.attrs).length>0)return[de(e)];let o=H(e.children);return o.length>0?o:[T("mrow",[k()])]}if(t==="semantics"){let o=z(e).find(n=>n.name!=="annotation"&&n.name!=="annotation-xml");return o?lt(o):[]}if(t==="annotation"||t==="annotation-xml")return[];if(t==="maction"){if(vo(e)){if(!ce)return H(e.children);let n=Q(e);return[T("mrow",[n])]}let o=z(e)[0];return[T("maction",[o?Q(o):k()],e.attrs)]}if(t==="mfenced")return[Pl(e)];if(t==="mtable")return[$l(e)];if(t==="mmultiscripts")return[Hl(e)];if(ui.has(t))return[Ro(e)];if(ni.has(t))return[de(e)];let i=no[t];return i!==void 0?[Kl(e,i)]:t==="math"?H(e.children):[de(e)]}function zl(e){let t=e&&Co(e)?e.children[0]:void 0;return t?.kind==="row"&&t.children.length===0}function H(e){let t=[];for(let i of e)i.type==="text"?t.push(...Dl(i)):t.push(...lt(i));return t.length===1&&zl(t[0])?[]:t}function Eo(e){if(e.name==="annotation"&&(e.attrs.encoding??"").toLowerCase()==="latex")return te(e).trim();for(let t of z(e)){let i=Eo(t);if(i!==null)return i}return null}function K(e,t={}){ce=t.argumentRows??null;try{return Ul(e)}finally{ce=null}}function Ul(e){let t=ao(e)?mo(e):e,i;try{i=lo(t.trim())}catch(r){throw new ci(r instanceof Error?r.message:"Invalid MathML")}let o=i.find(r=>r.name==="math");if(!o)return i.length===0?{doc:{attrs:{},root:k()},latex:null}:{doc:{attrs:{},root:k(H(i))},latex:null};let n={};for(let[r,l]of Object.entries(o.attrs))r!=="xmlns"&&!r.startsWith("xmlns:")&&(n[r]=l);return{doc:{attrs:n,root:k(H(o.children))},latex:Eo(o)}}function Z(e){return Object.entries(e).map(([t,i])=>` ${t}="${nt(i,!0)}"`).join("")}function Vl(e,t){let i=Object.keys(e),o=Object.keys(t);return i.length===o.length&&i.every(n=>e[n]===t[n])}function Co(e){return e.kind==="element"&&e.tag==="mrow"&&Object.keys(e.attrs).length===0}function Bo(e){let t=[];for(let i of e){let o=Co(i)?i.children[0]:void 0;o?.kind==="row"&&o.children.length>0?t.push(...Bo(o.children)):t.push(i)}return t}function I(e){let t=[];for(let i of Bo(e)){let o=t[t.length-1];i.kind==="token"&&o?.kind==="token"&&To.has(i.tag)&&o.tag===i.tag&&Vl(o.attrs,i.attrs)?t[t.length-1]={...o,text:o.text+i.text}:t.push(i)}return t}function ql(e){return`<${e.tag}${Z(e.attrs)}>${nt(e.text)}</${e.tag}>`}function pi(e){return I(e.children).map(he).join("")}function ue(e){if(e.children.length===0&&e.tokenHint)return`<${e.tokenHint.tag}${Z(e.tokenHint.attrs)}></${e.tokenHint.tag}>`;let t=I(e.children),i=Object.keys(e.attrs).length>0;if(t.length===0)return`<mrow${Z(e.attrs)}/>`;let o=t[0];return t.length===1&&o&&!i?he(o):`<mrow${Z(e.attrs)}>${t.map(he).join("")}</mrow>`}function rt(e,t,i){return i?`<${e}${Z(t)}>${i}</${e}>`:`<${e}${Z(t)}/>`}function Yl(e){return e.kind==="row"?e.tag==="msrow"&&Object.keys(e.attrs).length===0&&I(e.children).length===1?ue(e):e.tag==="msrow"||e.tag==="mscarry"?rt(e.tag,e.attrs,pi(e)):ue(e):e.kind==="leaf"?pe(e):_t(e)}function pe(e){return`<${e.tag}${Z(e.attrs)}/>`}function _t(e){let{tag:t,attrs:i,children:o}=e;if(ni.has(t)){let r=o[0],l=r?.kind==="row"?pi(r):"";return rt(t,i,l)}if(t==="mtable"||t==="mtr"||t==="mlabeledtr")return rt(t,i,o.map(r=>r.kind==="element"?_t(r):"").join(""));if(ui.has(t))return rt(t,i,o.map(Yl).join(""));if(t==="mmultiscripts")return rt(t,i,o.map(r=>r.kind==="row"?ue(r):r.kind==="leaf"?pe(r):_t(r)).join(""));let n=o.map(r=>r.kind==="row"?ue(r):r.kind==="leaf"?pe(r):_t(r)).join("");return rt(t,i,n)}function he(e){switch(e.kind){case"token":return ql(e);case"leaf":return pe(e);case"element":return _t(e)}}function q(e,t={}){let{[Ot]:i,...o}=e.attrs,n=Z(o),r=pi(e.root),l=i!==void 0&&r?rt("mstyle",{[Ot]:i},r):r;return t.latexAnnotation!==void 0?`<math${n} xmlns="${O}"><semantics><mrow>${l}</mrow><annotation encoding="LaTeX">${nt(t.latexAnnotation)}</annotation></semantics></math>`:l?`<math${n} xmlns="${O}">${l}</math>`:`<math${n} xmlns="${O}"/>`}function Ao(e){return`<math xmlns="${O}">${I(e).map(he).join("")}</math>`}var So=["sin","cos","tan","cot","sec","csc","sinh","cosh","tanh","coth","sech","csch","arcsin","arccos","arctan","arccot","arcsec","arccsc","log","ln","lg","exp"],jl=new Set(So),Mo=Math.max(...So.map(e=>e.length));function No(e){return jl.has(e)}var fe=class{constructor(t=200){p(this,"limit",t);p(this,"undoStack",[]);p(this,"redoStack",[])}push(t){this.undoStack.push(t),this.undoStack.length>this.limit&&this.undoStack.shift(),this.redoStack=[]}discardLast(){this.undoStack.pop()}undo(t){let i=this.undoStack.pop();return i===void 0?null:(this.redoStack.push(t),i)}redo(t){let i=this.redoStack.pop();return i===void 0?null:(this.undoStack.push(t),i)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[]}};function st(e){if(e.kind!=="element")return[];let t=[],i=e.tag==="mroot"?[1,0]:e.children.map((o,n)=>n);for(let o of i){let n=e.children[o];n&&(n.kind==="row"?t.push(n):n.kind==="element"&&t.push(...st(n)))}return t}function hi(e){let t=new Map,i=new Map,o=new Map,n=new Map,r=new Map,l=a=>{t.set(a.id,a),a.children.forEach((m,d)=>{o.set(m.id,a),r.set(m.id,{row:a,index:d});let c=st(m);n.set(m.id,c);for(let u of c)i.set(u.id,{atom:m,parentRow:a,index:d});s(m)})},s=a=>{if(a.kind==="row"){l(a);return}if(a.kind==="element")for(let m of a.children)o.set(m.id,a),s(m)};return l(e),{rows:t,owners:i,parents:o,atomRows:n,atomParent:r}}function ge(e,t){let i=[],o=e.rows.get(t);for(;o;)i.unshift(o),o=e.owners.get(o.id)?.parentRow;return i}function Y(e,t,i){let o=e.rows.get(t);for(;o;){let n=e.parents.get(o.id)??e.owners.get(o.id)?.atom;if(!n)return null;if(n.kind==="element"&&n.tag===i)return n;o=n}return null}var Wl="\xA0",Lo={bold:!1,italic:null,color:null,textMode:!1},Zl=/^\p{L}$/u,Ql=/^\p{Nd}$/u,Jl=new Set(["_"]),ts=new Set([")","]","}","|","\u2016","\u232A","\u27E9","\u2309","\u230B"]),es={")":"(","]":"[","}":"{","|":"|","\u2016":"\u2016","\u232A":"\u2329","\u27E9":"\u27E8","\u2309":"\u2308","\u230B":"\u230A"},Fo=new Set(["msub","msup","msubsup","mmultiscripts","munder","mover","munderover"]),Oo=new Set([..."\u2211\u220F\u2210\u222B\u222C\u222D\u222E\u222F\u2230\u2231\u2232\u2233\u22C0\u22C1\u22C2\u22C3\u2A00\u2A01\u2A02\u2A04\u2A06"]),is=new Set(["lim"]),os={mover:1,munderover:2},ns={mroot:[0,1],munderover:[0,2,1]},rs={"=":"\u2260","<":"\u226E",">":"\u226F","\u2264":"\u2270","\u2265":"\u2271","\u2261":"\u2262","\u223C":"\u2241","~":"\u2241","\u2243":"\u2244","\u2245":"\u2247","\u2248":"\u2249","\u2208":"\u2209","\u220B":"\u220C","\u2282":"\u2284","\u2283":"\u2285","\u2286":"\u2288","\u2287":"\u2289","\u2203":"\u2204","\u2223":"\u2224","\u2225":"\u2226"},ls={parentheses:{},brackets:{open:"[",close:"]"},bars:{open:"|",close:"|"}},ss={mfrac:{0:[null,1],1:[0,null]},msup:{0:[1,null],1:[null,0]},msub:{0:[null,1],1:[0,null]},msubsup:{0:[2,1],1:[2,null],2:[null,1]},mover:{0:[1,null],1:[null,0]},munder:{0:[null,1],1:[0,null]},munderover:{0:[2,1],1:[0,null],2:[null,0]},mroot:{0:[1,null],1:[null,0]}};function Io(e){let t=new Map;for(let i of(e??"").split(";")){let o=i.indexOf(":");o>0&&t.set(i.slice(0,o).trim(),i.slice(o+1).trim())}return t}function as(e){return[...e.entries()].map(([t,i])=>`${t}:${i}`).join(";")}function Kt(e,t){return e==="mi"&&[...t].length===1?"italic":"normal"}function _o(e,t){return e?t?"bold-italic":"bold":t?"italic":"normal"}function be(e){return(e.attrs.mathvariant??"").startsWith("bold")}function Xo(e){let t=e.attrs.mathvariant;return t===void 0?Kt(e.tag,e.text)==="italic":t.includes("italic")}function we(e,t,i){let o=_o(t,i);o===Kt(e.tag,e.text)?delete e.attrs.mathvariant:e.attrs.mathvariant=o}function ms(e){let t=[],i=o=>{if(o.kind==="token")t.push(o);else if(o.kind==="row"||o.kind==="element")for(let n of o.children)i(n)};for(let o of e)i(o);return t}function ye(e){let t=[];for(let i of e)for(let o of st(i))t.push(o),t.push(...ye(o.children));return t}function Ko(e){return e?.kind==="element"&&e.tag==="mrow"&&Object.keys(e.attrs).length===0&&e.children.length===1&&e.children[0]?.kind==="row"}function Go(e){return e?.kind==="leaf"&&e.tag==="mspace"&&e.attrs.linebreak==="newline"}function Do(e){return Ko(e)&&e.children[0]?.kind==="row"&&e.children[0].children.length===0}function gi(e){if(e.kind!=="element"||!Fo.has(e.tag))return!1;let t=e.children[0],i=t?.kind==="row"&&t.children.length===1?t.children[0]:void 0;return i?.kind!=="token"?!1:i.tag==="mo"?Oo.has(i.text)||i.attrs.largeop==="true":i.tag==="mi"&&is.has(i.text)}function fi(e){if(e.kind!=="element")return[];if(e.tag==="mmultiscripts"){let n=e.children.findIndex(l=>l.kind==="leaf"&&l.tag==="mprescripts"),r=l=>l.filter(s=>s.kind==="row");return n<0?r(e.children):[...r(e.children.slice(n+1)),...r(e.children.slice(0,n))]}let t=os[e.tag],i=st(e);if(t===void 0)return i;let o=e.children[t];return i.filter(n=>n!==o)}function Po(e,t){let i=[];for(let o of e){if(t&&gi(o))continue;let n=o.kind==="element"&&!gi(o)?ns[o.tag]:void 0,r=n&&o.kind==="element"?n.map(l=>o.children[l]).filter(l=>l?.kind==="row"):st(o);for(let l of r)i.push(l,...Po(l.children,!1))}return i}function Te(e,t,i){let o=(e??"").trim().split(/\s+/).filter(Boolean),n=[];for(let r=0;r<t;r+=1)n.push(o[r]??o[o.length-1]??i);return n}function ke(e,t){if(e.every(o=>o===t))return null;let i=e[0];return e.every(o=>o===i)&&i!==void 0?i:e.join(" ")}var xe=class{constructor(t={}){p(this,"doc",oo());p(this,"index",hi(this.doc.root));p(this,"caret",{rowId:this.doc.root.id,offset:0});p(this,"anchor",null);p(this,"history");p(this,"style",{...Lo});p(this,"lineStyle","solid");p(this,"docRevision",0);p(this,"listeners",new Set);this.history=new fe(t.historyLimit)}onChange(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(){for(let t of this.listeners)t()}get document(){return this.doc}getMathML(){return q(this.doc)}setMathML(t,i=!1){let o=K(t);xo(o.doc),i?this.history.push(this.snapshot()):this.history.clear(),this.doc=o.doc,this.reindex(),this.caret={rowId:this.doc.root.id,offset:this.doc.root.children.length},this.anchor=null,this.style={...Lo},this.emit()}setDocument(t){this.history.clear(),this.doc=It(t,!0),this.reindex(),this.caret={rowId:this.doc.root.id,offset:this.doc.root.children.length},this.anchor=null,this.emit()}isEmpty(){return this.doc.root.children.length===0}get treeIndex(){return this.index}getCaret(){return{...this.caret}}getAnchor(){return this.anchor?{...this.anchor}:null}getInputStyle(){return this.style}getLineStyle(){return this.lineStyle}currentRow(){return this.index.rows.get(this.caret.rowId)??this.doc.root}setCaret(t,i=!1){let o=this.index.rows.get(t.rowId);if(!o)return;let n={rowId:o.id,offset:Math.max(0,Math.min(t.offset,o.children.length))};i?this.anchor||(this.anchor={...this.caret}):this.anchor=null,this.caret=n,this.anchor&&this.anchor.rowId===n.rowId&&this.anchor.offset===n.offset&&(this.anchor=null),this.emit()}select(t,i){!this.index.rows.has(t.rowId)||!this.index.rows.has(i.rowId)||(this.anchor={...t},this.caret={...i},t.rowId===i.rowId&&t.offset===i.offset&&(this.anchor=null),this.emit())}selectAll(){let t=this.doc.root;t.children.length!==0&&this.select({rowId:t.id,offset:0},{rowId:t.id,offset:t.children.length})}selectAtom(t,i){this.select({rowId:t,offset:i},{rowId:t,offset:i+1})}clearSelection(){this.anchor&&(this.anchor=null,this.emit())}getSelection(){if(!this.anchor)return null;let t=ge(this.index,this.anchor.rowId),i=ge(this.index,this.caret.rowId),o=0;for(;o+1<t.length&&o+1<i.length&&t[o+1]?.id===i[o+1]?.id;)o+=1;let n=t[o];if(!n)return null;let r=(u,f)=>{if(f.length-1===o)return[u.offset,u.offset];let b=f[o+1],w=(b?this.index.owners.get(b.id):void 0)?.index??0;return[w,w+1]},[l,s]=r(this.anchor,t),[a,m]=r(this.caret,i),d=Math.min(l,a),c=Math.max(s,m);return d===c?null:{row:n,start:d,end:c}}hasSelection(){return this.getSelection()!==null}moveRight(t=!1){let i=this.currentRow(),o=this.caret.offset;if(t){o<i.children.length?this.setCaret({rowId:i.id,offset:o+1},!0):this.exitRow(i,"after",!0);return}let n=this.getSelection();if(n){this.setCaret({rowId:n.row.id,offset:n.end});return}let r=i.children[o];if(r){let l=fi(r)[0];l?this.setCaret({rowId:l.id,offset:0}):this.setCaret({rowId:i.id,offset:o+1});return}this.exitRow(i,"after",!1)}moveLeft(t=!1){let i=this.currentRow(),o=this.caret.offset;if(t){o>0?this.setCaret({rowId:i.id,offset:o-1},!0):this.exitRow(i,"before",!0);return}let n=this.getSelection();if(n){this.setCaret({rowId:n.row.id,offset:n.start});return}let r=i.children[o-1];if(r){let l=fi(r),s=l[l.length-1];s?this.setCaret({rowId:s.id,offset:s.children.length}):this.setCaret({rowId:i.id,offset:o-1});return}this.exitRow(i,"before",!1)}exitRow(t,i,o){let n=this.index.owners.get(t.id);if(!n)return;let r=i==="after"&&gi(n.atom)&&n.atom.kind==="element"&&n.atom.children[0]===t;if(!o&&!r){let d=fi(n.atom),c=d.findIndex(f=>f.id===t.id),u=i==="after"?d[c+1]:c<0?void 0:d[c-1];if(u){this.setCaret({rowId:u.id,offset:i==="after"?0:u.children.length});return}}let l=n.parentRow,s=i==="after"?n.index+1:n.index,a=this.index.owners.get(l.id)?.atom,m=i==="after"?s===l.children.length:s===0;if(!o&&m&&a?.kind==="element"&&a.tag==="mstyle"){this.exitRow(l,i,!1);return}this.setCaret({rowId:l.id,offset:s},o)}moveHome(t=!1){if(t){this.setCaret({rowId:this.caret.rowId,offset:0},!0);return}let i=this.doc.root,o=this.rootOffset();for(;o>0&&!Go(i.children[o-1]);)o-=1;this.setCaret({rowId:i.id,offset:o})}moveEnd(t=!1){if(t){this.setCaret({rowId:this.caret.rowId,offset:this.currentRow().children.length},!0);return}let i=this.doc.root,o=this.rootOffset();for(this.caret.rowId!==i.id&&(o+=1);o<i.children.length&&!Go(i.children[o]);)o+=1;this.setCaret({rowId:i.id,offset:o})}rootOffset(){let i=ge(this.index,this.caret.rowId)[1];return i?this.index.owners.get(i.id)?.index??0:this.caret.offset}moveVertical(t){let i=this.currentRow(),o=i.children.length===0?0:this.caret.offset/i.children.length;for(;;){let n=this.verticalTarget(i,t);if(n)return this.setCaret({rowId:n.id,offset:Math.round(o*n.children.length)}),!0;let r=this.index.owners.get(i.id);if(!r)return!1;i=r.parentRow,o=i.children.length===0?0:r.index/i.children.length}}verticalTarget(t,i){let o=this.index.parents.get(t.id);if(!o||o.kind!=="element")return null;let n=ss[o.tag];if(n){let r=o.children.findIndex(m=>m.id===t.id),l=n[r],s=l?l[i==="up"?0:1]:null,a=s===null?void 0:o.children[s];return a?.kind==="row"?a:null}if(o.tag==="mtd"){let r=this.tableContext();if(!r)return null;let l=r.rowIndex+(i==="up"?-1:1),s=r.table.children[l],a=s?.kind==="element"?s.children[r.columnIndex]:void 0,m=a?.kind==="element"?a.children[0]:void 0;return m?.kind==="row"?m:null}if(o.tag==="mstack"||o.tag==="mlongdiv"||o.tag==="msgroup"){let r=st(o),l=r.findIndex(s=>s.id===t.id);return r[l+(i==="up"?-1:1)]??null}return null}moveToSlot(t){let i=ye(this.doc.root.children),o=[this.doc.root,...i],n=o.findIndex(s=>s.id===this.caret.rowId),l=(t?o.slice(n+1):o.slice(0,Math.max(n,0)).reverse()).find(s=>s.children.length===0);return l?(this.setCaret({rowId:l.id,offset:0}),!0):!1}snapshot(){return{doc:It(this.doc),caret:{...this.caret},anchor:this.anchor?{...this.anchor}:null}}restore(t){this.doc=t.doc,this.reindex(),this.caret=t.caret,this.anchor=t.anchor}reindex(){this.index=hi(this.doc.root),this.docRevision+=1}get revision(){return this.docRevision}mutate(t){let i=this.snapshot(),o=q(i.doc),n=t();return this.reindex(),n===!1||q(this.doc)===o?(n===!1&&this.restore(i),this.emit(),!1):(this.history.push(i),this.emit(),!0)}removeSelection(){let t=this.getSelection();if(!t)return null;let i=t.row.children.splice(t.start,t.end-t.start);return this.anchor=null,this.caret={rowId:t.row.id,offset:t.start},this.reindex(),{row:t.row,offset:t.start,removed:i}}insertAtCaret(t){let i=this.currentRow(),o=this.caret.offset,n=this.index.owners.get(i.id);i.children.length===0&&n&&Ko(n.atom)?(i=n.parentRow,o=n.index,i.children.splice(o,1)):Do(i.children[o])?i.children.splice(o,1):o>0&&Do(i.children[o-1])&&(o-=1,i.children.splice(o,1)),i.children.splice(o,0,...t),this.caret={rowId:i.id,offset:o+t.length},this.reindex()}negateInPlace(t){let i=this.currentRow(),o=rs[t],n=this.index.owners.get(i.id),r=n?.atom;return!o||!n||i.children.length>0||r?.kind!=="element"||r.tag!=="menclose"||r.attrs.notation!=="updiagonalstrike"?!1:(n.parentRow.children.splice(n.index,1,v("mo",o,this.tokenAttrs("mo",o))),this.caret={rowId:n.parentRow.id,offset:n.index+1},this.reindex(),!0)}tokenAttrs(t,i,o){let n={...o??{}},r=this.style.italic??Kt(t,i)==="italic",l=_o(this.style.bold,r);return l!==Kt(t,i)&&(n.mathvariant=l),this.style.color&&(n.mathcolor=this.style.color),n}classify(t){return this.style.textMode?"mtext":Ql.test(t)?"mn":Zl.test(t)||Jl.has(t)?"mi":"mo"}typeCharacter(t,i){t&&this.mutate(()=>{if(this.removeSelection(),!this.style.textMode&&this.negateInPlace(t))return;let o=this.currentRow();if(o.tokenHint&&o.children.length===0){let{largeop:a,...m}=o.tokenHint.attrs;this.insertAtCaret([v(o.tokenHint.tag,t,Oo.has(t)||a===void 0?m:o.tokenHint.attrs)]);return}let n=this.style.textMode?void 0:i,r=n?.text??(t===" "?Wl:t),l=n?.tag??(t===" "&&!this.style.textMode?"mo":this.classify(t)),s=this.tokenAttrs(l,r);n?.mathvariant&&(s.mathvariant=n.mathvariant),this.insertAtCaret([v(l,r,s)]),l==="mi"&&this.mergeFunctionName()})}typeText(t){for(let i of t)i===`
|
|
2
|
+
`?this.insertNewline():this.typeCharacter(i)}mergeFunctionName(){let t=this.currentRow(),i=this.caret.offset,o=t.children[i-1];if(o?.kind!=="token"||o.tag!=="mi")return;let n=i,r=0;for(;n>0;){let l=t.children[n-1];if(l?.kind!=="token"||l.tag!=="mi"||!/^\p{L}+$/u.test(l.text)||l.attrs.mathvariant==="normal")break;let s=Object.keys(l.attrs).filter(a=>a!=="mathvariant");if(s.length>0&&s.some(a=>l.attrs[a]!==o.attrs[a])||(r+=l.text.length,r>Mo))break;n-=1}for(let l=n;l<i;l+=1){let s=t.children.slice(l,i).map(a=>a.kind==="token"?a.text:"").join("");if(No(s)&&i-l>1){let a={},m=o.attrs.mathcolor;m&&(a.mathcolor=m),this.style.bold&&(a.mathvariant="bold"),t.children.splice(l,i-l,v("mi",s,a)),this.caret={rowId:t.id,offset:l+1},this.reindex();return}}}insertNewline(){this.mutate(()=>{this.removeSelection(),this.insertAtCaret([F("mspace",{linebreak:"newline"})])})}canBeScriptBase(t){return t.kind==="token"&&t.tag==="mo"?ts.has(t.text)||t.attrs.largeop==="true":t.kind!=="leaf"}matchingOpen(t,i,o,n){let r=0;for(let l=i-1;l>=0;l-=1){let s=t[l];if(!(s?.kind!=="token"||s.tag!=="mo")){if(s.text===o&&r===0)return l;s.text===n&&o!==n?r+=1:s.text===o&&(r-=1)}}return-1}takePreviousBase(){let t=this.currentRow(),i=this.caret.offset,o=t.children[i-1];if(!o||!this.canBeScriptBase(o))return[];i-=1;let n=o.kind==="token"&&o.tag==="mo"?es[o.text]:void 0;if(n!==void 0&&o.kind==="token"){let l=this.matchingOpen(t.children,i,n,o.text);l>=0&&(i=l)}if(o.kind==="token"&&o.tag==="mn")for(;i>0;){let l=t.children[i-1];if(l?.kind!=="token"||l.tag!=="mn")break;i-=1}let r=t.children.splice(i,this.caret.offset-i);return this.caret={rowId:t.id,offset:i},this.reindex(),r}insertMathML(t){return this.mutate(()=>{let i=new Set,n=K(t,{argumentRows:i}).doc.root.children;if(n.length===0)return!1;let r=ye(n),l=r.find(u=>i.has(u.id)),a=this.removeSelection()?.removed??[],m=n[0];if(a.length===0&&l&&m?.kind==="element"&&Fo.has(m.tag)&&m.children[0]?.id===l.id&&!l.tokenHint&&(a=this.takePreviousBase()),a.length>0){let u=l??r[0];u&&(u.children=a,delete u.tokenHint)}let d=this.isNestedFraction(n)?[T("mstyle",[k(n)],{displaystyle:"true"})]:n;this.insertAtCaret(d);let c=Po(d,!0).find(u=>u.children.length===0);return c&&(this.caret={rowId:c.id,offset:0}),!0})}isNestedFraction(t){let i=t.length===1?t[0]:void 0;return i?.kind!=="element"||i.tag!=="mfrac"||Object.keys(i.attrs).length>0||!i.children.every(o=>o.kind==="row"&&o.children.length===0)?!1:Y(this.index,this.caret.rowId,"mfrac")!==null}insertMatrix(t,i,o="parentheses"){if(t<1||i<1)return!1;let n=T("mtable",Array.from({length:t},()=>T("mtr",Array.from({length:i},()=>T("mtd",[k()]))))),r=o==="table"?n:T("mfenced",[k([n])],ls[o]);return this.mutate(()=>{let l=this.removeSelection(),s=n.children[0]?.kind==="element"?n.children[0].children[0]:void 0,a=s?.kind==="element"?s.children[0]:void 0;l&&l.removed.length>0&&a?.kind==="row"&&(a.children=l.removed),this.insertAtCaret([r]);let m=ye([r]).find(d=>d.children.length===0);m&&(this.caret={rowId:m.id,offset:0})})}deleteBackward(){if(this.hasSelection()){this.mutate(()=>{this.removeSelection()});return}let t=this.currentRow(),i=this.caret.offset,o=t.children[i-1];if(o){if(o.kind==="element"&&(this.index.atomRows.get(o.id)?.length??0)>0){this.selectAtom(t.id,i-1);return}this.mutate(()=>{t.children.splice(i-1,1),this.caret={rowId:t.id,offset:i-1}});return}this.deleteAtSlotBoundary(t,"before")}deleteForward(){if(this.hasSelection()){this.mutate(()=>{this.removeSelection()});return}let t=this.currentRow(),i=this.caret.offset,o=t.children[i];if(o){if(o.kind==="element"&&(this.index.atomRows.get(o.id)?.length??0)>0){this.selectAtom(t.id,i);return}this.mutate(()=>{t.children.splice(i,1)});return}this.deleteAtSlotBoundary(t,"after")}deleteAtSlotBoundary(t,i){let o=this.index.owners.get(t.id);if(!o)return;let n=this.index.atomRows.get(o.atom.id)??[];if(n.every(s=>s.children.length===0)){this.mutate(()=>{o.parentRow.children.splice(o.index,1),this.caret={rowId:o.parentRow.id,offset:o.index}});return}let r=n.findIndex(s=>s.id===t.id),l=i==="before"?n[r-1]:n[r+1];if(l){this.setCaret({rowId:l.id,offset:i==="before"?l.children.length:0});return}this.selectAtom(o.parentRow.id,o.index)}clear(){this.mutate(()=>{this.doc.root.children=[],this.caret={rowId:this.doc.root.id,offset:0},this.anchor=null})}copySelection(){let t=this.getSelection();return t?Ao(t.row.children.slice(t.start,t.end)):null}cutSelection(){let t=this.copySelection();return t===null?null:(this.mutate(()=>{this.removeSelection()}),t)}paste(t){let i=t.trim();if(!i)return!1;if(i.startsWith("<")||i.startsWith("\xAB"))try{let n=K(i).doc.root.children.map(r=>gt(r,!0));return this.mutate(()=>{this.removeSelection(),this.insertAtCaret(n)})}catch{return!1}return this.typeText(i),!0}insertNodes(t){let i=t.map(o=>gt(o,!0));return this.mutate(()=>{this.removeSelection(),this.insertAtCaret(i)})}undo(){let t=this.history.undo(this.snapshot());return t?(this.restore(t),this.emit(),!0):!1}redo(){let t=this.history.redo(this.snapshot());return t?(this.restore(t),this.emit(),!0):!1}canUndo(){return this.history.canUndo()}canRedo(){return this.history.canRedo()}selectedTokens(){let t=this.getSelection();return t?ms(t.row.children.slice(t.start,t.end)):[]}toggleBold(){let t=this.selectedTokens();if(t.length===0){this.style={...this.style,bold:!this.style.bold},this.emit();return}let i=!t.every(be);this.mutate(()=>{for(let o of t)we(o,i,Xo(o))})}toggleItalic(){let t=this.selectedTokens();if(t.length===0){let o=this.style.italic;this.style={...this.style,italic:o===null?!0:!o},this.emit();return}let i=!t.every(Xo);this.mutate(()=>{for(let o of t)we(o,be(o),i)})}setAutoItalic(){let t=this.selectedTokens();if(this.style={...this.style,italic:null,textMode:!1},t.length===0){this.emit();return}this.mutate(()=>{for(let i of t)we(i,be(i),Kt(i.tag,i.text)==="italic")})}setTextMode(t){let i=this.selectedTokens();if(this.style={...this.style,textMode:t},i.length===0||!t){this.emit();return}this.mutate(()=>{for(let o of i)we(o,be(o),!1)})}setColor(t){let i=this.selectedTokens();if(this.style={...this.style,color:t},i.length===0){this.emit();return}this.mutate(()=>{for(let o of i)t?o.attrs.mathcolor=t:delete o.attrs.mathcolor})}setFontSize(t){let i=this.getSelection();if(!i){this.setDocumentAttribute("mathsize",t);return}this.mutate(()=>{let o=i.end-i.start===1?i.row.children[i.start]:void 0;if(o?.kind==="element"&&o.tag==="mstyle"){t?o.attrs.mathsize=t:delete o.attrs.mathsize;return}if(!t)return!1;let n=this.removeSelection();return this.insertAtCaret([T("mstyle",[k(n?.removed??[])],{mathsize:t})]),!0})}getFontSize(){return this.doc.attrs.mathsize??null}setFontFamily(t){this.mutate(()=>{let i=Io(this.doc.attrs.style);t?i.set("font-family",t):i.delete("font-family");let o=as(i);o?this.doc.attrs.style=o:delete this.doc.attrs.style})}getFontFamily(){return Io(this.doc.attrs.style).get("font-family")??null}setDocumentAttribute(t,i){return(this.doc.attrs[t]??null)===i?!1:this.mutate(()=>{i===null?delete this.doc.attrs[t]:this.doc.attrs[t]=i})}hasLineBreaks(){return this.doc.root.children.some(t=>t.kind==="leaf"&&t.attrs.linebreak==="newline")}isRtl(){return this.doc.attrs.dir==="rtl"}toggleRtl(){this.mutate(()=>{this.doc.attrs.dir==="rtl"?delete this.doc.attrs.dir:this.doc.attrs.dir="rtl"})}setTokenAttribute(t,i){let o=this.selectedTokens(),r=this.currentRow().children[this.caret.offset-1],l=o.length>0?o:r?.kind==="token"?[r]:[];return l.length===0?!1:this.mutate(()=>{for(let s of l)i===null?delete s.attrs[t]:s.attrs[t]=i})}previousAtom(){return this.currentRow().children[this.caret.offset-1]??null}contextKind(){if(this.tableContext())return"table";let t=this.previousAtom();return Y(this.index,this.caret.rowId,"mstack")||Y(this.index,this.caret.rowId,"mlongdiv")?"stack":t?.kind==="leaf"&&t.tag==="mspace"?"space":t?.kind==="token"&&t.tag==="mo"?"operator":t?.kind==="token"&&t.tag==="mn"?"number":this.fenceContext()?"fence":"none"}fenceContext(){return Y(this.index,this.caret.rowId,"mfenced")}setFence(t){let i=this.fenceContext();return i?this.mutate(()=>{for(let[o,n]of Object.entries(t)){if(n===void 0)continue;o==="open"&&n==="("||o==="close"&&n===")"||o==="separators"&&n===","?delete i.attrs[o]:i.attrs[o]=n}}):!1}tableContext(){let t=Y(this.index,this.caret.rowId,"mtd");if(!t)return null;let i=this.index.parents.get(t.id),o=i?this.index.parents.get(i.id):void 0;if(i?.kind!=="element"||o?.kind!=="element"||o.tag!=="mtable")return null;let n=o.children.findIndex(s=>s.id===i.id),r=i.children.findIndex(s=>s.id===t.id),l=Math.max(...o.children.map(s=>s.kind==="element"?s.children.length:0));return{table:o,rowIndex:n,columnIndex:r,rowCount:o.children.length,columnCount:l}}newCell(){return T("mtd",[k()])}tableInsertRow(t){let i=this.tableContext();return i?this.mutate(()=>{let o=T("mtr",Array.from({length:i.columnCount},()=>this.newCell())),n=i.rowIndex+(t==="below"?1:0);i.table.children.splice(n,0,o),this.adjustLines(i.table,"rowlines",i.rowCount,n,"insert");let r=o.children[i.columnIndex]?.children[0];r?.kind==="row"&&(this.caret={rowId:r.id,offset:0}),this.anchor=null}):!1}tableInsertColumn(t){let i=this.tableContext();return i?this.mutate(()=>{let o=i.columnIndex+(t==="right"?1:0),n=null;i.table.children.forEach((l,s)=>{if(l.kind!=="element")return;let a=this.newCell();l.children.splice(Math.min(o,l.children.length),0,a);let m=a.children[0];s===i.rowIndex&&m?.kind==="row"&&(n=m)}),this.adjustLines(i.table,"columnlines",i.columnCount,o,"insert"),this.adjustList(i.table,"columnalign",i.columnCount,o,"insert","center");let r=n;r&&(this.caret={rowId:r.id,offset:0}),this.anchor=null}):!1}tableRemoveRow(){let t=this.tableContext();return!t||t.rowCount<=1?!1:this.mutate(()=>{t.table.children.splice(t.rowIndex,1),this.adjustLines(t.table,"rowlines",t.rowCount,t.rowIndex,"remove");let i=t.table.children[Math.min(t.rowIndex,t.table.children.length-1)],o=i?.kind==="element"?i.children[Math.min(t.columnIndex,i.children.length-1)]:void 0,n=o?.kind==="element"?o.children[0]:void 0;n?.kind==="row"&&(this.caret={rowId:n.id,offset:n.children.length}),this.anchor=null})}tableRemoveColumn(){let t=this.tableContext();return!t||t.columnCount<=1?!1:this.mutate(()=>{for(let r of t.table.children)r.kind==="element"&&r.children.length>t.columnIndex&&r.children.splice(t.columnIndex,1);this.adjustLines(t.table,"columnlines",t.columnCount,t.columnIndex,"remove"),this.adjustList(t.table,"columnalign",t.columnCount,t.columnIndex,"remove","center");let i=t.table.children[t.rowIndex],o=i?.kind==="element"?i.children[Math.min(t.columnIndex,i.children.length-1)]:void 0,n=o?.kind==="element"?o.children[0]:void 0;n?.kind==="row"&&(this.caret={rowId:n.id,offset:n.children.length}),this.anchor=null})}adjustList(t,i,o,n,r,l){if(t.attrs[i]===void 0)return;let s=Te(t.attrs[i],o,l);r==="insert"?s.splice(n,0,l):s.splice(n,1);let a=ke(s,l);a===null?delete t.attrs[i]:t.attrs[i]=a}adjustLines(t,i,o,n,r){if(t.attrs[i]===void 0||o<1)return;let l=Te(t.attrs[i],Math.max(o-1,0),"none");r==="insert"?l.splice(Math.min(n,l.length),0,"none"):l.splice(Math.min(n,l.length-1),1);let s=ke(l,"none");s===null?delete t.attrs[i]:t.attrs[i]=s}setLineStyle(t){this.lineStyle=t,this.emit()}setTableLine(t,i){let o=this.tableContext();if(!o)return!1;let n=t==="row"?"rowlines":"columnlines",r=(t==="row"?o.rowCount:o.columnCount)-1,l=t==="row"?o.rowIndex:o.columnIndex;return r<1||l>=r?!1:this.mutate(()=>{let s=Te(o.table.attrs[n],r,"none");s[l]=i?this.lineStyle:"none";let a=ke(s,"none");a===null?delete o.table.attrs[n]:o.table.attrs[n]=a})}setTableFrame(t){let i=this.tableContext();return i?this.mutate(()=>{t?i.table.attrs.frame=this.lineStyle:delete i.table.attrs.frame}):!1}setColumnAlign(t){let i=this.tableContext();return i?this.mutate(()=>{let o=Te(i.table.attrs.columnalign,i.columnCount,"center");o[i.columnIndex]=t;let n=ke(o,"center");n===null?delete i.table.attrs.columnalign:i.table.attrs.columnalign=n}):!1}setRowAlign(t){let i=this.tableContext(),o=i?.table.children[i.rowIndex];return!i||o?.kind!=="element"?!1:this.mutate(()=>{t==="baseline"?delete o.attrs.rowalign:o.attrs.rowalign=t})}setTableAttribute(t,i){let o=this.tableContext();return o?this.mutate(()=>{i===null?delete o.table.attrs[t]:o.table.attrs[t]=i}):!1}stackContext(){let t=this.currentRow(),i=this.index.parents.get(t.id);return i?.kind!=="element"||i.tag!=="mstack"&&i.tag!=="mlongdiv"&&i.tag!=="msgroup"?null:{stack:i,row:t,index:i.children.findIndex(o=>o.id===t.id)}}stackInsertRow(t){let i=this.stackContext();return i?this.mutate(()=>{let o=k([],"msrow");i.stack.children.splice(i.index+(t==="after"?1:0),0,o),this.caret={rowId:o.id,offset:0},this.anchor=null}):!1}stackInsertLine(){let t=this.stackContext();return t?this.mutate(()=>{t.stack.children.splice(t.index+1,0,F("msline"))}):!1}stackShiftRow(t){let i=this.stackContext();return i?this.mutate(()=>{let n=(Number.parseInt(i.row.attrs.position??"0",10)||0)+t;n===0?delete i.row.attrs.position:i.row.attrs.position=String(n)}):!1}setStackAttribute(t,i){let o=Y(this.index,this.caret.rowId,"mstack")??Y(this.index,this.caret.rowId,"mlongdiv");return o?this.mutate(()=>{i===null?delete o.attrs[t]:o.attrs[t]=i}):!1}carriesContext(){let t=Y(this.index,this.caret.rowId,"mscarries");if(t)return t;let i=this.stackContext(),o=i?i.stack.children[i.index-1]:void 0;return o?.kind==="element"&&o.tag==="mscarries"?o:null}hasCarries(){return this.carriesContext()!==null}stackInsertCarries(){let t=this.stackContext();if(!t||this.carriesContext())return!1;let i=Math.max(1,t.row.children.length);return this.mutate(()=>{let o=T("mscarries",Array.from({length:i},()=>k([],"mscarry")));t.stack.children.splice(t.index,0,o);let n=o.children[0];n?.kind==="row"&&(this.caret={rowId:n.id,offset:0}),this.anchor=null})}setCarriesAttribute(t,i){let o=this.carriesContext();return o?this.mutate(()=>{i===null?delete o.attrs[t]:o.attrs[t]=i}):!1}setSpaceAttribute(t,i){let o=this.previousAtom();return o?.kind!=="leaf"||o.tag!=="mspace"?!1:this.mutate(()=>{i===null?delete o.attrs[t]:o.attrs[t]=i})}toggleNumberSeparators(){let t=this.currentRow();return this.mutate(()=>{let i=!1;for(let o=1;o+1<t.children.length;o+=1){let n=t.children[o-1],r=t.children[o],l=t.children[o+1];n?.kind==="token"&&n.tag==="mn"&&r?.kind==="token"&&r.tag==="mo"&&(r.text==="."||r.text===",")&&l?.kind==="token"&&l.tag==="mn"&&(t.children[o]=v("mn",r.text,n.attrs),i=!0)}if(!i)for(let o=1;o+1<t.children.length;o+=1){let n=t.children[o];n?.kind==="token"&&n.tag==="mn"&&(n.text==="."||n.text===",")&&(t.children[o]=v("mo",n.text),i=!0)}return i})}nudge(t,i){let o=this.getSelection(),n=o?.row??this.currentRow(),r=o?o.start:this.caret.offset-1,l=o?o.end:this.caret.offset;return r<0||l<=r?!1:this.mutate(()=>{let s=l-r===1?n.children[r]:void 0,a;if(s?.kind==="element"&&s.tag==="mpadded")a=s;else{let d=n.children.splice(r,l-r);a=T("mpadded",[k(d)]),n.children.splice(r,0,a)}let m=(d,c)=>{let u=Number.parseFloat(a.attrs[d]??"0")||0,f=Math.round((u+c)*10)/10;f===0?delete a.attrs[d]:a.attrs[d]=`${f}em`};t!==0&&m("lspace",t),i!==0&&m("voffset",i),this.anchor=null,this.caret={rowId:n.id,offset:r+1}})}static merged(t){return I(t)}};var ds="\xA0",cs="\u200A",us="\u2009",Wo=".",ps=new Set(["-0.2em","-0.1667em"]),$o={"+":"plus","-":"minus","\u2212":"minus","=":"equals","\xB1":"plus-or-minus","\u2213":"minus-or-plus","\xD7":"cross times","\xB7":"times","\u22C5":"times","*":"times","\u2217":"times","\xF7":"divided by","/":"divided by","<":"less than",">":"greater than","\u2264":"less or equal than","\u2265":"greater or equal than","\u2260":"not equal to","\u2248":"almost equal to","\u2261":"identical to","\u223C":"tilde operator","\u221D":"proportional to","\u2192":"rightwards arrow","\u2190":"leftwards arrow","\u2194":"left right arrow","\u21D2":"rightwards double arrow","\u21D0":"leftwards double arrow","\u21D4":"left right double arrow","\u2208":"element of","\u2209":"not an element of","\u2282":"subset of","\u2283":"superset of","\u2286":"subset of or equal to","\u2287":"superset of or equal to","\u222A":"union","\u2229":"intersection","\u2205":"empty set","\u221E":"infinity","\u2202":"partial differential","\u2207":"nabla","\u2200":"for all","\u2203":"there exists","\xAC":"not","\u2227":"logical and","\u2228":"logical or","\u2220":"angle","\u22A5":"perpendicular","\u2225":"parallel to","\xB0":"degree","!":"factorial",",":"comma",";":"semicolon",":":"colon",".":"dot","\u2026":"horizontal ellipsis","\u22EF":"midline horizontal ellipsis","%":"percent sign","(":"left parenthesis",")":"right parenthesis","[":"left square bracket","]":"right square bracket","{":"left curly bracket","}":"right curly bracket","|":"vertical line","'":"apostrophe","\u2032":"prime","\u222B":"integral","\u222C":"double integral","\u222D":"triple integral","\u222E":"contour integral","\u2211":"sum","\u220F":"product","\u2210":"coproduct","\u2206":"increment","\u2234":"therefore","\u2235":"because","\u2218":"ring operator","\u2295":"circled plus","\u2297":"circled times","\u27E8":"left angle bracket","\u27E9":"right angle bracket","\u230A":"left floor","\u230B":"right floor","\u2308":"left ceiling","\u2309":"right ceiling","\u2243":"asymptotically equal to","\u2245":"approximately equal to","\u226A":"much less-than","\u226B":"much greater-than","\u227A":"precedes","\u227B":"succeeds","\u2204":"there does not exist","\u2216":"set minus","\u21A6":"rightwards arrow from bar","\u2191":"upwards arrow","\u2193":"downwards arrow","\u2195":"up down arrow","\u2197":"north east arrow","\u2198":"south east arrow","\u21AA":"rightwards arrow with hook","\u22EE":"vertical ellipsis","\u22F1":"down right diagonal ellipsis",\u2112:"script capital l","\u2118":"script capital p",\u2113:"ell",\u211C:"real part",\u2111:"imaginary part",\u2135:"alef",\u2102:"complex numbers",\u2115:"natural numbers",\u211A:"rational numbers",\u211D:"real numbers",\u2124:"integer numbers",\u2119:"double-struck capital p"},hs={"-":"negative","\u2212":"negative","\u2213":"negative-or-plus"},Ho={"\u222A":"large union","\u2229":"large intersection"},fs={normal:"straight",bold:"bold",italic:"italic","bold-italic":"bold italic",fraktur:"fraktur",script:"calligraphic","double-struck":"double-struck"},gs={longdiv:"long division",updiagonalstrike:"up diagonal",downdiagonalstrike:"down diagonal",horizontalstrike:"horizontal",verticalstrike:"vertical"},bs=["columnalign","rowalign"],zo={"(":"parentheses",")":"parentheses","[":"square brackets","]":"square brackets","{":"curly brackets","}":"curly brackets","|":"vertical bar","\u2016":"double vertical bar","||":"double vertical bar","<":"angle brackets",">":"angle brackets","\u27E8":"angle brackets","\u27E9":"angle brackets","\u2308":"ceiling","\u2309":"ceiling","\u230A":"floor","\u230B":"floor"},Uo={"\u2192":"rightwards arrow","\u21C0":"rightwards harpoon with barb upwards","\u2194":"left right arrow","\xAF":"bar","^":"hat","~":"tilde","\xA8":"diaeresis","\u2025":"two dots","\u02D9":"dot","\u23DE":"overbrace","\u23DF":"underbrace","\u23DC":"top parenthesis","\u23DD":"bottom parenthesis","\u02C7":"caron","\u02D8":"breve"},ws={2:"half",3:"third",4:"fourth",5:"fifth"},Ts={2:"square",3:"cube"},ks=new Set(["\u2211","\u220F","\u2210","\u22C3","\u22C2","\u22C1","\u22C0","\u2A01","\u2A02"]),Zo="lim",ys=new Set(["msub","msup"]),xs=(()=>{let e=new Map([["\u03C2","final sigma"]]);for(let[t,i]of Object.entries(Gt)){if(!/^[\u0391-\u03A9\u03B1-\u03C9]$/.test(i)||e.has(i))continue;let o=(t.startsWith("var")?t.slice(3):t).toLowerCase();e.set(i,/[\u0391-\u03A9]/.test(i)?`capital ${o}`:o)}return e})();function E(e){return e.filter(t=>t.length>0).join(" ")}function J(e){if(!e)return null;let t=I(e.children);return t.length===1?t[0]??null:null}function tt(e){let t=J(e);return t?.kind==="token"&&t.tag!=="mtext"}function Ti(e){return!e||I(e.children).length===0}function Vo(e){let t=J(e);return tt(e)||t?.kind==="element"&&ys.has(t.tag)}function Re(e,t){return E([e,B(t),tt(t)?"":`end ${e}`])}function R(e,t){let i=e.children[t];return i?.kind==="row"?i:void 0}function bi(e){let t=e.attrs.mathvariant;return!t||t==="italic"&&e.tag==="mi"&&[...e.text].length===1?"":fs[t]??""}function vs(e){if(e===cs)return e;if(e===us)return"thin space";if(e===ds)return"space";if(/^\u00A0+$/.test(e))return e;if(/^[\u2000-\u200B]$/.test(e))return""}function Rs(e,t){if(e.tag==="mtext")return E(["text",bi(e),e.text,"end text"]);if(e.tag==="mn")return E([bi(e),e.text]);if(e.tag==="mi"){let n=[...e.text].length>1?e.text:xs.get(e.text)??$o[e.text]??e.text;return E([bi(e),n])}let i=vs(e.text);if(i!==void 0)return i;if(e.attrs.largeop==="true"&&Ho[e.text])return Ho[e.text]??"";let o=hs[e.text];return o&&Es(t)?o:$o[e.text]??e.text}function Es(e){return e?e.kind==="token"&&e.tag==="mo"&&!")]}|".includes(e.text):!0}function Cs(e){return e?.kind==="token"&&e.tag==="mo"&&e.text===Wo}function B(e){if(!e)return"";let t=I(e.children),i=[];for(let o=0;o<t.length;o++){let n=t[o];if(!n)continue;let r=t[o+1],l=i.length-1;if(Cs(n)&&o>0&&r?.kind==="token"&&t[o-1]?.kind==="token"&&l>=0){i[l]=`${i[l]??""}${Wo}${jo(r,n)}`,o++;continue}i.push(jo(n,t[o-1]??null))}return E(i)}function Bs(e){let t=J(R(e,0)),i=J(R(e,1));if(t?.kind==="token"&&t.tag==="mn"&&t.text==="1"&&i?.kind==="token"&&i.tag==="mn"){let o=ws[i.text];if(o)return`1 ${o}`}return Vo(R(e,0))&&Vo(R(e,1))?E([B(R(e,0)),"over",B(R(e,1))]):E(["fraction numerator",B(R(e,0)),"over denominator",B(R(e,1)),"end fraction"])}function As(e,t){let i=J(t);return i?.kind==="token"&&i.tag==="mn"&&i.text==="2"?E([e,"squared"]):i?.kind==="token"&&i.tag==="mn"&&i.text==="3"?E([e,"cubed"]):tt(t)?E([e,"to the power of",B(t)]):E([e,"to the power of",B(t),"end exponent"])}function wt(e){let t=R(e,0);return Ti(t)?"blank":B(t)}function wi(e){return tt(R(e,0))?wt(e):E(["stack",wt(e)])}function qo(e){let t=J(e);return t?.kind!=="token"?!1:t.tag==="mo"?ks.has(t.text)||t.attrs.largeop==="true":t.tag==="mi"&&t.text===Zo}function Yo(e){let t=J(e);return t?.kind==="token"&&t.tag==="mi"&&t.text===Zo?"limit":B(e)}function Ss(e){let t=e.kind==="element"?R(e,0):void 0;return Ti(t)?"blank":tt(t)?B(t):E(["cell",B(t),"end cell"])}function Ms(e){let t=bs.flatMap(o=>{let n=e.attrs[o];return n?[`${o} ${n}`]:[]}),i=e.children.filter(o=>o.kind==="element").map(o=>E(["row",...o.children.map(Ss)]));return E(["table",t.length?E(["attributes",...t,"end attributes"]):"",...i,"end table"])}function Ns(e){let t=(e.attrs.notation??"longdiv").trim().split(/\s+/),i=t.every(n=>n.endsWith("strike"))?"strike":"enclose",o=t.map(n=>gs[n]??n);return E([...o,i,B(R(e,0)),tt(R(e,0))?"":`end ${i}`])}function Ls(e){let t=e.children,i=t.findIndex(l=>l.kind==="leaf"&&l.tag==="mprescripts"),o=(l,s,a)=>l.flatMap((m,d)=>m.kind==="row"&&!Ti(m)?[Re(d%2===0?s:a,m)]:[]),n=t.slice(1,i<0?void 0:i),r=i<0?[]:t.slice(i+1);return E([wt(e),...o(r,"presubscript","presuperscript"),...o(n,"subscript","superscript")])}function Is(e){let t=B(R(e,0)),i=e.attrs.displaystyle;return i==="true"?E(["begin display style",t,"end style"]):i==="false"?E(["begin inline style",t,"end style"]):t}function Xs(e){let t=e.attrs.open??"(",i=e.attrs.close??")";return E([E(["open",zo[t]??t]),B(R(e,0)),E(["close",zo[i]??i])])}function Qo(e){switch(e.tag){case"mfrac":return Bs(e);case"msqrt":return tt(R(e,0))?E(["square root of",B(R(e,0))]):E(["square root of",B(R(e,0)),"end root"]);case"mroot":{let t=B(R(e,1)),i=Ts[t]??`${t}-th`;return E([`${i} root of`,B(R(e,0)),tt(R(e,0))?"":"end root"])}case"msup":return As(wt(e),R(e,1));case"msub":return E([wt(e),Re("subscript",R(e,1))]);case"msubsup":return E([wt(e),Re("subscript",R(e,1)),Re("superscript",R(e,2))]);case"munderover":return qo(R(e,0))?E([Yo(R(e,0)),"from",B(R(e,1)),"to",B(R(e,2)),"of"]):E([wi(e),"with",ve(R(e,1)),"below and",ve(R(e,2)),"on top"]);case"munder":if(qo(R(e,0))){let t=Yo(R(e,0));return E([t,t==="limit"?"as":"for",B(R(e,1)),"of"])}return E([wi(e),"with",ve(R(e,1)),"below"]);case"mover":return E([wi(e),"with",ve(R(e,1)),"on top"]);case"mfenced":return Xs(e);case"mtable":return Ms(e);case"menclose":return Ns(e);case"mphantom":return"";case"mmultiscripts":return Ls(e);case"mstyle":return Is(e);default:return E(e.children.map(t=>t.kind==="row"?B(t):t.kind==="element"?Qo(t):""))}}function ve(e){let t=J(e);return t?.kind==="token"&&Uo[t.text]?Uo[t.text]??"":B(e)}function jo(e,t){switch(e.kind){case"token":return Rs(e,t);case"leaf":return e.tag!=="mspace"?"":e.attrs.linebreak==="newline"?"new line":ps.has(e.attrs.width??"")?"back space":"";case"element":return Qo(e)}}function Ee(e){return B(e.root).trim()}var Jo={mfrac:["numerator","denominator"],msqrt:["square root"],mroot:["root","index"],msup:["base","superscript"],msub:["base","subscript"],msubsup:["base","subscript","superscript"],mover:["base","overscript"],munder:["base","underscript"],munderover:["base","underscript","overscript"],mfenced:["fence"],menclose:["enclosure"],mtd:["cell"],mstyle:["style"],mmultiscripts:["base"]};function Ce(e){return e?Ee({attrs:{},root:{kind:"row",id:-1,tag:"mrow",attrs:{},children:[e]}}):""}function tn(e){let t=e.getCaret(),i=e.treeIndex,o=i.rows.get(t.rowId);if(!o)return"";let n=i.owners.get(o.id),r=t.offset===o.children.length;if(!n)return o.children.length===0?"empty expression":r?"end expression":t.offset===0?`begin expression ${Ce(o.children[0])}`.trim():Ce(o.children[t.offset-1]);let l=i.parents.get(o.id),s=l?.kind==="element"?l.tag:n.atom.kind==="element"?n.atom.tag:"",a=l?.kind==="element"?l.children.findIndex(d=>d.id===o.id):0,m=Jo[s]?.[a]??Jo[s]?.[0]??"slot";return t.offset===0?`${m} begin ${Ce(o.children[0])}`.trim():r?`${m} end`:Ce(o.children[t.offset-1])}var Gs=new Set(["mrow","mfrac","msqrt","mroot","mstyle","merror","mpadded","mphantom","mfenced","menclose","msub","msup","msubsup","munder","mover","munderover","mmultiscripts","mtable","mlabeledtr","mtr","mtd","mstack","mlongdiv","msgroup","msrow","mscarries","mscarry","maction"]),Ds=/^[A-Za-z][A-Za-z0-9_.-]*(?::[A-Za-z][A-Za-z0-9_.-]*)?$/,Fs=/^on/i,Os=new Set(["href","xlink:href","src","definitionurl","altimg"]),_s=/^(?:https?:|mailto:|[^:]*$)/i,Ks=/url\s*\(|expression\s*\(|javascript\s*:|@import|behavior\s*:/i;function en(e){let t={};for(let[i,o]of Object.entries(e)){let n=i.toLowerCase();!Ds.test(i)||Fs.test(i)||n==="xmlns"||n.startsWith("xmlns:")||Os.has(n)&&!_s.test(o.trim())||n==="style"&&Ks.test(o)||(t[i]=o)}return t}function ki(e){let t=It(e);return t.attrs=en(t.attrs),ri(t.root,i=>{i.attrs=en(i.attrs),i.kind==="element"&&!Gs.has(i.tag)&&(i.tag="mrow")}),t}var M=class extends Error{constructor(i,o){super(`${i} at ${o}`);p(this,"position",o);this.name="LatexParseError"}};function Ps(e){let t=[],i=0,o=[...e];for(;i<o.length;){let n=o[i]??"";if(n==="\\"){let r=o[i+1];if(r===void 0)throw new M("Trailing backslash",i);if(r==="\\"){t.push({t:"newline",p:i}),i+=2;continue}if(/[A-Za-z]/.test(r)){let l=i+1;for(;l<o.length&&/[A-Za-z]/.test(o[l]??"");)l+=1;t.push({t:"cmd",v:o.slice(i+1,l).join(""),p:i}),i=l;continue}t.push({t:"cmd",v:r,p:i}),i+=2;continue}if(n==="%"){for(;i<o.length&&o[i]!==`
|
|
3
|
+
`;)i+=1;continue}n==="{"?t.push({t:"open",p:i}):n==="}"?t.push({t:"close",p:i}):n==="^"?t.push({t:"sup",p:i}):n==="_"?t.push({t:"sub",p:i}):n==="&"?t.push({t:"amp",p:i}):/\s/.test(n)?t.push({t:"space",p:i}):n==="~"?t.push({t:"cmd",v:" ",p:i}):t.push({t:"char",v:n,p:i}),i+=1}return t}var on="\xA0",Be=/^[0-9]$/,nn=/^\p{L}$/u,$s={matrix:null,smallmatrix:null,pmatrix:{},bmatrix:{open:"[",close:"]"},Bmatrix:{open:"{",close:"}"},vmatrix:{open:"|",close:"|"},Vmatrix:{open:"||",close:"||"}},Hs={textbf:"bold",textit:"italic",textrm:"normal",textsf:"sans-serif",texttt:"monospace"},rn={l:"left",c:"center",r:"right"},zs={boxed:"box",fbox:"box",cancel:"updiagonalstrike",bcancel:"downdiagonalstrike",xcancel:"downdiagonalstrike updiagonalstrike",sout:"horizontalstrike"},Us=new Set(["left","right","big","Big","bigg","Bigg","bigl","bigr","Bigl","Bigr","biggl","biggr","Biggl","Biggr","displaylimits","nonumber","notag"]),Vs=new Set(["big","Big","bigg","Bigg","bigl","bigr","Bigl","Bigr","biggl","biggr","Biggl","Biggr","bigm","Bigm"]),xi=class{constructor(t){p(this,"toks",t);p(this,"pos",0);p(this,"limitsOverride",null)}peek(){return this.toks[this.pos]}next(){let t=this.toks[this.pos];return this.pos+=1,t}skipSpaces(){for(;this.peek()?.t==="space";)this.pos+=1}position(){return this.peek()?.p??-1}parseSequence(t,i=!1){let o=[];for(;;){let n=this.peek();if(!n||n.t==="close"||i&&(n.t==="amp"||n.t==="newline")||n.t==="cmd"&&(n.v==="right"||n.v==="end"||n.v==="middle"))return o;if(n.t==="space"){this.pos+=1;continue}if(n.t==="sup"||n.t==="sub"){this.attachScripts(o,t);continue}if(n.t==="amp"){this.pos+=1,o.push(v("mo","&"));continue}if(n.t==="newline"){this.pos+=1,o.push(F("mspace",{linebreak:"newline"}));continue}if(n.t==="cmd"&&(n.v==="displaystyle"||n.v==="textstyle")){this.pos+=1;let r=this.parseSequence(t,i);return o.push(T("mstyle",[k(r)],{displaystyle:n.v==="displaystyle"?"true":"false"})),o}if(n.t==="cmd"&&n.v==="color"){this.pos+=1;let{spec:r,model:l}=this.parseColorParts(),s=this.parseSequence(t,i),a=s.length===1?s[0]:void 0;return a?.kind==="token"?a.attrs.mathcolor=Se(r,l):s.length>0&&o.push(T("mstyle",[k(s)],{mathcolor:l?Se(r,l):r})),a?.kind==="token"&&o.push(a),o}o.push(...this.parseAtom(t))}}parseColorParts(){let t=null;this.skipSpaces();let i=this.peek();return i?.t==="char"&&i.v==="["&&(this.pos+=1,t=this.readRawUntil("]")),{spec:this.readRawGroup().trim(),model:t}}parseColorSpec(){let{spec:t,model:i}=this.parseColorParts();return Se(t,i)}readRawUntil(t){let i="";for(;;){let o=this.next();if(!o)throw new M(`Expected ${t}`,this.position());if(o.t==="char"&&o.v===t)return i;i+=yi(o)}}readRawGroup(){this.skipSpaces();let t=this.next();if(!t)throw new M("Expected {",this.position());if(t.t!=="open")return yi(t);let i=1,o="";for(;;){let n=this.next();if(!n)throw new M("Unclosed {",t.p);if(n.t==="open"&&(i+=1),n.t==="close"&&(i-=1,i===0))return o;o+=yi(n)}}parseArgument(t){this.skipSpaces();let i=this.peek();if(!i)return k();if(i.t==="open"){this.pos+=1;let o=this.parseSequence(t);return this.expect("close"),k(o)}return i.t==="close"||i.t==="amp"||i.t==="newline"?k():i.t==="char"&&Be.test(i.v)?(this.pos+=1,k([this.makeToken("mn",i.v,t)])):k(this.parseAtom(t))}parseOptional(t){this.skipSpaces();let i=this.peek();if(i?.t!=="char"||i.v!=="[")return null;this.pos+=1;let o=[],n=0;for(;;){let r=this.peek();if(!r)throw new M("Unclosed [",i.p);if(r.t==="char"&&r.v==="]"&&n===0)return this.pos+=1,k(o);if(r.t==="open"&&(n+=1),r.t==="close"&&(n-=1),r.t==="sup"||r.t==="sub"){this.attachScripts(o,t);continue}if(r.t==="space"){this.pos+=1;continue}o.push(...this.parseAtom(t))}}expect(t){let i=this.next();if(i?.t!==t)throw new M(`Expected ${t==="close"?"}":t}`,i?.p??-1)}makeToken(t,i,o,n={}){let r={...n};if(o.variant&&t!=="mo"){let l=t==="mi"&&[...i].length===1;l&&o.variant==="italic"||!l&&o.variant==="normal"||(r.mathvariant=o.variant)}return o.color&&(r.mathcolor=o.color),v(t,i,r)}readScripts(t){let i=null,o=null;for(;;){this.skipSpaces();let n=this.peek();if(n?.t==="sub"&&!i)this.pos+=1,i=this.parseArgument(t);else if(n?.t==="sup"&&!o)this.pos+=1,o=this.parseArgument(t);else return{sub:i,sup:o}}}attachScripts(t,i){let o=t.pop(),n=o?[o]:[];for(;o?.kind==="token"&&o.tag==="mn";){let c=t[t.length-1];if(c?.kind!=="token"||c.tag!=="mn")break;n.unshift(c),t.pop()}let r=this.limitsOverride;this.limitsOverride=null;let{sub:l,sup:s}=this.readScripts(i);if(o&&js(o)&&this.startsAtom()){t.push(...this.prescripted(l,s,i));return}if(s?.children.length===1&&s.children[0]?.kind==="token"&&s.children[0].text==="\u2218"&&!l){t.push(...n,v("mo","\xB0"));return}let m=k(n),d=r??(o!==void 0&&Ws(o));l&&s?t.push(T(d?"munderover":"msubsup",[m,l,s])):l?t.push(T(d?"munder":"msub",[m,l])):s?t.push(T(d?"mover":"msup",[m,s])):t.push(...n)}startsAtom(){let t=this.peek();return t!==void 0&&(t.t==="char"||t.t==="cmd"||t.t==="open")}prescripted(t,i,o){let[n,...r]=this.parseAtom(o),l=r.length===0?this.readScripts(o):{sub:null,sup:null},s=m=>m??F("none"),a=[k(n?[n]:[])];return(l.sub||l.sup)&&a.push(s(l.sub),s(l.sup)),a.push(F("mprescripts"),s(t),s(i)),[T("mmultiscripts",a),...r]}parseAtom(t){let i=this.next();if(!i)return[];switch(i.t){case"open":{let o=this.parseSequence(t);return this.expect("close"),o.length===1?o:[T("mrow",[k(o)])]}case"char":return this.parseChar(i.v,t);case"cmd":return this.parseCommand(i.v,t,i.p);default:return[]}}parseChar(t,i){if(Be.test(t)){let o=[this.makeToken("mn",t,i)];for(;;){let n=this.peek(),r=this.toks[this.pos+1];if(n?.t==="char"&&Be.test(n.v))o.push(this.makeToken("mn",n.v,i)),this.pos+=1;else if(n?.t==="char"&&n.v==="."&&r?.t==="char"&&Be.test(r.v))o.push(this.makeToken("mo",".",i)),this.pos+=1;else return o}}if(nn.test(t)){if(i.variant==="double-struck"&&Dt[t]){let o={mathvariant:"normal"};return i.color&&(o.mathcolor=i.color),[v("mi",Dt[t]??t,o)]}return[this.makeToken("mi",t,i)]}return[this.makeToken("mo",t,i)]}parseFence(){this.skipSpaces();let t=this.next();if(!t)throw new M("Missing delimiter",-1);let i=t.t==="cmd"?`\\${t.v}`:t.t==="char"?t.v:"",o=fo[i];if(o===void 0)throw new M(`Unknown delimiter ${i}`,t.p);return o}parseCommand(t,i,o){let n=ne[t];if(n)return n.char?[v("mo",n.char)]:[F("mspace",{width:n.width??"0em"})];if(t==="left"){let h=this.parseFence(),x=[...this.parseSequence(i)];for(;this.peek()?.t==="cmd"&&this.peek().v==="middle";)this.pos+=1,x.push(v("mo",this.parseFence(),{stretchy:"true"})),x.push(...this.parseSequence(i));let X=this.next();if(X?.t!=="cmd"||X.v!=="right")throw new M("Missing \\right",o);let D=this.parseFence(),P={};return h!=="("&&(P.open=h),D!==")"&&(P.close=D),[T("mfenced",[k(x)],P)]}if(Vs.has(t))return[v("mo",this.parseFence())];if(t==="limits"||t==="nolimits")return this.limitsOverride=t==="limits",[];if(t==="frac"||t==="dfrac"||t==="tfrac"||t==="cfrac"){let h=this.parseArgument(i),w=this.parseArgument(i),x=T("mfrac",[h,w]);return t==="dfrac"||t==="cfrac"?[T("mstyle",[k([x])],{displaystyle:"true"})]:t==="tfrac"?[T("mstyle",[k([x])],{displaystyle:"false"})]:[x]}if(t==="binom"||t==="dbinom"||t==="tbinom"){let h=this.parseArgument(i),w=this.parseArgument(i);return[T("mfenced",[k([T("mfrac",[h,w],{linethickness:"0"})])])]}if(t==="sqrt"){let h=this.parseOptional(i),w=this.parseArgument(i);return h&&h.children.length>0?[T("mroot",[w,h])]:[T("msqrt",[w])]}if(t==="text"||t==="textnormal"||t==="mbox"||t==="textup"||t==="hbox"){let h=this.readRawGroup().replace(/ /g,on),w={};return i.color&&(w.mathcolor=i.color),h?[...h].map(x=>v("mtext",x,w)):[]}let r=Hs[t];if(r){let h=this.readRawGroup().replace(/ /g,on),w={mathvariant:r};return i.color&&(w.mathcolor=i.color),h?[v("mtext",h,w)]:[]}if(t==="operatorname"){let h=this.readRawGroup();return[v("mo",h,i.color?{mathcolor:i.color}:{})]}if(t==="pmod"){let h=this.parseArgument(i);return[v("mo","("),v("mi","mod"),...h.children,v("mo",")")]}if(t==="bmod"||t==="mod")return[v("mi","mod")];if(t==="substack")return this.parseArgument(i).children;let l=ae[t];if(l){let h=this.parseArgument({...i,variant:l}),w=h.children.every(D=>D.kind==="token"&&D.tag==="mi"&&[...D.text].length===1&&nn.test(D.text)),x=h.children.length===1?h.children[0]:void 0,X=t==="mathcal"&&x?.kind==="token"?bt[x.text]:void 0;if(X)return[v("mo",X,i.color?{mathcolor:i.color}:{})];if(t==="mathit"&&w&&h.children.length>1){let D=h.children.map(P=>P.kind==="token"?P.text:"").join("");return[this.makeToken("mi",D,{...i,variant:l},{mathvariant:l})]}return h.children}if(t==="color"||t==="textcolor"){let h=this.parseColorSpec();return this.parseArgument({...i,color:h}).children}let s=re[t];if(s!==void 0){let h=this.parseArgument(i);return[T("mover",[h,k([v("mo",s)])],ho.has(t)?{accent:"true"}:{})]}let a=le[t];if(a!==void 0){let h=this.parseArgument(i);return[T("mover",[h,k([v("mo",a)])])]}let m=se[t];if(m!==void 0){let h=this.parseArgument(i);return[T("munder",[h,k([v("mo",m)])])]}if(t==="overset"||t==="stackrel"){let h=this.parseArgument(i),w=this.parseArgument(i);return[T("mover",[w,h])]}if(t==="underset"){let h=this.parseArgument(i),w=this.parseArgument(i);return[T("munder",[w,h])]}if(t==="xrightarrow"||t==="xleftarrow"){let h=this.parseOptional(i),w=this.parseArgument(i),x=k([v("mo",t==="xrightarrow"?"\u2192":"\u2190")]);return h&&h.children.length>0?[T("munderover",[x,h,w])]:[T("mover",[x,w])]}let d=zs[t];if(d)return[T("menclose",[this.parseArgument(i)],{notation:d})];if(t==="enclose"){let h=this.readRawGroup();return[T("menclose",[this.parseArgument(i)],{notation:h.replace(/,/g," ")})]}if(t==="phantom")return[T("mphantom",[this.parseArgument(i)])];if(t==="not"){this.skipSpaces();let h=this.parseAtom(i)[0];return h?.kind==="token"?[v("mo",{"=":"\u2260","\u2208":"\u2209","\u2282":"\u2284","\u2286":"\u2288","<":"\u226E",">":"\u226F","\u2261":"\u2262"}[h.text]??`${h.text}\u0338`)]:h?[h]:[]}if(t==="begin")return[this.parseEnvironment(i,o)];if(t==="mathstrut"||t==="strut"||Us.has(t))return[];let c=ie[t];if(c)return[v("mo",c,{largeop:"true"})];let u=ee[t];if(u)return[v("mo",u)];if(oe.includes(t))return[v("mi",t,i.color?{mathcolor:i.color}:{})];let f=Gt[t];if(f)return[this.makeToken("mi",f,i)];let b=mi[t];if(b)return[this.makeToken("mo",b,i)];throw new M(`Unknown command \\${t}`,o)}parseEnvironment(t,i){let o=this.readRawGroup().trim(),n=null,r=null;if(o==="array"){let c=this.readRawGroup(),f=[...c.replace(/[^lcr]/g,"")].map(h=>rn[h]??"center");f.some(h=>h!=="center")&&(n=f.join(" "));let b=Ys(c);b.includes("solid")&&(r=b.join(" "))}let l=[],s=[];for(;;){let c=this.parseSequence(t,!0);s.push(T("mtd",[k(c)]));let u=this.next();if(!u)throw new M(`Missing \\end{${o}}`,i);if(u.t!=="amp"){if(u.t==="newline"){l.push(T("mtr",s)),s=[];continue}if(u.t==="cmd"&&u.v==="end"){let f=this.readRawGroup().trim();if(f!==o)throw new M(`Mismatched \\end{${f}}`,u.p);s.length===1&&s[0]?.children[0]?.kind==="row"&&s[0].children[0].children.length===0&&l.length>0||l.push(T("mtr",s));break}throw new M("Unexpected token in environment",u.p)}}let a={};n&&(a.columnalign=n),r&&(a.columnlines=r),(o==="cases"||o==="dcases")&&(a.columnalign="left"),(o==="aligned"||o==="align"||o==="align*"||o==="split"||o==="eqnarray"||o==="alignat")&&(a.columnalign="right left",a.columnspacing="0em"),(o==="gathered"||o==="gather")&&(a.columnalign="center");let m=T("mtable",l,a);if(o==="cases"||o==="dcases")return T("mfenced",[k([m])],{open:"{",close:""});if(o==="rcases")return T("mfenced",[k([m])],{open:"",close:"}"});let d=$s[o];if(d)return T("mfenced",[k([m])],d);if(d===null||o==="array"||a.columnalign)return m;throw new M(`Unknown environment ${o}`,i)}atEnd(){return this.skipSpaces(),this.pos>=this.toks.length}rest(){return this.peek()}};function yi(e){switch(e.t){case"cmd":return`\\${e.v}`;case"char":return e.v;case"open":return"{";case"close":return"}";case"sup":return"^";case"sub":return"_";case"amp":return"&";case"newline":return"\\\\";case"space":return" "}}var qs=16,Ae=255;function Tt(e){return Math.max(0,Math.min(Ae,Math.round(e))).toString(qs).padStart(2,"0").toUpperCase()}function Se(e,t){let i=e.trim();if(t==="rgb"){let[n=0,r=0,l=0]=i.split(",").map(s=>Number.parseFloat(s));return`#${Tt(n*Ae)}${Tt(r*Ae)}${Tt(l*Ae)}`}if(t==="RGB"){let[n=0,r=0,l=0]=i.split(",").map(s=>Number.parseFloat(s));return`#${Tt(n)}${Tt(r)}${Tt(l)}`}if(t==="HTML"||/^#?[0-9a-fA-F]{6}$/.test(i))return`#${i.replace("#","").toUpperCase()}`;let o=me[i.toLowerCase()];return o||i}function Ys(e){let t=[],i=!1,o=!1;for(let n of e)n==="|"?o=i:rn[n]&&(i&&t.push(o?"solid":"none"),i=!0,o=!1);return t}function js(e){return e.kind==="element"&&e.tag==="mrow"&&e.children.length===1&&e.children[0]?.kind==="row"&&e.children[0].children.length===0}function Ws(e){return!!(e.kind==="token"&&e.tag==="mo"&&(uo.has(e.text)||e.attrs.largeop==="true")||e.kind==="element"&&e.tag==="munder"&&Zs(e.children[1],"\u23DF")||e.kind==="token"&&e.tag==="mi"&&po.has(e.text))}function Zs(e,t){let i=e?.kind==="row"&&e.children.length===1?e.children[0]:void 0;return i?.kind==="token"&&i.text===t}function ln(e){let t=new xi(Ps(e)),i=t.parseSequence({variant:null,color:null});if(!t.atEnd()){let o=t.rest();throw new M("Unexpected token",o?.p??-1)}return i}function kt(e){return{attrs:{},root:k(ln(e))}}var Qs=255,Js=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,ta={"{":"\\{","}":"\\}","#":"\\#",$:"\\$","%":"\\%","&":"\\&",_:"\\_","\\":"\\backslash","~":"\\sim","^":"\\hat{}","\xB0":"^\\circ"},ea={bold:"textbf",italic:"textit",normal:"textrm","sans-serif":"textsf",monospace:"texttt"},Ci=new Map(Object.entries(ie).map(([e,t])=>[t,e])),sn=new Map(Object.entries(bt).map(([e,t])=>[t,e])),ia=/^\p{L}{2,}$/u,oa=(()=>{let e=new Map;for(let[t,i]of Object.entries(ae))t.startsWith("math")&&!e.has(i)&&e.set(i,t);return e.set("bold-italic","boldsymbol"),e})(),vi=new Map(Object.entries(Dt).map(([e,t])=>[t,e])),Me=new Map([...Object.entries(re).filter(([e])=>!e.startsWith("wide")).map(([e,t])=>[t,e]),["\xA8","ddot"]]),na=new Map(Object.entries(le).map(([e,t])=>[t,e])),ra=new Map(Object.entries(se).map(([e,t])=>[t,e])),pn=(()=>{let e=new Map;for(let[t,i]of Object.entries(ne))i.char&&!e.has(i.char)&&e.set(i.char,/^[a-z]+$/.test(t)?`\\${t} `:`\\${t}`);return e})(),la={"(":"(",")":")","[":"[","]":"]","{":"\\{","}":"\\}","|":"|","\u2016":"\\|","":".","\u27E8":"\\langle","\u27E9":"\\rangle","\u2329":"\\langle","\u232A":"\\rangle","<":"\\langle",">":"\\rangle","\u230A":"\\lfloor","\u230B":"\\rfloor","\u2308":"\\lceil","\u2309":"\\rceil","||":"\\|","\u27E6":"\\llbracket","\u27E7":"\\rrbracket"},sa={"()":"pmatrix","[]":"bmatrix","{}":"Bmatrix","||":"vmatrix","\u2016\u2016":"Vmatrix","||||":"Vmatrix"},aa={left:"l",center:"c",right:"r"},ma={box:"boxed",updiagonalstrike:"cancel",downdiagonalstrike:"bcancel","updiagonalstrike downdiagonalstrike":"xcancel","downdiagonalstrike updiagonalstrike":"xcancel"},hn=new Set(oe);function C(e){let t="";for(let i of e)i&&(/\\[A-Za-z]+$/.test(t)&&/^[A-Za-z]/.test(i)&&(t+=" "),t+=i);return t}function Ri(e){let t=Number.parseInt(e,16)/Qs,i=Math.round(t*1e3)/1e3;return Number.isInteger(i)?i.toFixed(1):String(i)}function fn(e){let t=Js.exec(e);return t?`\\color[rgb]{${Ri(t[1]??"00")}, ${Ri(t[2]??"00")}, ${Ri(t[3]??"00")}}`:`\\color{${e}}`}function da(e){return`{${fn(e)}`}function ca(e){return[...e].length===1&&e!==" "&&e!=="\\"}function j(e){return`{${e}}`}function S(e){return ca(e)||/^\\[A-Za-z]+$/.test(e)?e:j(e)}function U(e){let t=e?V(e):"",i=e?I(e.children):[],o=i.length===1?i[0]:void 0;return o?.kind==="element"&&o.tag==="mfrac"&&Object.keys(o.attrs).length===0||o?.kind==="token"&&o.tag==="mtext"&&Object.keys(o.attrs).length===0?t:S(t)}function ua(e){let t=ta[e];if(t)return t;let i=Ft.get(e);if(i)return`\\${i}`;let o=pn.get(e);return o||e}function an(e){return[...e].map(ua).join("")}function pa(e){let t,i=e.attrs.mathvariant,o=i?oa.get(i):void 0,n=e.tag==="mi"&&[...e.text].length>1;if(e.tag==="mtext"){let r=i?ea[i]??"text":"text";return mn(e,`\\${r}{${e.text.replace(/[{}\\]/g,l=>`\\${l}`)}}`)}else e.tag==="mn"?t=e.text:n&&o&&i!=="normal"?t=an(e.text):n?t=e.text==="mod"?"\\mod":hn.has(e.text)?`\\${e.text}`:`\\operatorname{${e.text}}`:e.tag==="mi"&&vi.has(e.text)?t=`\\mathbb{${vi.get(e.text)??""}}`:e.tag==="mo"&&e.attrs.largeop==="true"&&Ci.has(e.text)?t=`\\${Ci.get(e.text)??""}`:sn.has(e.text)?t=`\\mathcal{${sn.get(e.text)??""}}`:e.tag==="mo"&&ia.test(e.text)?t=`\\operatorname{${e.text}}`:t=(e.tag==="mo"?pn.get(e.text):void 0)??an(e.text);return o&&!vi.has(e.text)&&!(i==="italic"&&e.tag==="mi"&&!n)&&!(i==="normal"&&e.tag!=="mi")&&(t=e.tag==="mo"?`\\${o}${j(t)}`:C([`\\${o}`,S(t)])),mn(e,t)}function mn(e,t){let i=e.attrs.mathcolor;return i?`${da(i)}${t}}`:t}function V(e){return ha(e.children)}function ha(e){return C(I(e).map(xa))}function N(e,t){let i=e.children[t];return i?.kind==="row"?i:null}function A(e,t){let i=N(e,t);return i?V(i):""}function yt(e){if(!e)return null;let t=I(e.children),i=t[0];return t.length===1&&i?.kind==="token"?i:null}function dn(e){let t=N(e,0),i=t?V(t):"";if(!i)return"{}";let o=t?I(t.children):[],n=o[0],r=n?.kind==="element"&&n.tag==="mfenced"&&(n.attrs.open??"(")==="("&&(n.attrs.close??")")===")";return o.length===1&&n&&(n.kind==="token"||n.kind==="element"&&!["msub","msup","msubsup","mfenced"].includes(n.tag)||r)?i:j(i)}function cn(e,t){let i=e??t;return la[i]??i}function un(e){return e.children.filter(t=>t.kind==="element").map(t=>t.children.map(i=>i.kind==="element"?A(i,0):"").join("&")).join("\\\\")}function Bi(e,t){if(!t){let i=Math.max(...e.children.map(l=>l.kind==="element"?l.children.length:0),1),o=(e.attrs.columnalign??"center").split(/\s+/),n=(e.attrs.columnlines??"none").split(/\s+/);return`\\begin{array}{${Array.from({length:i},(l,s)=>{let a=aa[o[s]??o[o.length-1]??"center"]??"c",m=s<i-1&&(n[s]??n[n.length-1])==="solid"?"|":"";return`${a}${m}`}).join("")}}${un(e)}\\end{array}`}return`\\begin{${t}}${un(e)}\\end{${t}}`}function fa(e){let t=e.attrs.open??"(",i=e.attrs.close??")",o=N(e,0),n=o?I(o.children):[],r=n[0];if(n.length===1&&r?.kind==="element"&&r.tag==="mtable"){let l=sa[`${t}${i}`];if(l)return Bi(r,l);if(t==="{"&&i==="")return Bi(r,"cases")}return n.length===1&&r?.kind==="element"&&r.tag==="mfrac"&&r.attrs.linethickness==="0"&&t==="("&&i===")"?C(["\\binom",S(A(r,0)),S(A(r,1))]):C([`\\left${cn(t,"(")}`,o?V(o):"",`\\right${cn(i,")")}`])}function ga(e){let t=yt(N(e,1)),i=N(e,0),o=A(e,0);if(t?.tag==="mo"){let r=t.text;if(e.attrs.accent==="true"||r==="\u21C0"){let s=r==="\u21C0"?"vec":Me.get(r);if(s)return C([`\\${s}`,S(o)])}let l=na.get(r)??(Me.get(r)==="hat"?"widehat":Me.get(r)==="tilde"?"widetilde":Me.get(r));if(l)return C([`\\${l}`,S(o)])}let n=yt(i);return n?.tag==="mo"&&n.text==="\u2192"?C(["\\xrightarrow",S(A(e,1))]):n?.tag==="mo"&&n.text==="\u2190"?C(["\\xleftarrow",S(A(e,1))]):Ai(i)?C([o,`^${U(N(e,1))}`]):C(["\\overset",S(A(e,1)),S(o)])}function ba(e){let t=yt(N(e,1)),i=N(e,0),o=A(e,0);if(Ai(i)||wa(i))return C([o,`_${U(N(e,1))}`]);if(t?.tag==="mo"){let n=ra.get(t.text);if(n)return C([`\\${n}`,S(o)])}return C(["\\underset",S(A(e,1)),S(o)])}function wa(e){let t=e?I(e.children):[],i=t.length===1?t[0]:void 0;return i?.kind==="element"&&i.tag==="munder"&&yt(N(i,1))?.text==="\u23DF"}function Ta(e){let t=yt(e);return t?.tag==="mo"&&/^(sum|prod|coprod|big)/.test(Ft.get(t.text)??Ci.get(t.text)??"")}function Ei(e){return Ta(N(e,0))?C([dn(e),"\\nolimits"]):dn(e)}function gn(e,t){let i=A(e,0),o=e.attrs.displaystyle,n=e.attrs.mathcolor;if(!o&&!n)return i;let r=i;return o==="true"&&(r=C(["\\displaystyle",i])),o==="false"&&(r=C(["\\textstyle",i])),n&&(r=C([fn(n),r])),t?r:j(r)}function Ai(e){let t=yt(e);return t?t.tag==="mo"?t.attrs.largeop==="true"||Ft.has(t.text)&&/^(sum|prod|coprod|big|int|iint|iiint|oint)/.test(Ft.get(t.text)??""):t.tag==="mi"&&hn.has(t.text):!1}function ka(e){switch(e.tag){case"mfrac":return e.attrs.linethickness==="0"?`\\genfrac{}{}{0pt}{}${j(A(e,0))}${j(A(e,1))}`:e.attrs.bevelled==="true"?C([`{}^${U(N(e,0))}`,"/",`{}_${U(N(e,1))}`]):C(["\\frac",S(A(e,0)),S(A(e,1))]);case"msqrt":return C(["\\sqrt",S(A(e,0))]);case"mroot":return C([`\\sqrt[${A(e,1)}]`,S(A(e,0))]);case"msup":return C([Ei(e),`^${U(N(e,1))}`]);case"msub":return C([Ei(e),`_${U(N(e,1))}`]);case"msubsup":return C([Ei(e),`_${U(N(e,1))}`,`^${U(N(e,2))}`]);case"munderover":return Ai(N(e,0))?C([A(e,0),`_${U(N(e,1))}`,`^${U(N(e,2))}`]):C(["\\underset",S(A(e,1)),j(C(["\\overset",S(A(e,2)),S(A(e,0))]))]);case"mover":return ga(e);case"munder":return ba(e);case"mfenced":return fa(e);case"mtable":return Bi(e);case"menclose":{let t=(e.attrs.notation??"longdiv").trim(),i=ma[t],o=A(e,0);return i?C([`\\${i}`,S(o)]):`\\enclose{${t.replace(/\s+/g,",")}}${j(o)}`}case"mphantom":return`\\phantom${j(A(e,0))}`;case"mstyle":return gn(e,!1);case"mmultiscripts":{let t=e.children,i=t[0]?.kind==="row"?V(t[0]):"",o=t.findIndex(a=>a.kind==="leaf"&&a.tag==="mprescripts"),n=t.slice(1,o<0?void 0:o),r=o<0?[]:t.slice(o+1),l=a=>{let m="";for(let d=0;d+1<a.length;d+=2){let c=a[d],u=a[d+1],f=c?.kind==="row"?V(c):"",b=u?.kind==="row"?V(u):"";f&&(m+=`_${S(f)}`),b&&(m+=`^${S(b)}`)}return m},s=l(r);return C([s?`{}${s}`:"",i?S(i):"{}",l(n)])}case"mrow":case"mpadded":case"merror":case"maction":case"mtd":return A(e,0);case"mstack":case"mlongdiv":case"msgroup":return e.children.filter(t=>t.kind==="row").map(V).join("\\\\");default:return e.children.map(t=>t.kind==="row"?V(t):"").join("")}}function ya(e){if(e.tag==="mspace"){if(e.attrs.linebreak==="newline")return"\\\\";let t=e.attrs.width;return t==="-0.2em"||t==="-0.1667em"?"\\!":t==="2em"?"\\qquad ":t==="1em"?"\\quad ":t?`\\hspace{${t}}`:""}return""}function xa(e){switch(e.kind){case"token":return pa(e);case"leaf":return ya(e);case"element":return ka(e)}}function Pt(e){let t=I(e.root.children),i=t.length===1?t[0]:void 0;return i?.kind==="element"&&i.tag==="mstyle"?gn(i,!0).trim():V(e.root).trim()}var va={B:"\u212C",E:"\u2130",F:"\u2131",H:"\u210B",I:"\u2110",L:"\u2112",M:"\u2133",R:"\u211B",e:"\u212F",g:"\u210A",o:"\u2134"},Ra={C:"\u212D",H:"\u210C",I:"\u2111",R:"\u211C",Z:"\u2128"},Ea={C:"\u2102",H:"\u210D",N:"\u2115",P:"\u2119",Q:"\u211A",R:"\u211D",Z:"\u2124"},xn={bold:{upper:119808,lower:119834,digits:120782,greekUpper:120488,greekLower:120514},italic:{upper:119860,lower:119886,greekUpper:120546,greekLower:120572,exceptions:{h:"\u210E"}},"bold-italic":{upper:119912,lower:119938,greekUpper:120604,greekLower:120630},script:{upper:119964,lower:119990,exceptions:va},"bold-script":{upper:120016,lower:120042},fraktur:{upper:120068,lower:120094,exceptions:Ra},"double-struck":{upper:120120,lower:120146,digits:120792,exceptions:Ea},"bold-fraktur":{upper:120172,lower:120198},"sans-serif":{upper:120224,lower:120250,digits:120802},"bold-sans-serif":{upper:120276,lower:120302,digits:120812,greekUpper:120662,greekLower:120688},"sans-serif-italic":{upper:120328,lower:120354},"sans-serif-bold-italic":{upper:120380,lower:120406,greekUpper:120720,greekLower:120746},monospace:{upper:120432,lower:120458,digits:120822}},bn=65,Ca=90,wn=97,Ba=122,Tn=48,Aa=57,kn=913,Sa=937,yn=945,Ma=969;function Na(e,t){let i=t.exceptions?.[e];if(i)return i;let o=e.codePointAt(0)??0;return o>=bn&&o<=Ca&&t.upper!==void 0?String.fromCodePoint(t.upper+o-bn):o>=wn&&o<=Ba&&t.lower!==void 0?String.fromCodePoint(t.lower+o-wn):o>=Tn&&o<=Aa&&t.digits!==void 0?String.fromCodePoint(t.digits+o-Tn):o>=kn&&o<=Sa&&t.greekUpper!==void 0?String.fromCodePoint(t.greekUpper+o-kn):o>=yn&&o<=Ma&&t.greekLower!==void 0?String.fromCodePoint(t.greekLower+o-yn):e}function Si(e,t){let i=xn[t];return i?[...e].map(o=>Na(o,i)).join(""):null}function vn(e){return e in xn}var La=["dir","mathcolor","mathbackground","mathsize","displaystyle","scriptlevel"],Ia={math:["display"],mo:["form","fence","separator","lspace","rspace","stretchy","symmetric","maxsize","minsize","largeop","movablelimits"],mfrac:["linethickness"],mover:["accent"],munder:["accentunder"],munderover:["accent","accentunder"],mspace:["width","height","depth"],mpadded:["width","height","depth","lspace","voffset"],mtd:["rowspan","columnspan"]},Xa=new Set(["lspace","rspace","width","height","depth","voffset","maxsize","minsize"]),Ga=18,Da={veryverythinmathspace:1,verythinmathspace:2,thinmathspace:3,mediummathspace:4,thickmathspace:5,verythickmathspace:6,veryverythickmathspace:7},Fa={small:"80%",normal:"100%",big:"125%"},Oa={thin:"0.04em",medium:"0.066em",thick:"0.12em"},_a=.066,Ka=100,Mi=/^-?\d*\.?\d+$/,Pa=/^[\w\s#().,%+-]*$/,$a=/^[\w\s,"'-]+$/,Ha=new Set(["color","background-color","font-family","font-size","font-weight","font-style","text-decoration"]);function xt(e){let t=e.trim(),i=t.startsWith("negative"),o=i?t.slice(8):t,n=Da[o];return n!==void 0?`${i?"-":""}${(n/Ga).toFixed(4)}em`:Mi.test(t)&&t!=="0"?`${t}em`:t}function za(e){let t=e.trim(),i=Fa[t];return i||(Mi.test(t)?`${Number(t)*Ka}%`:t)}function Ua(e){let t=e.trim(),i=Oa[t];return i||(Mi.test(t)&&t!=="0"?`${Number(t)*_a}em`:t)}function Rn(e){return Pa.test(e)&&!/url\s*\(|expression/i.test(e)}function Va(e){if(!e)return null;let t=[];for(let i of e.split(";")){let o=i.indexOf(":");if(o<=0)continue;let n=i.slice(0,o).trim().toLowerCase(),r=i.slice(o+1).trim();if(!Ha.has(n)||r==="")continue;(n==="font-family"?$a.test(r):Rn(r))&&t.push(`${n}:${r}`)}return t.length>0?t.join(";"):null}function G(e,t){let i={},o=[...La,...Ia[e]??[]];for(let r of o){let l=t[r];l!==void 0&&(r==="mathsize"?i[r]=za(l):r==="linethickness"?i[r]=Ua(l):Xa.has(r)?i[r]=xt(l):Rn(l)&&(i[r]=l))}let n=Va(t.style);return n&&(i.style=n),i}function $(e,t){if(t.length===0)return;let i=e.style;e.style=i?`${i};${t.join(";")}`:t.join(";")}var qa="data-sw-id",Ya="data-sw-row",$t="data-sw-line";function y(e,t={},i=[]){return{tag:e,attrs:t,children:i}}function at(e,t,i){let o=t.createElementNS(O,e.tag);for(let[n,r]of Object.entries(e.attrs))o.setAttribute(n,r);e.nodeId!==void 0&&(o.setAttribute(qa,String(e.nodeId)),i?.atoms.set(e.nodeId,o)),e.rowId!==void 0&&(o.setAttribute(Ya,String(e.rowId)),i?.rows.set(e.rowId,o)),e.line&&o.setAttribute($t,"");for(let n of e.children)o.appendChild(typeof n=="string"?t.createTextNode(n):at(n,t,i));return o}function Ne(e,t=!0){let i=Object.entries(e.attrs).map(([r,l])=>` ${r}="${nt(l,!0)}"`).join(""),o=t?` xmlns="${O}"`:"",n=e.children.map(r=>typeof r=="string"?nt(r,!1):Ne(r,!1)).join("");return`<${e.tag}${i}${o}>${n}</${e.tag}>`}var ja="sw-placeholder",Ni={width:"0.6em",height:"0.75em",depth:"0.15em"},Wa=new Set(["mfrac","mroot","msqrt","msub","msup","msubsup","munder","mover","munderover","mmultiscripts","mstyle","mphantom","mpadded","merror"]),ct="1px solid currentColor",Dn=.1,Fn=.2,Xe=.6,Za="0",Qa=.5,Li="padding:0",Le="padding:0.1em 0",Ja="1",tm="(",em=")",En='"',im="-",om="\u2212",nm=new Map([["\u2229","\u22C2"],["\u222A","\u22C3"],["\u2293","\u2A05"],["\u2294","\u2A06"]]),On=new Set(["\u2211","\u220F","\u2210","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A05","\u2A06"]),_n=new Set(["munder","mover","munderover"]),rm=new Set([..._n,"msub","msup","msubsup"]),mt="font-family:",lm=new Set(["bold","italic","bold-italic"]),sm="italic",am=new Set([...On,"\u222B","\u222C","\u222D","\u222E","\u222F","\u2230","\u2A0C"]),mm=new Set(["\xAF","\u203E","_","\u0332","^","\u02C6","\u02C7","\u02D8","\u02D9","\u02DA","\xA8","~","\u02DC","\xB4","`","\u23B4","\u23B5","\u23DC","\u23DD","\u23DE","\u23DF","\u2190","\u2192","\u2194","\u21BC","\u21BD","\u21C0","\u21C1","\u21D0","\u21D2","\u21D4"]),dm={mover:[[1,"accent"]],munder:[[1,"accentunder"]],munderover:[[1,"accentunder"],[2,"accent"]]};function Kn(e){if(e?.kind!=="row"||e.children.length!==1)return;let t=e.children[0];return t?.kind==="token"&&t.tag==="mo"?t.text:void 0}function cm(e){if(!_n.has(e.tag))return!1;let t=Pn(e);return t!==void 0&&(t.attrs.largeop==="true"||On.has(t.text))}function Pn(e){let t=e.children[0],i=t?.kind==="row"&&t.children.length===1?t.children[0]:t;return i?.kind==="token"&&i.tag==="mo"?i:void 0}function Cn(e){return e?.tag==="mo"&&(e.attrs.largeop==="true"||am.has(e.text))}function um(e){return mm.has(Kn(e)??"")}var Bn="0.9em",An="0",pm="0.15em",hm=new Map([["\u23DC",An],["\u23DD",An],["\u23DE",Bn],["\u23DF",Bn]]),fm={mover:["accent","height"],munder:["accentunder","depth"]};function gm(e){let t=hm.get(Kn(e.children[1])??""),i=fm[e.tag];return t===void 0||i===void 0?void 0:{tag:e.tag,attrs:i,minWidth:t}}function bm(e,{tag:t,attrs:[i,o],minWidth:n}){return y(t,{[i]:"true"},[e,y("mspace",{width:n,[o]:pm})])}var wm={mover:[void 0,"over"],munder:[void 0,"under"],munderover:[void 0,"under","over"]},Tm=[[8592,8703],[10224,10239],[10496,10623]],vt="1em";function km(e){if(e?.kind!=="row"||e.children.length!==1)return!1;let t=e.children[0];if(t?.kind!=="token"||t.tag!=="mo"||t.attrs.stretchy==="false"||[...t.text].length!==1)return!1;let i=t.text.codePointAt(0)??0;return Tm.some(([o,n])=>i>=o&&i<=n)}function ym(e,t){let i=t==="over"?`padding-bottom:${vt};margin-top:-${vt}`:`padding-top:${vt};margin-bottom:-${vt}`;return y("mpadded",{voffset:t==="over"?`-${vt}`:vt,style:i},[e])}var Ii={left:"left",center:"center",right:"right",decimalpoint:"right"},xm={top:"top",bottom:"bottom",center:"middle",baseline:"baseline",axis:"middle"},Sn="3px double currentColor",Mn={"|":ct,"\u2223":ct,"\u2016":Sn,"\u2225":Sn},Nn="0.2em",vm="padding-block:0.1em",Rm=new Set(["stackedrightright","mediumstackedrightright","shortstackedrightright"]),Em=")",Ln="padding-left:0.2em",Cm="padding-right:0.3em",Bm="padding:0 0 0.1em",Am="padding-top:0.1em";function Xi(e){return[`text-align:${e}`,`text-align:-webkit-${e}`]}var $n="text-align:start",Hn={height:"0.8em",depth:"0.2em"},Sm={height:Hn.height,depth:"0"},Mm="padding:0.45em 0 0",Nm="math-style:inherit";function In(e){return e.length===0?[]:[y("mrow",{style:$n},[...e])]}function Ie(e){let t=`calc(50% - ${Xe}px)`,i=`calc(50% + ${Xe}px)`;return`linear-gradient(${e}, transparent ${t}, currentColor ${t}, currentColor ${i}, transparent ${i})`}var Lm={box:["border"],roundedbox:["border"],circle:["border"],left:["border-left"],right:["border-right"],top:["border-top"],bottom:["border-bottom"],actuarial:["border-top","border-right"],madruwb:["border-bottom","border-right"],longdiv:["border-top"],phasorangle:["border-bottom"]},Im={roundedbox:"0.4em",circle:"50%"},Xm={circle:"padding:0.3em 0.4em",roundedbox:"padding:0.1em",longdiv:"padding:0.2em 0 0.2em 0.35em"},Gm=`radial-gradient(0.55em 60% at -0.3em 50%, transparent calc(100% - ${2*Xe}px), currentColor calc(100% - ${2*Xe}px), currentColor 100%, transparent 100%)`,zn=.25,Dm=.35,Xn={image:Ie("to bottom right"),inline:0,block:zn},Fm={horizontalstrike:{image:Ie("to bottom"),inline:Fn,block:Dn},verticalstrike:{image:Ie("to right"),inline:0,block:Dm},updiagonalstrike:Xn,updiagonalarrow:Xn,downdiagonalstrike:{image:Ie("to top right"),inline:0,block:zn}};function Gn(e){return e===0?"0":`${e}em`}function Om(e,t){let i=e.has("border")||e.size===0&&t.length===0,o=Math.max(0,...t.map(l=>l.inline)),n=l=>Gn(Math.max(o,i||e.has(l)?Fn:0)),r=Gn(Math.max(Dn,...t.map(l=>l.block)));return`padding:${r} ${n("border-right")} ${r} ${n("border-left")}`}function dt(e,t){if(!e)return;let i=e.trim().split(/\s+/);return i[Math.min(t,i.length-1)]}function _m(e){return e.kind==="leaf"&&e.tag==="mspace"&&e.attrs.linebreak==="newline"}function Km(e){return e.tag==="mo"&&e.text!==""&&e.text.trim()===""}var Pm=new Set([",",":",";","%","*",".","?","@","/","-","^","\xB7","\u2022","\u2043","\u2305","\u2306","\u2145","\u2146"]),$m=/^\p{Sm}$/u,Hm=[[8592,8703],[10224,10239],[10496,10623],[11008,11263]];function zm(e){let t=[...e],i=t[0];if(t.length!==1||i===void 0||$m.test(i)||Pm.has(i))return!1;let o=i.codePointAt(0)??0;return!Hm.some(([n,r])=>o>=n&&o<=r)}function Um({atoms:e,first:t}){let i=e[0];t?.kind==="token"&&t.tag==="mo"&&t.attrs.lspace===void 0&&i&&(i.attrs.lspace="0")}var Gi=class{constructor(t){p(this,"options",t);p(this,"lineAlign","left");p(this,"textFamily",null)}document(t){let{mathsize:i,...o}=t.attrs,n=G("math",o),r=n.style?.split(";")??[],l=r.find(d=>d.startsWith(mt))?.slice(mt.length),s=this.options.fallbackFonts,a=l===void 0?null:s?`${l}, ${s}`:l;this.textFamily=a,a!==null&&(n.style=r.map(d=>d.startsWith(mt)?`${mt}${a}`:d).join(";")),this.lineAlign=Ii[t.attrs.indentalign??"left"]??"left";let m=this.row(t.root);return y("math",n,[i===void 0?m:y("mstyle",G("mstyle",{mathsize:i}),[m])])}row(t){let i=this.splitLines(t.children),o;if(i.length>1){let n=i.map((r,l)=>{let{atoms:s,empty:a}=r;Um(r);let m={};$(m,[...Xi(this.lineAlign),l===0?"padding:0":Mm]);let d=y("mspace",{...a?Sm:Hn}),c=y("mrow",{style:$n},[d,...s]);return c.line=!0,y("mtr",{},[y("mtd",m,[c])])});o=y("mtable",{style:Nm},n)}else{let n=i[0]?.atoms??[];n.length===0&&(this.options.placeholders??this.options.editable)&&n.push(this.placeholder()),o=y("mrow",{},n)}return this.options.editable&&(o.rowId=t.id),o}splitLines(t){let i=[{atoms:[],empty:!0}];for(let o of t){let n=i[i.length-1];n&&(n.first??(n.first=o),n.atoms.push(this.atom(o)),_m(o)?i.push({atoms:[],empty:!0}):n.empty=!1)}return i}placeholder(){return y("mspace",{class:ja,...Ni})}atom(t){let i;return t.kind==="token"?i=this.token(t):t.kind==="leaf"?i=this.leaf(t):i=this.element(t),this.options.editable&&(i.nodeId=t.id),i}child(t){return t.kind==="row"?this.row(t):t.kind==="leaf"?this.leaf(t):this.element(t)}token(t){if(t.tag==="ms"){let l=t.attrs.lquote??En,s=t.attrs.rquote??En;return y("mtext",G("mtext",t.attrs),[`${l}${t.text}${s}`])}let i=G(t.tag,t.attrs),o=t.attrs.mathvariant,n=t.text;if(o==="normal")i.mathvariant="normal";else if(!o&&this.textFamily!==null&&t.tag==="mi"&&[...t.text].length===1&&Si(t.text,sm)!==t.text)i.mathvariant="normal",$(i,["font-style:italic"]);else if(o&&vn(o)&&(n=this.textFamily!==null&&lm.has(o)?t.text:Si(t.text,o)??t.text,t.tag==="mi"&&(i.mathvariant="normal"),[...t.text].some((s,a)=>s.trim()!==""&&[...n][a]===s))){let s=[];o.includes("bold")&&s.push("font-weight:bold"),o.includes("italic")&&s.push("font-style:italic"),$(i,s)}(Km(t)||t.tag==="mo"&&zm(t.text))&&(i.lspace??(i.lspace="0"),i.rspace??(i.rspace="0")),t.tag==="mo"&&n===im&&(n=om),t.tag==="mo"&&t.attrs.largeop==="true"&&(n=nm.get(n)??n);let r=this.options.fallbackFonts;return this.textFamily!==null&&r&&Cn(t)&&$(i,[`${mt}${r}`]),y(t.tag,i,n?[n]:[])}leaf(t){switch(t.tag){case"mspace":return y("mspace",G("mspace",t.attrs));case"mprescripts":return y("mprescripts");case"mglyph":return y("mtext",{},t.attrs.alt?[t.attrs.alt]:[]);case"none":return y("mrow");default:return y("mspace",{width:"0"})}}element(t){switch(t.tag){case"mfrac":return t.attrs.bevelled==="true"?this.bevelled(t):this.generic(t);case"mfenced":return this.fenced(t);case"menclose":return this.enclose(t);case"mtable":return this.table(t);case"mstack":return this.stack(t);case"mlongdiv":return this.longdiv(t);case"maction":{let i=t.children[0];return y("mrow",{},i?[this.child(i)]:[])}default:return Wa.has(t.tag)?this.generic(t):y("mrow",G("mrow",t.attrs),t.children.map(i=>this.child(i)))}}generic(t){let i=G(t.tag,t.attrs);for(let[a,m]of dm[t.tag]??[])i[m]===void 0&&um(t.children[a])&&(i[m]="true");let o=km(t.children[0])?wm[t.tag]:void 0,n=gm(t),r=cm(t),l=t.children.map((a,m)=>{let d=o?.[m];return d?ym(this.child(a),d):m===0&&r?y("mstyle",{displaystyle:"true"},[this.child(a)]):n?m===0?bm(this.child(a),n):a.kind==="row"?this.operatorRow(a):this.child(a):this.child(a)}),s=this.largeOperatorFonts(t);if(s){$(i,[`${mt}${s.element}`]);for(let a of l.slice(1))$(a.attrs,[`${mt}${s.scripts}`])}return y(t.tag,i,l)}largeOperatorFonts(t){let i=this.options.fallbackFonts;return this.textFamily===null||!i||!rm.has(t.tag)||!Cn(Pn(t))?null:{element:i,scripts:this.textFamily}}operatorRow(t){let[i]=t.children;if(!i)return this.row(t);let o=this.atom(i);return this.options.editable&&(o.rowId=t.id),o}bevelled(t){let[i,o]=t.children,n=r=>y("mstyle",{scriptlevel:Za},r?[this.child(r)]:[]);return y("mrow",G("mrow",t.attrs),[y("msup",{},[y("mrow"),n(i)]),y("mo",{stretchy:"false",lspace:"0",rspace:"0"},["/"]),y("msub",{},[y("mrow"),n(o)])])}fenced(t){let i=t.attrs.open??tm,o=t.attrs.close??em,n=[],r=[],l=Mn[i],s=Mn[o];l?r.push(`border-inline-start:${l}`,`padding-inline-start:${Nn}`):i&&n.push(y("mo",{fence:"true",form:"prefix"},[i]));for(let m of t.children)n.push(this.child(m));s?r.push(`border-inline-end:${s}`,`padding-inline-end:${Nn}`):o&&n.push(y("mo",{fence:"true",form:"postfix"},[o]));let a=G("mrow",t.attrs);return r.length>0&&$(a,[...r,vm]),y("mrow",a,n)}enclose(t){let i=(t.attrs.notation??"longdiv").trim().split(/[\s,]+/).filter(Boolean),o=t.children.map(c=>this.child(c));i.includes("radical")&&(o=[y("msqrt",{},o)]);let n=G("mrow",t.attrs),r=[],l=[],s=new Set,a;for(let c of i){for(let f of Lm[c]??[])r.push(`${f}:${ct}`),s.add(f);a=Im[c]??a;let u=Fm[c];u&&l.push(u)}a&&r.push(`border-radius:${a}`);let m=[...i.includes("longdiv")?[Gm]:[],...l.map(c=>c.image)];m.length>0&&r.push(`background-image:${m.join(",")}`);let d=i.map(c=>Xm[c]).find(c=>c!==void 0);return r.push(d??Om(s,l)),$(n,r),(s.size>0||l.length>0)&&o.push(y("mspace",{height:Ni.height,depth:Ni.depth})),y("mrow",n,o)}table(t){let i=t.children.filter(s=>s.kind==="element"),o=G("mtable",t.attrs),n=t.attrs.frame;(n==="solid"||n==="dashed")&&$(o,[`border:1px ${n} currentColor`]);let r=i.length,l=i.map((s,a)=>{let m=s.children.filter(f=>f.kind==="element"),d=m.length,c=s.attrs.rowalign??dt(t.attrs.rowalign,a);return y("mtr",{},m.map((f,b)=>{let h=G("mtd",f.attrs),w=[],x=f.attrs.columnalign??dt(s.attrs.columnalign,b)??dt(t.attrs.columnalign,b),X=x?Ii[x]:void 0;X&&w.push(...Xi(X));let D=f.attrs.rowalign??c,P=D?xm[D]:void 0;P&&w.push(`vertical-align:${P}`);let Mt=dt(t.attrs.columnlines,b);b<d-1&&(Mt==="solid"||Mt==="dashed")&&w.push(`border-right:1px ${Mt} currentColor`);let Nt=dt(t.attrs.rowlines,a);a<r-1&&(Nt==="solid"||Nt==="dashed")&&w.push(`border-bottom:1px ${Nt} currentColor`);let ft=dt(t.attrs.columnspacing,b);ft&&w.push(`padding-left:calc(${xt(ft)} / 2)`,`padding-right:calc(${xt(ft)} / 2)`);let oi=dt(t.attrs.rowspacing,a);oi&&w.push(`padding-top:calc(${xt(oi)} / 2)`,`padding-bottom:calc(${xt(oi)} / 2)`),$(h,w);let eo=f.children.map(Cl=>this.child(Cl));return y("mtd",h,X?In(eo):eo)}))});return y("mtable",o,l)}stackCells(t,i,o){let n=[],r=i;for(let l of t){if(l.kind==="element"&&l.tag==="msgroup"){let s=r+Number(l.attrs.position??0);n.push(...this.stackCells(l.children,s,Number(l.attrs.shift??0)))}else if(l.kind==="leaf"&&l.tag==="msline")n.push({css:[Li,`border-top:${ct}`],content:[]});else if(l.kind==="element"&&l.tag==="mscarries"){let s=l.children.map(a=>this.child(a));n.push({css:[Li],content:[y("mstyle",{scriptlevel:Ja},s)]})}else{let s=r+Number(l.kind==="row"?l.attrs.position??0:0),a=[Le];s!==0&&a.push(`padding-right:${s*Qa}em`),n.push({css:a,content:[this.child(l)]})}r+=o}return n}stackAlign(t){return Ii[t.attrs.stackalign??"decimalpoint"]??"right"}stackCell(t,i,o=[]){let n=[...t?.css??[Li],...Xi(i),...o];return y("mtd",{style:n.join(";")},In(t?.content??[]))}slotCell(t){return{css:[Le],content:t?[this.child(t)]:[]}}stack(t){let i=this.stackAlign(t),o=this.stackCells(t.children,0,0).map(n=>y("mtr",{},[this.stackCell(n,i)]));return y("mtable",G("mtable",t.attrs),o)}longdiv(t){let[i,o,...n]=t.children,r=this.stackAlign(t),[l,...s]=this.stackCells(n,0,0),a=()=>this.stackCell(void 0,r),m;if(Rm.has(t.attrs.longdivstyle??"")){let[d,...c]=s,u=f=>this.stackCell(f,r,[Cm]);m=[[u(l),this.stackCell(this.slotCell(i),"left",[`border-left:${ct}`,`border-bottom:${ct}`,Ln])],[u(d),this.stackCell(this.slotCell(o),"left",[Ln])],...c.map(f=>[u(f),a()])]}else m=[[a(),this.bracketCell(this.slotCell(o),r,!1)],[this.stackCell(this.slotCell(i),"right"),this.bracketCell(l,r,!0)],...s.map(d=>[a(),this.bracketCell(d,r,!1)])];return y("mtable",G("mtable",t.attrs),m.map(d=>y("mtr",{},d)))}bracketCell(t,i,o){let n=y("mo",{lspace:"0",rspace:"0"},[Em]),r=t?.content??[];if(!o)return this.stackCell({css:t?.css??[Le],content:[y("mrow",{},[y("mphantom",{},[n]),...r])]},i);let l=[Bm,...(t?.css??[]).filter(s=>s!==Le),`border-top:${ct}`];return this.stackCell({css:l,content:[y("mrow",{},[n,y("mrow",{style:Am},[...r])])]},i)}};function Rt(e,t){return new Gi(t).document(e)}var Ht="FormulaComposer Math",Di=`@font-face{font-family:"${Ht}";src:local("STIX Two Math"),local("STIXTwoMath-Regular"),local("Cambria Math"),local("Latin Modern Math"),local("LatinModernMath-Regular");}`,zt=`"${Ht}", math`,Fi=`"STIX Two Math", "${Ht}", "Cambria Math", "Latin Modern Math", math`,Un="formula-composer-renderer-styles",Vm=`${Di}
|
|
4
|
+
.sw-canvas{position:relative;outline:none;cursor:text;}
|
|
5
|
+
.sw-canvas math{font-family:${Fi};math-style:normal;}
|
|
6
|
+
.sw-placeholder{outline:1px solid var(--sw-placeholder,#3f9b46);outline-offset:-1px;}
|
|
7
|
+
.sw-caret{position:absolute;width:0;border-left:1.5px solid currentColor;pointer-events:none;animation:sw-blink 1.06s steps(1) infinite;}
|
|
8
|
+
.sw-canvas:not(.sw-focused) .sw-caret{display:none;}
|
|
9
|
+
.sw-selection-box{position:absolute;background:rgba(51,128,240,0.28);pointer-events:none;}
|
|
10
|
+
@keyframes sw-blink{50%{opacity:0;}}
|
|
11
|
+
@media (prefers-reduced-motion:reduce){.sw-caret{animation:none;}}`;function ut(e){if(e.getElementById(Un))return;let t=e.createElement("style");t.id=Un,t.textContent=Vm,(e.head??e.documentElement).appendChild(t)}var Qn=16,qm="#000000",Ut=1,Vn=1,Ym=-1e5,jm="http://www.w3.org/2000/svg",Wm="http://www.w3.org/1999/xhtml",Zm=/^(#[0-9a-fA-F]{3,8}|[a-zA-Z]+|rgba?\([\d\s.,%]+\))$/,qn="math-style:normal",Qm="math:not([displaystyle])",Yn=new WeakMap;function Jn(e){let t=Yn.get(e);if(t)return t;ut(e);let i=e.fonts,o=i?i.load(`${Qn}px "${Ht}"`).then(()=>{},()=>{}):Promise.resolve();return Yn.set(e,o),o}var jn=100;function Wn(e){return Math.round(e*jn)/jn}function Jm(e){let t=e.getBoundingClientRect(),i={left:t.left,top:t.top,right:t.right,bottom:t.bottom};for(let o of e.querySelectorAll("*")){let n=o.getBoundingClientRect();n.width===0&&n.height===0||(i.left=Math.min(i.left,n.left),i.top=Math.min(i.top,n.top),i.right=Math.max(i.right,n.right),i.bottom=Math.max(i.bottom,n.bottom))}return i}function Zn(e,t){return e&&Zm.test(e)?e:t}function tr(e,t,i={}){let o=typeof e=="string"?K(e).doc:e,n=Rt(o,{editable:!1,fallbackFonts:zt}),r=i.fontSize??Qn,l=Zn(i.color,qm),s=i.backgroundColor?Zn(i.backgroundColor,"transparent"):"transparent";ut(t);let a=t.createElement("div");a.setAttribute("aria-hidden","true"),a.style.cssText=`position:absolute;left:${Ym}px;top:0;visibility:hidden;white-space:nowrap;line-height:normal;font-size:${r}px;`;let m=at(n,t),d=m.getAttribute("style"),c=m.hasAttribute("displaystyle")?`font-family:${zt}`:`font-family:${zt};${qn}`;m.setAttribute("style",d?`${c};${d}`:c);let u=t.createElement("span");u.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline;",a.append(m,u),(t.body??t.documentElement).appendChild(a);let f=a.getBoundingClientRect(),b=Jm(m),h=u.getBoundingClientRect();a.remove();let w=Math.max(Vn,Math.ceil(b.right-b.left)+2*Ut),x=Math.max(Vn,Math.ceil(b.bottom-b.top)+2*Ut),X=Math.round(h.top-b.top)+Ut,D=-(x-X),P=Wn(f.left-b.left+Ut),Mt=Wn(f.top-b.top+Ut),Nt=`${Di}math{font-family:${zt};}${Qm}{${qn};}`,ft=`<svg xmlns="${jm}" width="${w}" height="${x}" viewBox="0 0 ${w} ${x}"><foreignObject x="0" y="0" width="${w}" height="${x}"><div xmlns="${Wm}" style="position:relative;overflow:hidden;width:${w}px;height:${x}px;background:${s};"><div style="position:absolute;left:${P}px;top:${Mt}px;font-size:${r}px;line-height:normal;white-space:nowrap;color:${l};"><style>${Nt}</style>${Ne(n)}</div></div></foreignObject></svg>`;return{svg:ft,dataUri:`data:image/svg+xml;charset=utf8,${encodeURIComponent(ft)}`,width:w,height:x,baseline:X,verticalAlign:D}}function er(e){let t="";for(let i of new TextEncoder().encode(e))t+=String.fromCharCode(i);return`data:image/svg+xml;base64,${btoa(t)}`}var Ge=2;function td(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":!1}function or(e,t){if(e===t)return t.getBoundingClientRect();let i=e.parentElement;for(;i&&i!==t;){if(i.hasAttribute($t))return i.getBoundingClientRect();i=i.parentElement}return t.getBoundingClientRect()}function ir(e,t){let i=e.children[t];return i?.kind==="leaf"&&i.attrs.linebreak==="newline"}function ed(e){return e.closest(`[${$t}]`)?.parentElement?.parentElement?.nextElementSibling?.querySelector(`[${$t}]`)??null}function nr(e,t){let i=t.rows.get(e.id);if(!i)return[];let o=i.getBoundingClientRect();if(e.children.length===0)return[{offset:0,x:o.left+o.width/2,line:o}];let n=td(i),r=[];for(let l=0;l<=e.children.length;l+=1){let s=l>0&&!ir(e,l-1),a=e.children[s?l-1:l],m=a?t.atoms.get(a.id):void 0;if(!m){let u=l===e.children.length?e.children[l-1]:void 0,f=u&&ir(e,l-1)?t.atoms.get(u.id):void 0,b=f?ed(f):null;if(b){let h=b.getBoundingClientRect();r.push({offset:l,x:n?h.right:h.left,line:h})}continue}let d=m.getBoundingClientRect(),c=s!==n;r.push({offset:l,x:c?d.right:d.left,line:or(m,i)})}return r}function rr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function lr(e,t,i,o){let n=t.rows.get(e.rowId);if(!n)return null;let r=nr(n,i).find(l=>l.offset===e.offset);return r?rr({left:r.x,top:r.line.top,width:0,height:r.line.height},o):null}function sr(e,t,i){let o=t.rows.get(e.row.id);if(!o)return[];let n=new Map;for(let r=e.start;r<e.end;r+=1){let l=e.row.children[r],s=l?t.atoms.get(l.id):void 0;if(!s)continue;let a=s.getBoundingClientRect(),m=or(s,o),d=`${m.top}:${m.left}`,c=n.get(d);c?(c.left=Math.min(c.left,a.left),c.right=Math.max(c.right,a.right)):n.set(d,{left:a.left,right:a.right,line:m})}return[...n.values()].map(r=>rr({left:r.left,top:r.line.top,width:r.right-r.left,height:r.line.height},i))}function id(e,t,i){return t>=e.left-Ge&&t<=e.right+Ge&&i>=e.top-Ge&&i<=e.bottom+Ge}function ar(e,t,i,o,n){let r,l=Number.POSITIVE_INFINITY;for(let[u,f]of o.rows){let b=f.getBoundingClientRect();if(!id(b,e,t))continue;let h=b.width*b.height;if(h<=l){let w=i.rows.get(u);w&&(r=w,l=h)}}let s=r??i.rows.get(n);if(!s)return null;let a=nr(s,o),m=a.filter(u=>t>=u.line.top&&t<=u.line.bottom),d=m.length>0?m:a,c;for(let u of d)(!c||Math.abs(u.x-e)<Math.abs(c.x-e))&&(c=u);return c?{rowId:s.id,offset:c.offset}:{rowId:s.id,offset:0}}var od="sw-canvas",nd="sw-focused",rd="sw-caret",mr="sw-selection-box",et=8;function dr(e,t){e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`}var De=class{constructor(t,i,o={}){p(this,"model",i);p(this,"element");p(this,"mathHost");p(this,"overlay");p(this,"caretEl");p(this,"maps",{rows:new Map,atoms:new Map});p(this,"unsubscribe");p(this,"destroyed",!1);p(this,"renderedRevision",-1);let n=t.ownerDocument;ut(n),this.element=n.createElement("div"),this.element.className=od,o.fontSize&&(this.element.style.fontSize=o.fontSize),this.mathHost=n.createElement("div"),this.overlay=n.createElement("div"),this.overlay.setAttribute("aria-hidden","true"),this.caretEl=n.createElement("div"),this.caretEl.className=rd,this.overlay.appendChild(this.caretEl),this.element.append(this.mathHost,this.overlay),t.appendChild(this.element),this.unsubscribe=i.onChange(()=>{i.revision!==this.renderedRevision?this.render():this.updateOverlay()}),this.render()}get elementMaps(){return this.maps}get mathElement(){return this.mathHost.firstElementChild}render(){if(this.destroyed)return;let t=this.element.ownerDocument,i={rows:new Map,atoms:new Map},o=at(Rt(this.model.document,{editable:!0,fallbackFonts:Fi}),t,i);this.maps=i,this.renderedRevision=this.model.revision,this.mathHost.replaceChildren(o),this.updateOverlay()}updateOverlay(){if(this.destroyed)return;let t=this.element.getBoundingClientRect();for(let n of this.overlay.querySelectorAll(`.${mr}`))n.remove();let i=this.model.getSelection();if(i)for(let n of sr(i,this.maps,t)){let r=this.element.ownerDocument.createElement("div");r.className=mr,dr(r,n),this.overlay.appendChild(r)}let o=lr(this.model.getCaret(),this.model.treeIndex,this.maps,t);this.caretEl.hidden=o===null||i!==null,o&&dr(this.caretEl,o),this.restartBlink()}restartBlink(){this.caretEl.style.animation="none",this.caretEl.offsetWidth,this.caretEl.style.animation=""}setFocused(t){this.element.classList.toggle(nd,t)}caretFromPoint(t,i){return ar(t,i,this.model.treeIndex,this.maps,this.model.document.root.id)}scrollCaretIntoView(t){let i=this.caretEl.getBoundingClientRect(),o=t.getBoundingClientRect();i.right+et>o.right?t.scrollLeft+=i.right+et-o.right:i.left-et<o.left&&(t.scrollLeft-=o.left-i.left+et),i.bottom+et>o.bottom?t.scrollTop+=i.bottom+et-o.bottom:i.top-et<o.top&&(t.scrollTop-=o.top-i.top+et)}destroy(){this.destroyed||(this.destroyed=!0,this.unsubscribe(),this.element.remove())}};function ld(e){return typeof e=="string"?K(e).doc:e}function cr(e,t,i={}){return ut(t),at(Rt(ld(e),{editable:!1,placeholders:i.placeholders??!1}),t)}var ur="data:image/svg+xml;charset=utf8,",sd="data:image/svg+xml",ad=/\u00ABmath[\s\S]*?\u00AB\/math\u00BB/g,Oe=/\$\$([\s\S]+?)\$\$/g,md="LaTeX",dd="script, style, textarea, code, pre, title",cd=256;var Fe=new Map;function it(e){let t=Fe.get(e);if(t!==void 0)return t;let i;try{let o=K(e),n=ki(o.doc);i={doc:n,mathml:q(n),latex:o.latex}}catch{i=null}return Fe.size>=cd&&Fe.clear(),Fe.set(e,i),i}function _e(e){return e.doc.root.children.length===0}function Et(e,t){let{options:i}=t,o=tr(e.doc,t.doc,{fontSize:i.imageFontSize}),n={class:i.imageClassName,src:o.dataUri,[i.imageMathmlAttribute]:Xt(e.mathml),width:String(o.width),height:String(o.height),role:"math",align:"middle",style:`max-width: none; vertical-align: ${o.verticalAlign}px;`,...t.conventions.imageAttributes};return i.accessibility&&(n.alt=Ee(e.doc)),t.fontLoaded||(n[t.conventions.staleAttribute]="true"),n}function Oi(e){return`img.${e.imageClassName}[${e.imageMathmlAttribute}]`}function ud(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function hr(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&e.nodeType===Node.TEXT_NODE}function fr(e,t){return ud(e)&&e.matches(Oi(t))}function gr(e,t){for(let[i,o]of Object.entries(t))e.setAttribute(i,o)}function pd(e,t){let i=t.doc.createElement("img");return gr(i,Et(e,t)),i}function pr(e,t){let i=t.options.parseLatex?e.latex:null;return i!==null?t.doc.createTextNode(`$$${i}$$`):pd(e,t)}function br(e,t){let i=t.createElement("template");return i.innerHTML=e,i}function wr(e,t){let i=t.createTreeWalker(e,NodeFilter.SHOW_TEXT),o=[];for(let n=i.nextNode();n;n=i.nextNode())hr(n)&&!n.parentElement?.closest(dd)&&o.push(n);return o}function Tr(e,t,i){let o=e.data,n=[],r=0,l=!1;t.lastIndex=0;for(let s=t.exec(o);s;s=t.exec(o)){let a=i(s);a&&(s.index>r&&n.push(e.ownerDocument.createTextNode(o.slice(r,s.index))),n.push(a),r=s.index+s[0].length,l=!0)}return l?(r<o.length&&n.push(e.ownerDocument.createTextNode(o.slice(r))),e.replaceWith(...n),!0):!1}var hd=/<math[\s>/]|\u00ABmath/i;function kr(e,t,i){let{options:o,doc:n}=t;if(!hd.test(e)&&!e.includes(o.imageClassName))return e;let r=br(e,n),l=r.content,s=!1,a=new XMLSerializer;for(let d of[...l.querySelectorAll("math")]){if(!l.contains(d))continue;let c=it(a.serializeToString(d));c&&(d.replaceWith(pr(c,t)),s=!0)}for(let d of wr(l,n))d.data.includes("\xABmath")&&(s=Tr(d,ad,c=>{let u=it(c[0]);return u?pr(u,t):null})||s);let m=o.parseLatex&&e.includes(md);for(let d of l.querySelectorAll(Oi(o))){if(m){let f=it(d.getAttribute(o.imageMathmlAttribute)??"")?.latex??null;if(f!==null){d.replaceWith(n.createTextNode(`$$${f}$$`)),s=!0;continue}}let c=d.getAttribute("src")??"";if(!i&&c.startsWith(sd)&&!d.hasAttribute(t.conventions.staleAttribute)){for(let[f,b]of Object.entries(t.conventions.imageAttributes))d.getAttribute(f)!==b&&(d.setAttribute(f,b),s=!0);continue}let u=it(d.getAttribute(o.imageMathmlAttribute)??"");u&&(gr(d,Et(u,t)),t.fontLoaded&&d.removeAttribute(t.conventions.staleAttribute),s=!0)}return s?r.innerHTML:e}function fd(e){if(!e.startsWith(ur))return e;try{return er(decodeURIComponent(e.slice(ur.length)))}catch{return e}}function gd(e,t,i){let{options:o,conventions:n}=i;for(let r of e.getAttributeNames())r.startsWith(n.internalAttributePrefix)&&e.removeAttribute(r);e.setAttribute(o.imageMathmlAttribute,Xt(t.mathml)),o.saveMode==="base64"&&e.setAttribute("src",fd(e.getAttribute("src")??""))}function bd(e){try{return q(ki(kt(e)),{latexAnnotation:e})}catch{return null}}function yr(e,t){let{options:i,doc:o}=t,n=i.parseLatex&&e.includes("$$");if(!n&&!e.includes(i.imageClassName))return e;let r=br(e,o),l=r.content,s=[],a=Math.random().toString(36).slice(2),m=u=>(s.push(u),o.createComment(`sw-${a}-${s.length-1}`)),d=!1;for(let u of[...l.querySelectorAll(Oi(i))]){let f=it(u.getAttribute(i.imageMathmlAttribute)??"");f&&(i.saveMode==="xml"?u.replaceWith(m(f.mathml)):i.saveMode==="safeXml"?u.replaceWith(m(Xt(f.mathml))):gd(u,f,t),d=!0)}if(n)for(let u of wr(l,o))u.data.includes("$$")&&(d=Tr(u,Oe,f=>{let b=bd(f[1]??"");return b===null?null:m(i.saveMode==="safeXml"?Xt(b):b)})||d);if(!d)return e;let c=r.innerHTML;return s.forEach((u,f)=>{c=c.split(`<!--sw-${a}-${f}-->`).join(u)}),c}function xr(e){let t=e.startContainer;if(!e.collapsed||!hr(t))return null;Oe.lastIndex=0;for(let i=Oe.exec(t.data);i;i=Oe.exec(t.data)){let o=i.index+i[0].length;if(e.startOffset>i.index&&e.startOffset<o)return{text:t,start:i.index,end:o,latex:i[1]??""}}return null}var Ct=[{id:"GEN",title:"General",sections:[{id:"GEN-0",rows:2,items:[{id:"TB-GEN-001",title:"Fraction (Cmd+/)",kind:"template",mml:"<mfrac><mrow/><mrow/></mfrac>",cell:[0,0]},{id:"TB-GEN-002",title:"Square root",kind:"template",mml:"<msqrt/>",cell:[0,1]},{id:"TB-GEN-003",title:"Bevelled fraction",kind:"template",mml:'<mfrac bevelled="true"><mrow/><mrow/></mfrac>',cell:[1,0]},{id:"TB-GEN-004",title:"Root",kind:"template",mml:"<mroot><mrow/><mrow/></mroot>",cell:[1,1]}]},{id:"GEN-1",rows:2,items:[{id:"TB-GEN-005",title:"Superscript (Cmd+Up)",kind:"template",mml:'<msup><maction actiontype="argument"><mrow/></maction><mrow/></msup>',cell:[0,0]},{id:"TB-GEN-006",title:"Subscript (Cmd+Down)",kind:"template",mml:'<msub><maction actiontype="argument"><mrow/></maction><mrow/></msub>',cell:[1,0]}]},{id:"GEN-2",rows:2,items:[{id:"TB-GEN-007",title:"Parentheses",kind:"template",mml:"<mfenced><mrow/></mfenced>",cell:[0,0]},{id:"TB-GEN-008",title:"Square brackets",kind:"template",mml:'<mfenced open="[" close="]"><mrow/></mfenced>',cell:[0,1]},{id:"TB-GEN-009",title:"Vertical bars",kind:"template",mml:'<mfenced open="|" close="|"><mrow/></mfenced>',cell:[1,0]},{id:"TB-GEN-010",title:"Curly brackets",kind:"template",mml:'<mfenced open="{" close="}"><mrow/></mfenced>',cell:[1,1]}]},{id:"GEN-3",rows:3,items:[{id:"TB-GEN-011",title:"Plus sign",kind:"symbol",mml:"<mo>+</mo>",cell:[0,0]},{id:"TB-GEN-012",title:"Forward slash",kind:"symbol",mml:"<mo>/</mo>",cell:[0,1]},{id:"TB-GEN-013",title:"Multiplication sign",kind:"symbol",mml:"<mo>×</mo>",cell:[1,0]},{id:"TB-GEN-014",title:"Plus-minus sign",kind:"symbol",mml:"<mo>±</mo>",cell:[1,1]},{id:"TB-GEN-015",title:"Minus sign",kind:"symbol",mml:"<mo>-</mo>",cell:[2,0]},{id:"TB-GEN-016",title:"Division sign",kind:"symbol",mml:"<mo>÷</mo>",cell:[2,1]}]},{id:"GEN-4",rows:3,items:[{id:"TB-GEN-017",title:"Greater-than or equal to",kind:"symbol",mml:"<mo>≥</mo>",cell:[0,0]},{id:"TB-GEN-018",title:"Less-than or equal to",kind:"symbol",mml:"<mo>≤</mo>",cell:[0,1]},{id:"TB-GEN-019",title:"Element of",kind:"symbol",mml:"<mo>∈</mo>",cell:[1,0]},{id:"TB-GEN-020",title:"Subset of",kind:"symbol",mml:"<mo>⊂</mo>",cell:[1,1]},{id:"TB-GEN-021",title:"Union",kind:"symbol",mml:"<mo>∪</mo>",cell:[2,0]},{id:"TB-GEN-022",title:"Intersection",kind:"symbol",mml:"<mo>∩</mo>",cell:[2,1]}]},{id:"GEN-5",rows:3,items:[{id:"TB-GEN-023",title:"Empty set",kind:"symbol",mml:"<mo>∅</mo>",cell:[0,0]},{id:"TB-GEN-024",title:"Infinity",kind:"symbol",mml:"<mo>∞</mo>",cell:[1,0]},{id:"TB-GEN-025",title:"Number pi",kind:"symbol",mml:'<mi mathvariant="normal">π</mi>',cell:[2,0]}]},{id:"GEN-6",rows:3,items:[{id:"TB-GEN-026",title:"Press Ctrl+C to copy the selection",kind:"action",cell:[0,0]},{id:"TB-GEN-027",title:"Undo",kind:"action",cell:[0,1]},{id:"TB-GEN-028",title:"Press Ctrl+X to cut the selection",kind:"action",cell:[1,0]},{id:"TB-GEN-029",title:"Redo",kind:"action",cell:[1,1]},{id:"TB-GEN-030",title:"Press Ctrl+V to paste the content of the clipboard",kind:"action",cell:[2,0]}]},{id:"GEN-7",rows:3,items:[{id:"TB-GEN-031",title:"Bold (Cmd+B)",kind:"action",cell:[0,0]},{id:"TB-GEN-032",title:"Color",kind:"action",cell:[0,1]},{id:"TB-GEN-033",title:"Italic (Cmd+I)",kind:"action",cell:[1,0]},{id:"TB-GEN-034",title:"Insert special characters",kind:"action",cell:[1,1]},{id:"TB-GEN-035",title:"Automatic italic",kind:"action",cell:[2,0]},{id:"TB-GEN-036",title:"Regular text",kind:"action",cell:[2,1]}]},{id:"GEN-8",rows:3,items:[{id:"TB-GEN-037",title:"Right to left editing",kind:"action",cell:[0,0]},{id:"TB-GEN-038",title:"Arabic ligature",kind:"action",cell:[1,0]}]},{id:"GEN-9",rows:2,items:[{id:"TB-GEN-039",title:"Font family",kind:"select",options:["\u2014 Font \u2014","Arial","Classic","Courier New","Tahoma","Times New Roman","Verdana"],cell:[0,0]},{id:"TB-GEN-040",title:"Font size",kind:"select",options:["\u2014 Size \u2014","8px","9px","10px","11px","12px","14px","16px","18px","20px","22px","24px","26px","28px","36px","48px","72px"],cell:[1,0]}]}]},{id:"SYM",title:"Symbols",sections:[{id:"SYM-0",rows:3,items:[{id:"TB-SYM-001",title:"Negate operator",kind:"template",mml:'<menclose notation="updiagonalstrike"/>',cell:[0,0]}]},{id:"SYM-1",rows:3,items:[{id:"TB-SYM-002",title:"Plus sign",kind:"symbol",mml:"<mo>+</mo>",cell:[0,0]},{id:"TB-SYM-003",title:"Multiplication sign",kind:"symbol",mml:"<mo>×</mo>",cell:[0,1]},{id:"TB-SYM-004",title:"Middle dot",kind:"symbol",mml:"<mo>·</mo>",cell:[0,2]},{id:"TB-SYM-005",title:"Minus sign",kind:"symbol",mml:"<mo>-</mo>",cell:[1,0]},{id:"TB-SYM-006",title:"Division sign",kind:"symbol",mml:"<mo>÷</mo>",cell:[1,1]},{id:"TB-SYM-007",title:"Forward slash",kind:"symbol",mml:"<mo>/</mo>",cell:[1,2]},{id:"TB-SYM-008",title:"Plus-minus sign",kind:"symbol",mml:"<mo>±</mo>",cell:[2,0]},{id:"TB-SYM-009",title:"Asterisk",kind:"symbol",mml:"<mo>*</mo>",cell:[2,1]},{id:"TB-SYM-010",title:"Ring operator",kind:"symbol",mml:"<mo>∘</mo>",cell:[2,2]}],moreRows:3,more:[{id:"TB-SYM-X001",title:"Reverse solidus",kind:"symbol",mml:"<mo>\\</mo>",cell:[0,0]},{id:"TB-SYM-X002",title:"Set minus",kind:"symbol",mml:"<mo>∖</mo>",cell:[1,0]},{id:"TB-SYM-X003",title:"Minus-or-plus sign",kind:"symbol",mml:"<mo>∓</mo>",cell:[2,0]}]},{id:"SYM-2",rows:3,items:[{id:"TB-SYM-011",title:"Number pi",kind:"symbol",mml:'<mi mathvariant="normal">π</mi>',cell:[0,0]},{id:"TB-SYM-012",title:"Partial differential",kind:"symbol",mml:"<mo>∂</mo>",cell:[0,1]},{id:"TB-SYM-013",title:"Degree sign",kind:"symbol",mml:"<mo>°</mo>",cell:[0,2]},{id:"TB-SYM-014",title:"Infinity",kind:"symbol",mml:"<mo>∞</mo>",cell:[1,0]},{id:"TB-SYM-015",title:"Increment",kind:"symbol",mml:"<mo>∆</mo>",cell:[1,1]},{id:"TB-SYM-016",title:"Apostrophe",kind:"symbol",mml:"<mo>'</mo>",cell:[1,2]},{id:"TB-SYM-017",title:"Empty set",kind:"symbol",mml:"<mo>∅</mo>",cell:[2,0]},{id:"TB-SYM-018",title:"Nabla",kind:"symbol",mml:"<mo>∇</mo>",cell:[2,1]},{id:"TB-SYM-019",title:"Double apostrophe",kind:"symbol",mml:"<mo>''</mo>",cell:[2,2]}],moreRows:3,more:[{id:"TB-SYM-X004",title:"Triple apostrophe",kind:"symbol",mml:"<mo>'''</mo>",cell:[0,0]},{id:"TB-SYM-X005",title:"Quadruple apostrophe",kind:"symbol",mml:"<mo>''''</mo>",inferred:!0,cell:[1,0]},{id:"TB-SYM-X006",title:"Reversed prime",kind:"symbol",mml:"<mo>‵</mo>",cell:[2,0]}]},{id:"SYM-3",rows:3,items:[{id:"TB-SYM-020",title:"Equals sign",kind:"symbol",mml:"<mo>=</mo>",cell:[0,0]},{id:"TB-SYM-021",title:"Identical to",kind:"symbol",mml:"<mo>≡</mo>",cell:[0,1]},{id:"TB-SYM-022",title:"Tilde operator",kind:"symbol",mml:"<mo>~</mo>",cell:[1,0]},{id:"TB-SYM-023",title:"Almost equal to",kind:"symbol",mml:"<mo>≈</mo>",cell:[1,1]},{id:"TB-SYM-024",title:"Asymptotically equal to",kind:"symbol",mml:"<mo>≃</mo>",cell:[2,0]},{id:"TB-SYM-025",title:"Approximately equal to",kind:"symbol",mml:"<mo>≅</mo>",cell:[2,1]}],moreRows:3,more:[{id:"TB-SYM-X007",title:"Not equal to",kind:"symbol",mml:"<mo>≠</mo>",cell:[0,0]},{id:"TB-SYM-X008",title:"Not almost equal to",kind:"symbol",mml:"<mo>≉</mo>",cell:[0,1]},{id:"TB-SYM-X009",title:"Not identical to",kind:"symbol",mml:"<mo>≢</mo>",cell:[1,0]},{id:"TB-SYM-X010",title:"Not tilde",kind:"symbol",mml:"<mo>≁</mo>",cell:[2,0]}]},{id:"SYM-4",rows:3,items:[{id:"TB-SYM-026",title:"Greater-than sign",kind:"symbol",mml:"<mo>></mo>",cell:[0,0]},{id:"TB-SYM-027",title:"Less-than sign",kind:"symbol",mml:"<mo><</mo>",cell:[0,1]},{id:"TB-SYM-028",title:"Greater-than or equal to",kind:"symbol",mml:"<mo>≥</mo>",cell:[1,0]},{id:"TB-SYM-029",title:"Less-than or equal to",kind:"symbol",mml:"<mo>≤</mo>",cell:[1,1]},{id:"TB-SYM-030",title:"Greater-than or slanted equal to",kind:"symbol",mml:"<mo>⩾</mo>",cell:[2,0]},{id:"TB-SYM-031",title:"Less-than or slanted equal to",kind:"symbol",mml:"<mo>⩽</mo>",cell:[2,1]}],moreRows:3,more:[{id:"TB-SYM-X011",title:"Less-than and single-line not equal to",kind:"symbol",mml:"<mo>⪇</mo>",cell:[0,0]},{id:"TB-SYM-X012",title:"Much greater-than",kind:"symbol",mml:"<mo>≫</mo>",cell:[0,1]},{id:"TB-SYM-X013",title:"Succeeds",kind:"symbol",mml:"<mo>≻</mo>",cell:[0,2]},{id:"TB-SYM-X014",title:"Greater-than and single-line not equal to",kind:"symbol",mml:"<mo>⪈</mo>",cell:[1,0]},{id:"TB-SYM-X015",title:"Proportional to",kind:"symbol",mml:"<mo>∝</mo>",cell:[1,1]},{id:"TB-SYM-X016",title:"Normal subgroup of",kind:"symbol",mml:"<mo>⊲</mo>",cell:[1,2]},{id:"TB-SYM-X017",title:"Much less-than",kind:"symbol",mml:"<mo>≪</mo>",cell:[2,0]},{id:"TB-SYM-X018",title:"Precedes",kind:"symbol",mml:"<mo>≺</mo>",cell:[2,1]},{id:"TB-SYM-X019",title:"Contains as normal subgroup",kind:"symbol",mml:"<mo>⊳</mo>",cell:[2,2]}]},{id:"SYM-5",rows:3,items:[{id:"TB-SYM-032",title:"Element of",kind:"symbol",mml:"<mo>∈</mo>",cell:[0,0]},{id:"TB-SYM-033",title:"Contains as member",kind:"symbol",mml:"<mo>∋</mo>",cell:[0,1]},{id:"TB-SYM-034",title:"Union",kind:"symbol",mml:"<mo>∪</mo>",cell:[1,0]},{id:"TB-SYM-035",title:"Intersection",kind:"symbol",mml:"<mo>∩</mo>",cell:[1,1]},{id:"TB-SYM-036",title:"Subset of",kind:"symbol",mml:"<mo>⊂</mo>",cell:[2,0]},{id:"TB-SYM-037",title:"Superset of",kind:"symbol",mml:"<mo>⊃</mo>",cell:[2,1]}],moreRows:3,more:[{id:"TB-SYM-X020",title:"Not an element of",kind:"symbol",mml:"<mo>∉</mo>",cell:[0,0]},{id:"TB-SYM-X021",title:"Does not contain as member",kind:"symbol",mml:"<mo>∌</mo>",cell:[0,1]},{id:"TB-SYM-X022",title:"Subset of or equal to",kind:"symbol",mml:"<mo>⊆</mo>",cell:[0,2]},{id:"TB-SYM-X023",title:"Superset of or equal to",kind:"symbol",mml:"<mo>⊇</mo>",cell:[0,3]},{id:"TB-SYM-X024",title:"Square subset of",kind:"symbol",mml:"<mo>⊏</mo>",cell:[1,0]},{id:"TB-SYM-X025",title:"Square superset of",kind:"symbol",mml:"<mo>⊐</mo>",cell:[1,1]},{id:"TB-SYM-X026",title:"Square subset of or equal to",kind:"symbol",mml:"<mo>⊑</mo>",inferred:!0,cell:[1,2]},{id:"TB-SYM-X027",title:"Square superset of or equal to",kind:"symbol",mml:"<mo>⊒</mo>",cell:[1,3]},{id:"TB-SYM-X028",title:"Square cap",kind:"symbol",mml:"<mo>⊓</mo>",cell:[2,0]},{id:"TB-SYM-X029",title:"Square cup",kind:"symbol",mml:"<mo>⊔</mo>",cell:[2,1]}]},{id:"SYM-6",rows:3,items:[{id:"TB-SYM-038",title:"Logical and",kind:"symbol",mml:"<mo>∧</mo>",cell:[0,0]},{id:"TB-SYM-039",title:"Logical or",kind:"symbol",mml:"<mo>∨</mo>",cell:[0,1]},{id:"TB-SYM-040",title:"Not sign",kind:"symbol",mml:"<mo>¬</mo>",cell:[1,0]},{id:"TB-SYM-041",title:"For all",kind:"symbol",mml:"<mo>∀</mo>",cell:[1,1]},{id:"TB-SYM-042",title:"There exists",kind:"symbol",mml:"<mo>∃</mo>",cell:[2,0]},{id:"TB-SYM-043",title:"There does not exist",kind:"symbol",mml:"<mo>∄</mo>",cell:[2,1]}],moreRows:3,more:[{id:"TB-SYM-X030",title:"Therefore",kind:"symbol",mml:"<mo>∴</mo>",cell:[0,0]},{id:"TB-SYM-X031",title:"Because",kind:"symbol",mml:"<mo>∵</mo>",cell:[1,0]}]},{id:"SYM-7",rows:3,items:[{id:"TB-SYM-044",title:"Angle",kind:"symbol",mml:"<mo>∠</mo>",cell:[0,0]},{id:"TB-SYM-045",title:"Parallel to",kind:"symbol",mml:"<mo>∥</mo>",cell:[1,0]},{id:"TB-SYM-046",title:"Perpendicular",kind:"symbol",mml:"<mo>⊥</mo>",cell:[2,0]}],moreRows:3,more:[{id:"TB-SYM-X032",title:"Not parallel to",kind:"symbol",mml:"<mo>∦</mo>",cell:[0,0]},{id:"TB-SYM-X033",title:"Diamond",kind:"symbol",mml:"<mo>⋄</mo>",cell:[0,1]},{id:"TB-SYM-X034",title:"Measured angle",kind:"symbol",mml:"<mo>∡</mo>",cell:[1,0]},{id:"TB-SYM-X035",title:"Spherical angle",kind:"symbol",mml:"<mo>∢</mo>",inferred:!0,cell:[2,0]}]},{id:"SYM-8",rows:3,items:[{id:"TB-SYM-047",title:"Square",kind:"symbol",mml:"<mo>□</mo>",cell:[0,0]},{id:"TB-SYM-048",title:"Triangle",kind:"symbol",mml:"<mo>△</mo>",cell:[1,0]},{id:"TB-SYM-049",title:"Circle",kind:"symbol",mml:"<mo>○</mo>",cell:[2,0]}],moreRows:3,more:[{id:"TB-SYM-X036",title:"Rectangle",kind:"symbol",mml:"<mo>▭</mo>",cell:[0,0]},{id:"TB-SYM-X037",title:"Parallelogram",kind:"symbol",mml:"<mo>▱</mo>",cell:[1,0]}]},{id:"SYM-9",rows:3,items:[{id:"TB-SYM-050",title:"Circled plus",kind:"symbol",mml:"<mo>⊕</mo>",cell:[0,0]},{id:"TB-SYM-051",title:"Circled times",kind:"symbol",mml:"<mo>⊗</mo>",cell:[1,0]},{id:"TB-SYM-052",title:"Circled dot",kind:"symbol",mml:"<mo>⊙</mo>",cell:[2,0]}],moreRows:3,more:[{id:"TB-SYM-X038",title:"Circled dash",kind:"symbol",mml:"<mo>⊝</mo>",cell:[0,0]},{id:"TB-SYM-X039",title:"Bullet",kind:"symbol",mml:"<mo>∙</mo>",cell:[0,1]},{id:"TB-SYM-X040",title:"Circled asterisk",kind:"symbol",mml:"<mo>⊛</mo>",cell:[1,0]},{id:"TB-SYM-X041",title:"Circled division",kind:"symbol",mml:"<mo>⨸</mo>",cell:[2,0]}]}]},{id:"ARR",title:"Arrows",sections:[{id:"ARR-0",rows:3,items:[{id:"TB-ARR-001",title:"Leftwards arrow",kind:"symbol",mml:"<mo>←</mo>",cell:[0,0]},{id:"TB-ARR-002",title:"Rightwards arrow",kind:"symbol",mml:"<mo>→</mo>",cell:[0,1]},{id:"TB-ARR-003",title:"Left right arrow",kind:"symbol",mml:"<mo>↔</mo>",cell:[0,2]},{id:"TB-ARR-004",title:"Leftwards double arrow",kind:"symbol",mml:"<mo>⇐</mo>",cell:[1,0]},{id:"TB-ARR-005",title:"Rightwards double arrow",kind:"symbol",mml:"<mo>⇒</mo>",cell:[1,1]},{id:"TB-ARR-006",title:"Left right double arrow",kind:"symbol",mml:"<mo>⇔</mo>",cell:[1,2]},{id:"TB-ARR-007",title:"Leftwards arrow from bar",kind:"symbol",mml:"<mo>↤</mo>",cell:[2,0]},{id:"TB-ARR-008",title:"Rightwards arrow from bar",kind:"symbol",mml:"<mo>↦</mo>",cell:[2,1]}],moreRows:3,more:[{id:"TB-ARR-X001",title:"North east arrow",kind:"symbol",mml:"<mo>↗</mo>",cell:[0,0]},{id:"TB-ARR-X002",title:"South east arrow",kind:"symbol",mml:"<mo>↘</mo>",cell:[0,1]},{id:"TB-ARR-X003",title:"North west arrow",kind:"symbol",mml:"<mo>↖</mo>",cell:[0,2]},{id:"TB-ARR-X004",title:"South west arrow",kind:"symbol",mml:"<mo>↙</mo>",cell:[0,3]},{id:"TB-ARR-X005",title:"North west and south east arrow",kind:"symbol",mml:"<mo>⤡</mo>",cell:[0,4]},{id:"TB-ARR-X006",title:"North east and south west arrow",kind:"symbol",mml:"<mo>⤢</mo>",cell:[0,5]},{id:"TB-ARR-X007",title:"Leftwards arrow with hook",kind:"symbol",mml:"<mo>↩</mo>",cell:[0,6]},{id:"TB-ARR-X008",title:"Rightwards arrow with hook",kind:"symbol",mml:"<mo>↪</mo>",cell:[0,7]},{id:"TB-ARR-X009",title:"Leftwards harpoon with barb upwards",kind:"symbol",mml:"<mo>↼</mo>",cell:[0,8]},{id:"TB-ARR-X010",title:"Rightwards harpoon with barb upwards",kind:"symbol",mml:"<mo>⇀</mo>",cell:[0,9]},{id:"TB-ARR-X011",title:"Upwards arrow",kind:"symbol",mml:"<mo>↑</mo>",cell:[0,10]},{id:"TB-ARR-X012",title:"Downwards arrow",kind:"symbol",mml:"<mo>↓</mo>",cell:[1,0]},{id:"TB-ARR-X013",title:"Upwards double arrow",kind:"symbol",mml:"<mo>⇑</mo>",cell:[1,1]},{id:"TB-ARR-X014",title:"Downwards double arrow",kind:"symbol",mml:"<mo>⇓</mo>",cell:[1,2]},{id:"TB-ARR-X015",title:"Leftwards harpoon with barb up above long dash",kind:"symbol",mml:"<mo>⥪</mo>",cell:[1,3]},{id:"TB-ARR-X016",title:"Rightwards harpoon with barb down below long dash",kind:"symbol",mml:"<mo>⥭</mo>",cell:[1,4]},{id:"TB-ARR-X017",title:"Leftwards harpoon over rightwards harpoon",kind:"symbol",mml:"<mo>⇋</mo>",cell:[1,5]},{id:"TB-ARR-X018",title:"Rightwards harpoon over leftwards harpoon",kind:"symbol",mml:"<mo>⇌</mo>",cell:[1,6]},{id:"TB-ARR-X019",title:"Leftwards harpoon with barb downwards",kind:"symbol",mml:"<mo>↽</mo>",cell:[1,7]},{id:"TB-ARR-X020",title:"Rightwards harpoon with barb downwards",kind:"symbol",mml:"<mo>⇁</mo>",cell:[1,8]},{id:"TB-ARR-X021",title:"Leftwards arrow over rightwards arrow",kind:"symbol",mml:"<mo>⇆</mo>",cell:[1,9]},{id:"TB-ARR-X022",title:"Rightwards arrow over leftwards arrow",kind:"symbol",mml:"<mo>⇄</mo>",cell:[1,10]},{id:"TB-ARR-X023",title:"Upwards arrow leftwards of downwards arrow",kind:"symbol",mml:"<mo>⇅</mo>",cell:[2,0]},{id:"TB-ARR-X024",title:"Downwards arrow leftwards of upwards arrow",kind:"symbol",mml:"<mo>⇵</mo>",cell:[2,1]},{id:"TB-ARR-X025",title:"Upwards harpoon with barb left beside downwards harpoon with barb right",kind:"symbol",mml:"<mo>⥮</mo>",cell:[2,2]},{id:"TB-ARR-X026",title:"Downwards harpoon with barb left beside upwards harpoon with barb right",kind:"symbol",mml:"<mo>⥯</mo>",cell:[2,3]},{id:"TB-ARR-X027",title:"Rightwards arrow over short leftwards arrow",kind:"symbol",mml:"<mo>⥂</mo>",cell:[2,4]},{id:"TB-ARR-X028",title:"Short rightwards arrow over leftwards arrow",kind:"symbol",mml:"<mo>⥄</mo>",cell:[2,5]},{id:"TB-ARR-X029",title:"Up down arrow",kind:"symbol",mml:"<mo>↕</mo>",cell:[2,6]},{id:"TB-ARR-X030",title:"Up down double arrow",kind:"symbol",mml:"<mo>⇕</mo>",cell:[2,7]},{id:"TB-ARR-X031",title:"Downwards arrow with corner leftwards",kind:"symbol",mml:"<mo>↵</mo>",inferred:!0,cell:[2,8]}]},{id:"ARR-1",rows:3,items:[{id:"TB-ARR-009",title:"Vertical ellipsis",kind:"symbol",mml:"<mo>⋮</mo>",cell:[0,0]},{id:"TB-ARR-010",title:"Up right diagonal ellipsis",kind:"symbol",mml:"<mo>⋰</mo>",cell:[0,1]},{id:"TB-ARR-011",title:"Horizontal ellipsis",kind:"symbol",mml:"<mo>…</mo>",cell:[1,0]},{id:"TB-ARR-012",title:"Down right diagonal ellipsis",kind:"symbol",mml:"<mo>⋱</mo>",cell:[1,1]},{id:"TB-ARR-013",title:"Midline horizontal ellipsis",kind:"symbol",mml:"<mo>⋯</mo>",cell:[2,0]}]},{id:"ARR-2",rows:3,items:[{id:"TB-ARR-014",title:"Short dash",kind:"symbol",mml:"<mo>‐</mo>",cell:[0,0]},{id:"TB-ARR-015",title:"Dash",kind:"symbol",mml:"<mo>-</mo>",cell:[1,0]},{id:"TB-ARR-016",title:"Long dash",kind:"symbol",mml:"<mo>—</mo>",cell:[2,0]}]},{id:"ARR-3",rows:2,items:[{id:"TB-ARR-017",title:"Right arrow with over script",kind:"template",mml:"<mover><mo>→</mo><mrow/></mover>",cell:[0,0]},{id:"TB-ARR-018",title:"Right arrow with under script",kind:"template",mml:"<munder><mo>→</mo><mrow/></munder>",cell:[0,1]},{id:"TB-ARR-019",title:"Right arrow with under and over script",kind:"template",mml:"<munderover><mo>→</mo><mrow/><mrow/></munderover>",cell:[0,2]},{id:"TB-ARR-020",title:"Left arrow with over script",kind:"template",mml:"<mover><mo>←</mo><mrow/></mover>",cell:[1,0]},{id:"TB-ARR-021",title:"Left arrow with under script",kind:"template",mml:"<munder><mo>←</mo><mrow/></munder>",cell:[1,1]},{id:"TB-ARR-022",title:"Left arrow with under and over script",kind:"template",mml:"<munderover><mo>←</mo><mrow/><mrow/></munderover>",cell:[1,2]}],moreRows:2,more:[{id:"TB-ARR-X032",title:"Right left arrow with over script",kind:"template",mml:"<mover><mo>↔</mo><mrow/></mover>",cell:[0,0]},{id:"TB-ARR-X033",title:"Right left arrow with under script",kind:"template",mml:"<munder><mo>↔</mo><mrow/></munder>",cell:[0,1]},{id:"TB-ARR-X034",title:"Right left arrow with under and over script",kind:"template",mml:"<munderover><mo>↔</mo><mrow/><mrow/></munderover>",cell:[0,2]},{id:"TB-ARR-X035",title:"Left arrow with over right arrow with over script",kind:"template",mml:"<mover><mo>⇆</mo><mrow/></mover>",cell:[0,3]},{id:"TB-ARR-X036",title:"Left arrow over right arrow with under script",kind:"template",mml:"<munder><mo>⇆</mo><mrow/></munder>",cell:[0,4]},{id:"TB-ARR-X037",title:"Left arrow over right arrow with under and over script",kind:"template",mml:"<munderover><mo>⇆</mo><mrow/><mrow/></munderover>",cell:[0,5]},{id:"TB-ARR-X038",title:"Right arrow over left arrow with over script",kind:"template",mml:"<mover><mo>⇄</mo><mrow/></mover>",cell:[0,6]},{id:"TB-ARR-X039",title:"Right arrow over left arrow with under script",kind:"template",mml:"<munder><mo>⇄</mo><mrow/></munder>",cell:[0,7]},{id:"TB-ARR-X040",title:"Right arrow over left arrow with under and over script",kind:"template",mml:"<munderover><mo>⇄</mo><mrow/><mrow/></munderover>",cell:[0,8]},{id:"TB-ARR-X041",title:"Left harpoon over right harpoon with over script",kind:"template",mml:"<mover><mo>⇋</mo><mrow/></mover>",cell:[0,9]},{id:"TB-ARR-X042",title:"Left harpoon over right harpoon with under script",kind:"template",mml:"<munder><mo>⇋</mo><mrow/></munder>",cell:[0,10]},{id:"TB-ARR-X043",title:"Left harpoon over right harpoon with under and over script",kind:"template",mml:"<munderover><mo>⇋</mo><mrow/><mrow/></munderover>",cell:[1,0]},{id:"TB-ARR-X044",title:"Right harpoon over left harpoon with over script",kind:"template",mml:"<mover><mo>⇌</mo><mrow/></mover>",cell:[1,1]},{id:"TB-ARR-X045",title:"Right harpoon over left harpoon with under script",kind:"template",mml:"<munder><mo>⇌</mo><mrow/></munder>",cell:[1,2]},{id:"TB-ARR-X046",title:"Right harpoon over left harpoon with under and over script",kind:"template",mml:"<munderover><mo>⇌</mo><mrow/><mrow/></munderover>",cell:[1,3]},{id:"TB-ARR-X047",title:"Rightwards arrow over short leftwards arrow with over script",kind:"template",mml:"<mover><mo>⥂</mo><mrow/></mover>",cell:[1,4]},{id:"TB-ARR-X048",title:"Rightwards arrow over short leftwards arrow with under script",kind:"template",mml:"<munder><mo>⥂</mo><mrow/></munder>",cell:[1,5]},{id:"TB-ARR-X049",title:"Rightwards arrow over short leftwards arrow with under and over script",kind:"template",mml:"<munderover><mo>⥂</mo><mrow/><mrow/></munderover>",cell:[1,6]},{id:"TB-ARR-X050",title:"Short rightwards arrow over leftwards arrow with over script",kind:"template",mml:"<mover><mo>⥄</mo><mrow/></mover>",cell:[1,7]},{id:"TB-ARR-X051",title:"Short rightwards arrow over leftwards arrow with under script",kind:"template",mml:"<munder><mo>⥄</mo><mrow/></munder>",cell:[1,8]},{id:"TB-ARR-X052",title:"Short rightwards arrow over leftwards arrow with under and over script",kind:"template",mml:"<munderover><mo>⥄</mo><mrow/><mrow/></munderover>",cell:[1,9]}]},{id:"ARR-4",rows:2,items:[{id:"TB-ARR-023",title:"Vector accent",kind:"template",mml:"<mover><mrow/><mo>⇀</mo></mover>",cell:[0,0]},{id:"TB-ARR-024",title:"Left right arrow accent",kind:"template",mml:"<mover><mrow/><mo>↔</mo></mover>",cell:[0,1]},{id:"TB-ARR-025",title:"Arrow accent",kind:"template",mml:"<mover><mrow/><mo>→</mo></mover>",cell:[1,0]},{id:"TB-ARR-026",title:"Bar accent",kind:"template",mml:"<mover><mrow/><mo>¯</mo></mover>",cell:[1,1]}]}]},{id:"GRK",title:"Greek, letters and numbers",sections:[{id:"GRK-0",rows:3,items:[{id:"TB-GRK-001",title:"Alpha",kind:"symbol",mml:"<mi>α</mi>",cell:[0,0]},{id:"TB-GRK-002",title:"Beta",kind:"symbol",mml:"<mi>β</mi>",cell:[0,1]},{id:"TB-GRK-003",title:"Gamma",kind:"symbol",mml:"<mi>γ</mi>",cell:[0,2]},{id:"TB-GRK-004",title:"Delta",kind:"symbol",mml:"<mi>δ</mi>",cell:[0,3]},{id:"TB-GRK-005",title:"Epsilon",kind:"symbol",mml:"<mi>ε</mi>",cell:[0,4]},{id:"TB-GRK-006",title:"Zeta",kind:"symbol",mml:"<mi>ζ</mi>",cell:[0,5]},{id:"TB-GRK-007",title:"Eta",kind:"symbol",mml:"<mi>η</mi>",cell:[0,6]},{id:"TB-GRK-008",title:"Theta",kind:"symbol",mml:"<mi>θ</mi>",cell:[0,7]},{id:"TB-GRK-009",title:"Theta",kind:"symbol",mml:"<mi>ϑ</mi>",cell:[0,8]},{id:"TB-GRK-010",title:"Iota",kind:"symbol",mml:"<mi>ι</mi>",cell:[0,9]},{id:"TB-GRK-011",title:"Kappa",kind:"symbol",mml:"<mi>κ</mi>",cell:[1,0]},{id:"TB-GRK-012",title:"Lambda",kind:"symbol",mml:"<mi>λ</mi>",cell:[1,1]},{id:"TB-GRK-013",title:"Mu",kind:"symbol",mml:"<mi>μ</mi>",cell:[1,2]},{id:"TB-GRK-014",title:"Nu",kind:"symbol",mml:"<mi>ν</mi>",cell:[1,3]},{id:"TB-GRK-015",title:"Xi",kind:"symbol",mml:"<mi>ξ</mi>",cell:[1,4]},{id:"TB-GRK-016",title:"Omicron",kind:"symbol",mml:"<mi>ο</mi>",cell:[1,5]},{id:"TB-GRK-017",title:"Pi",kind:"symbol",mml:"<mi>π</mi>",cell:[1,6]},{id:"TB-GRK-018",title:"Pi",kind:"symbol",mml:"<mi>ϖ</mi>",cell:[1,7]},{id:"TB-GRK-019",title:"Rho",kind:"symbol",mml:"<mi>ρ</mi>",cell:[1,8]},{id:"TB-GRK-020",title:"Final sigma",kind:"symbol",mml:"<mi>ς</mi>",cell:[1,9]},{id:"TB-GRK-021",title:"Sigma",kind:"symbol",mml:"<mi>σ</mi>",cell:[2,0]},{id:"TB-GRK-022",title:"Tau",kind:"symbol",mml:"<mi>τ</mi>",cell:[2,1]},{id:"TB-GRK-023",title:"Upsilon",kind:"symbol",mml:"<mi>υ</mi>",cell:[2,2]},{id:"TB-GRK-024",title:"Phi",kind:"symbol",mml:"<mi>φ</mi>",cell:[2,3]},{id:"TB-GRK-025",title:"Phi",kind:"symbol",mml:"<mi>ϕ</mi>",cell:[2,4]},{id:"TB-GRK-026",title:"Chi",kind:"symbol",mml:"<mi>χ</mi>",cell:[2,5]},{id:"TB-GRK-027",title:"Psi",kind:"symbol",mml:"<mi>ψ</mi>",cell:[2,6]},{id:"TB-GRK-028",title:"Omega",kind:"symbol",mml:"<mi>ω</mi>",cell:[2,7]}],moreRows:3,more:[{id:"TB-GRK-X001",title:"Capital alpha",kind:"symbol",mml:"<mi>Α</mi>",cell:[0,0]},{id:"TB-GRK-X002",title:"Capital beta",kind:"symbol",mml:"<mi>Β</mi>",cell:[0,1]},{id:"TB-GRK-X003",title:"Capital gamma",kind:"symbol",mml:"<mi>Γ</mi>",cell:[0,2]},{id:"TB-GRK-X004",title:"Capital delta",kind:"symbol",mml:"<mi>Δ</mi>",cell:[0,3]},{id:"TB-GRK-X005",title:"Capital epsilon",kind:"symbol",mml:"<mi>Ε</mi>",cell:[0,4]},{id:"TB-GRK-X006",title:"Capital zeta",kind:"symbol",mml:"<mi>Ζ</mi>",cell:[0,5]},{id:"TB-GRK-X007",title:"Capital eta",kind:"symbol",mml:"<mi>Η</mi>",cell:[0,6]},{id:"TB-GRK-X008",title:"Capital theta",kind:"symbol",mml:"<mi>Θ</mi>",cell:[0,7]},{id:"TB-GRK-X009",title:"Capital iota",kind:"symbol",mml:"<mi>Ι</mi>",cell:[1,0]},{id:"TB-GRK-X010",title:"Capital kappa",kind:"symbol",mml:"<mi>Κ</mi>",cell:[1,1]},{id:"TB-GRK-X011",title:"Capital lambda",kind:"symbol",mml:"<mi>Λ</mi>",cell:[1,2]},{id:"TB-GRK-X012",title:"Capital mu",kind:"symbol",mml:"<mi>Μ</mi>",cell:[1,3]},{id:"TB-GRK-X013",title:"Capital nu",kind:"symbol",mml:"<mi>Ν</mi>",cell:[1,4]},{id:"TB-GRK-X014",title:"Capital xi",kind:"symbol",mml:"<mi>Ξ</mi>",cell:[1,5]},{id:"TB-GRK-X015",title:"Capital omicron",kind:"symbol",mml:"<mi>Ο</mi>",cell:[1,6]},{id:"TB-GRK-X016",title:"Capital pi",kind:"symbol",mml:"<mi>Π</mi>",cell:[1,7]},{id:"TB-GRK-X017",title:"Capital rho",kind:"symbol",mml:"<mi>Ρ</mi>",cell:[2,0]},{id:"TB-GRK-X018",title:"Capital sigma",kind:"symbol",mml:"<mi>Σ</mi>",cell:[2,1]},{id:"TB-GRK-X019",title:"Capital tau",kind:"symbol",mml:"<mi>Τ</mi>",cell:[2,2]},{id:"TB-GRK-X020",title:"Capital upsilon",kind:"symbol",mml:"<mi>Υ</mi>",cell:[2,3]},{id:"TB-GRK-X021",title:"Capital phi",kind:"symbol",mml:"<mi>Φ</mi>",cell:[2,4]},{id:"TB-GRK-X022",title:"Capital chi",kind:"symbol",mml:"<mi>Χ</mi>",cell:[2,5]},{id:"TB-GRK-X023",title:"Capital psi",kind:"symbol",mml:"<mi>Ψ</mi>",cell:[2,6]},{id:"TB-GRK-X024",title:"Capital omega",kind:"symbol",mml:"<mi>Ω</mi>",cell:[2,7]}]},{id:"GRK-1",rows:3,items:[{id:"TB-GRK-029",title:"Natural numbers (double-struck capital n)",kind:"symbol",mml:'<mi mathvariant="normal">ℕ</mi>',cell:[0,0]},{id:"TB-GRK-030",title:"Integer numbers (double-struck capital z)",kind:"symbol",mml:'<mi mathvariant="normal">ℤ</mi>',cell:[0,1]},{id:"TB-GRK-031",title:"Rational numbers (double-struck capital q)",kind:"symbol",mml:'<mi mathvariant="normal">ℚ</mi>',cell:[1,0]},{id:"TB-GRK-032",title:"Complex numbers (double-struck capital c)",kind:"symbol",mml:'<mi mathvariant="normal">ℂ</mi>',cell:[1,1]},{id:"TB-GRK-033",title:"Real numbers (double-struck capital r)",kind:"symbol",mml:'<mi mathvariant="normal">ℝ</mi>',cell:[2,0]},{id:"TB-GRK-034",title:"Prime numbers (double-struck capital p)",kind:"symbol",mml:'<mi mathvariant="normal">ℙ</mi>',cell:[2,1]}],moreRows:3,more:[{id:"TB-GRK-X025",title:"Double struck capital a",kind:"symbol",mml:'<mi mathvariant="double-struck">A</mi>',cell:[0,0]},{id:"TB-GRK-X026",title:"Double struck capital d",kind:"symbol",mml:'<mi mathvariant="double-struck">D</mi>',cell:[0,1]},{id:"TB-GRK-X027",title:"Double struck capital g",kind:"symbol",mml:'<mi mathvariant="double-struck">G</mi>',cell:[0,2]},{id:"TB-GRK-X028",title:"Double struck capital j",kind:"symbol",mml:'<mi mathvariant="double-struck">J</mi>',cell:[0,3]},{id:"TB-GRK-X029",title:"Double struck capital m",kind:"symbol",mml:'<mi mathvariant="double-struck">M</mi>',cell:[0,4]},{id:"TB-GRK-X030",title:"Prime numbers (double-struck capital p)",kind:"symbol",mml:'<mi mathvariant="normal">ℙ</mi>',cell:[0,5]},{id:"TB-GRK-X031",title:"Double struck capital s",kind:"symbol",mml:'<mi mathvariant="double-struck">S</mi>',cell:[0,6]},{id:"TB-GRK-X032",title:"Double struck capital v",kind:"symbol",mml:'<mi mathvariant="double-struck">V</mi>',inferred:!0,cell:[0,7]},{id:"TB-GRK-X033",title:"Double struck capital y",kind:"symbol",mml:'<mi mathvariant="double-struck">Y</mi>',cell:[0,8]},{id:"TB-GRK-X034",title:"Double struck a",kind:"symbol",mml:'<mi mathvariant="double-struck">a</mi>',cell:[0,9]},{id:"TB-GRK-X035",title:"Double struck d",kind:"symbol",mml:'<mi mathvariant="double-struck">d</mi>',cell:[0,10]},{id:"TB-GRK-X036",title:"Double struck g",kind:"symbol",mml:'<mi mathvariant="double-struck">g</mi>',cell:[0,11]},{id:"TB-GRK-X037",title:"Double struck j",kind:"symbol",mml:'<mi mathvariant="double-struck">j</mi>',cell:[0,12]},{id:"TB-GRK-X038",title:"Double struck m",kind:"symbol",mml:'<mi mathvariant="double-struck">m</mi>',cell:[0,13]},{id:"TB-GRK-X039",title:"Double struck p",kind:"symbol",mml:'<mi mathvariant="double-struck">p</mi>',cell:[0,14]},{id:"TB-GRK-X040",title:"Double struck s",kind:"symbol",mml:'<mi mathvariant="double-struck">s</mi>',cell:[0,15]},{id:"TB-GRK-X041",title:"Double struck v",kind:"symbol",mml:'<mi mathvariant="double-struck">v</mi>',cell:[0,16]},{id:"TB-GRK-X042",title:"Double struck y",kind:"symbol",mml:'<mi mathvariant="double-struck">y</mi>',cell:[0,17]},{id:"TB-GRK-X043",title:"Double struck capital b",kind:"symbol",mml:'<mi mathvariant="double-struck">B</mi>',cell:[1,0]},{id:"TB-GRK-X044",title:"Double struck capital e",kind:"symbol",mml:'<mi mathvariant="double-struck">E</mi>',cell:[1,1]},{id:"TB-GRK-X045",title:"Double struck capital h",kind:"symbol",mml:'<mi mathvariant="normal">ℍ</mi>',cell:[1,2]},{id:"TB-GRK-X046",title:"Double struck capital k",kind:"symbol",mml:'<mi mathvariant="double-struck">K</mi>',cell:[1,3]},{id:"TB-GRK-X047",title:"Natural numbers (double-struck capital n)",kind:"symbol",mml:'<mi mathvariant="normal">ℕ</mi>',inferred:!0,cell:[1,4]},{id:"TB-GRK-X048",title:"Rational numbers (double-struck capital q)",kind:"symbol",mml:'<mi mathvariant="normal">ℚ</mi>',cell:[1,5]},{id:"TB-GRK-X049",title:"Double struck capital t",kind:"symbol",mml:'<mi mathvariant="double-struck">T</mi>',cell:[1,6]},{id:"TB-GRK-X050",title:"Double struck capital w",kind:"symbol",mml:'<mi mathvariant="double-struck">W</mi>',cell:[1,7]},{id:"TB-GRK-X051",title:"Integer numbers (double-struck capital z)",kind:"symbol",mml:'<mi mathvariant="normal">ℤ</mi>',cell:[1,8]},{id:"TB-GRK-X052",title:"Double struck b",kind:"symbol",mml:'<mi mathvariant="double-struck">b</mi>',cell:[1,9]},{id:"TB-GRK-X053",title:"Double struck e",kind:"symbol",mml:'<mi mathvariant="double-struck">e</mi>',cell:[1,10]},{id:"TB-GRK-X054",title:"Double struck h",kind:"symbol",mml:'<mi mathvariant="double-struck">h</mi>',cell:[1,11]},{id:"TB-GRK-X055",title:"Double struck k",kind:"symbol",mml:'<mi mathvariant="double-struck">k</mi>',cell:[1,12]},{id:"TB-GRK-X056",title:"Double struck n",kind:"symbol",mml:'<mi mathvariant="double-struck">n</mi>',cell:[1,13]},{id:"TB-GRK-X057",title:"Double struck q",kind:"symbol",mml:'<mi mathvariant="double-struck">q</mi>',cell:[1,14]},{id:"TB-GRK-X058",title:"Double struck t",kind:"symbol",mml:'<mi mathvariant="double-struck">t</mi>',cell:[1,15]},{id:"TB-GRK-X059",title:"Double struck w",kind:"symbol",mml:'<mi mathvariant="double-struck">w</mi>',cell:[1,16]},{id:"TB-GRK-X060",title:"Double struck z",kind:"symbol",mml:'<mi mathvariant="double-struck">z</mi>',cell:[1,17]},{id:"TB-GRK-X061",title:"Complex numbers (double-struck capital c)",kind:"symbol",mml:'<mi mathvariant="normal">ℂ</mi>',cell:[2,0]},{id:"TB-GRK-X062",title:"Double struck capital f",kind:"symbol",mml:'<mi mathvariant="double-struck">F</mi>',cell:[2,1]},{id:"TB-GRK-X063",title:"Imaginary numbers (double-struck capital i)",kind:"symbol",mml:'<mi mathvariant="normal">𝕀</mi>',cell:[2,2]},{id:"TB-GRK-X064",title:"Double struck capital l",kind:"symbol",mml:'<mi mathvariant="double-struck">L</mi>',cell:[2,3]},{id:"TB-GRK-X065",title:"Double struck capital o",kind:"symbol",mml:'<mi mathvariant="double-struck">O</mi>',cell:[2,4]},{id:"TB-GRK-X066",title:"Real numbers (double-struck capital r)",kind:"symbol",mml:'<mi mathvariant="normal">ℝ</mi>',cell:[2,5]},{id:"TB-GRK-X067",title:"Double struck capital u",kind:"symbol",mml:'<mi mathvariant="double-struck">U</mi>',cell:[2,6]},{id:"TB-GRK-X068",title:"Double struck capital x",kind:"symbol",mml:'<mi mathvariant="double-struck">X</mi>',cell:[2,7]},{id:"TB-GRK-X069",title:"Double struck c",kind:"symbol",mml:'<mi mathvariant="double-struck">c</mi>',cell:[2,9]},{id:"TB-GRK-X070",title:"Double struck f",kind:"symbol",mml:'<mi mathvariant="double-struck">f</mi>',cell:[2,10]},{id:"TB-GRK-X071",title:"Double struck i",kind:"symbol",mml:'<mi mathvariant="double-struck">i</mi>',cell:[2,11]},{id:"TB-GRK-X072",title:"Double struck l",kind:"symbol",mml:'<mi mathvariant="double-struck">l</mi>',cell:[2,12]},{id:"TB-GRK-X073",title:"Double struck o",kind:"symbol",mml:'<mi mathvariant="double-struck">o</mi>',cell:[2,13]},{id:"TB-GRK-X074",title:"Double struck r",kind:"symbol",mml:'<mi mathvariant="double-struck">r</mi>',cell:[2,14]},{id:"TB-GRK-X075",title:"Double struck u",kind:"symbol",mml:'<mi mathvariant="double-struck">u</mi>',cell:[2,15]},{id:"TB-GRK-X076",title:"Double struck x",kind:"symbol",mml:'<mi mathvariant="double-struck">x</mi>',cell:[2,16]}]},{id:"GRK-2",rows:3,items:[{id:"TB-GRK-035",title:"Fraktur capital a",kind:"symbol",mml:'<mi mathvariant="fraktur">A</mi>',cell:[0,0]},{id:"TB-GRK-036",title:"Fraktur capital b",kind:"symbol",mml:'<mi mathvariant="fraktur">B</mi>',cell:[1,0]},{id:"TB-GRK-037",title:"Fraktur capital c",kind:"symbol",mml:'<mi mathvariant="fraktur">C</mi>',cell:[2,0]}],moreRows:3,more:[{id:"TB-GRK-X077",title:"Fraktur capital a",kind:"symbol",mml:'<mi mathvariant="fraktur">A</mi>',cell:[0,0]},{id:"TB-GRK-X078",title:"Fraktur capital d",kind:"symbol",mml:'<mi mathvariant="fraktur">D</mi>',inferred:!0,cell:[0,1]},{id:"TB-GRK-X079",title:"Fraktur capital g",kind:"symbol",mml:'<mi mathvariant="fraktur">G</mi>',cell:[0,2]},{id:"TB-GRK-X080",title:"Fraktur capital j",kind:"symbol",mml:'<mi mathvariant="fraktur">J</mi>',cell:[0,3]},{id:"TB-GRK-X081",title:"Fraktur capital m",kind:"symbol",mml:'<mi mathvariant="fraktur">M</mi>',cell:[0,4]},{id:"TB-GRK-X082",title:"Fraktur capital p",kind:"symbol",mml:'<mi mathvariant="fraktur">P</mi>',cell:[0,5]},{id:"TB-GRK-X083",title:"Fraktur capital s",kind:"symbol",mml:'<mi mathvariant="fraktur">S</mi>',cell:[0,6]},{id:"TB-GRK-X084",title:"Fraktur capital v",kind:"symbol",mml:'<mi mathvariant="fraktur">V</mi>',cell:[0,7]},{id:"TB-GRK-X085",title:"Fraktur capital y",kind:"symbol",mml:'<mi mathvariant="fraktur">Y</mi>',cell:[0,8]},{id:"TB-GRK-X086",title:"Fraktur a",kind:"symbol",mml:'<mi mathvariant="fraktur">a</mi>',cell:[0,9]},{id:"TB-GRK-X087",title:"Fraktur d",kind:"symbol",mml:'<mi mathvariant="fraktur">d</mi>',cell:[0,10]},{id:"TB-GRK-X088",title:"Fraktur g",kind:"symbol",mml:'<mi mathvariant="fraktur">g</mi>',cell:[0,11]},{id:"TB-GRK-X089",title:"Fraktur j",kind:"symbol",mml:'<mi mathvariant="fraktur">j</mi>',cell:[0,12]},{id:"TB-GRK-X090",title:"Fraktur m",kind:"symbol",mml:'<mi mathvariant="fraktur">m</mi>',cell:[0,13]},{id:"TB-GRK-X091",title:"Fraktur p",kind:"symbol",mml:'<mi mathvariant="fraktur">p</mi>',cell:[0,14]},{id:"TB-GRK-X092",title:"Fraktur s",kind:"symbol",mml:'<mi mathvariant="fraktur">s</mi>',cell:[0,15]},{id:"TB-GRK-X093",title:"Fraktur v",kind:"symbol",mml:'<mi mathvariant="fraktur">v</mi>',cell:[0,16]},{id:"TB-GRK-X094",title:"Fraktur y",kind:"symbol",mml:'<mi mathvariant="fraktur">y</mi>',cell:[0,17]},{id:"TB-GRK-X095",title:"Fraktur capital b",kind:"symbol",mml:'<mi mathvariant="fraktur">B</mi>',cell:[1,0]},{id:"TB-GRK-X096",title:"Fraktur capital e",kind:"symbol",mml:'<mi mathvariant="fraktur">E</mi>',cell:[1,1]},{id:"TB-GRK-X097",title:"Fraktur capital h",kind:"symbol",mml:'<mi mathvariant="fraktur">H</mi>',cell:[1,2]},{id:"TB-GRK-X098",title:"Fraktur capital k",kind:"symbol",mml:'<mi mathvariant="fraktur">K</mi>',cell:[1,3]},{id:"TB-GRK-X099",title:"Fraktur capital n",kind:"symbol",mml:'<mi mathvariant="fraktur">N</mi>',cell:[1,4]},{id:"TB-GRK-X100",title:"Fraktur capital q",kind:"symbol",mml:'<mi mathvariant="fraktur">Q</mi>',inferred:!0,cell:[1,5]},{id:"TB-GRK-X101",title:"Fraktur capital t",kind:"symbol",mml:'<mi mathvariant="fraktur">T</mi>',cell:[1,6]},{id:"TB-GRK-X102",title:"Fraktur capital w",kind:"symbol",mml:'<mi mathvariant="fraktur">W</mi>',cell:[1,7]},{id:"TB-GRK-X103",title:"Fraktur capital z",kind:"symbol",mml:'<mi mathvariant="fraktur">Z</mi>',cell:[1,8]},{id:"TB-GRK-X104",title:"Fraktur b",kind:"symbol",mml:'<mi mathvariant="fraktur">b</mi>',cell:[1,9]},{id:"TB-GRK-X105",title:"Fraktur e",kind:"symbol",mml:'<mi mathvariant="fraktur">e</mi>',cell:[1,10]},{id:"TB-GRK-X106",title:"Fraktur h",kind:"symbol",mml:'<mi mathvariant="fraktur">h</mi>',cell:[1,11]},{id:"TB-GRK-X107",title:"Fraktur k",kind:"symbol",mml:'<mi mathvariant="fraktur">k</mi>',cell:[1,12]},{id:"TB-GRK-X108",title:"Fraktur n",kind:"symbol",mml:'<mi mathvariant="fraktur">n</mi>',cell:[1,13]},{id:"TB-GRK-X109",title:"Fraktur q",kind:"symbol",mml:'<mi mathvariant="fraktur">q</mi>',cell:[1,14]},{id:"TB-GRK-X110",title:"Fraktur t",kind:"symbol",mml:'<mi mathvariant="fraktur">t</mi>',cell:[1,15]},{id:"TB-GRK-X111",title:"Fraktur w",kind:"symbol",mml:'<mi mathvariant="fraktur">w</mi>',inferred:!0,cell:[1,16]},{id:"TB-GRK-X112",title:"Fraktur z",kind:"symbol",mml:'<mi mathvariant="fraktur">z</mi>',cell:[1,17]},{id:"TB-GRK-X113",title:"Fraktur capital c",kind:"symbol",mml:'<mi mathvariant="fraktur">C</mi>',cell:[2,0]},{id:"TB-GRK-X114",title:"Fraktur capital f",kind:"symbol",mml:'<mi mathvariant="fraktur">F</mi>',cell:[2,1]},{id:"TB-GRK-X115",title:"Fraktur capital i",kind:"symbol",mml:'<mi mathvariant="fraktur">I</mi>',cell:[2,2]},{id:"TB-GRK-X116",title:"Fraktur capital l",kind:"symbol",mml:'<mi mathvariant="fraktur">L</mi>',cell:[2,3]},{id:"TB-GRK-X117",title:"Fraktur capital o",kind:"symbol",mml:'<mi mathvariant="fraktur">O</mi>',cell:[2,4]},{id:"TB-GRK-X118",title:"Fraktur capital r",kind:"symbol",mml:'<mi mathvariant="fraktur">R</mi>',cell:[2,5]},{id:"TB-GRK-X119",title:"Fraktur capital u",kind:"symbol",mml:'<mi mathvariant="fraktur">U</mi>',cell:[2,6]},{id:"TB-GRK-X120",title:"Fraktur capital x",kind:"symbol",mml:'<mi mathvariant="fraktur">X</mi>',cell:[2,7]},{id:"TB-GRK-X121",title:"Fraktur c",kind:"symbol",mml:'<mi mathvariant="fraktur">c</mi>',cell:[2,9]},{id:"TB-GRK-X122",title:"Fraktur f",kind:"symbol",mml:'<mi mathvariant="fraktur">f</mi>',cell:[2,10]},{id:"TB-GRK-X123",title:"Fraktur i",kind:"symbol",mml:'<mi mathvariant="fraktur">i</mi>',cell:[2,11]},{id:"TB-GRK-X124",title:"Fraktur l",kind:"symbol",mml:'<mi mathvariant="fraktur">l</mi>',cell:[2,12]},{id:"TB-GRK-X125",title:"Fraktur o",kind:"symbol",mml:'<mi mathvariant="fraktur">o</mi>',cell:[2,13]},{id:"TB-GRK-X126",title:"Fraktur r",kind:"symbol",mml:'<mi mathvariant="fraktur">r</mi>',cell:[2,14]},{id:"TB-GRK-X127",title:"Fraktur u",kind:"symbol",mml:'<mi mathvariant="fraktur">u</mi>',cell:[2,15]},{id:"TB-GRK-X128",title:"Fraktur x",kind:"symbol",mml:'<mi mathvariant="fraktur">x</mi>',cell:[2,16]}]},{id:"GRK-3",rows:3,items:[{id:"TB-GRK-038",title:"Script capital a",kind:"symbol",mml:'<mi mathvariant="script">A</mi>',cell:[0,0]},{id:"TB-GRK-039",title:"Script capital b",kind:"symbol",mml:'<mi mathvariant="script">B</mi>',cell:[1,0]},{id:"TB-GRK-040",title:"Script capital c",kind:"symbol",mml:'<mi mathvariant="script">C</mi>',cell:[2,0]}],moreRows:3,more:[{id:"TB-GRK-X129",title:"Script capital a",kind:"symbol",mml:'<mi mathvariant="script">A</mi>',cell:[0,0]},{id:"TB-GRK-X130",title:"Script capital d",kind:"symbol",mml:'<mi mathvariant="script">D</mi>',cell:[0,1]},{id:"TB-GRK-X131",title:"Script capital g",kind:"symbol",mml:'<mi mathvariant="script">G</mi>',cell:[0,2]},{id:"TB-GRK-X132",title:"Script capital j",kind:"symbol",mml:'<mi mathvariant="script">J</mi>',cell:[0,3]},{id:"TB-GRK-X133",title:"Script capital m",kind:"symbol",mml:'<mi mathvariant="script">M</mi>',cell:[0,4]},{id:"TB-GRK-X134",title:"Script capital p",kind:"symbol",mml:'<mi mathvariant="script">P</mi>',inferred:!0,cell:[0,5]},{id:"TB-GRK-X135",title:"Script capital s",kind:"symbol",mml:'<mi mathvariant="script">S</mi>',cell:[0,6]},{id:"TB-GRK-X136",title:"Script capital v",kind:"symbol",mml:'<mi mathvariant="script">V</mi>',cell:[0,7]},{id:"TB-GRK-X137",title:"Script capital y",kind:"symbol",mml:'<mi mathvariant="script">Y</mi>',cell:[0,8]},{id:"TB-GRK-X138",title:"Script a",kind:"symbol",mml:'<mi mathvariant="script">a</mi>',cell:[0,9]},{id:"TB-GRK-X139",title:"Script d",kind:"symbol",mml:'<mi mathvariant="script">d</mi>',cell:[0,10]},{id:"TB-GRK-X140",title:"Script g",kind:"symbol",mml:'<mi mathvariant="script">g</mi>',cell:[0,11]},{id:"TB-GRK-X141",title:"Script j",kind:"symbol",mml:'<mi mathvariant="script">j</mi>',cell:[0,12]},{id:"TB-GRK-X142",title:"Script m",kind:"symbol",mml:'<mi mathvariant="script">m</mi>',cell:[0,13]},{id:"TB-GRK-X143",title:"Script p",kind:"symbol",mml:'<mi mathvariant="script">p</mi>',cell:[0,14]},{id:"TB-GRK-X144",title:"Script s",kind:"symbol",mml:'<mi mathvariant="script">s</mi>',cell:[0,15]},{id:"TB-GRK-X145",title:"Script v",kind:"symbol",mml:'<mi mathvariant="script">v</mi>',cell:[0,16]},{id:"TB-GRK-X146",title:"Script y",kind:"symbol",mml:'<mi mathvariant="script">y</mi>',cell:[0,17]},{id:"TB-GRK-X147",title:"Script capital b",kind:"symbol",mml:'<mi mathvariant="script">B</mi>',cell:[1,0]},{id:"TB-GRK-X148",title:"Script capital e",kind:"symbol",mml:'<mi mathvariant="script">E</mi>',cell:[1,1]},{id:"TB-GRK-X149",title:"Script capital h",kind:"symbol",mml:'<mi mathvariant="script">H</mi>',cell:[1,2]},{id:"TB-GRK-X150",title:"Script capital k",kind:"symbol",mml:'<mi mathvariant="script">K</mi>',cell:[1,3]},{id:"TB-GRK-X151",title:"Script capital n",kind:"symbol",mml:'<mi mathvariant="script">N</mi>',cell:[1,4]},{id:"TB-GRK-X152",title:"Script capital q",kind:"symbol",mml:'<mi mathvariant="script">Q</mi>',cell:[1,5]},{id:"TB-GRK-X153",title:"Script capital t",kind:"symbol",mml:'<mi mathvariant="script">T</mi>',cell:[1,6]},{id:"TB-GRK-X154",title:"Script capital w",kind:"symbol",mml:'<mi mathvariant="script">W</mi>',cell:[1,7]},{id:"TB-GRK-X155",title:"Script capital z",kind:"symbol",mml:'<mi mathvariant="script">Z</mi>',cell:[1,8]},{id:"TB-GRK-X156",title:"Script b",kind:"symbol",mml:'<mi mathvariant="script">b</mi>',cell:[1,9]},{id:"TB-GRK-X157",title:"Script e",kind:"symbol",mml:'<mi mathvariant="script">e</mi>',cell:[1,10]},{id:"TB-GRK-X158",title:"Script h",kind:"symbol",mml:'<mi mathvariant="script">h</mi>',cell:[1,11]},{id:"TB-GRK-X159",title:"Script k",kind:"symbol",mml:'<mi mathvariant="script">k</mi>',cell:[1,12]},{id:"TB-GRK-X160",title:"Script n",kind:"symbol",mml:'<mi mathvariant="script">n</mi>',cell:[1,13]},{id:"TB-GRK-X161",title:"Script q",kind:"symbol",mml:'<mi mathvariant="script">q</mi>',cell:[1,14]},{id:"TB-GRK-X162",title:"Script t",kind:"symbol",mml:'<mi mathvariant="script">t</mi>',cell:[1,15]},{id:"TB-GRK-X163",title:"Script w",kind:"symbol",mml:'<mi mathvariant="script">w</mi>',cell:[1,16]},{id:"TB-GRK-X164",title:"Script z",kind:"symbol",mml:'<mi mathvariant="script">z</mi>',cell:[1,17]},{id:"TB-GRK-X165",title:"Script capital c",kind:"symbol",mml:'<mi mathvariant="script">C</mi>',cell:[2,0]},{id:"TB-GRK-X166",title:"Script capital f",kind:"symbol",mml:'<mi mathvariant="script">F</mi>',cell:[2,1]},{id:"TB-GRK-X167",title:"Script capital i",kind:"symbol",mml:'<mi mathvariant="script">I</mi>',cell:[2,2]},{id:"TB-GRK-X168",title:"Script capital l",kind:"symbol",mml:'<mi mathvariant="script">L</mi>',cell:[2,3]},{id:"TB-GRK-X169",title:"Script capital o",kind:"symbol",mml:'<mi mathvariant="script">O</mi>',cell:[2,4]},{id:"TB-GRK-X170",title:"Script capital r",kind:"symbol",mml:'<mi mathvariant="script">R</mi>',cell:[2,5]},{id:"TB-GRK-X171",title:"Script capital u",kind:"symbol",mml:'<mi mathvariant="script">U</mi>',cell:[2,6]},{id:"TB-GRK-X172",title:"Script capital x",kind:"symbol",mml:'<mi mathvariant="script">X</mi>',cell:[2,7]},{id:"TB-GRK-X173",title:"Script c",kind:"symbol",mml:'<mi mathvariant="script">c</mi>',cell:[2,9]},{id:"TB-GRK-X174",title:"Script f",kind:"symbol",mml:'<mi mathvariant="script">f</mi>',cell:[2,10]},{id:"TB-GRK-X175",title:"Script i",kind:"symbol",mml:'<mi mathvariant="script">i</mi>',cell:[2,11]},{id:"TB-GRK-X176",title:"Script l",kind:"symbol",mml:'<mi mathvariant="script">l</mi>',cell:[2,12]},{id:"TB-GRK-X177",title:"Script o",kind:"symbol",mml:'<mi mathvariant="script">o</mi>',cell:[2,13]},{id:"TB-GRK-X178",title:"Script r",kind:"symbol",mml:'<mi mathvariant="script">r</mi>',cell:[2,14]},{id:"TB-GRK-X179",title:"Script u",kind:"symbol",mml:'<mi mathvariant="script">u</mi>',cell:[2,15]},{id:"TB-GRK-X180",title:"Script x",kind:"symbol",mml:'<mi mathvariant="script">x</mi>',cell:[2,16]}]},{id:"GRK-4",rows:3,items:[{id:"TB-GRK-041",title:"Imaginary part (black-letter capital i)",kind:"symbol",mml:'<mi mathvariant="fraktur">I</mi>',cell:[0,0]},{id:"TB-GRK-042",title:"Real part (black-letter capital r)",kind:"symbol",mml:'<mi mathvariant="fraktur">R</mi>',cell:[1,0]},{id:"TB-GRK-043",title:"Ell",kind:"symbol",mml:'<mi mathvariant="script">l</mi>',cell:[2,0]}],moreRows:3,more:[{id:"TB-GRK-X181",title:"Alef",kind:"symbol",mml:"<mo>ℵ</mo>",cell:[0,0]},{id:"TB-GRK-X182",title:"Script capital l",kind:"symbol",mml:"<mi>ℒ</mi>",cell:[0,1]},{id:"TB-GRK-X183",title:"Script capital p",kind:"symbol",mml:"<mi>℘</mi>",cell:[1,0]},{id:"TB-GRK-X184",title:"Z transform",kind:"symbol",mml:"<mo>Ƶ</mo>",cell:[1,1]},{id:"TB-GRK-X185",title:"Script capital f",kind:"symbol",mml:"<mi>ℱ</mi>",cell:[2,0]}]},{id:"GRK-5",rows:3,items:[{id:"TB-GRK-044",title:"Arabic-Indic numerals",kind:"action",cell:[0,0]},{id:"TB-GRK-045",title:"Eastern Arabic-Indic numerals",kind:"action",cell:[1,0]}]},{id:"GRK-6",rows:3,items:[{id:"TB-GRK-046",title:"Hydrogen",kind:"symbol",mml:'<mi mathvariant="normal">H</mi>',cell:[0,0]},{id:"TB-GRK-047",title:"Carbon",kind:"symbol",mml:'<mi mathvariant="normal">C</mi>',cell:[0,1]},{id:"TB-GRK-048",title:"Nitrogen",kind:"symbol",mml:'<mi mathvariant="normal">N</mi>',cell:[1,0]},{id:"TB-GRK-049",title:"Oxygen",kind:"symbol",mml:'<mi mathvariant="normal">O</mi>',cell:[1,1]},{id:"TB-GRK-050",title:"Fluorine",kind:"symbol",mml:'<mi mathvariant="normal">F</mi>',cell:[2,0]},{id:"TB-GRK-051",title:"Sulfur",kind:"symbol",mml:'<mi mathvariant="normal">S</mi>',cell:[2,1]}],moreRows:9,more:[{id:"TB-GRK-X186",title:"Hydrogen",kind:"symbol",mml:'<mi mathvariant="normal">H</mi>',cell:[0,0]},{id:"TB-GRK-X187",title:"Helium",kind:"symbol",mml:"<mi>He</mi>",cell:[0,17]},{id:"TB-GRK-X188",title:"Lithium",kind:"symbol",mml:"<mi>Li</mi>",cell:[1,0]},{id:"TB-GRK-X189",title:"Beryllium",kind:"symbol",mml:"<mi>Be</mi>",cell:[1,1]},{id:"TB-GRK-X190",title:"Boron",kind:"symbol",mml:'<mi mathvariant="normal">B</mi>',cell:[1,12]},{id:"TB-GRK-X191",title:"Carbon",kind:"symbol",mml:'<mi mathvariant="normal">C</mi>',cell:[1,13]},{id:"TB-GRK-X192",title:"Nitrogen",kind:"symbol",mml:'<mi mathvariant="normal">N</mi>',cell:[1,14]},{id:"TB-GRK-X193",title:"Oxygen",kind:"symbol",mml:'<mi mathvariant="normal">O</mi>',cell:[1,15]},{id:"TB-GRK-X194",title:"Fluorine",kind:"symbol",mml:'<mi mathvariant="normal">F</mi>',cell:[1,16]},{id:"TB-GRK-X195",title:"Neon",kind:"symbol",mml:"<mi>Ne</mi>",cell:[1,17]},{id:"TB-GRK-X196",title:"Sodium",kind:"symbol",mml:"<mi>Na</mi>",cell:[2,0]},{id:"TB-GRK-X197",title:"Magnesium",kind:"symbol",mml:"<mi>Mg</mi>",cell:[2,1]},{id:"TB-GRK-X198",title:"Aluminium",kind:"symbol",mml:"<mi>Al</mi>",cell:[2,12]},{id:"TB-GRK-X199",title:"Silicon",kind:"symbol",mml:"<mi>Si</mi>",cell:[2,13]},{id:"TB-GRK-X200",title:"Phosphorus",kind:"symbol",mml:'<mi mathvariant="normal">P</mi>',cell:[2,14]},{id:"TB-GRK-X201",title:"Sulfur",kind:"symbol",mml:'<mi mathvariant="normal">S</mi>',cell:[2,15]},{id:"TB-GRK-X202",title:"Chlorine",kind:"symbol",mml:"<mi>Cl</mi>",cell:[2,16]},{id:"TB-GRK-X203",title:"Argon",kind:"symbol",mml:"<mi>Ar</mi>",cell:[2,17]},{id:"TB-GRK-X204",title:"Potassium",kind:"symbol",mml:'<mi mathvariant="normal">K</mi>',cell:[3,0]},{id:"TB-GRK-X205",title:"Calcium",kind:"symbol",mml:"<mi>Ca</mi>",cell:[3,1]},{id:"TB-GRK-X206",title:"Scandium",kind:"symbol",mml:"<mi>Sc</mi>",cell:[3,2]},{id:"TB-GRK-X207",title:"Titanium",kind:"symbol",mml:"<mi>Ti</mi>",cell:[3,3]},{id:"TB-GRK-X208",title:"Vanadium",kind:"symbol",mml:'<mi mathvariant="normal">V</mi>',cell:[3,4]},{id:"TB-GRK-X209",title:"Chromium",kind:"symbol",mml:"<mi>Cr</mi>",cell:[3,5]},{id:"TB-GRK-X210",title:"Manganese",kind:"symbol",mml:"<mi>Mn</mi>",cell:[3,6]},{id:"TB-GRK-X211",title:"Iron",kind:"symbol",mml:"<mi>Fe</mi>",cell:[3,7]},{id:"TB-GRK-X212",title:"Cobalt",kind:"symbol",mml:"<mi>Co</mi>",cell:[3,8]},{id:"TB-GRK-X213",title:"Nickel",kind:"symbol",mml:"<mi>Ni</mi>",cell:[3,9]},{id:"TB-GRK-X214",title:"Copper",kind:"symbol",mml:"<mi>Cu</mi>",cell:[3,10]},{id:"TB-GRK-X215",title:"Zinc",kind:"symbol",mml:"<mi>Zn</mi>",cell:[3,11]},{id:"TB-GRK-X216",title:"Gallium",kind:"symbol",mml:"<mi>Ga</mi>",cell:[3,12]},{id:"TB-GRK-X217",title:"Germanium",kind:"symbol",mml:"<mi>Ge</mi>",cell:[3,13]},{id:"TB-GRK-X218",title:"Arsenic",kind:"symbol",mml:"<mi>As</mi>",cell:[3,14]},{id:"TB-GRK-X219",title:"Selenium",kind:"symbol",mml:"<mi>Se</mi>",cell:[3,15]},{id:"TB-GRK-X220",title:"Bromine",kind:"symbol",mml:"<mi>Br</mi>",cell:[3,16]},{id:"TB-GRK-X221",title:"Krypton",kind:"symbol",mml:"<mi>Kr</mi>",cell:[3,17]},{id:"TB-GRK-X222",title:"Rubidium",kind:"symbol",mml:"<mi>Rb</mi>",cell:[4,0]},{id:"TB-GRK-X223",title:"Strontium",kind:"symbol",mml:"<mi>Sr</mi>",cell:[4,1]},{id:"TB-GRK-X224",title:"Yttrium",kind:"symbol",mml:'<mi mathvariant="normal">Y</mi>',cell:[4,2]},{id:"TB-GRK-X225",title:"Zirconium",kind:"symbol",mml:"<mi>Zr</mi>",cell:[4,3]},{id:"TB-GRK-X226",title:"Niobium",kind:"symbol",mml:"<mi>Nb</mi>",cell:[4,4]},{id:"TB-GRK-X227",title:"Molybdenum",kind:"symbol",mml:"<mi>Mo</mi>",inferred:!0,cell:[4,5]},{id:"TB-GRK-X228",title:"Technetium",kind:"symbol",mml:"<mi>Tc</mi>",cell:[4,6]},{id:"TB-GRK-X229",title:"Ruthenium",kind:"symbol",mml:"<mi>Ru</mi>",cell:[4,7]},{id:"TB-GRK-X230",title:"Rhodium",kind:"symbol",mml:"<mi>Rh</mi>",cell:[4,8]},{id:"TB-GRK-X231",title:"Palladium",kind:"symbol",mml:"<mi>Pd</mi>",cell:[4,9]},{id:"TB-GRK-X232",title:"Silver",kind:"symbol",mml:"<mi>Ag</mi>",cell:[4,10]},{id:"TB-GRK-X233",title:"Cadmium",kind:"symbol",mml:"<mi>Cd</mi>",cell:[4,11]},{id:"TB-GRK-X234",title:"Indium",kind:"symbol",mml:"<mi>In</mi>",cell:[4,12]},{id:"TB-GRK-X235",title:"Tin",kind:"symbol",mml:"<mi>Sn</mi>",cell:[4,13]},{id:"TB-GRK-X236",title:"Antimony",kind:"symbol",mml:"<mi>Sb</mi>",cell:[4,14]},{id:"TB-GRK-X237",title:"Tellurium",kind:"symbol",mml:"<mi>Te</mi>",cell:[4,15]},{id:"TB-GRK-X238",title:"Iodine",kind:"symbol",mml:'<mi mathvariant="normal">I</mi>',cell:[4,16]},{id:"TB-GRK-X239",title:"Xenon",kind:"symbol",mml:"<mi>Xe</mi>",cell:[4,17]},{id:"TB-GRK-X240",title:"Caesium",kind:"symbol",mml:"<mi>Cs</mi>",cell:[5,0]},{id:"TB-GRK-X241",title:"Barium",kind:"symbol",mml:"<mi>Ba</mi>",cell:[5,1]},{id:"TB-GRK-X242",title:"Hafnium",kind:"symbol",mml:"<mi>Hf</mi>",cell:[5,3]},{id:"TB-GRK-X243",title:"Tantalum",kind:"symbol",mml:"<mi>Ta</mi>",cell:[5,4]},{id:"TB-GRK-X244",title:"Tungsten",kind:"symbol",mml:'<mi mathvariant="normal">W</mi>',cell:[5,5]},{id:"TB-GRK-X245",title:"Rhenium",kind:"symbol",mml:"<mi>Re</mi>",cell:[5,6]},{id:"TB-GRK-X246",title:"Osmium",kind:"symbol",mml:"<mi>Os</mi>",cell:[5,7]},{id:"TB-GRK-X247",title:"Iridium",kind:"symbol",mml:"<mi>Ir</mi>",cell:[5,8]},{id:"TB-GRK-X248",title:"Platinum",kind:"symbol",mml:"<mi>Pt</mi>",cell:[5,9]},{id:"TB-GRK-X249",title:"Gold",kind:"symbol",mml:"<mi>Au</mi>",cell:[5,10]},{id:"TB-GRK-X250",title:"Mercury",kind:"symbol",mml:"<mi>Hg</mi>",cell:[5,11]},{id:"TB-GRK-X251",title:"Thallium",kind:"symbol",mml:"<mi>Tl</mi>",cell:[5,12]},{id:"TB-GRK-X252",title:"Lead",kind:"symbol",mml:"<mi>Pb</mi>",cell:[5,13]},{id:"TB-GRK-X253",title:"Bismuth",kind:"symbol",mml:"<mi>Bi</mi>",cell:[5,14]},{id:"TB-GRK-X254",title:"Polonium",kind:"symbol",mml:"<mi>Po</mi>",cell:[5,15]},{id:"TB-GRK-X255",title:"Astatine",kind:"symbol",mml:"<mi>At</mi>",cell:[5,16]},{id:"TB-GRK-X256",title:"Radon",kind:"symbol",mml:"<mi>Rn</mi>",cell:[5,17]},{id:"TB-GRK-X257",title:"Francium",kind:"symbol",mml:"<mi>Fr</mi>",cell:[6,0]},{id:"TB-GRK-X258",title:"Radium",kind:"symbol",mml:"<mi>Ra</mi>",inferred:!0,cell:[6,1]},{id:"TB-GRK-X259",title:"Rutherfordium",kind:"symbol",mml:"<mi>Rf</mi>",inferred:!0,cell:[6,3]},{id:"TB-GRK-X260",title:"Dubnium",kind:"symbol",mml:"<mi>Db</mi>",cell:[6,4]},{id:"TB-GRK-X261",title:"Seaborgium",kind:"symbol",mml:"<mi>Sg</mi>",cell:[6,5]},{id:"TB-GRK-X262",title:"Bohrium",kind:"symbol",mml:"<mi>Bh</mi>",cell:[6,6]},{id:"TB-GRK-X263",title:"Hassium",kind:"symbol",mml:"<mi>Hs</mi>",cell:[6,7]},{id:"TB-GRK-X264",title:"Meitnerium",kind:"symbol",mml:"<mi>Mt</mi>",cell:[6,8]},{id:"TB-GRK-X265",title:"Darmstadtium",kind:"symbol",mml:"<mi>Ds</mi>",cell:[6,9]},{id:"TB-GRK-X266",title:"Roentgenium",kind:"symbol",mml:"<mi>Rg</mi>",cell:[6,10]},{id:"TB-GRK-X267",title:"Copernicium",kind:"symbol",mml:"<mi>Cn</mi>",cell:[6,11]},{id:"TB-GRK-X268",title:"Nihonium",kind:"symbol",mml:"<mi>Nh</mi>",cell:[6,12]},{id:"TB-GRK-X269",title:"Flerovium",kind:"symbol",mml:"<mi>Fl</mi>",cell:[6,13]},{id:"TB-GRK-X270",title:"Moscovium",kind:"symbol",mml:"<mi>Mc</mi>",cell:[6,14]},{id:"TB-GRK-X271",title:"Livermorium",kind:"symbol",mml:"<mi>Lv</mi>",cell:[6,15]},{id:"TB-GRK-X272",title:"Tennessine",kind:"symbol",mml:"<mi>Ts</mi>",inferred:!0,cell:[6,16]},{id:"TB-GRK-X273",title:"Oganesson",kind:"symbol",mml:"<mi>Og</mi>",cell:[6,17]},{id:"TB-GRK-X274",title:"Lanthanum",kind:"symbol",mml:"<mi>La</mi>",cell:[7,3]},{id:"TB-GRK-X275",title:"Cerium",kind:"symbol",mml:"<mi>Ce</mi>",cell:[7,4]},{id:"TB-GRK-X276",title:"Praseodymium",kind:"symbol",mml:"<mi>Pr</mi>",cell:[7,5]},{id:"TB-GRK-X277",title:"Neodymium",kind:"symbol",mml:"<mi>Nd</mi>",cell:[7,6]},{id:"TB-GRK-X278",title:"Promethium",kind:"symbol",mml:"<mi>Pm</mi>",cell:[7,7]},{id:"TB-GRK-X279",title:"Samarium",kind:"symbol",mml:"<mi>Sm</mi>",cell:[7,8]},{id:"TB-GRK-X280",title:"Europium",kind:"symbol",mml:"<mi>Eu</mi>",cell:[7,9]},{id:"TB-GRK-X281",title:"Gadolinium",kind:"symbol",mml:"<mi>Gd</mi>",cell:[7,10]},{id:"TB-GRK-X282",title:"Terbium",kind:"symbol",mml:"<mi>Tb</mi>",cell:[7,11]},{id:"TB-GRK-X283",title:"Dysprosium",kind:"symbol",mml:"<mi>Dy</mi>",cell:[7,12]},{id:"TB-GRK-X284",title:"Holmium",kind:"symbol",mml:"<mi>Ho</mi>",cell:[7,13]},{id:"TB-GRK-X285",title:"Erbium",kind:"symbol",mml:"<mi>Er</mi>",cell:[7,14]},{id:"TB-GRK-X286",title:"Thulium",kind:"symbol",mml:"<mi>Tm</mi>",cell:[7,15]},{id:"TB-GRK-X287",title:"Ytterbium",kind:"symbol",mml:"<mi>Yb</mi>",cell:[7,16]},{id:"TB-GRK-X288",title:"Lutetium",kind:"symbol",mml:"<mi>Lu</mi>",cell:[7,17]},{id:"TB-GRK-X289",title:"Actinium",kind:"symbol",mml:"<mi>Ac</mi>",cell:[8,3]},{id:"TB-GRK-X290",title:"Thorium",kind:"symbol",mml:"<mi>Th</mi>",cell:[8,4]},{id:"TB-GRK-X291",title:"Protactinium",kind:"symbol",mml:"<mi>Pa</mi>",cell:[8,5]},{id:"TB-GRK-X292",title:"Uranium",kind:"symbol",mml:'<mi mathvariant="normal">U</mi>',cell:[8,6]},{id:"TB-GRK-X293",title:"Neptunium",kind:"symbol",mml:"<mi>Np</mi>",cell:[8,7]},{id:"TB-GRK-X294",title:"Plutonium",kind:"symbol",mml:"<mi>Pu</mi>",cell:[8,8]},{id:"TB-GRK-X295",title:"Americium",kind:"symbol",mml:"<mi>Am</mi>",cell:[8,9]},{id:"TB-GRK-X296",title:"Curium",kind:"symbol",mml:"<mi>Cm</mi>",cell:[8,10]},{id:"TB-GRK-X297",title:"Barkelium",kind:"symbol",mml:"<mi>Bk</mi>",cell:[8,11]},{id:"TB-GRK-X298",title:"Californium",kind:"symbol",mml:"<mi>Cf</mi>",cell:[8,12]},{id:"TB-GRK-X299",title:"Einsteinium",kind:"symbol",mml:"<mi>Es</mi>",cell:[8,13]},{id:"TB-GRK-X300",title:"Fermium",kind:"symbol",mml:"<mi>Fm</mi>",cell:[8,14]},{id:"TB-GRK-X301",title:"Mendelevium",kind:"symbol",mml:"<mi>Md</mi>",cell:[8,15]},{id:"TB-GRK-X302",title:"Nobelium",kind:"symbol",mml:"<mi>No</mi>",cell:[8,16]},{id:"TB-GRK-X303",title:"Lawrencium",kind:"symbol",mml:"<mi>Lr</mi>",cell:[8,17]}]}]},{id:"MAT",title:"Matrices and elementary",sections:[{id:"MAT-0",rows:2,items:[{id:"TB-MAT-001",title:"Table",kind:"action",cell:[0,0]},{id:"TB-MAT-002",title:"Matrix with vertical bars",kind:"action",cell:[0,1]},{id:"TB-MAT-003",title:"Matrix with square brackets",kind:"action",cell:[1,0]},{id:"TB-MAT-004",title:"Matrix with parenthesis",kind:"action",cell:[1,1]}]},{id:"MAT-1",rows:2,items:[{id:"TB-MAT-005",title:"3 rows column",kind:"template",mml:"<mtable><mtr><mtd/></mtr><mtr><mtd/></mtr><mtr><mtd/></mtr></mtable>",cell:[0,0]},{id:"TB-MAT-006",title:"2 rows column with square brackets",kind:"template",mml:'<mfenced open="[" close="]"><mtable><mtr><mtd/></mtr><mtr><mtd/></mtr></mtable></mfenced>',cell:[0,1]},{id:"TB-MAT-007",title:"2 rows column with parenthesis",kind:"template",mml:"<mfenced><mtable><mtr><mtd/></mtr><mtr><mtd/></mtr></mtable></mfenced>",cell:[0,2]},{id:"TB-MAT-008",title:"3 column row",kind:"template",mml:"<mtable><mtr><mtd/><mtd/><mtd/></mtr></mtable>",cell:[1,0]},{id:"TB-MAT-009",title:"2 columns row with square brackets",kind:"template",mml:'<mfenced open="[" close="]"><mtable><mtr><mtd/><mtd/></mtr></mtable></mfenced>',cell:[1,1]},{id:"TB-MAT-010",title:"2 columns row with parenthesis",kind:"template",mml:"<mfenced><mtable><mtr><mtd/><mtd/></mtr></mtable></mfenced>",cell:[1,2]}]},{id:"MAT-2",rows:2,items:[{id:"TB-MAT-011",title:"2 rows column with left curly brackets",kind:"template",mml:'<mfenced open="{" close=""><mtable columnalign="left"><mtr><mtd/></mtr><mtr><mtd/></mtr></mtable></mfenced>',cell:[0,0]},{id:"TB-MAT-012",title:"Piecewise function",kind:"template",mml:'<mfenced open="{" close=""><mtable columnspacing="1.4ex" columnalign="left"><mtr><mtd/><mtd/></mtr><mtr><mtd/><mtd/></mtr></mtable></mfenced>',cell:[0,1]},{id:"TB-MAT-013",title:"2 rows column with right curly brackets",kind:"template",mml:'<mfenced open="" close="}"><mtable columnalign="right"><mtr><mtd/></mtr><mtr><mtd/></mtr></mtable></mfenced>',cell:[1,0]},{id:"TB-MAT-014",title:"Aligned equations",kind:"template",mml:'<mtable columnspacing="2px" columnalign="right center left"><mtr><mtd/><mtd><mo>=</mo></mtd><mtd/></mtr><mtr><mtd/><mtd><mo>=</mo></mtd><mtd/></mtr></mtable>',cell:[1,1]}]},{id:"MAT-3",rows:2,items:[{id:"TB-MAT-015",title:"Vertical ellipsis",kind:"symbol",mml:"<mo>⋮</mo>",cell:[0,0]},{id:"TB-MAT-016",title:"Up right diagonal ellipsis",kind:"symbol",mml:"<mo>⋰</mo>",cell:[0,1]},{id:"TB-MAT-017",title:"Midline horizontal ellipsis",kind:"symbol",mml:"<mo>⋯</mo>",cell:[1,0]},{id:"TB-MAT-018",title:"Down right diagonal ellipsis",kind:"symbol",mml:"<mo>⋱</mo>",cell:[1,1]}]},{id:"MAT-4",rows:2,items:[{id:"TB-MAT-019",title:"3 rows stack with line and plus sign",kind:"template",mml:'<mstack charalign="center" stackalign="right"><msrow/><msrow><mo>+</mo><maction actiontype="argument"><mrow/></maction></msrow><msline/><msrow/></mstack>',cell:[0,0]},{id:"TB-MAT-020",title:"Long division (used in the United States, Great Britain, and elsewhere)",kind:"template",mml:'<mlongdiv charalign="center" charspacing="0px" stackalign="left"><mrow/><mrow/><msgroup><msrow/></msgroup></mlongdiv>',cell:[1,0]}],moreRows:2,more:[{id:"TB-MAT-X001",title:"3 rows stack with line",kind:"template",mml:'<mstack charalign="center" stackalign="right"><msrow/><msrow/><msline/><msrow/></mstack>',cell:[0,0]},{id:"TB-MAT-X002",title:"3 rows stack with line and minus sign",kind:"template",mml:'<mstack charalign="center" stackalign="right"><msrow/><msrow><mo>-</mo><maction actiontype="argument"><mrow/></maction></msrow><msline/><msrow/></mstack>',cell:[0,1]},{id:"TB-MAT-X003",title:"3 rows stack with line and multiplication sign",kind:"template",mml:'<mstack charalign="center" stackalign="right"><msrow/><msrow><mo>×</mo><maction actiontype="argument"><mrow/></maction></msrow><msline/><msrow/></mstack>',cell:[0,2]},{id:"TB-MAT-X004",title:"Long division (used in Spain, Brazil and elsewhere)",kind:"template",mml:'<mlongdiv longdivstyle="shortstackedrightright" charalign="center" charspacing="0px" stackalign="left"><mrow/><mrow/><msgroup><msrow/></msgroup></mlongdiv>',cell:[1,0]},{id:"TB-MAT-X005",title:"Long division with remainder (used in Spain, Brazil and elsewhere)",kind:"template",mml:'<mlongdiv longdivstyle="shortstackedrightright" charalign="center" charspacing="0px" stackalign="left"><mrow/><mrow/><msgroup><msrow/><msrow/></msgroup></mlongdiv>',cell:[1,1]},{id:"TB-MAT-X006",title:"Long division with remainder (used in the United States, Great Britain, and elsewhere)",kind:"template",mml:'<mlongdiv charalign="center" charspacing="0px" stackalign="left"><mrow/><mrow/><msgroup><msrow/><msrow/></msgroup></mlongdiv>',cell:[1,2]}]}]},{id:"SCR",title:"Scripts and layout",sections:[{id:"SCR-0",rows:2,items:[{id:"TB-SCR-001",title:"Big fraction",kind:"template",mml:"<mfrac><mrow/><mrow/></mfrac>",cell:[0,0]},{id:"TB-SCR-002",title:"Small fraction",kind:"template",mml:'<mstyle displaystyle="false"><mfrac><mrow/><mrow/></mfrac></mstyle>',cell:[0,1]},{id:"TB-SCR-003",title:"Bevelled big fraction",kind:"template",mml:'<mfrac bevelled="true"><mrow/><mrow/></mfrac>',cell:[1,0]},{id:"TB-SCR-004",title:"Bevelled small fraction",kind:"template",mml:'<mstyle displaystyle="false"><mfrac bevelled="true"><mrow/><mrow/></mfrac></mstyle>',cell:[1,1]}]},{id:"SCR-1",rows:2,items:[{id:"TB-SCR-005",title:"Square root",kind:"template",mml:"<msqrt/>",cell:[0,0]},{id:"TB-SCR-006",title:"Root",kind:"template",mml:"<mroot><mrow/><mrow/></mroot>",cell:[1,0]}]},{id:"SCR-2",rows:2,items:[{id:"TB-SCR-007",title:"Superscript (Cmd+Up)",kind:"template",mml:'<msup><maction actiontype="argument"><mrow/></maction><mrow/></msup>',cell:[0,0]},{id:"TB-SCR-008",title:"Superscript and subscript",kind:"template",mml:'<msubsup><maction actiontype="argument"><mrow/></maction><mrow/><mrow/></msubsup>',cell:[0,1]},{id:"TB-SCR-009",title:"Subscript (Cmd+Down)",kind:"template",mml:'<msub><maction actiontype="argument"><mrow/></maction><mrow/></msub>',cell:[0,2]},{id:"TB-SCR-010",title:"Left superscript",kind:"template",mml:'<mmultiscripts><maction actiontype="argument"><mrow/></maction><mprescripts/><none/><mrow/></mmultiscripts>',cell:[1,0]},{id:"TB-SCR-011",title:"Left subscript and superscript",kind:"template",mml:'<mmultiscripts><maction actiontype="argument"><mrow/></maction><mprescripts/><mrow/><mrow/></mmultiscripts>',cell:[1,1]},{id:"TB-SCR-012",title:"Left subscript",kind:"template",mml:'<mmultiscripts><maction actiontype="argument"><mrow/></maction><mprescripts/><mrow/><none/></mmultiscripts>',cell:[1,2]}]},{id:"SCR-3",rows:2,items:[{id:"TB-SCR-013",title:"Element over",kind:"template",mml:"<mover><mrow/><mrow/></mover>",cell:[0,0]},{id:"TB-SCR-014",title:"Element under",kind:"template",mml:"<munder><mrow/><mrow/></munder>",cell:[0,1]},{id:"TB-SCR-015",title:"Elements under and over",kind:"template",mml:"<munderover><mrow/><mrow/><mrow/></munderover>",cell:[1,0]}]},{id:"SCR-4",rows:2,items:[{id:"TB-SCR-016",title:"Under script with brace",kind:"template",mml:"<munder><munder><mrow/><mo>⏟</mo></munder><mrow/></munder>",cell:[0,0]},{id:"TB-SCR-017",title:"Over script with brace",kind:"template",mml:"<mover><mover><mrow/><mo>⏞</mo></mover><mrow/></mover>",cell:[1,0]}]},{id:"SCR-5",rows:2,items:[{id:"TB-SCR-018",title:"Big operator with under and over scripts",kind:"template",mml:'<munderover><mo largeop="true"></mo><mrow/><mrow/></munderover>',cell:[0,0]},{id:"TB-SCR-019",title:"Big operator with subscript and superscript",kind:"template",mml:'<msubsup><maction actiontype="argument"><mo largeop="true"></mo></maction><mrow/><mrow/></msubsup>',cell:[0,1]},{id:"TB-SCR-020",title:"Big operator with under script",kind:"template",mml:'<munder><mo largeop="true"></mo><mrow/></munder>',cell:[1,0]},{id:"TB-SCR-021",title:"Big operator with subscript",kind:"template",mml:'<msub><maction actiontype="argument"><mo largeop="true"></mo></maction><mrow/></msub>',cell:[1,1]}]},{id:"SCR-6",rows:2,items:[{id:"TB-SCR-022",title:"Digit space",kind:"symbol",mml:"<mo> </mo>",cell:[0,0]},{id:"TB-SCR-023",title:"Thinner space",kind:"symbol",mml:"<mo> </mo>",cell:[0,1]},{id:"TB-SCR-024",title:"Back space",kind:"symbol",mml:'<mspace width="-0.2em"/>',cell:[1,0]}]}]},{id:"DEC",title:"Decorations",sections:[{id:"DEC-0",rows:2,items:[{id:"TB-DEC-001",title:"Parentheses",kind:"template",mml:"<mfenced><mrow/></mfenced>",cell:[0,0]},{id:"TB-DEC-002",title:"Vertical bars",kind:"template",mml:'<mfenced open="|" close="|"><mrow/></mfenced>',cell:[0,1]},{id:"TB-DEC-003",title:"Angle brackets",kind:"template",mml:'<mfenced open="<" close=">"><mrow/></mfenced>',cell:[0,2]},{id:"TB-DEC-004",title:"Square brackets",kind:"template",mml:'<mfenced open="[" close="]"><mrow/></mfenced>',cell:[1,0]},{id:"TB-DEC-005",title:"Double vertical bars",kind:"template",mml:'<mfenced open="||" close="||"><mrow/></mfenced>',cell:[1,1]},{id:"TB-DEC-006",title:"Curly brackets",kind:"template",mml:'<mfenced open="{" close="}"><mrow/></mfenced>',cell:[1,2]}],moreRows:2,more:[{id:"TB-DEC-X001",title:"Floor",kind:"template",mml:'<mfenced open="⌊" close="⌋"><mrow/></mfenced>',inferred:!0,cell:[0,0]},{id:"TB-DEC-X002",title:"Angle brackets with bar",kind:"template",mml:'<mfenced open="⟨" close="⟩" separators="|"><mrow/><mrow/></mfenced>',inferred:!0,cell:[0,1]},{id:"TB-DEC-X003",title:"Ceiling",kind:"template",mml:'<mfenced open="⌈" close="⌉"><mrow/></mfenced>',cell:[1,0]}]},{id:"DEC-1",rows:2,items:[{id:"TB-DEC-007",title:"Top curly bracket",kind:"template",mml:"<mover><mrow/><mo>⏞</mo></mover>",cell:[0,0]},{id:"TB-DEC-008",title:"Top parenthesis",kind:"template",mml:"<mover><mrow/><mo>⏜</mo></mover>",cell:[0,1]},{id:"TB-DEC-009",title:"Bottom curly bracket",kind:"template",mml:"<munder><mrow/><mo>⏟</mo></munder>",cell:[1,0]},{id:"TB-DEC-010",title:"Bottom parenthesis",kind:"template",mml:"<munder><mrow/><mo>⏝</mo></munder>",cell:[1,1]}]},{id:"DEC-2",rows:3,items:[{id:"TB-DEC-011",title:"Vector accent",kind:"template",mml:"<mover><mrow/><mo>⇀</mo></mover>",cell:[0,0]},{id:"TB-DEC-012",title:"Arrow accent",kind:"template",mml:"<mover><mrow/><mo>→</mo></mover>",cell:[0,1]},{id:"TB-DEC-013",title:"Left right arrow accent",kind:"template",mml:"<mover><mrow/><mo>↔</mo></mover>",cell:[0,2]},{id:"TB-DEC-014",title:"Bar accent",kind:"template",mml:"<mover><mrow/><mo>¯</mo></mover>",cell:[1,0]},{id:"TB-DEC-015",title:"Hat accent",kind:"template",mml:"<mover><mrow/><mo>^</mo></mover>",cell:[1,1]},{id:"TB-DEC-016",title:"Tilde",kind:"template",mml:"<mover><mrow/><mo>~</mo></mover>",cell:[1,2]},{id:"TB-DEC-017",title:"Diaeresis",kind:"template",mml:"<mover><mrow/><mo>¨</mo></mover>",cell:[2,0]},{id:"TB-DEC-018",title:"Dot accent",kind:"template",mml:"<mover><mrow/><mo>˙</mo></mover>",cell:[2,1]}]},{id:"DEC-3",rows:2,items:[{id:"TB-DEC-019",title:"Enclose top",kind:"template",mml:'<menclose notation="top"/>',cell:[0,0]},{id:"TB-DEC-020",title:"Enclose left",kind:"template",mml:'<menclose notation="left"/>',cell:[0,1]},{id:"TB-DEC-021",title:"Enclose box",kind:"template",mml:'<menclose notation="box"/>',cell:[0,2]},{id:"TB-DEC-022",title:"Enclose bottom",kind:"template",mml:'<menclose notation="bottom"/>',cell:[1,0]},{id:"TB-DEC-023",title:"Enclose right",kind:"template",mml:'<menclose notation="right"/>',cell:[1,1]},{id:"TB-DEC-024",title:"Enclose circle",kind:"template",mml:'<menclose notation="circle"/>',cell:[1,2]}],moreRows:2,more:[{id:"TB-DEC-X004",title:"Enclose actuarial",kind:"template",mml:'<menclose notation="actuarial"/>',cell:[0,0]},{id:"TB-DEC-X005",title:"Enclose rounded box",kind:"template",mml:'<menclose notation="roundedbox"/>',cell:[1,0]}]},{id:"DEC-4",rows:2,items:[{id:"TB-DEC-025",title:"Up diagonal strike",kind:"template",mml:'<menclose notation="updiagonalstrike"/>',cell:[0,0]},{id:"TB-DEC-026",title:"Horizontal strike",kind:"template",mml:'<menclose notation="horizontalstrike"/>',cell:[0,1]},{id:"TB-DEC-027",title:"Down diagonal strike",kind:"template",mml:'<menclose notation="downdiagonalstrike"/>',cell:[1,0]},{id:"TB-DEC-028",title:"Up and down diagonal strike",kind:"template",mml:'<menclose notation="downdiagonalstrike updiagonalstrike"/>',cell:[1,1]}],moreRows:2,more:[{id:"TB-DEC-X006",title:"Vertical strike",kind:"template",mml:'<menclose notation="verticalstrike"/>',inferred:!0,cell:[0,0]},{id:"TB-DEC-X007",title:"Long division",kind:"template",mml:'<menclose notation="longdiv"/>',inferred:!0,cell:[0,1]},{id:"TB-DEC-X008",title:"Horizontal and vertical strikes",kind:"template",mml:'<menclose notation="verticalstrike horizontalstrike"/>',cell:[1,0]}]}]},{id:"BIG",title:"Big operators",sections:[{id:"BIG-0",rows:2,items:[{id:"TB-BIG-001",title:"Summation with under and over scripts",kind:"template",mml:"<munderover><mo>∑</mo><mrow/><mrow/></munderover>",cell:[0,0]},{id:"TB-BIG-002",title:"Summation with subscript and superscript",kind:"template",mml:'<mstyle displaystyle="false"><munderover><mo>∑</mo><mrow/><mrow/></munderover></mstyle>',cell:[0,1]},{id:"TB-BIG-003",title:"Summation with under scripts",kind:"template",mml:"<munder><mo>∑</mo><mrow/></munder>",cell:[1,0]},{id:"TB-BIG-004",title:"Summation with subscript",kind:"template",mml:'<mstyle displaystyle="false"><munder><mo>∑</mo><mrow/></munder></mstyle>',cell:[1,1]}]},{id:"BIG-1",rows:2,items:[{id:"TB-BIG-005",title:"Product with under and over scripts",kind:"template",mml:"<munderover><mo>∏</mo><mrow/><mrow/></munderover>",cell:[0,0]},{id:"TB-BIG-006",title:"Product with subscript and superscript",kind:"template",mml:'<mstyle displaystyle="false"><munderover><mo>∏</mo><mrow/><mrow/></munderover></mstyle>',cell:[0,1]},{id:"TB-BIG-007",title:"Product with under scripts",kind:"template",mml:"<munder><mo>∏</mo><mrow/></munder>",cell:[1,0]},{id:"TB-BIG-008",title:"Product with subscript",kind:"template",mml:'<mstyle displaystyle="false"><munder><mo>∏</mo><mrow/></munder></mstyle>',cell:[1,1]}]},{id:"BIG-2",rows:2,items:[{id:"TB-BIG-009",title:"Big operator with under and over scripts",kind:"template",mml:'<munderover><mo largeop="true"></mo><mrow/><mrow/></munderover>',cell:[0,0]},{id:"TB-BIG-010",title:"Big operator with subscript and superscript",kind:"template",mml:'<msubsup><maction actiontype="argument"><mo largeop="true"></mo></maction><mrow/><mrow/></msubsup>',cell:[0,1]},{id:"TB-BIG-011",title:"Big operator with under script",kind:"template",mml:'<munder><mo largeop="true"></mo><mrow/></munder>',cell:[1,0]},{id:"TB-BIG-012",title:"Big operator with subscript",kind:"template",mml:'<msub><maction actiontype="argument"><mo largeop="true"></mo></maction><mrow/></msub>',cell:[1,1]}]},{id:"BIG-3",rows:2,items:[{id:"TB-BIG-013",title:"Big intersection",kind:"symbol",mml:'<mo largeop="true">∩</mo>',cell:[0,0]},{id:"TB-BIG-014",title:"Big union",kind:"symbol",mml:'<mo largeop="true">∪</mo>',cell:[1,0]}],moreRows:2,more:[{id:"TB-BIG-X001",title:"Big square cap",kind:"symbol",mml:'<mo largeop="true">⊓</mo>',cell:[0,0]},{id:"TB-BIG-X002",title:"Product",kind:"symbol",mml:"<mo>∏</mo>",cell:[0,1]},{id:"TB-BIG-X003",title:"Sum",kind:"symbol",mml:"<mo>∑</mo>",cell:[0,2]},{id:"TB-BIG-X004",title:"Big square cup",kind:"symbol",mml:'<mo largeop="true">⊔</mo>',cell:[1,0]},{id:"TB-BIG-X005",title:"Coproduct",kind:"symbol",mml:"<mo>∐</mo>",cell:[1,1]}]}]},{id:"CAL",title:"Calculus",sections:[{id:"CAL-0",rows:2,items:[{id:"TB-CAL-001",title:"Definite integral",kind:"template",mml:"<msubsup><mo>∫</mo><mrow/><mrow/></msubsup>",cell:[0,0]},{id:"TB-CAL-002",title:"Definite integral with differential",kind:"template",mml:'<msubsup><mo>∫</mo><mrow/><mrow/></msubsup><maction actiontype="argument"><mrow/></maction><mo>d</mo><maction actiontype="argument"><mrow/></maction>',cell:[0,1]},{id:"TB-CAL-003",title:"Integral with subscript",kind:"template",mml:"<msub><mo>∫</mo><mrow/></msub>",cell:[1,0]},{id:"TB-CAL-004",title:"Integral with subscript and differential",kind:"template",mml:'<msub><mo>∫</mo><mrow/></msub><maction actiontype="argument"><mrow/></maction><mo>d</mo><maction actiontype="argument"><mrow/></maction>',cell:[1,1]}]},{id:"CAL-1",rows:2,items:[{id:"TB-CAL-005",title:"Differential",kind:"symbol",mml:"<mo>d</mo>",cell:[0,0]},{id:"TB-CAL-006",title:"Derivative",kind:"template",mml:'<mfrac><mrow><mo>d</mo><maction actiontype="argument"><mrow/></maction></mrow><mrow><mo>d</mo><maction actiontype="argument"><mrow/></maction></mrow></mfrac>',cell:[0,1]},{id:"TB-CAL-007",title:"Partial differential",kind:"symbol",mml:"<mo>∂</mo>",cell:[1,0]},{id:"TB-CAL-008",title:"Partial derivative",kind:"template",mml:'<mfrac><mrow><mo>∂</mo><maction actiontype="argument"><mrow/></maction></mrow><mrow><mo>∂</mo><maction actiontype="argument"><mrow/></maction></mrow></mfrac>',cell:[1,1]}]},{id:"CAL-2",rows:2,items:[{id:"TB-CAL-009",title:"Limit to infinity",kind:"template",mml:'<munder><mi>lim</mi><mrow><maction actiontype="argument"><mrow/></maction><mo>→</mo><mo>∞</mo></mrow></munder>',cell:[0,0]},{id:"TB-CAL-010",title:"Limit with under script",kind:"template",mml:"<munder><mi>lim</mi><mrow/></munder>",cell:[1,0]}]},{id:"CAL-3",rows:2,items:[{id:"TB-CAL-011",title:"Curl",kind:"template",mml:'<mo>∇</mo><mo>×</mo><maction actiontype="argument"><mrow/></maction>',cell:[0,0]},{id:"TB-CAL-012",title:"Gradient",kind:"template",mml:'<mo>∇</mo><maction actiontype="argument"><mrow/></maction>',cell:[0,1]},{id:"TB-CAL-013",title:"Divergence",kind:"template",mml:'<mo>∇</mo><mo>·</mo><maction actiontype="argument"><mrow/></maction>',cell:[1,0]},{id:"TB-CAL-014",title:"Laplacian",kind:"template",mml:'<mo>∆</mo><maction actiontype="argument"><mrow/></maction>',cell:[1,1]}]},{id:"CAL-4",rows:2,items:[{id:"TB-CAL-015",title:"Integral",kind:"symbol",mml:"<mo>∫</mo>",cell:[0,0]},{id:"TB-CAL-016",title:"Double integral",kind:"symbol",mml:"<mo>∬</mo>",cell:[0,1]},{id:"TB-CAL-017",title:"Contour integral",kind:"symbol",mml:"<mo>∮</mo>",cell:[1,0]},{id:"TB-CAL-018",title:"Surface integral",kind:"symbol",mml:"<mo>∯</mo>",cell:[1,1]}],moreRows:2,more:[{id:"TB-CAL-X001",title:"Triple integral",kind:"symbol",mml:"<mo>∭</mo>",cell:[0,0]},{id:"TB-CAL-X002",title:"Volume integral",kind:"symbol",mml:"<mo>∰</mo>",cell:[1,0]}]},{id:"CAL-5",rows:2,items:[{id:"TB-CAL-019",title:"Sine",kind:"template",mml:"<mi>sin</mi><mfenced><mrow/></mfenced>",cell:[0,0]},{id:"TB-CAL-020",title:"Cosine",kind:"template",mml:"<mi>cos</mi><mfenced><mrow/></mfenced>",cell:[0,1]},{id:"TB-CAL-021",title:"Tangent",kind:"template",mml:"<mi>tan</mi><mfenced><mrow/></mfenced>",cell:[0,2]},{id:"TB-CAL-022",title:"Logarithm",kind:"template",mml:"<mi>log</mi><mfenced><mrow/></mfenced>",cell:[1,0]},{id:"TB-CAL-023",title:"Logarithm to base n",kind:"template",mml:"<msub><mi>log</mi><mrow/></msub><mfenced><mrow/></mfenced>",cell:[1,1]},{id:"TB-CAL-024",title:"Natural logarithm",kind:"template",mml:"<mi>ln</mi><mfenced><mrow/></mfenced>",cell:[1,2]}],moreRows:2,more:[{id:"TB-CAL-X003",title:"Cosecant",kind:"symbol",mml:"<mi>csc</mi><mfenced><mrow/></mfenced>",cell:[0,0]},{id:"TB-CAL-X004",title:"Secant",kind:"symbol",mml:"<mi>sec</mi><mfenced><mrow/></mfenced>",cell:[0,1]},{id:"TB-CAL-X005",title:"Cotangent",kind:"symbol",mml:"<mi>cot</mi><mfenced><mrow/></mfenced>",cell:[0,2]},{id:"TB-CAL-X006",title:"Arcsine",kind:"template",mml:"<msup><mi>sin</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup><mfenced><mrow/></mfenced>",cell:[1,0]},{id:"TB-CAL-X007",title:"Arccosine",kind:"template",mml:"<msup><mi>cos</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup><mfenced><mrow/></mfenced>",cell:[1,1]},{id:"TB-CAL-X008",title:"Arctangent",kind:"template",mml:"<msup><mi>tan</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup><mfenced><mrow/></mfenced>",cell:[1,2]}]}]},{id:"CTX",title:"Contextual",sections:[{id:"CTX-0",rows:2,items:[{id:"TB-CTX-001",title:"Nudge up",kind:"action",cell:[0,0]},{id:"TB-CTX-002",title:"Nudge right",kind:"action",cell:[0,1]},{id:"TB-CTX-003",title:"Nudge left",kind:"action",cell:[1,0]},{id:"TB-CTX-004",title:"Nudge down",kind:"action",cell:[1,1]}]},{id:"CTX-1",rows:1,items:[{id:"TB-CTX-005",title:"Merge/unmerge separators in <mn>",kind:"action",cell:[0,0]}]},{id:"CTX-2",rows:2,items:[{id:"TB-CTX-006",title:"setOpenBracket",kind:"select",options:["","(",")","[","]","\u27E8","\u27E9","{","}","\u230A","\u230B","\u2308","\u2309","\u27E6","\u27E7","|","||"],cell:[0,0]},{id:"TB-CTX-007",title:"setCloseBracket",kind:"select",options:["","(",")","[","]","\u27E8","\u27E9","{","}","\u230A","\u230B","\u2308","\u2309","\u27E6","\u27E7","|","||"],cell:[0,1]},{id:"TB-CTX-008",title:"setSeparator",kind:"select",options:[",",".",";",":","\u2423"],cell:[1,1]}]},{id:"CTX-3",rows:2,items:[{id:"TB-CTX-009",title:"Baseline",kind:"action",cell:[0,0]},{id:"TB-CTX-010",title:"Middle",kind:"action",cell:[0,1]},{id:"TB-CTX-011",title:"Middle-baseline",kind:"action",cell:[1,0]}]},{id:"CTX-4",rows:3,items:[{id:"TB-CTX-012",title:"Left spacing",kind:"action",cell:[0,0]},{id:"TB-CTX-013",title:"Right spacing",kind:"action",cell:[1,0]}]},{id:"CTX-5",rows:3,items:[{id:"TB-CTX-014",title:"Stretchy",kind:"action",cell:[0,0]}]},{id:"CTX-6",rows:3,items:[{id:"TB-CTX-015",title:"Space width",kind:"action",cell:[0,0]},{id:"TB-CTX-016",title:"Space height",kind:"action",cell:[1,0]},{id:"TB-CTX-017",title:"Space depth",kind:"action",cell:[2,0]}]},{id:"CTX-7",rows:3,items:[{id:"TB-CTX-018",title:"Align left",kind:"action",cell:[0,0]},{id:"TB-CTX-019",title:"Relation align",kind:"action",cell:[0,1]},{id:"TB-CTX-020",title:"Align center",kind:"action",cell:[1,0]},{id:"TB-CTX-021",title:"Align right",kind:"action",cell:[2,0]}]},{id:"CTX-8",rows:3,items:[{id:"TB-CTX-022",title:"Align with axis",kind:"action",cell:[0,0]},{id:"TB-CTX-023",title:"Align with top",kind:"action",cell:[0,1]},{id:"TB-CTX-024",title:"Align with baseline",kind:"action",cell:[1,0]},{id:"TB-CTX-025",title:"Align with center",kind:"action",cell:[1,1]},{id:"TB-CTX-026",title:"Align to row",kind:"action",cell:[2,0]},{id:"TB-CTX-027",title:"Align with bottom",kind:"action",cell:[2,1]}]},{id:"CTX-9",rows:3,items:[{id:"TB-CTX-028",title:"Insert row below",kind:"action",cell:[0,0]},{id:"TB-CTX-029",title:"Insert row above",kind:"action",cell:[0,1]},{id:"TB-CTX-030",title:"Insert column at right",kind:"action",cell:[1,0]},{id:"TB-CTX-031",title:"Insert column at left",kind:"action",cell:[1,1]},{id:"TB-CTX-032",title:"Remove row",kind:"action",cell:[2,0]},{id:"TB-CTX-033",title:"Remove column",kind:"action",cell:[2,1]}]},{id:"CTX-10",rows:3,items:[{id:"TB-CTX-034",title:"Insert frame",kind:"action",cell:[0,0]},{id:"TB-CTX-035",title:"Remove frame",kind:"action",cell:[0,1]},{id:"TB-CTX-036",title:"Activate solid lines",kind:"action",cell:[0,2]},{id:"TB-CTX-037",title:"Insert line below",kind:"action",cell:[1,0]},{id:"TB-CTX-038",title:"Insert right line",kind:"action",cell:[1,1]},{id:"TB-CTX-039",title:"Activate dash lines",kind:"action",cell:[1,2]},{id:"TB-CTX-040",title:"Remove line below",kind:"action",cell:[2,0]},{id:"TB-CTX-041",title:"Remove right line",kind:"action",cell:[2,1]}]},{id:"CTX-11",rows:3,items:[{id:"TB-CTX-042",title:"Align left",kind:"action",cell:[0,0]},{id:"TB-CTX-043",title:"Align center",kind:"action",cell:[0,1]},{id:"TB-CTX-044",title:"Align right",kind:"action",cell:[0,2]},{id:"TB-CTX-045",title:"Decimal align",kind:"action",cell:[0,3]},{id:"TB-CTX-046",title:"Decimal align symbol",kind:"select",options:["0.0","0,0","0'0","0 0"],cell:[0,4]},{id:"TB-CTX-047",title:"Align rows to top",kind:"action",cell:[1,0]},{id:"TB-CTX-048",title:"Align rows to center",kind:"action",cell:[1,1]},{id:"TB-CTX-049",title:"Align rows to bottom",kind:"action",cell:[1,2]},{id:"TB-CTX-050",title:"Relation align",kind:"action",cell:[1,3]},{id:"TB-CTX-051",title:"Align rows to baseline",kind:"action",cell:[2,0]},{id:"TB-CTX-052",title:"Align rows to axis",kind:"action",cell:[2,1]}]},{id:"CTX-12",rows:3,items:[{id:"TB-CTX-053",title:"Force equal row heights",kind:"action",cell:[0,0]},{id:"TB-CTX-054",title:"Force equal column widths",kind:"action",cell:[1,0]}]},{id:"CTX-13",rows:3,items:[{id:"TB-CTX-055",title:"Column spacing at right",kind:"action",cell:[0,0]},{id:"TB-CTX-056",title:"Horizontal frame spacing",kind:"action",cell:[0,1]},{id:"TB-CTX-057",title:"Row spacing below",kind:"action",cell:[1,0]},{id:"TB-CTX-058",title:"Vertical frame spacing",kind:"action",cell:[1,1]}]},{id:"CTX-14",rows:2,items:[{id:"TB-CTX-059",title:"Insert line",kind:"action",cell:[0,0]},{id:"TB-CTX-060",title:"Join the selected digits in a single column",kind:"action",cell:[0,1]},{id:"TB-CTX-061",title:"Up diagonal strike",kind:"action",cell:[1,0]}]},{id:"CTX-15",rows:3,items:[{id:"TB-CTX-062",title:"Prepend row",kind:"action",cell:[0,0]},{id:"TB-CTX-063",title:"Append row",kind:"action",cell:[1,0]}]},{id:"CTX-16",rows:3,items:[{id:"TB-CTX-064",title:"Set carries location at north-west",kind:"action",cell:[0,0]},{id:"TB-CTX-065",title:"Set carries location at north",kind:"action",cell:[0,1]},{id:"TB-CTX-066",title:"Set carries location at north-east",kind:"action",cell:[0,2]},{id:"TB-CTX-067",title:"Set carries location at west",kind:"action",cell:[1,0]},{id:"TB-CTX-068",title:"Insert carries in this row",kind:"action",cell:[1,1]},{id:"TB-CTX-069",title:"Set carries location at east",kind:"action",cell:[1,2]},{id:"TB-CTX-070",title:"Set carries location at south-west",kind:"action",cell:[2,0]},{id:"TB-CTX-071",title:"Set carries location at south",kind:"action",cell:[2,1]},{id:"TB-CTX-072",title:"Set carries location at south-east",kind:"action",cell:[2,2]}]},{id:"CTX-17",rows:3,items:[{id:"TB-CTX-073",title:"Move to left",kind:"action",cell:[0,0]},{id:"TB-CTX-074",title:"Move to right",kind:"action",cell:[1,0]}]},{id:"CTX-18",rows:3,items:[{id:"TB-CTX-075",title:"Spacing between digits",kind:"select",options:["\u2014 Digit spacing \u2014","0px","1px","2px","3px","4px","5px","6px","7px","8px","9px","10px","12px","15px","20px","25px","30px"],cell:[0,0]}]}]}];var wd=/^(<mi>[a-z]+<\/mi>|<msu[bp]><mi>[a-z]+<\/mi>.*<\/msu[bp]>)<mfenced><mrow\/><\/mfenced>$/,Td=/^<(mover|munder|munderover)><mo>&#x(?:21[9A-F]|29[0-7])[0-9A-F];<\/mo>(?:<mrow\/>)+<\/\1>$/,kd=/<mrow\/>/g,yd='<mpadded width="2.2em" lspace="0.8em"><mrow/></mpadded>',xd={"←":"⟵","→":"⟶","↔":"⟷"},vd=/^(<m(?:over|under|underover)><mo>)([^<]+)(<\/mo>)/,Rd=/<m(?:table|stack|longdiv)[\s>]/,Ed=/^(?:<mo> (?:0[0-9A]|2F|5F);<\/mo>|<mspace [^>]*\/>)$/,vr='<mo largeop="true"></mo>',Rr='<mstyle mathsize="140%"><mrow/></mstyle>',Cd=/<maction actiontype="argument"><mrow\/><\/maction>/g,Bd="<mpadded><mrow/></mpadded>",Ad="<mroot><mrow/><mrow/></mroot>",Sd=`<mroot><mrow/><mpadded depth="0.4em" width="1.1em">${Rr}</mpadded></mroot>`;function Ke(e){return`<mstyle scriptlevel="1">${e}</mstyle>`}function Er(e){let t=e.mml?.replace(Cd,Bd);if(t===void 0)return;let i=wd.exec(t);return i?.[1]?i[1]:Td.test(t)?t.replace(kd,yd).replace(vd,(o,n,r,l)=>`${n}${xd[r]??r}${l}`):t===Ad?Sd:Rd.test(t)?Ke(t):Ed.test(t)?`<mrow/>${t}<mrow/>`:t.includes(vr)?t.replace(vr,Rr):t}var Pe=.1,Cr="1b",Md={"TB-CTX-064":"nw","TB-CTX-065":"n","TB-CTX-066":"ne","TB-CTX-067":"w","TB-CTX-069":"e","TB-CTX-070":"sw","TB-CTX-071":"s","TB-CTX-072":"se"},Nd={nw:"\u2196",n:"\u2191",ne:"\u2197",w:"\u2190",e:"\u2192",sw:"\u2199",s:"\u2193",se:"\u2198"},Bt={undo:["M5 3 2 6l3 3","M2 6h7a4 4 0 0 1 0 8H6"],redo:["M11 3l3 3-3 3","M14 6H7a4 4 0 0 0 0 8h3"],copy:["M5 5h8v9H5z","M3 11V2h8"],cut:["M4 13a2 2 0 1 0 0-.01","M12 13a2 2 0 1 0 0-.01","M5.5 11.5 12 2","M10.5 11.5 4 2"],paste:["M4 3H3v11h10V3h-1","M6 2h4v2H6z","M6 8h4","M6 11h4"],rtl:["M9 2v12","M12 2v12","M12 2H8a3 3 0 0 0 0 6h1","M6 12H2","M4 10l-2 2 2 2"]};function L(e){return e.model.tableContext()!==null}function W(e){return e.model.contextKind()==="stack"}function _i(e){return e.model.fenceContext()!==null}function $e(e){return e.model.hasSelection()||e.model.previousAtom()!==null}function He(e,t){let i=e.model.previousAtom();return i?.kind==="token"?i.attrs[t]??null:null}function pt(e,t){return e.model.tableContext()?.table.attrs[t]??null}function qt(e,t,i){let o=(e??"").trim().split(/\s+/).filter(Boolean);return o[Math.min(t,o.length-1)]??i}var Br=["0.4em","0.5ex"];function Ld(e,t,i){let o=[qt(e,0,Br[0]),qt(e,1,Br[1])];return o[t]=i,o.join(" ")}function Ar(e){return{label:e==="equalrows"?"\u21D5=":"\u21D4=",visible:L,pressed:t=>pt(t,e)==="true",run:t=>{t.model.setTableAttribute(e,pt(t,e)==="true"?null:"true")}}}function ze(e,t,i,o){return{label:e,popup:!0,visible:L,run:(n,r)=>{let l=pt(n,t),s=n.model.tableContext(),a=t==="framespacing"?i:t==="columnspacing"?s?.columnIndex??0:s?.rowIndex??0;n.openValuePrompt(r,e,qt(l,a,o),m=>{if(t==="framespacing"){n.model.setTableAttribute(t,Ld(l,i,m));return}let d=t==="columnspacing"?Math.max(1,(s?.columnCount??1)-1):Math.max(1,(s?.rowCount??1)-1),c=Array.from({length:d},(u,f)=>qt(l,f,o));a<d&&(c[a]=m),n.model.setTableAttribute(t,c.every(u=>u===c[0])?c[0]??m:c.join(" "))})}}}function Ki(e,t){return{label:e,enabled:i=>i.model.hasLineBreaks(),pressed:i=>(i.model.document.attrs.indentalign??"left")===t&&i.model.hasLineBreaks(),run:i=>{i.model.setDocumentAttribute("indentalign",t==="left"?null:t)}}}function At(e,t){return{label:e,visible:L,pressed:i=>(pt(i,"align")??"axis")===t(i),run:i=>{let o=t(i);i.model.setTableAttribute("align",o==="axis"?null:o)}}}function Ue(e,t){return{label:e,visible:L,pressed:i=>{let o=i.model.tableContext();return o?qt(o.table.attrs.columnalign??null,o.columnIndex,"center")===t:!1},run:i=>{i.model.setColumnAlign(t)}}}function Vt(e,t){return{label:e,visible:L,pressed:i=>{let o=i.model.tableContext(),n=o?.table.children[o.rowIndex];return n?.kind==="element"?(n.attrs.rowalign??"baseline")===t:!1},run:i=>{i.model.setRowAlign(t)}}}function Ve(e,t){return{mml:t,popup:!0,run:(i,o)=>i.openMatrixPicker(o,e)}}function Mr(e){return`<mtable>${`<mtr>${"<mtd><mrow/></mtd>".repeat(e)}</mtr>`.repeat(e)}</mtable>`}var Id=3,Xd=2,Gd=Ke(Mr(Id)),Pi=(e,t)=>Ke(`<mfenced open="${e}" close="${t}">${Mr(Xd)}</mfenced>`);function ot(e){let t=Md[e]??"n";return{label:Nd[t]??t,visible:W,enabled:i=>i.model.hasCarries(),run:i=>{i.model.setCarriesAttribute("location",t==="n"?null:t)}}}var Nr={"TB-GEN-026":{icon:Bt.copy,enabled:e=>e.model.hasSelection(),run:e=>e.copy()},"TB-GEN-027":{icon:Bt.undo,enabled:e=>e.model.canUndo(),run:e=>{e.model.undo()}},"TB-GEN-028":{icon:Bt.cut,enabled:e=>e.model.hasSelection(),run:e=>e.cut()},"TB-GEN-029":{icon:Bt.redo,enabled:e=>e.model.canRedo(),run:e=>{e.model.redo()}},"TB-GEN-030":{icon:Bt.paste,run:e=>e.paste()},"TB-GEN-031":{label:"B",pressed:e=>e.model.getInputStyle().bold,run:e=>e.model.toggleBold()},"TB-GEN-032":{label:"A",popup:!0,run:(e,t)=>e.openColorPicker(t)},"TB-GEN-033":{label:Cr,pressed:e=>e.model.getInputStyle().italic===!0,run:e=>e.model.toggleItalic()},"TB-GEN-034":{label:"\u03A9",popup:!0,run:(e,t)=>e.openSpecialCharacters(t)},"TB-GEN-035":{label:Cr,pressed:e=>e.model.getInputStyle().italic===null&&!e.model.getInputStyle().textMode,run:e=>e.model.setAutoItalic()},"TB-GEN-036":{label:"Tt",pressed:e=>e.model.getInputStyle().textMode,run:e=>e.model.setTextMode(!e.model.getInputStyle().textMode)},"TB-GEN-037":{icon:Bt.rtl,pressed:e=>e.model.isRtl(),run:e=>e.model.toggleRtl()},"TB-GRK-044":{label:"\u0661\u0662\u0663",pressed:e=>e.numerals==="arabic-indic",run:e=>e.setNumerals(e.numerals==="arabic-indic"?"western":"arabic-indic")},"TB-GRK-045":{label:"\u06F1\u06F2\u06F3",pressed:e=>e.numerals==="eastern-arabic-indic",run:e=>e.setNumerals(e.numerals==="eastern-arabic-indic"?"western":"eastern-arabic-indic")},"TB-MAT-001":Ve("table",Gd),"TB-MAT-002":Ve("bars",Pi("|","|")),"TB-MAT-003":Ve("brackets",Pi("[","]")),"TB-MAT-004":Ve("parentheses",Pi("(",")")),"TB-CTX-001":{label:"\u2912",visible:$e,run:e=>{e.model.nudge(0,Pe)}},"TB-CTX-002":{label:"\u21E5",visible:$e,run:e=>{e.model.nudge(Pe,0)}},"TB-CTX-003":{label:"\u21E4",visible:$e,run:e=>{e.model.nudge(-Pe,0)}},"TB-CTX-004":{label:"\u2913",visible:$e,run:e=>{e.model.nudge(0,-Pe)}},"TB-CTX-005":{label:"1.5",visible:e=>e.model.contextKind()==="number",run:e=>{e.model.toggleNumberSeparators()}},"TB-CTX-012":{label:"\u25C2\u2423",popup:!0,visible:e=>e.model.contextKind()==="operator",run:(e,t)=>e.openValuePrompt(t,"lspace",He(e,"lspace")??"0.2778em",i=>{e.model.setTokenAttribute("lspace",i)})},"TB-CTX-013":{label:"\u2423\u25B8",popup:!0,visible:e=>e.model.contextKind()==="operator",run:(e,t)=>e.openValuePrompt(t,"rspace",He(e,"rspace")??"0.2778em",i=>{e.model.setTokenAttribute("rspace",i)})},"TB-CTX-014":{label:"\u2195",visible:e=>e.model.contextKind()==="operator",pressed:e=>He(e,"stretchy")!=="false",run:e=>{e.model.setTokenAttribute("stretchy",He(e,"stretchy")==="false"?null:"false")}},"TB-CTX-015":$i("width","\u2194"),"TB-CTX-016":$i("height","\u21A5"),"TB-CTX-017":$i("depth","\u21A7"),"TB-CTX-018":Ki("\u2AF7","left"),"TB-CTX-020":Ki("\u2261","center"),"TB-CTX-021":Ki("\u2AF8","right"),"TB-CTX-022":At("axis",()=>"axis"),"TB-CTX-023":At("top",()=>"top"),"TB-CTX-024":At("base",()=>"baseline"),"TB-CTX-025":At("mid",()=>"center"),"TB-CTX-026":At("row",e=>`baseline ${(e.model.tableContext()?.rowIndex??0)+1}`),"TB-CTX-027":At("bot",()=>"bottom"),"TB-CTX-028":{label:"\u229E\u2193",visible:L,run:e=>{e.model.tableInsertRow("below")}},"TB-CTX-029":{label:"\u229E\u2191",visible:L,run:e=>{e.model.tableInsertRow("above")}},"TB-CTX-030":{label:"\u229E\u2192",visible:L,run:e=>{e.model.tableInsertColumn("right")}},"TB-CTX-031":{label:"\u2190\u229E",visible:L,run:e=>{e.model.tableInsertColumn("left")}},"TB-CTX-032":{label:"\u229Fr",visible:L,enabled:e=>(e.model.tableContext()?.rowCount??0)>1,run:e=>{e.model.tableRemoveRow()}},"TB-CTX-033":{label:"\u229Fc",visible:L,enabled:e=>(e.model.tableContext()?.columnCount??0)>1,run:e=>{e.model.tableRemoveColumn()}},"TB-CTX-034":{label:"\u25A3",visible:L,enabled:e=>pt(e,"frame")===null,run:e=>{e.model.setTableFrame(!0)}},"TB-CTX-035":{label:"\u25A2",visible:L,enabled:e=>pt(e,"frame")!==null,run:e=>{e.model.setTableFrame(!1)}},"TB-CTX-036":{label:"\u2501",visible:L,pressed:e=>e.model.getLineStyle()==="solid",run:e=>e.model.setLineStyle("solid")},"TB-CTX-037":{label:"\u229E_",visible:L,run:e=>{e.model.setTableLine("row",!0)}},"TB-CTX-038":{label:"\u229E|",visible:L,run:e=>{e.model.setTableLine("column",!0)}},"TB-CTX-039":{label:"\u254D",visible:L,pressed:e=>e.model.getLineStyle()==="dashed",run:e=>e.model.setLineStyle("dashed")},"TB-CTX-040":{label:"\u229F_",visible:L,run:e=>{e.model.setTableLine("row",!1)}},"TB-CTX-041":{label:"\u229F|",visible:L,run:e=>{e.model.setTableLine("column",!1)}},"TB-CTX-042":Ue("\u2AF7","left"),"TB-CTX-043":Ue("\u2261","center"),"TB-CTX-044":Ue("\u2AF8","right"),"TB-CTX-045":Ue(".0","decimalpoint"),"TB-CTX-047":Vt("\u22A4","top"),"TB-CTX-048":Vt("\u229D","center"),"TB-CTX-049":Vt("\u22A5","bottom"),"TB-CTX-051":Vt("base","baseline"),"TB-CTX-052":Vt("axis","axis"),"TB-CTX-053":Ar("equalrows"),"TB-CTX-054":Ar("equalcolumns"),"TB-CTX-055":ze("col \u2423","columnspacing",0,"0.8em"),"TB-CTX-056":ze("frame \u2194","framespacing",0,"0.4em"),"TB-CTX-057":ze("row \u2423","rowspacing",0,"1.0ex"),"TB-CTX-058":ze("frame \u2195","framespacing",1,"0.5ex"),"TB-CTX-059":{label:"\u2015",visible:W,run:e=>{e.model.stackInsertLine()}},"TB-CTX-061":{label:"\u27CB",visible:W,enabled:e=>e.model.hasCarries(),run:e=>{e.model.setCarriesAttribute("crossout","updiagonalstrike")}},"TB-CTX-062":{label:"+\u2191",visible:W,run:e=>{e.model.stackInsertRow("before")}},"TB-CTX-063":{label:"+\u2193",visible:W,run:e=>{e.model.stackInsertRow("after")}},"TB-CTX-064":ot("TB-CTX-064"),"TB-CTX-065":ot("TB-CTX-065"),"TB-CTX-066":ot("TB-CTX-066"),"TB-CTX-067":ot("TB-CTX-067"),"TB-CTX-068":{label:"c",visible:W,enabled:e=>!e.model.hasCarries(),run:e=>{e.model.stackInsertCarries()}},"TB-CTX-069":ot("TB-CTX-069"),"TB-CTX-070":ot("TB-CTX-070"),"TB-CTX-071":ot("TB-CTX-071"),"TB-CTX-072":ot("TB-CTX-072"),"TB-CTX-073":{label:"\u21E0",visible:W,run:e=>{e.model.stackShiftRow(1)}},"TB-CTX-074":{label:"\u21E2",visible:W,run:e=>{e.model.stackShiftRow(-1)}}};function $i(e,t){return{label:t,popup:!0,visible:i=>i.model.contextKind()==="space",run:(i,o)=>{let n=i.model.previousAtom(),r=n?.kind==="leaf"?n.attrs[e]??"0em":"0em";i.openValuePrompt(o,e,r,l=>{i.model.setSpaceAttribute(e,l)})}}}var Sr="\u2423",Lr={"TB-GEN-039":{values:[null,"Arial",null,"Courier New","Tahoma","Times New Roman","Verdana"],current:e=>e.model.getFontFamily(),run:(e,t)=>e.model.setFontFamily(t)},"TB-GEN-040":{values:[null,"8px","9px","10px","11px","12px","14px","16px","18px","20px","22px","24px","26px","28px","36px","48px","72px"],current:e=>e.model.getFontSize(),run:(e,t)=>e.model.setFontSize(t)},"TB-CTX-006":{values:["","(",")","[","]","\u27E8","\u27E9","{","}","\u230A","\u230B","\u2308","\u2309","\u27E6","\u27E7","|","\u2016"],visible:_i,current:e=>e.model.fenceContext()?.attrs.open??"(",run:(e,t)=>{e.model.setFence({open:t??""})}},"TB-CTX-007":{values:["","(",")","[","]","\u27E8","\u27E9","{","}","\u230A","\u230B","\u2308","\u2309","\u27E6","\u27E7","|","\u2016"],visible:_i,current:e=>e.model.fenceContext()?.attrs.close??")",run:(e,t)=>{e.model.setFence({close:t??""})}},"TB-CTX-008":{values:[",",".",";",":",Sr],visible:_i,current:e=>e.model.fenceContext()?.attrs.separators??",",run:(e,t)=>{e.model.setFence({separators:t===Sr?"":t??","})}},"TB-CTX-046":{values:[".",",","'"," "],visible:L,current:e=>pt(e,"decimalpoint")??".",run:(e,t)=>{e.model.setTableAttribute("decimalpoint",t==="."?null:t)}},"TB-CTX-075":{values:[null,"0px","1px","2px","3px","4px","5px","6px","7px","8px","9px","10px","12px","15px","20px","25px","30px"],visible:W,run:(e,t)=>{e.model.setStackAttribute("charspacing",t)}}};function g(e,t,i={},o=[]){let n=e.createElement(t);for(let[r,l]of Object.entries(i))l!==void 0&&n.setAttribute(r,l);for(let r of o)n.append(r);return n}var Yt="http://www.w3.org/2000/svg",Ir="16";function Xr(e,t){let i=e.createElementNS(Yt,"svg");i.setAttribute("viewBox","0 0 16 16"),i.setAttribute("width",Ir),i.setAttribute("height",Ir),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let o of t){let n=e.createElementNS(Yt,"path");n.setAttribute("d",o),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.4"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),i.appendChild(n)}return i}function Gr(e){let t=e.defaultView?.navigator,i=t?.userAgentData?.platform??t?.platform??"";return/mac|iphone|ipad/i.test(i)}var Dr={symbol:"24 2b 3c-3e 5e 60 7c 7e a2-a6 a8-a9 ac ae-b1 b4 b8 d7 f7 2c2-2c5 2d2-2df 2e5-2eb 2ed 2ef-2ff 375 384-385 3f6 482 58f 606-608 60b 60e-60f 6de 6e9 6fd-6fe e3f 1fbd 1fbf-1fc1 1fcd-1fcf 1fdd-1fdf 1fed-1fef 1ffd-1ffe 2044 2052 20a0-20ba 2105 2116-2118 211e 2120 2122 2125 2127 2129 212e 2140-2144 214a-214b 214d 2190-21ea 21f4-2300 2302 2305-2306 230c-2313 2315-231a 231c-2323 232c-232e 2332 2336 233d 233f-2340 2353 2370 237c 2393-2394 23af 23b4-23b6 23ce 23d0 23dc-23e7 2423 24b6-24e9 2500 2502 2506 2508 250a 250c 2510 2514 2518 251c 2524 252c 2534 253c 2550-256c 2571-2572 2580 2584 2588 258c 2590-2593 25a0-25ff 2605-2606 2609 260c 260e 2612 2621 2639-2644 2646-2649 2660-2667 2669-266b 266d-266f 267e 2680-2689 26a0 26a5 26aa-26ac 26b2 26e2 2702 2709 2713 2720 272a 2736 273d 279b 27c0-27c4 27c7-27c9 27cb-27cd 27d0-27e5 27f0-27ff 2900-2982 2999-29d7 29dc-29fb 29fe-2aff 2b12-2b4c 2b50-2b54 3012 a720-a721 a789-a78a fb29 fbb2-fbc1 fdfc fffc-fffd 1d6c1 1d6db 1d6fb 1d715 1d735 1d74f 1d76f 1d789 1d7a9 1d7c3",punctuation:"21-23 25-2a 2c-2f 3a-3b 3f-40 5b-5d 5f 7b 7d a1 a7 ab b6-b7 bb bf 37e 387 55a-55f 589-58a 5be 5c0 5c3 5c6 5f3-5f4 609-60a 60c-60d 61b 61e-61f 66a-66d 6d4 e4f e5a-e5b 2010-2022 2025-2026 2030-203e 2040 2043 2047 204e-2051 2057 205e 2308-230b 2329-232a 2772-2773 27c5-27c6 27e6-27ef 2983-2998 29d8-29db 29fc-29fd 2e17 3030 fd3e-fd3f",letter:"41-5a 61-7a aa b5 ba c0-d6 d8-f6 f8-2c1 2c6-2d1 2e0-2e4 2ec 2ee 370-374 376-377 37a-37d 386 388-38a 38c 38e-3a1 3a3-3f5 3f7-481 48a-527 531-556 559 561-587 5d0-5ea 5f0-5f2 620-64a 66e-66f 671-6d3 6d5 6e5-6e6 6ee-6ef 6fa-6fc 6ff 750-77f e01-e30 e32-e33 e40-e46 1d00-1dbf 1e00-1f15 1f18-1f1d 1f20-1f45 1f48-1f4d 1f50-1f57 1f59 1f5b 1f5d 1f5f-1f7d 1f80-1fb4 1fb6-1fbc 1fbe 1fc2-1fc4 1fc6-1fcc 1fd0-1fd3 1fd6-1fdb 1fe0-1fec 1ff2-1ff4 1ff6-1ffc 207f 2090-2094 2102 2107 210a-2113 2115 2119-211d 2124 2126 2128 212b-212d 212f-2138 213c-213f 2145-2149 214e 2184 2c60-2c7f 306e a717-a71f a727 a788 a78b-a78c a792 fb00-fb04 fb13-fb17 fb1d fb1f-fb28 fb2a-fb36 fb38-fb3c fb3e fb40-fb41 fb43-fb44 fb46-fbb1 fbd3-fbe9 fbfc-fbff fc5e-fc63 fc6a fc6d fc70 fc73 fc91 fc94 fdf2 fe70-fe74 fe76-fefc 1d400-1d454 1d456-1d49c 1d49e-1d49f 1d4a2 1d4a5-1d4a6 1d4a9-1d4ac 1d4ae-1d4b9 1d4bb 1d4bd-1d4c3 1d4c5-1d505 1d507-1d50a 1d50d-1d514 1d516-1d51c 1d51e-1d539 1d53b-1d53e 1d540-1d544 1d546 1d54a-1d550 1d552-1d6a5 1d6a8-1d6c0 1d6c2-1d6da 1d6dc-1d6fa 1d6fc-1d714 1d716-1d734 1d736-1d74e 1d750-1d76e 1d770-1d788 1d78a-1d7a8 1d7aa-1d7c2 1d7c4-1d7c9",mark:"300-36f 483-489 591-5bd 5bf 5c1-5c2 5c4-5c5 5c7 610-61a 64b-65f 670 6d6-6dc 6df-6e4 6e7-6e8 6ea-6ed e31 e34-e3a e47-e4e 1dc0-1dc1 1dc3 1dca 1dfe-1dff 20d0-20d2 20d6-20d7 20db-20df 20e1 20e4-20f0 fb1e fe20-fe23",number:"30-39 b2-b3 b9 bc-be 660-669 6f0-6f9 e50-e59 2070 2074-2079 2080-2089 2153-215e 2460-2468 24ea 2780-2793 1d7ce-1d7ff",phonetic:"70 62 74 64 288 256 63 25f 6b 261 71 262 294 6d 271 6e 273 272 14b 274 72 280 27e 27d 278 3b2 66 76 3b8 f0 73 7a 283 292 282 290 e7 29d 78 263 3c7 281 127 295 68 266 26c 26e 28b 279 27b 6a 270 6c 26d 28e 29f 1a5 253 1ad 257 188 284 199 260 2a0 29b 28d 77 265 29c 2a1-2a2 267 298 1c0 1c3 1c2 1c1 27a 255 291 2c71 287 297 296 286 293 27c 2e2 1ab 26b 67 2a6 2a3 2a7 2a4 2a8 2a5 1dbf 1d4a 1d91 1bb 29e 2e3 19e 19b 3bb 17e 161 1f0 10d 69 65 25b 61 251 254 6f 75 79 f8 153 276 252 28c 264 26f 268 289 26a 28f 28a 259 275 250 e6 25c 25a 131 25e 29a 258 277 269 2bc 325 30a 32c 2b0 324 330 33c 32a 33a-33b 339 31c 31f-320 308 33d 318-319 2de 2b7 2b2 2e0 2e4 303 207f 2e1 31a 334 31d 2d4 31e 2d5 329 32f 361 35c 322 2f9 2c 2bb 307 2d7 2d6 2b8 323 321 32b 2c8 2cc 2d0-2d1 306 2e 7c 2016 203f 2197-2198 30b 301 304 300 30f a71b-a71c 2e5-2e9 30c 302 1dc4-1dc5 1dc8 311 2c7 2c6 316 2ce 317 2cf 2ad 2a9-2ab 274d 2a 56 46 57 43 4c 4a 152 398 1d191 1d18f 31-33 346 34d 34a-34c 348-349 5c 34e 2193 2191 2ec 1db9 362 347 2b6 2ed 2f1-2f2 2f7 41-42 44-45 47-49 4b 4d-55 58-5b 5d 2f 28-29 7b 7d",other:"ad 600-603 6dd 200b-200f 202a-202e 206a-206f"},Fr={symbol:"ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooiiiiiiooooooiiiiiiiiiiiiiiiiiiooooooooooooooooooooooooooooooooooioooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooiiiioooooooooooooooooooooooooooooo",punctuation:"ooooooooooooooooooooioooooooooiiiiiiiiiiiiiiooooooiiiiiiiiiiiooo-ooooooooo-ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",letter:"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioooiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiooooooooooooooooooooooooooooiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii-iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii-iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioooooovoiiiiooiviivivivvvoioiiiiioiiooooooooooooooooooooooooooooooooooooooooooooooooiiiiiiiiiiiiiiooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioooooooooooooooooooooooooooooooooooo-oooooooooooooooiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooovvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",mark:"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii-ooooooooooooooooooooooooooooo",number:"nnnnnnnnnnoooooonnnnnnnnnnnnnnnnnnnniiiiiiiiiiooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooovvvvv-vvvv",phonetic:"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiioiiiiiiiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiiiioiiooiooiiioioiiiiioooiooiiiiooooiooooooiiiiiiioooooiiiiiiooioioiiiiooiiiiiiiioonnniiiiiiioioooiiiiooooiiiiiiiiiiiiiiiiiiiiooooooo",other:"oooooioooooooooooooooo"},Or={2102:["mi","normal","\u2102"],2111:["mi","fraktur","I"],2115:["mi","normal","\u2115"],"211a":["mi","normal","\u211A"],"211c":["mi","fraktur","R"],"211d":["mi","normal","\u211D"],2124:["mi","normal","\u2124"],"1d670":["mo","monospace","A"],"1d671":["mo","monospace","B"],"1d672":["mo","monospace","C"],"1d673":["mo","monospace","D"],"1d674":["mo","monospace","E"],"1d675":["mo","monospace","F"],"1d676":["mo","monospace","G"],"1d677":["mo","monospace","H"],"1d678":["mo","monospace","I"],"1d679":["mo","monospace","J"],"1d67a":["mo","monospace","K"],"1d67b":["mo","monospace","L"],"1d67c":["mo","monospace","M"],"1d67d":["mo","monospace","N"],"1d67e":["mo","monospace","O"],"1d67f":["mo","monospace","P"],"1d680":["mo","monospace","Q"],"1d681":["mo","monospace","R"],"1d682":["mo","monospace","S"],"1d683":["mo","monospace","T"],"1d684":["mo","monospace","U"],"1d685":["mo","monospace","V"],"1d686":["mo","monospace","W"],"1d687":["mo","monospace","X"],"1d688":["mo","monospace","Y"],"1d689":["mo","monospace","Z"],"1d68a":["mo","monospace","a"],"1d68b":["mo","monospace","b"],"1d68c":["mo","monospace","c"],"1d68d":["mo","monospace","d"],"1d68e":["mo","monospace","e"],"1d68f":["mo","monospace","f"],"1d690":["mo","monospace","g"],"1d691":["mo","monospace","h"],"1d692":["mo","monospace","i"],"1d693":["mo","monospace","j"],"1d694":["mo","monospace","k"],"1d695":["mo","monospace","l"],"1d696":["mo","monospace","m"],"1d697":["mo","monospace","n"],"1d698":["mo","monospace","o"],"1d699":["mo","monospace","p"],"1d69a":["mo","monospace","q"],"1d69b":["mo","monospace","r"],"1d69c":["mo","monospace","s"],"1d69d":["mo","monospace","t"],"1d69e":["mo","monospace","u"],"1d69f":["mo","monospace","v"],"1d6a0":["mo","monospace","w"],"1d6a1":["mo","monospace","x"],"1d6a2":["mo","monospace","y"],"1d6a3":["mo","monospace","z"],"1d7f6":["mo","monospace","0"],"1d7f7":["mo","monospace","1"],"1d7f8":["mo","monospace","2"],"1d7f9":["mo","monospace","3"],"1d7fa":["mo","monospace","4"],"1d7fc":["mo","monospace","6"],"1d7fd":["mo","monospace","7"],"1d7fe":["mo","monospace","8"],"1d7ff":["mo","monospace","9"]};var qe=6,Hi=30;function Kr(e,t,i){let o=g(e,"div",{class:"sw-matrix-grid",role:"grid","aria-label":`${t.rows} \xD7 ${t.columns}`}),n=g(e,"input",{type:"number",min:"1",max:String(Hi),value:"2","aria-label":t.rows}),r=g(e,"input",{type:"number",min:"1",max:String(Hi),value:"2","aria-label":t.columns}),l=[],s={r:1,c:1},a=(f,b)=>{s={r:f,c:b},n.value=String(f),r.value=String(b);for(let h of l){let w=Number(h.dataset.r),x=Number(h.dataset.c);h.classList.toggle("sw-active",w<=f&&x<=b),h.tabIndex=w===f&&x===b?0:-1}};for(let f=1;f<=qe;f+=1){let b=g(e,"div",{role:"row"});for(let h=1;h<=qe;h+=1){let w=g(e,"button",{type:"button",role:"gridcell",class:"sw-matrix-cell","aria-label":`${f} \xD7 ${h}`,"data-r":String(f),"data-c":String(h)});w.addEventListener("pointerenter",()=>a(f,h)),w.addEventListener("focus",()=>a(f,h)),w.addEventListener("click",()=>i(f,h)),l.push(w),b.appendChild(w)}o.appendChild(b)}o.addEventListener("keydown",f=>{let h={ArrowRight:[0,1],ArrowLeft:[0,-1],ArrowDown:[1,0],ArrowUp:[-1,0]}[f.key];if(!h)return;f.preventDefault();let w=Math.min(qe,Math.max(1,s.r+h[0])),x=Math.min(qe,Math.max(1,s.c+h[1]));l.find(X=>X.dataset.r===String(w)&&X.dataset.c===String(x))?.focus()});let m=f=>Math.min(Hi,Math.max(1,Math.round(Number(f.value)||1))),d=g(e,"button",{type:"button",class:"sw-button"},[t.apply]);d.addEventListener("click",()=>i(m(n),m(r)));for(let f of[n,r])f.addEventListener("keydown",b=>{b.key==="Enter"&&(b.preventDefault(),i(m(n),m(r)))});a(1,1);let c=g(e,"div",{class:"sw-picker-form"},[g(e,"label",{},[t.rows," ",n]),g(e,"label",{},[t.columns," ",r]),d]),u=l[0];return{content:g(e,"div",{class:"sw-matrix-picker"},[o,c]),initialFocus:u??n}}var _r=["#000000","#404040","#808080","#BFBFBF","#FFFFFF","#C00000","#FF0000","#FF7F00","#FFC000","#FFFF00","#00B050","#008000","#00B0F0","#0070C0","#002060","#7030A0","#B000B0","#FF00FF","#FF66B2","#996633","#00FFFF","#33CC99","#6699FF","#9999CC","#CC9966"],Dd=/^#?([0-9a-fA-F]{6})$/;function Fd(e){let t=Dd.exec(e.trim());return t?.[1]?`#${t[1].toUpperCase()}`:null}function Pr(e,t,i,o){let n=g(e,"div",{class:"sw-swatches",role:"listbox","aria-label":t.hexColor}),r=_r.map(c=>{let u=g(e,"button",{type:"button",role:"option",class:"sw-swatch","aria-label":c,"aria-selected":String(c===i),style:`background:${c}`,tabindex:"-1"});return u.addEventListener("click",()=>o(c)),n.appendChild(u),u}),l=Math.max(0,_r.indexOf(i??""));r[l]?.setAttribute("tabindex","0"),n.addEventListener("keydown",c=>{let u=r.indexOf(e.activeElement);if(u<0)return;let f=5,h={ArrowRight:1,ArrowLeft:-1,ArrowDown:f,ArrowUp:-f}[c.key];if(h===void 0)return;c.preventDefault();let w=r[(u+h+r.length)%r.length];if(w){for(let x of r)x.tabIndex=-1;w.tabIndex=0,w.focus()}});let s=g(e,"input",{type:"text",value:i??"#000000","aria-label":t.hexColor,maxlength:"7",spellcheck:"false"}),a=g(e,"button",{type:"button",class:"sw-button"},[t.apply]),m=()=>{let c=Fd(s.value);s.setAttribute("aria-invalid",String(c===null)),c&&o(c)};a.addEventListener("click",m),s.addEventListener("keydown",c=>{c.key==="Enter"&&(c.preventDefault(),m())});let d=r[l];return{content:g(e,"div",{class:"sw-color-picker"},[n,g(e,"div",{class:"sw-picker-form"},[s,a])]),initialFocus:d??s}}var $r=["symbol","punctuation","letter","mark","number","phonetic","other"],Od=384,_d=/^(?:u\+|0x)?([0-9a-fA-F]{1,6})$/i,Ye=16,Kd=4;function Hr(e){let t=[];for(let i of Dr[e].split(" ")){let[o="",n=o]=i.split("-"),r=Number.parseInt(n,Ye);for(let l=Number.parseInt(o,Ye);l<=r;l+=1)t.push(String.fromCodePoint(l))}return t}var Pd={i:"mi",o:"mo",n:"mn"},$d="v",zi;function Hd(){let e=new Map;for(let t of $r){let i=Fr[t];Hr(t).forEach((o,n)=>{let r=i[n]??"",l=Pd[r];if(l&&e.set(o,{tag:l}),r!==$d)return;let s=Or[(o.codePointAt(0)??0).toString(Ye)];s&&e.set(o,{tag:s[0],text:s[2],...s[1]?{mathvariant:s[1]}:{}})})}return e}function zr(e){return zi??(zi=Hd()),zi.get(e)}function zd(e){return`${Ur(e)}
|
|
12
|
+
&#${e};`}function Ur(e){return`U+${e.toString(Ye).toUpperCase().padStart(Kd,"0")}`}function Ud(e){let t=_d.exec(e.trim());if(!t?.[1])return null;let i=Number.parseInt(t[1],16);return i<32||i>1114111||i>=55296&&i<=57343?null:String.fromCodePoint(i)}function Vr(e,t,i){let o=g(e,"input",{type:"text","aria-label":t.code,placeholder:"U+221E",spellcheck:"false",maxlength:"8"}),n=g(e,"select",{"aria-label":t.category});for(let c of $r)n.appendChild(g(e,"option",{value:c},[t.categories[c]]));let r=g(e,"div",{class:"sw-char-grid",role:"listbox","aria-label":t.category,tabindex:"0"}),l=new Map,s=[],a=0,m=()=>{let c=Math.min(s.length,a+Od),u=e.createDocumentFragment();for(let f=a;f<c;f+=1){let b=s[f]??"",h=b.codePointAt(0)??0,w=g(e,"button",{type:"button",role:"option",class:"sw-char",tabindex:"-1",title:zd(h),"aria-label":Ur(h)},[b]);w.addEventListener("click",()=>i(b)),u.appendChild(w)}r.appendChild(u),a=c},d=c=>{let u=l.get(c)??Hr(c);l.set(c,u),s=u,a=0,r.replaceChildren(),r.scrollTop=0,m()};return r.addEventListener("scroll",()=>{r.scrollTop+r.clientHeight>=r.scrollHeight-r.clientHeight&&a<s.length&&m()}),r.addEventListener("keydown",c=>{let u=[...r.querySelectorAll(".sw-char")],f=u.indexOf(e.activeElement),b=Math.max(1,Math.floor(r.clientWidth/(u[0]?.offsetWidth||1))),w={ArrowRight:1,ArrowLeft:-1,ArrowDown:b,ArrowUp:-b}[c.key];if(w===void 0)return;c.preventDefault();let x=f<0?0:Math.min(u.length-1,Math.max(0,f+w));x>=u.length-b&&a<s.length&&m(),r.querySelectorAll(".sw-char")[x]?.focus()}),n.addEventListener("change",()=>d(n.value)),o.addEventListener("keydown",c=>{if(c.key!=="Enter")return;c.preventDefault();let u=Ud(o.value);o.setAttribute("aria-invalid",String(u===null)),u&&i(u)}),d("symbol"),{content:g(e,"div",{class:"sw-special-picker"},[g(e,"div",{class:"sw-picker-form"},[g(e,"label",{},[`${t.code}: `,o]),n]),r]),initialFocus:o}}function qr(e,t,i,o,n){let r=g(e,"input",{type:"text",value:o,"aria-label":i,spellcheck:"false"}),l=g(e,"button",{type:"button",class:"sw-button"},[t.apply]),s=()=>{let a=r.value.trim(),m=/^-?\d*\.?\d+(em|ex|px|pt|%)?$/.test(a);r.setAttribute("aria-invalid",String(!m)),m&&n(/[a-z%]$/.test(a)?a:`${a}em`)};return l.addEventListener("click",s),r.addEventListener("keydown",a=>{a.key==="Enter"&&(a.preventDefault(),s())}),{content:g(e,"div",{class:"sw-picker-form"},[g(e,"label",{},[i," ",r]),l]),initialFocus:r}}var Yr={title:"FormulaComposer",insert:"Insert",cancel:"Cancel",minimize:"Minimize",restore:"Restore",fullscreen:"Full-screen",exitFullscreen:"Exit full-screen",close:"Close",confirmMessage:"Leave without inserting? Your changes to this formula will be lost.",confirmDiscard:"Discard changes",confirmReturn:"Keep editing",mathInput:"Math input",toolbar:"Formula toolbar",more:"More",latex:"LaTeX",latexInput:"LaTeX source",latexInvalid:"The LaTeX cannot be converted yet; the last valid formula is kept.",help:"Keyboard shortcuts",helpTitle:"Keyboard shortcuts",rows:"Rows",columns:"Columns",apply:"Apply",hexColor:"Hex colour",code:"Code",category:"Category",resize:"Resize",dragHandle:"Move",emptyFormula:"empty formula",insertFormula:"Insert a math equation",menuItem:"Math equation",tabShortcut:"Ctrl+{n}",tabs:{GEN:"General",SYM:"Symbols",ARR:"Arrows",GRK:"Greek, letters and numbers",MAT:"Matrices and elementary",SCR:"Scripts and layout",DEC:"Decorations",BIG:"Big operators",CAL:"Calculus",CTX:"Contextual"},categories:{symbol:"Symbol",punctuation:"Punctuation",letter:"Letter",mark:"Mark",number:"Number",phonetic:"Phonetical",other:"Other"}},Vd={insert:"Insertar",cancel:"Cancelar",minimize:"Minimizar",restore:"Restaurar",fullscreen:"Pantalla completa",exitFullscreen:"Salir de pantalla completa",close:"Cerrar",confirmMessage:"\xBFSalir sin insertar? Se perder\xE1n los cambios de esta f\xF3rmula.",confirmDiscard:"Descartar cambios",confirmReturn:"Seguir editando",mathInput:"Entrada matem\xE1tica",toolbar:"Barra de herramientas de f\xF3rmulas",more:"M\xE1s",latex:"LaTeX",latexInput:"C\xF3digo LaTeX",latexInvalid:"El LaTeX todav\xEDa no se puede convertir; se conserva la \xFAltima f\xF3rmula v\xE1lida.",help:"Atajos de teclado",helpTitle:"Atajos de teclado",rows:"Filas",columns:"Columnas",apply:"Aplicar",hexColor:"Color hexadecimal",code:"C\xF3digo",category:"Categor\xEDa",resize:"Cambiar tama\xF1o",dragHandle:"Mover",emptyFormula:"f\xF3rmula vac\xEDa",insertFormula:"Insertar una ecuaci\xF3n matem\xE1tica",menuItem:"Ecuaci\xF3n matem\xE1tica",tabs:{GEN:"General",SYM:"S\xEDmbolos",ARR:"Flechas",GRK:"Letras griegas, letras y n\xFAmeros",MAT:"Matrices y elemental",SCR:"\xCDndices y disposici\xF3n",DEC:"Decoraciones",BIG:"Operadores grandes",CAL:"C\xE1lculo",CTX:"Contextual"},categories:{symbol:"S\xEDmbolo",punctuation:"Puntuaci\xF3n",letter:"Letra",mark:"Marca",number:"N\xFAmero",phonetic:"Fon\xE9tico",other:"Otro"}},qd={insert:"Ins\xE9rer",cancel:"Annuler",minimize:"R\xE9duire",restore:"Restaurer",fullscreen:"Plein \xE9cran",exitFullscreen:"Quitter le plein \xE9cran",close:"Fermer",confirmMessage:"Quitter sans ins\xE9rer ? Les modifications de cette formule seront perdues.",confirmDiscard:"Abandonner les modifications",confirmReturn:"Continuer la modification",mathInput:"Saisie math\xE9matique",toolbar:"Barre d\u2019outils des formules",more:"Plus",latex:"LaTeX",latexInput:"Source LaTeX",latexInvalid:"Le LaTeX ne peut pas encore \xEAtre converti ; la derni\xE8re formule valide est conserv\xE9e.",help:"Raccourcis clavier",helpTitle:"Raccourcis clavier",rows:"Lignes",columns:"Colonnes",apply:"Appliquer",hexColor:"Couleur hexad\xE9cimale",code:"Code",category:"Cat\xE9gorie",resize:"Redimensionner",dragHandle:"D\xE9placer",emptyFormula:"formule vide",insertFormula:"Ins\xE9rer une \xE9quation math\xE9matique",menuItem:"\xC9quation math\xE9matique",tabs:{GEN:"G\xE9n\xE9ral",SYM:"Symboles",ARR:"Fl\xE8ches",GRK:"Lettres grecques, lettres et nombres",MAT:"Matrices et \xE9l\xE9mentaire",SCR:"Indices et mise en page",DEC:"D\xE9corations",BIG:"Grands op\xE9rateurs",CAL:"Analyse",CTX:"Contextuel"},categories:{symbol:"Symbole",punctuation:"Ponctuation",letter:"Lettre",mark:"Diacritique",number:"Nombre",phonetic:"Phon\xE9tique",other:"Autre"}},Yd={insert:"Einf\xFCgen",cancel:"Abbrechen",minimize:"Minimieren",restore:"Wiederherstellen",fullscreen:"Vollbild",exitFullscreen:"Vollbild beenden",close:"Schlie\xDFen",confirmMessage:"Ohne Einf\xFCgen verlassen? Ihre \xC4nderungen an dieser Formel gehen verloren.",confirmDiscard:"\xC4nderungen verwerfen",confirmReturn:"Weiter bearbeiten",mathInput:"Mathematische Eingabe",toolbar:"Formel-Werkzeugleiste",more:"Mehr",latex:"LaTeX",latexInput:"LaTeX-Quelltext",latexInvalid:"Das LaTeX kann noch nicht umgewandelt werden; die letzte g\xFCltige Formel bleibt erhalten.",help:"Tastenk\xFCrzel",helpTitle:"Tastenk\xFCrzel",rows:"Zeilen",columns:"Spalten",apply:"Anwenden",hexColor:"Hex-Farbe",code:"Code",category:"Kategorie",resize:"Gr\xF6\xDFe \xE4ndern",dragHandle:"Verschieben",emptyFormula:"leere Formel",insertFormula:"Mathematische Gleichung einf\xFCgen",menuItem:"Mathematische Gleichung",tabs:{GEN:"Allgemein",SYM:"Symbole",ARR:"Pfeile",GRK:"Griechisch, Buchstaben und Zahlen",MAT:"Matrizen und Elementar",SCR:"Indizes und Layout",DEC:"Dekorationen",BIG:"Gro\xDFe Operatoren",CAL:"Analysis",CTX:"Kontextabh\xE4ngig"},categories:{symbol:"Symbol",punctuation:"Satzzeichen",letter:"Buchstabe",mark:"Zeichen",number:"Zahl",phonetic:"Phonetisch",other:"Andere"}},jd={insert:"Inserisci",cancel:"Annulla",minimize:"Riduci",restore:"Ripristina",fullscreen:"Schermo intero",exitFullscreen:"Esci da schermo intero",close:"Chiudi",confirmMessage:"Uscire senza inserire? Le modifiche a questa formula andranno perse.",confirmDiscard:"Scarta modifiche",confirmReturn:"Continua a modificare",mathInput:"Input matematico",toolbar:"Barra degli strumenti delle formule",more:"Altro",latex:"LaTeX",latexInput:"Sorgente LaTeX",latexInvalid:"Il LaTeX non pu\xF2 ancora essere convertito; viene mantenuta l\u2019ultima formula valida.",help:"Scorciatoie da tastiera",helpTitle:"Scorciatoie da tastiera",rows:"Righe",columns:"Colonne",apply:"Applica",hexColor:"Colore esadecimale",code:"Codice",category:"Categoria",resize:"Ridimensiona",dragHandle:"Sposta",emptyFormula:"formula vuota",insertFormula:"Inserisci un'equazione matematica",menuItem:"Equazione matematica",tabs:{GEN:"Generale",SYM:"Simboli",ARR:"Frecce",GRK:"Lettere greche, lettere e numeri",MAT:"Matrici ed elementare",SCR:"Indici e layout",DEC:"Decorazioni",BIG:"Operatori grandi",CAL:"Analisi",CTX:"Contestuale"},categories:{symbol:"Simbolo",punctuation:"Punteggiatura",letter:"Lettera",mark:"Segno",number:"Numero",phonetic:"Fonetico",other:"Altro"}},jr={insert:"Inserir",cancel:"Cancelar",minimize:"Minimizar",restore:"Restaurar",fullscreen:"Ecr\xE3 inteiro",exitFullscreen:"Sair do ecr\xE3 inteiro",close:"Fechar",confirmMessage:"Sair sem inserir? As altera\xE7\xF5es a esta f\xF3rmula ser\xE3o perdidas.",confirmDiscard:"Descartar altera\xE7\xF5es",confirmReturn:"Continuar a editar",mathInput:"Entrada matem\xE1tica",toolbar:"Barra de ferramentas de f\xF3rmulas",more:"Mais",latex:"LaTeX",latexInput:"C\xF3digo LaTeX",latexInvalid:"O LaTeX ainda n\xE3o pode ser convertido; mant\xE9m-se a \xFAltima f\xF3rmula v\xE1lida.",help:"Atalhos de teclado",helpTitle:"Atalhos de teclado",rows:"Linhas",columns:"Colunas",apply:"Aplicar",hexColor:"Cor hexadecimal",code:"C\xF3digo",category:"Categoria",resize:"Redimensionar",dragHandle:"Mover",emptyFormula:"f\xF3rmula vazia",insertFormula:"Inserir uma equa\xE7\xE3o matem\xE1tica",menuItem:"Equa\xE7\xE3o matem\xE1tica",tabs:{GEN:"Geral",SYM:"S\xEDmbolos",ARR:"Setas",GRK:"Letras gregas, letras e n\xFAmeros",MAT:"Matrizes e elementar",SCR:"\xCDndices e disposi\xE7\xE3o",DEC:"Decora\xE7\xF5es",BIG:"Operadores grandes",CAL:"C\xE1lculo",CTX:"Contextual"},categories:{symbol:"S\xEDmbolo",punctuation:"Pontua\xE7\xE3o",letter:"Letra",mark:"Marca",number:"N\xFAmero",phonetic:"Fon\xE9tico",other:"Outro"}},Wd={...jr,fullscreen:"Tela cheia",exitFullscreen:"Sair da tela cheia",confirmMessage:"Sair sem inserir? As altera\xE7\xF5es nesta f\xF3rmula ser\xE3o perdidas.",confirmReturn:"Continuar editando",latexInvalid:"O LaTeX ainda n\xE3o pode ser convertido; a \xFAltima f\xF3rmula v\xE1lida \xE9 mantida."},Zd={insert:"Insereix",cancel:"Cancel\xB7la",minimize:"Minimitza",restore:"Restaura",fullscreen:"Pantalla completa",exitFullscreen:"Surt de la pantalla completa",close:"Tanca",confirmMessage:"Vols sortir sense inserir? Es perdran els canvis d\u2019aquesta f\xF3rmula.",confirmDiscard:"Descarta els canvis",confirmReturn:"Continua editant",mathInput:"Entrada matem\xE0tica",toolbar:"Barra d\u2019eines de f\xF3rmules",more:"M\xE9s",latex:"LaTeX",latexInput:"Codi LaTeX",latexInvalid:"El LaTeX encara no es pot convertir; es conserva l\u2019\xFAltima f\xF3rmula v\xE0lida.",help:"Dreceres de teclat",helpTitle:"Dreceres de teclat",rows:"Files",columns:"Columnes",apply:"Aplica",hexColor:"Color hexadecimal",code:"Codi",category:"Categoria",resize:"Canvia la mida",dragHandle:"Mou",emptyFormula:"f\xF3rmula buida",insertFormula:"Insereix una equaci\xF3 matem\xE0tica",menuItem:"Equaci\xF3 matem\xE0tica",tabs:{GEN:"General",SYM:"S\xEDmbols",ARR:"Fletxes",GRK:"Lletres gregues, lletres i nombres",MAT:"Matrius i elemental",SCR:"\xCDndexs i disposici\xF3",DEC:"Decoracions",BIG:"Operadors grans",CAL:"C\xE0lcul",CTX:"Contextual"},categories:{symbol:"S\xEDmbol",punctuation:"Puntuaci\xF3",letter:"Lletra",mark:"Marca",number:"Nombre",phonetic:"Fon\xE8tic",other:"Altres"}},Qd={insert:"\u0625\u062F\u0631\u0627\u062C",cancel:"\u0625\u0644\u063A\u0627\u0621",minimize:"\u062A\u0635\u063A\u064A\u0631",restore:"\u0627\u0633\u062A\u0639\u0627\u062F\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",exitFullscreen:"\u0627\u0644\u062E\u0631\u0648\u062C \u0645\u0646 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",close:"\u0625\u063A\u0644\u0627\u0642",confirmMessage:"\u0647\u0644 \u062A\u0631\u064A\u062F \u0627\u0644\u0645\u063A\u0627\u062F\u0631\u0629 \u062F\u0648\u0646 \u0625\u062F\u0631\u0627\u062C\u061F \u0633\u062A\u0641\u0642\u062F \u0627\u0644\u062A\u063A\u064A\u064A\u0631\u0627\u062A \u0639\u0644\u0649 \u0647\u0630\u0647 \u0627\u0644\u0635\u064A\u063A\u0629.",confirmDiscard:"\u062A\u062C\u0627\u0647\u0644 \u0627\u0644\u062A\u063A\u064A\u064A\u0631\u0627\u062A",confirmReturn:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062A\u062D\u0631\u064A\u0631",mathInput:"\u0625\u062F\u062E\u0627\u0644 \u0631\u064A\u0627\u0636\u064A",toolbar:"\u0634\u0631\u064A\u0637 \u0623\u062F\u0648\u0627\u062A \u0627\u0644\u0635\u064A\u063A",more:"\u0627\u0644\u0645\u0632\u064A\u062F",latex:"LaTeX",latexInput:"\u0645\u0635\u062F\u0631 LaTeX",latexInvalid:"\u0644\u0627 \u064A\u0645\u0643\u0646 \u062A\u062D\u0648\u064A\u0644 LaTeX \u0628\u0639\u062F\u061B \u062A\u0645 \u0627\u0644\u0627\u062D\u062A\u0641\u0627\u0638 \u0628\u0622\u062E\u0631 \u0635\u064A\u063A\u0629 \u0635\u0627\u0644\u062D\u0629.",help:"\u0627\u062E\u062A\u0635\u0627\u0631\u0627\u062A \u0644\u0648\u062D\u0629 \u0627\u0644\u0645\u0641\u0627\u062A\u064A\u062D",helpTitle:"\u0627\u062E\u062A\u0635\u0627\u0631\u0627\u062A \u0644\u0648\u062D\u0629 \u0627\u0644\u0645\u0641\u0627\u062A\u064A\u062D",rows:"\u0627\u0644\u0635\u0641\u0648\u0641",columns:"\u0627\u0644\u0623\u0639\u0645\u062F\u0629",apply:"\u062A\u0637\u0628\u064A\u0642",hexColor:"\u0644\u0648\u0646 \u0633\u062F\u0627\u0633\u064A \u0639\u0634\u0631\u064A",code:"\u0627\u0644\u0631\u0645\u0632",category:"\u0627\u0644\u0641\u0626\u0629",resize:"\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",dragHandle:"\u0646\u0642\u0644",emptyFormula:"\u0635\u064A\u063A\u0629 \u0641\u0627\u0631\u063A\u0629",insertFormula:"\u0625\u062F\u0631\u0627\u062C \u0645\u0639\u0627\u062F\u0644\u0629 \u0631\u064A\u0627\u0636\u064A\u0629",menuItem:"\u0645\u0639\u0627\u062F\u0644\u0629 \u0631\u064A\u0627\u0636\u064A\u0629",tabs:{GEN:"\u0639\u0627\u0645",SYM:"\u0631\u0645\u0648\u0632",ARR:"\u0623\u0633\u0647\u0645",GRK:"\u062D\u0631\u0648\u0641 \u064A\u0648\u0646\u0627\u0646\u064A\u0629 \u0648\u062D\u0631\u0648\u0641 \u0648\u0623\u0631\u0642\u0627\u0645",MAT:"\u0645\u0635\u0641\u0648\u0641\u0627\u062A \u0648\u062D\u0633\u0627\u0628 \u0623\u0648\u0644\u064A",SCR:"\u0623\u062F\u0644\u0629 \u0648\u062A\u062E\u0637\u064A\u0637",DEC:"\u0632\u062E\u0627\u0631\u0641",BIG:"\u0639\u0648\u0627\u0645\u0644 \u0643\u0628\u064A\u0631\u0629",CAL:"\u0627\u0644\u062A\u0641\u0627\u0636\u0644 \u0648\u0627\u0644\u062A\u0643\u0627\u0645\u0644",CTX:"\u0633\u064A\u0627\u0642\u064A"},categories:{symbol:"\u0631\u0645\u0632",punctuation:"\u062A\u0631\u0642\u064A\u0645",letter:"\u062D\u0631\u0641",mark:"\u0639\u0644\u0627\u0645\u0629",number:"\u0631\u0642\u0645",phonetic:"\u0635\u0648\u062A\u064A",other:"\u0623\u062E\u0631\u0649"}},Jd={insert:"\u05D4\u05D5\u05E1\u05E4\u05D4",cancel:"\u05D1\u05D9\u05D8\u05D5\u05DC",minimize:"\u05DE\u05D6\u05E2\u05D5\u05E8",restore:"\u05E9\u05D7\u05D6\u05D5\u05E8",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",confirmMessage:"\u05DC\u05E6\u05D0\u05EA \u05D1\u05DC\u05D9 \u05DC\u05D4\u05D5\u05E1\u05D9\u05E3? \u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05D1\u05E0\u05D5\u05E1\u05D7\u05D4 \u05D6\u05D5 \u05D9\u05D0\u05D1\u05D3\u05D5.",confirmDiscard:"\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD",confirmReturn:"\u05D4\u05DE\u05E9\u05DA \u05E2\u05E8\u05D9\u05DB\u05D4",mathInput:"\u05E7\u05DC\u05D8 \u05DE\u05EA\u05DE\u05D8\u05D9",toolbar:"\u05E1\u05E8\u05D2\u05DC \u05DB\u05DC\u05D9\u05DD \u05DC\u05E0\u05D5\u05E1\u05D7\u05D0\u05D5\u05EA",more:"\u05E2\u05D5\u05D3",latex:"LaTeX",latexInput:"\u05DE\u05E7\u05D5\u05E8 LaTeX",latexInvalid:"\u05E2\u05D3\u05D9\u05D9\u05DF \u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05D4\u05DE\u05D9\u05E8 \u05D0\u05EA \u05D4-LaTeX; \u05D4\u05E0\u05D5\u05E1\u05D7\u05D4 \u05D4\u05EA\u05E7\u05D9\u05E0\u05D4 \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D4 \u05E0\u05E9\u05DE\u05E8\u05EA.",help:"\u05E7\u05D9\u05E6\u05D5\u05E8\u05D9 \u05DE\u05E7\u05DC\u05D3\u05EA",helpTitle:"\u05E7\u05D9\u05E6\u05D5\u05E8\u05D9 \u05DE\u05E7\u05DC\u05D3\u05EA",rows:"\u05E9\u05D5\u05E8\u05D5\u05EA",columns:"\u05E2\u05DE\u05D5\u05D3\u05D5\u05EA",apply:"\u05D4\u05D7\u05DC\u05D4",hexColor:"\u05E6\u05D1\u05E2 \u05D4\u05E7\u05E1\u05D3\u05E6\u05D9\u05DE\u05DC\u05D9",code:"\u05E7\u05D5\u05D3",category:"\u05E7\u05D8\u05D2\u05D5\u05E8\u05D9\u05D4",resize:"\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D2\u05D5\u05D3\u05DC",dragHandle:"\u05D4\u05D6\u05D6\u05D4",emptyFormula:"\u05E0\u05D5\u05E1\u05D7\u05D4 \u05E8\u05D9\u05E7\u05D4",insertFormula:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05DE\u05E9\u05D5\u05D5\u05D0\u05D4 \u05DE\u05EA\u05DE\u05D8\u05D9\u05EA",menuItem:"\u05DE\u05E9\u05D5\u05D5\u05D0\u05D4 \u05DE\u05EA\u05DE\u05D8\u05D9\u05EA",tabs:{GEN:"\u05DB\u05DC\u05DC\u05D9",SYM:"\u05E1\u05DE\u05DC\u05D9\u05DD",ARR:"\u05D7\u05E6\u05D9\u05DD",GRK:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA \u05D9\u05D5\u05D5\u05E0\u05D9\u05D5\u05EA, \u05D0\u05D5\u05EA\u05D9\u05D5\u05EA \u05D5\u05DE\u05E1\u05E4\u05E8\u05D9\u05DD",MAT:"\u05DE\u05D8\u05E8\u05D9\u05E6\u05D5\u05EA \u05D5\u05D7\u05E9\u05D1\u05D5\u05DF \u05D1\u05E1\u05D9\u05E1\u05D9",SCR:"\u05D0\u05D9\u05E0\u05D3\u05E7\u05E1\u05D9\u05DD \u05D5\u05E4\u05E8\u05D9\u05E1\u05D4",DEC:"\u05E2\u05D9\u05D8\u05D5\u05E8\u05D9\u05DD",BIG:"\u05D0\u05D5\u05E4\u05E8\u05D8\u05D5\u05E8\u05D9\u05DD \u05D2\u05D3\u05D5\u05DC\u05D9\u05DD",CAL:"\u05D7\u05E9\u05D1\u05D5\u05DF \u05D0\u05D9\u05E0\u05E4\u05D9\u05E0\u05D9\u05D8\u05E1\u05D9\u05DE\u05DC\u05D9",CTX:"\u05D4\u05E7\u05E9\u05E8\u05D9"},categories:{symbol:"\u05E1\u05DE\u05DC",punctuation:"\u05E4\u05D9\u05E1\u05D5\u05E7",letter:"\u05D0\u05D5\u05EA",mark:"\u05E1\u05D9\u05DE\u05DF",number:"\u05DE\u05E1\u05E4\u05E8",phonetic:"\u05E4\u05D5\u05E0\u05D8\u05D9",other:"\u05D0\u05D7\u05E8"}},je={es:Vd,fr:qd,de:Yd,it:jd,pt:jr,pt_br:Wd,ca:Zd,ar:Qd,he:Jd},tc=new Set(["ar","he","fa","ur"]),ec=["en",...Object.keys(je)];function jt(e){let t=(e??"en").toLowerCase().replace("-","_");if(t in je||t==="en")return t;let i=t.split("_")[0]??"en";return i in je?i:"en"}function Wt(e){return tc.has(jt(e).split("_")[0]??"")}function ht(e,t={}){let i=je[jt(e)],o=i?{...Yr,...i}:Yr;return{...o,...t,tabs:{...o.tabs,...t.tabs},categories:{...o.categories,...t.categories}}}function Wr(e,t){return e.replace(/\{(\w+)\}/g,(i,o)=>o in t?String(t[o]):i)}var Zr="formula-composer-editor-styles",ic=`
|
|
13
|
+
.sw-editor,.sw-modal{--sw-bg:#fff;--sw-fg:#1d2733;--sw-muted:#5b6878;--sw-border:#c9d1db;--sw-toolbar:#eef1f5;--sw-tab:#dde3ea;--sw-accent:#2f6fde;--sw-accent-fg:#fff;--sw-hover:#d7e3f7;--sw-focus:#2f6fde;--sw-strip:#5d6c7b;--sw-radius:4px;
|
|
14
|
+
font:13px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--sw-fg);box-sizing:border-box;}
|
|
15
|
+
.sw-editor *,.sw-modal *{box-sizing:border-box;}
|
|
16
|
+
.sw-editor{display:flex;flex-direction:column;min-height:0;height:100%;background:var(--sw-bg);position:relative;}
|
|
17
|
+
.sw-toolbar{background:var(--sw-toolbar);border-bottom:1px solid var(--sw-border);flex:none;}
|
|
18
|
+
.sw-tabbar{display:flex;align-items:flex-end;gap:4px;padding:3px 4px 0;}
|
|
19
|
+
.sw-tablist{display:flex;flex-wrap:wrap;gap:2px;flex:1;min-width:0;}
|
|
20
|
+
.sw-tab{border:1px solid var(--sw-border);border-bottom:none;border-radius:var(--sw-radius) var(--sw-radius) 0 0;background:var(--sw-tab);color:var(--sw-fg);padding:2px 7px;min-width:34px;height:24px;cursor:pointer;font:14px/1 "STIX Two Math","Cambria Math",serif;}
|
|
21
|
+
.sw-tab[aria-selected="true"]{background:var(--sw-bg);position:relative;top:1px;}
|
|
22
|
+
.sw-tab:hover{background:var(--sw-hover);}
|
|
23
|
+
.sw-tab-extras{display:flex;gap:2px;padding-bottom:2px;}
|
|
24
|
+
.sw-tab-extra{border:1px solid var(--sw-border);border-radius:var(--sw-radius);background:var(--sw-bg);color:var(--sw-fg);height:22px;min-width:22px;padding:0 6px;cursor:pointer;font:600 12px/1 system-ui,sans-serif;}
|
|
25
|
+
.sw-tab-extra[aria-pressed="true"]{background:var(--sw-accent);color:var(--sw-accent-fg);border-color:var(--sw-accent);}
|
|
26
|
+
.sw-panel{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:thin;align-items:flex-start;gap:0;padding:3px 2px;background:var(--sw-bg);min-height:86px;}
|
|
27
|
+
.sw-panel[hidden]{display:none;}
|
|
28
|
+
.sw-panel.sw-inactive{opacity:.45;pointer-events:none;}
|
|
29
|
+
.sw-section{display:grid;grid-template-rows:repeat(3,26px);gap:1px;padding:0 3px;border-inline-end:1px solid var(--sw-border);position:relative;}
|
|
30
|
+
.sw-section[data-rows="2"]{grid-template-rows:repeat(2,39px);}
|
|
31
|
+
.sw-section[data-rows="1"]{grid-template-rows:39px;}
|
|
32
|
+
.sw-section[data-more]{padding-inline-end:13px;}
|
|
33
|
+
.sw-section[hidden]{display:none;}
|
|
34
|
+
.sw-tool{min-width:26px;height:100%;padding:0 3px;border:1px solid transparent;border-radius:var(--sw-radius);background:transparent;color:var(--sw-fg);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;}
|
|
35
|
+
.sw-section[data-kind="template"] .sw-tool{min-width:30px;}
|
|
36
|
+
.sw-section[data-rows="3"] .sw-tool{min-width:22px;padding:0 2px;}
|
|
37
|
+
.sw-tool:hover{background:var(--sw-hover);border-color:var(--sw-border);}
|
|
38
|
+
.sw-tool[aria-pressed="true"]{background:var(--sw-hover);border-color:var(--sw-accent);}
|
|
39
|
+
.sw-tool.sw-disabled{opacity:.4;cursor:default;}
|
|
40
|
+
.sw-tool[hidden],.sw-select[hidden]{display:none;}
|
|
41
|
+
.sw-tool-label{font:600 12px/1 system-ui,sans-serif;white-space:nowrap;}
|
|
42
|
+
.sw-tool[data-id="TB-GEN-033"] .sw-tool-label{font-style:italic;font-family:"Times New Roman",Times,serif;font-size:14px;}
|
|
43
|
+
.sw-tool[data-id="TB-GEN-035"] .sw-tool-label{display:inline-block;font-style:italic;font-family:"Times New Roman",Times,serif;font-size:14px;}
|
|
44
|
+
.sw-tool[data-id="TB-GEN-035"] .sw-tool-label::first-letter{font-style:normal;}
|
|
45
|
+
.sw-icon{pointer-events:none;display:inline-flex;}
|
|
46
|
+
.sw-icon math{font-size:14px;font-family:"STIX Two Math","FormulaComposer Math","Cambria Math",math;}
|
|
47
|
+
.sw-section[data-kind="template"] .sw-icon math{font-size:12px;math-style:normal;}
|
|
48
|
+
.sw-more{position:absolute;inset-block:3px;inset-inline-end:2px;width:8px;padding:0 0 1px;border:none;border-radius:2px;background:transparent;color:var(--sw-muted);font-size:8px;line-height:1;cursor:pointer;display:flex;align-items:flex-end;justify-content:center;}
|
|
49
|
+
.sw-more:hover{background:var(--sw-hover);}
|
|
50
|
+
.sw-more[aria-expanded="true"]{background:var(--sw-strip);color:#fff;}
|
|
51
|
+
.sw-select{height:24px;max-width:80px;border:1px solid var(--sw-border);border-radius:var(--sw-radius);background:var(--sw-bg);color:var(--sw-fg);font:12px system-ui,sans-serif;}
|
|
52
|
+
.sw-area{position:relative;flex:1;min-height:60px;overflow:auto;overscroll-behavior:contain;padding:10px 12px;background:var(--sw-bg);cursor:text;}
|
|
53
|
+
.sw-area[hidden]{display:none;}
|
|
54
|
+
.sw-area .sw-canvas{display:inline-block;min-width:100%;padding:2px 2px 6px;}
|
|
55
|
+
.sw-input{position:absolute;left:0;top:0;width:1px;height:1px;opacity:0;padding:0;border:0;resize:none;overflow:hidden;pointer-events:none;}
|
|
56
|
+
.sw-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;}
|
|
57
|
+
.sw-latex{flex:1;min-height:60px;margin:8px;padding:8px;border:1px solid var(--sw-border);border-radius:var(--sw-radius);font:14px/1.4 ui-monospace,Menlo,Consolas,monospace;resize:none;color:var(--sw-fg);background:var(--sw-bg);}
|
|
58
|
+
.sw-latex[hidden],.sw-latex-status[hidden]{display:none;}
|
|
59
|
+
.sw-latex[aria-invalid="true"]{border-color:#c62828;}
|
|
60
|
+
.sw-latex-status{margin:0 8px 8px;color:#a32020;font-size:12px;}
|
|
61
|
+
.sw-popover{position:absolute;z-index:5;background:var(--sw-bg);border:1px solid var(--sw-border);border-radius:var(--sw-radius);box-shadow:0 4px 14px rgba(20,30,45,.18);padding:6px;max-width:100%;}
|
|
62
|
+
.sw-popover:has(> .sw-more-grid){padding:2px;border-color:var(--sw-strip);border-radius:3px;background:linear-gradient(var(--sw-bg),var(--sw-toolbar));box-shadow:0 3px 8px rgba(20,30,45,.2);}
|
|
63
|
+
.sw-more-grid{display:grid;grid-template-rows:repeat(3,26px);grid-auto-columns:minmax(26px,auto);gap:1px;width:max-content;}
|
|
64
|
+
.sw-more-grid[data-rows="2"]{grid-template-rows:repeat(2,39px);grid-auto-columns:minmax(34px,auto);}
|
|
65
|
+
.sw-more-grid[data-rows="9"]{grid-template-rows:repeat(9,21px);grid-auto-columns:21px;}
|
|
66
|
+
.sw-more-grid[data-rows="9"] .sw-tool{min-width:0;padding:0;border-radius:0;}
|
|
67
|
+
.sw-more-grid[data-rows="9"] .sw-icon math{font:11px Arial,Helvetica,sans-serif;}
|
|
68
|
+
.sw-more-grid .sw-tool[data-element="hydrogen"]{background:#e7e7e7;}
|
|
69
|
+
.sw-more-grid .sw-tool[data-element="alkali"]{background:#ffaa00;}
|
|
70
|
+
.sw-more-grid .sw-tool[data-element="alkaline-earth"]{background:#f2f44c;}
|
|
71
|
+
.sw-more-grid .sw-tool[data-element="transition"]{background:#ff7799;}
|
|
72
|
+
.sw-more-grid .sw-tool[data-element="post-transition"]{background:#00cccc;}
|
|
73
|
+
.sw-more-grid .sw-tool[data-element="nonmetal"]{background:#00f700;}
|
|
74
|
+
.sw-more-grid .sw-tool[data-element="noble-gas"]{background:#5ff7f7;}
|
|
75
|
+
.sw-more-grid .sw-tool[data-element="lanthanide"]{background:#ffaa88;}
|
|
76
|
+
.sw-more-grid .sw-tool[data-element="actinide"]{background:#ddaacc;}
|
|
77
|
+
.sw-more-grid .sw-tool[data-element="unknown"]{background:#fff;}
|
|
78
|
+
.sw-more-grid .sw-tool[data-element]{color:#000;}
|
|
79
|
+
.sw-more-grid .sw-tool[data-element]:hover{border-color:var(--sw-strip);}
|
|
80
|
+
.sw-periodic-slot{background:#f1c1d0;}
|
|
81
|
+
.sw-periodic-links{width:100%;height:100%;overflow:visible;fill:none;stroke:#8a8a8a;pointer-events:none;}
|
|
82
|
+
.sw-more-grid .sw-tool:focus{outline:2px solid var(--sw-strip);outline-offset:-2px;}
|
|
83
|
+
.sw-picker-form{display:flex;align-items:center;gap:6px;margin-top:6px;flex-wrap:wrap;}
|
|
84
|
+
.sw-picker-form input{width:72px;height:24px;border:1px solid var(--sw-border);border-radius:var(--sw-radius);padding:0 4px;font:12px system-ui,sans-serif;}
|
|
85
|
+
.sw-picker-form input[aria-invalid="true"]{border-color:#c62828;}
|
|
86
|
+
.sw-matrix-grid [role="row"]{display:flex;gap:2px;margin-bottom:2px;}
|
|
87
|
+
.sw-matrix-cell{width:18px;height:18px;border:1px solid var(--sw-border);background:var(--sw-bg);padding:0;cursor:pointer;}
|
|
88
|
+
.sw-matrix-cell.sw-active{background:var(--sw-hover);border-color:var(--sw-accent);}
|
|
89
|
+
.sw-swatches{display:grid;grid-template-columns:repeat(5,22px);gap:3px;}
|
|
90
|
+
.sw-swatch{width:22px;height:22px;border:1px solid var(--sw-border);border-radius:3px;padding:0;cursor:pointer;}
|
|
91
|
+
.sw-swatch[aria-selected="true"]{outline:2px solid var(--sw-accent);outline-offset:1px;}
|
|
92
|
+
.sw-char-grid{display:grid;grid-template-columns:repeat(9,27px);grid-auto-rows:27px;width:max-content;max-height:191px;overflow-x:hidden;overflow-y:auto;margin-top:6px;border-top:1px solid var(--sw-border);border-left:1px solid var(--sw-border);}
|
|
93
|
+
.sw-char{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:27px;height:27px;border:0;border-right:1px solid var(--sw-border);border-bottom:1px solid var(--sw-border);background:var(--sw-bg);color:var(--sw-fg);font:bold 16px/1 "STIX Two Math","STIX Two Text","Cambria Math",serif;cursor:pointer;padding:0;overflow:hidden;}
|
|
94
|
+
.sw-char:hover,.sw-char:focus{background:var(--sw-hover);}
|
|
95
|
+
.sw-help{border-collapse:collapse;font-size:12px;}
|
|
96
|
+
.sw-help caption{font-weight:600;text-align:start;margin-bottom:4px;}
|
|
97
|
+
.sw-help th,.sw-help td{text-align:start;padding:2px 8px 2px 0;font-weight:400;}
|
|
98
|
+
.sw-help kbd{font:11px ui-monospace,Menlo,monospace;}
|
|
99
|
+
.sw-help-popover{display:flex;flex-direction:column;gap:6px;align-items:flex-end;}
|
|
100
|
+
.sw-button{height:28px;padding:0 14px;border:1px solid var(--sw-border);border-radius:var(--sw-radius);background:var(--sw-bg);color:var(--sw-fg);font:13px system-ui,sans-serif;cursor:pointer;}
|
|
101
|
+
.sw-button:hover{background:var(--sw-hover);}
|
|
102
|
+
.sw-button.sw-primary{background:var(--sw-accent);border-color:var(--sw-accent);color:var(--sw-accent-fg);}
|
|
103
|
+
.sw-editor :focus-visible,.sw-modal :focus-visible{outline:2px solid var(--sw-focus);outline-offset:1px;}
|
|
104
|
+
.sw-area:focus-within{box-shadow:inset 0 0 0 2px rgba(47,111,222,.35);}
|
|
105
|
+
.sw-overlay{position:fixed;inset:0;background:rgba(15,20,30,.45);z-index:2147483000;}
|
|
106
|
+
.sw-overlay[hidden],.sw-modal[hidden]{display:none;}
|
|
107
|
+
.sw-modal{position:fixed;z-index:2147483001;display:flex;flex-direction:column;background:var(--sw-bg);border:1px solid #8c99a8;border-radius:6px 6px 0 0;box-shadow:0 8px 28px rgba(15,25,40,.28);overflow:hidden;}
|
|
108
|
+
.sw-modal[data-state="fullscreen"]{border-radius:6px;}
|
|
109
|
+
.sw-modal-titlebar{display:flex;align-items:center;justify-content:space-between;height:30px;flex:none;padding:0 4px 0 10px;background:#33475b;color:#fff;cursor:move;user-select:none;touch-action:none;}
|
|
110
|
+
.sw-modal[data-state="minimized"] .sw-modal-titlebar{cursor:pointer;}
|
|
111
|
+
.sw-modal[data-state="fullscreen"] .sw-modal-titlebar{cursor:default;}
|
|
112
|
+
.sw-modal-title{font-weight:600;font-size:13px;}
|
|
113
|
+
.sw-modal-actions{display:flex;gap:2px;}
|
|
114
|
+
.sw-title-button{width:26px;height:24px;border:none;border-radius:3px;background:transparent;color:#fff;font:15px/1 system-ui,sans-serif;cursor:pointer;}
|
|
115
|
+
.sw-title-button:hover{background:rgba(255,255,255,.16);}
|
|
116
|
+
.sw-title-button[hidden]{display:none;}
|
|
117
|
+
.sw-modal-body{flex:1;min-height:0;display:flex;flex-direction:column;}
|
|
118
|
+
.sw-modal-body[hidden],.sw-modal[data-state="minimized"] .sw-modal-footer,.sw-modal[data-state="minimized"] .sw-resizer{display:none;}
|
|
119
|
+
.sw-modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:8px 10px;border-top:1px solid var(--sw-border);flex:none;}
|
|
120
|
+
.sw-confirm{position:absolute;inset:30px 0 0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:rgba(255,255,255,.94);z-index:6;padding:16px;text-align:center;}
|
|
121
|
+
.sw-confirm[hidden]{display:none;}
|
|
122
|
+
.sw-confirm p{margin:0;max-width:360px;font-size:14px;}
|
|
123
|
+
.sw-confirm-actions{display:flex;gap:8px;}
|
|
124
|
+
.sw-resizer{position:absolute;bottom:0;width:12px;height:12px;z-index:4;touch-action:none;}
|
|
125
|
+
.sw-resizer-left{left:0;cursor:nesw-resize;}
|
|
126
|
+
.sw-resizer-right{right:0;cursor:nwse-resize;}
|
|
127
|
+
.sw-modal:not([data-state="stack"]) .sw-resizer{display:none;}
|
|
128
|
+
@media (forced-colors:active){.sw-tool[aria-pressed="true"],.sw-tab[aria-selected="true"]{outline:2px solid Highlight;}}
|
|
129
|
+
`;function We(e){if(e.getElementById(Zr))return;let t=e.createElement("style");t.id=Zr,t.textContent=ic,(e.head??e.documentElement).appendChild(t)}var el=9,oc={hydrogen:"H",alkali:"Li Na K Rb Cs Fr","alkaline-earth":"Be Mg Ca Sr Ba Ra",transition:"Sc Ti V Cr Mn Fe Co Ni Cu Zn Y Zr Nb Mo Tc Ru Rh Pd Ag Cd La Hf Ta W Re Os Ir Pt Au Hg Ac Rf Db Sg Bh Hs Mt Ds Rg Cn","post-transition":"Al Ga Ge In Sn Sb Tl Pb Bi Po Nh Fl Mc Lv",nonmetal:"B C N O F Si P S Cl As Se Br Te I At","noble-gas":"He Ne Ar Kr Xe Rn",lanthanide:"Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu",actinide:"Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr",unknown:"Ts Og"},nc=new Map(Object.entries(oc).flatMap(([e,t])=>t.split(" ").map(i=>[i,e]))),rc=/^<mi(?: mathvariant="normal")?>([A-Z][a-z]?)<\/mi>$/;function il(e){let t=e.mml===void 0?void 0:rc.exec(e.mml)?.[1];return t===void 0?void 0:nc.get(t)}var Qr=[[5,2],[6,2]],Jr=4,lc=["M0 1H1","M0 2H1","M0.65 1V2.5H1","M0.3 2V3.5H1"];function tl(e,t,i,o=1){e.style.gridRow=`${t+1} / span ${o}`,e.style.gridColumn=String(i+1)}function ol(e){let t=Qr.map(([r,l])=>{let s=g(e,"span",{class:"sw-periodic-slot","aria-hidden":"true"});return tl(s,r,l),s}),[i,o]=Qr[0]??[0,0],n=e.createElementNS(Yt,"svg");n.setAttribute("class","sw-periodic-links"),n.setAttribute("viewBox",`0 0 1 ${Jr}`),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false");for(let r of lc){let l=e.createElementNS(Yt,"path");l.setAttribute("d",r),l.setAttribute("vector-effect","non-scaling-stroke"),n.appendChild(l)}return tl(n,i,o,Jr),[...t,n]}var sc='button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',ac=2,Ze=class{constructor(t){p(this,"options",t);p(this,"element");p(this,"closed",!1);p(this,"onPointerDown");p(this,"onKeyDown");let i=t.container.ownerDocument;this.element=g(i,"div",{class:"sw-popover",role:t.role??"dialog","aria-label":t.label}),this.element.appendChild(t.content),t.container.appendChild(this.element),t.anchor.setAttribute("aria-expanded","true"),this.position(),this.onPointerDown=n=>{let r=n.target;r&&!this.element.contains(r)&&!t.anchor.contains(r)&&this.close(!1)},this.onKeyDown=n=>{n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),this.close(!0))},i.addEventListener("pointerdown",this.onPointerDown,!0),this.element.addEventListener("keydown",this.onKeyDown),(t.initialFocus??this.element.querySelector(sc))?.focus()}get isOpen(){return!this.closed}position(){let t=this.options.anchor.getBoundingClientRect(),i=this.options.container.getBoundingClientRect(),o=Math.max(0,Math.min(t.left-i.left,i.width-this.element.offsetWidth));this.element.style.left=`${o}px`;let n=Math.max(0,Math.min(t.bottom-i.top+ac,i.height-this.element.offsetHeight));this.element.style.top=`${n}px`}close(t=!1){if(this.closed)return;this.closed=!0,this.options.container.ownerDocument.removeEventListener("pointerdown",this.onPointerDown,!0),this.element.removeEventListener("keydown",this.onKeyDown),this.options.anchor.setAttribute("aria-expanded","false"),this.element.remove(),t&&this.options.anchor.focus(),this.options.onClose?.()}};var mc={GEN:"\u221A\u25AB",SYM:"\u2208\u221E",ARR:"\u2192\u22F0",GRK:"\u03B1\u03A9",MAT:"[\u22EE]",SCR:"\u25AB\xB2",DEC:"(\u25AB)",BIG:"\u03A3\u222A",CAL:"\u222Blim",CTX:"\u22EF"},Ui=10,nl=".sw-tool:not([hidden]), .sw-more:not([hidden]), select.sw-select:not([hidden])",dc=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"]),rl=0;function cc(e){return e.items.every(t=>t.kind==="template")?"template":e.items.some(t=>t.kind==="select")?"select":"symbol"}function ll(e,t){let[i,o]=t.cell;e.style.gridRow=String(i+1),e.style.gridColumn=String(o+1)}var Qe=class{constructor(t,i,o,n,r,l={}){p(this,"doc",t);p(this,"host",i);p(this,"strings",o);p(this,"popupContainer",n);p(this,"afterCommand",r);p(this,"element");p(this,"extras");p(this,"tabs");p(this,"tabButtons",[]);p(this,"panels",[]);p(this,"rendered",new Set);p(this,"actions",[]);p(this,"selects",[]);p(this,"prefix");p(this,"selected",0);p(this,"popover",null);rl+=1,this.prefix=`sw-tb${rl}`;let s=l.tabs;this.tabs=s?s.map(d=>Ct.find(c=>c.id===d)).filter(d=>d!==void 0):[...Ct];let a=g(t,"div",{role:"tablist","aria-label":o.toolbar,class:"sw-tablist"});this.extras=g(t,"div",{class:"sw-tab-extras"});let m=g(t,"div",{class:"sw-tabbar"},[a,this.extras]);this.element=g(t,"div",{class:"sw-toolbar"},[m]),this.tabs.forEach((d,c)=>{let u=c<Ui?Wr(o.tabShortcut,{n:(c+1)%Ui}):"",f=o.tabs[d.id],b=g(t,"button",{type:"button",role:"tab",id:`${this.prefix}-tab-${d.id}`,class:"sw-tab","aria-controls":`${this.prefix}-panel-${d.id}`,"aria-label":f,title:u?`${f} (${u})`:f,"aria-keyshortcuts":u?`Control+${(c+1)%Ui}`:void 0,"data-tab":d.id},[g(t,"span",{"aria-hidden":"true"},[mc[d.id]])]);b.addEventListener("click",()=>this.selectTab(c,!1)),a.appendChild(b),this.tabButtons.push(b);let h=g(t,"div",{role:"tabpanel",id:`${this.prefix}-panel-${d.id}`,class:"sw-panel","aria-labelledby":b.id,"data-tab":d.id});h.addEventListener("keydown",w=>this.onPanelKeyDown(w,h)),h.addEventListener("pointerdown",w=>{w.target?.closest(".sw-tool, .sw-more")&&w.preventDefault()}),this.panels.push(h),this.element.appendChild(h)}),a.addEventListener("keydown",d=>this.onTabKeyDown(d)),a.addEventListener("pointerdown",d=>d.preventDefault()),this.selectTab(0,!1)}get tabIds(){return this.tabs.map(t=>t.id)}get selectedTab(){return this.tabs[this.selected]?.id}selectTab(t,i){t<0||t>=this.tabs.length||(this.closePopover(),this.selected=t,this.ensureRendered(t),this.tabButtons.forEach((o,n)=>{o.setAttribute("aria-selected",String(n===t)),o.tabIndex=n===t?0:-1}),this.panels.forEach((o,n)=>{o.hidden=n!==t}),this.refresh(),i&&this.tabButtons[t]?.focus())}selectTabById(t){this.selectTab(this.tabs.findIndex(i=>i.id===t),!1)}onTabKeyDown(t){let i=this.tabs.length,o=null;t.key==="ArrowRight"?o=(this.selected+1)%i:t.key==="ArrowLeft"?o=(this.selected-1+i)%i:t.key==="Home"?o=0:t.key==="End"&&(o=i-1),o!==null&&(t.preventDefault(),this.selectTab(o,!0))}onPanelKeyDown(t,i){if(!dc.has(t.key))return;let o=t.target;if(o instanceof HTMLSelectElement&&(t.key==="ArrowUp"||t.key==="ArrowDown"))return;let n=[...i.querySelectorAll(nl)].filter(m=>!m.closest("[hidden]")),r=o?n.indexOf(o):-1;if(n.length===0)return;t.preventDefault();let l=t.key==="ArrowRight"||t.key==="ArrowDown",s;t.key==="Home"?s=0:t.key==="End"?s=n.length-1:s=(r+(l?1:-1)+n.length)%n.length;let a=n[s];if(a){for(let m of n)m.tabIndex=-1;a.tabIndex=0,a.focus()}}ensureRendered(t){if(this.rendered.has(t))return;this.rendered.add(t);let i=this.tabs[t],o=this.panels[t];if(!i||!o)return;for(let r of i.sections){let l=r.more!==void 0&&r.more.length>0,s=g(this.doc,"div",{class:"sw-section","data-kind":cc(r),"data-rows":String(r.rows),"data-section":r.id,"data-more":l?"true":void 0});for(let a of r.items){let m=this.createControl(a,null);m&&(ll(m,a),s.appendChild(m))}l&&s.appendChild(this.createMoreButton(r)),s.childElementCount>0&&o.appendChild(s)}let n=o.querySelector(nl);n&&(n.tabIndex=0)}icon(t){return this.mathIcon(Er(t),t.title)}mathIcon(t,i){if(!t)return this.doc.createTextNode(i.slice(0,1));try{return cr(`<math xmlns="${O}">${t}</math>`,this.doc,{placeholders:!0})}catch{return this.doc.createTextNode(i.slice(0,1))}}createControl(t,i){if(t.kind==="select")return this.createSelect(t);let o=t.kind==="action"?Nr[t.id]:void 0;if(t.kind==="action"&&!o)return null;let n=g(this.doc,"button",{type:"button",class:"sw-tool",title:t.title,"aria-label":t.title,tabindex:"-1","data-id":t.id,"aria-haspopup":o?.popup?"dialog":void 0,"aria-expanded":o?.popup?"false":void 0});return o?(o.icon?n.appendChild(Xr(this.doc,o.icon)):o.mml?n.appendChild(g(this.doc,"span",{class:"sw-icon","aria-hidden":"true"},[this.mathIcon(o.mml,t.title)])):n.appendChild(g(this.doc,"span",{class:"sw-tool-label","aria-hidden":"true"},[o.label??t.title.slice(0,1)])),o.pressed&&n.setAttribute("aria-pressed","false"),this.actions.push({element:n,spec:o}),n.addEventListener("click",()=>{if(n.getAttribute("aria-disabled")!=="true"){if(o.popup){o.run(this.host,n);return}o.run(this.host,n),this.afterCommand()}})):(n.appendChild(g(this.doc,"span",{class:"sw-icon","aria-hidden":"true"},[this.icon(t)])),n.addEventListener("click",()=>{t.mml&&this.host.insertMathML(t.mml),i?.()?.close(!1),this.afterCommand()})),n}createSelect(t){let i=Lr[t.id];if(!i)return null;let o=g(this.doc,"select",{class:"sw-select",title:t.title,"aria-label":t.title,tabindex:"-1","data-id":t.id});return(t.options??[]).forEach((n,r)=>{o.appendChild(g(this.doc,"option",{value:String(r)},[n===""?"\u2014":n]))}),o.addEventListener("change",()=>{let n=i.values[Number(o.value)];i.run(this.host,n??null),this.afterCommand()}),this.selects.push({element:o,spec:i}),o}createMoreButton(t){let i=g(this.doc,"button",{type:"button",class:"sw-more",title:this.strings.more,"aria-label":this.strings.more,"aria-haspopup":"dialog","aria-expanded":"false",tabindex:"-1"},[g(this.doc,"span",{"aria-hidden":"true"},["\u25B8"])]);return i.addEventListener("click",()=>{if(this.popover?.isOpen&&i.getAttribute("aria-expanded")==="true"){this.closePopover();return}let o=t.moreRows??t.rows,n=g(this.doc,"div",{class:"sw-more-grid","data-section":t.id,"data-rows":String(o)}),r=o===el,l=null;for(let a of t.more??[]){let m=this.createControl(a,()=>l);if(!m)continue;ll(m,a);let d=r?il(a):void 0;d&&(m.dataset.element=d),n.appendChild(m)}r&&n.append(...ol(this.doc)),n.addEventListener("keydown",a=>this.onPanelKeyDown(a,n)),n.addEventListener("pointerdown",a=>a.preventDefault());let s=n.querySelector(".sw-tool");s&&(s.tabIndex=0),l=this.openPopover(i,this.strings.more,n,s??void 0)}),i}openPopover(t,i,o,n){return this.closePopover(),this.popover=new Ze({anchor:t,container:this.popupContainer,label:i,content:o,initialFocus:n,onClose:()=>{this.popover=null}}),this.popover}closePopover(){this.popover?.close(!1),this.popover=null}get hasOpenPopover(){return this.popover?.isOpen??!1}refresh(){for(let{element:t,spec:i}of this.actions){let o=i.visible?i.visible(this.host):!0;if(t.hidden=!o,!o)continue;let n=i.enabled?i.enabled(this.host):!0;t.setAttribute("aria-disabled",String(!n)),t.classList.toggle("sw-disabled",!n),i.pressed&&t.setAttribute("aria-pressed",String(i.pressed(this.host)))}for(let{element:t,spec:i}of this.selects){let o=i.visible?i.visible(this.host):!0;if(t.hidden=!o,!o||!i.current)continue;let n=i.current(this.host),r=i.values.findIndex(l=>l===n);t.value=String(Math.max(0,r))}for(let t of this.panels)for(let i of t.querySelectorAll(".sw-section")){let o=[...i.children].some(n=>!n.hidden);i.hidden=!o}}destroy(){this.closePopover(),this.element.remove()}};var uc="<mfrac><mrow/><mrow/></mfrac>",pc='<msup><maction actiontype="argument"><mrow/></maction><mrow/></msup>',hc='<msub><maction actiontype="argument"><mrow/></maction><mrow/></msub>',fc="22px",sl="application/mathml+xml",gc=/^Digit(\d)$/,bc=10,wc=250,Tc={"arabic-indic":1632,"eastern-arabic-indic":1776},al=0,Je=class{constructor(t,i={}){p(this,"element");p(this,"model",new xe);p(this,"strings");p(this,"doc");p(this,"toolbar");p(this,"view");p(this,"area");p(this,"input");p(this,"live");p(this,"latexArea");p(this,"latexStatus");p(this,"latexButton",null);p(this,"mac");p(this,"listeners",new Set);p(this,"unsubscribeModel");p(this,"composing",!1);p(this,"dragging",!1);p(this,"latexMode",!1);p(this,"latexTimer",null);p(this,"internalClipboard",null);p(this,"initialMathML");p(this,"numeralMode","western");p(this,"destroyed",!1);this.doc=t.ownerDocument,We(this.doc),al+=1;let o=`sw-editor${al}`;if(this.strings=ht(i.language,i.strings),this.mac=Gr(this.doc),this.element=g(this.doc,"div",{class:"sw-editor",dir:Wt(i.language)?"rtl":"ltr",lang:i.language}),this.toolbar=new Qe(this.doc,this,this.strings,this.element,()=>this.focus(),i),this.area=g(this.doc,"div",{class:"sw-area"}),this.input=g(this.doc,"textarea",{class:"sw-input","aria-label":this.strings.mathInput,"aria-describedby":`${o}-live`,autocapitalize:"off",autocomplete:"off",spellcheck:"false",rows:"1"}),this.live=g(this.doc,"div",{id:`${o}-live`,class:"sw-live","aria-live":"polite","aria-atomic":"true"}),this.latexArea=g(this.doc,"textarea",{class:"sw-latex","aria-label":this.strings.latexInput,spellcheck:"false",hidden:""}),this.latexStatus=g(this.doc,"div",{class:"sw-latex-status",role:"status",hidden:""}),this.area.append(this.input,this.live),this.element.append(this.toolbar.element,this.area,this.latexArea,this.latexStatus),t.appendChild(this.element),this.view=new De(this.area,this.model,{fontSize:i.fontSize??fc}),this.area.insertBefore(this.view.element,this.input),i.latexToggle!==!1&&(this.latexButton=g(this.doc,"button",{type:"button",class:"sw-tab-extra","aria-pressed":"false",title:this.strings.latex},[this.strings.latex]),this.latexButton.addEventListener("click",()=>this.setLatexMode(!this.latexMode)),this.toolbar.extras.appendChild(this.latexButton)),i.help!==!1){let n=g(this.doc,"button",{type:"button",class:"sw-tab-extra","aria-label":this.strings.help,title:this.strings.help,"aria-haspopup":"dialog","aria-expanded":"false"},["?"]);n.addEventListener("click",()=>this.openHelp(n)),this.toolbar.extras.appendChild(n)}this.bindInput(),this.bindPointer(),this.unsubscribeModel=this.model.onChange(()=>this.onModelChange()),this.initialMathML=this.model.getMathML(),this.toolbar.refresh()}getMathML(){return this.latexMode&&this.flushLatex(),this.model.getMathML()}setMathML(t){this.model.setMathML(t),this.initialMathML=this.model.getMathML(),this.latexMode&&(this.latexArea.value=Pt(this.model.document))}setLatex(t){this.model.setDocument(kt(t)),this.initialMathML=this.model.getMathML()}getLatex(){return Pt(K(this.getMathML()).doc)}isEmpty(){return this.model.isEmpty()}hasChanges(){return this.getMathML()!==this.initialMathML}onChange(t){return this.listeners.add(t),()=>this.listeners.delete(t)}focus(){this.latexMode?this.latexArea.focus():this.input.focus({preventScroll:!0})}selectTab(t){this.toolbar.selectTabById(t)}get numerals(){return this.numeralMode}setNumerals(t){this.numeralMode=t,this.toolbar.refresh()}relayout(){this.view.updateOverlay()}get hasOpenPopup(){return this.toolbar.hasOpenPopover}closePopups(){this.toolbar.closePopover()}destroy(){this.destroyed||(this.destroyed=!0,this.latexTimer&&clearTimeout(this.latexTimer),this.unsubscribeModel(),this.listeners.clear(),this.toolbar.destroy(),this.view.destroy(),this.element.remove())}insertMathML(t){this.model.insertMathML(`<math xmlns="${O}">${t}</math>`)}copy(){let t=this.model.copySelection();t!==null&&(this.internalClipboard=t,this.writeSystemClipboard(t))}cut(){let t=this.model.cutSelection();t!==null&&(this.internalClipboard=t,this.writeSystemClipboard(t))}paste(){let t=this.doc.defaultView?.navigator.clipboard;if(!t?.readText){this.pasteInternal();return}t.readText().then(i=>{(!i||!this.model.paste(i))&&this.pasteInternal(),this.focus()},()=>{this.pasteInternal(),this.focus()})}openColorPicker(t){let i=Pr(this.doc,this.strings,this.model.getInputStyle().color,o=>{this.model.setColor(o),this.toolbar.closePopover(),this.focus()});this.toolbar.openPopover(t,t.getAttribute("aria-label")??"",i.content,i.initialFocus)}openSpecialCharacters(t){let i=Vr(this.doc,this.strings,o=>{this.model.typeCharacter(o,zr(o)),this.toolbar.closePopover(),this.focus()});this.toolbar.openPopover(t,t.getAttribute("aria-label")??"",i.content,i.initialFocus)}openMatrixPicker(t,i){let o=Kr(this.doc,this.strings,(n,r)=>{this.model.insertMatrix(n,r,i),this.toolbar.closePopover(),this.focus()});this.toolbar.openPopover(t,t.getAttribute("aria-label")??"",o.content,o.initialFocus)}openValuePrompt(t,i,o,n){let r=qr(this.doc,this.strings,i,o,l=>{n(l),this.toolbar.closePopover(),this.focus()});this.toolbar.openPopover(t,i,r.content,r.initialFocus)}onModelChange(){this.toolbar.refresh(),this.view.scrollCaretIntoView(this.area),this.announce();for(let t of this.listeners)t()}announce(){let t=this.model.isEmpty()?this.strings.emptyFormula:tn(this.model);this.live.textContent!==t&&(this.live.textContent=t)}pasteInternal(){this.internalClipboard&&this.model.paste(this.internalClipboard)}async writeSystemClipboard(t){let i=this.doc.defaultView?.navigator.clipboard;if(i?.writeText)try{await i.writeText(t)}catch{}}mapNumerals(t){if(this.numeralMode==="western")return t;let i=Tc[this.numeralMode];return t.replace(/[0-9]/g,o=>String.fromCodePoint(i+Number(o)))}typeText(t){t&&this.model.typeText(this.mapNumerals(t))}isCommand(t){return this.mac?t.metaKey:t.ctrlKey}bindInput(){this.input.addEventListener("focus",()=>{this.view.setFocused(!0),this.view.updateOverlay(),this.announce()}),this.input.addEventListener("blur",()=>this.view.setFocused(!1)),this.input.addEventListener("compositionstart",()=>{this.composing=!0}),this.input.addEventListener("compositionend",()=>{this.composing=!1,this.typeText(this.input.value),this.input.value=""}),this.input.addEventListener("input",()=>{this.composing||(this.typeText(this.input.value),this.input.value="")}),this.input.addEventListener("keydown",t=>this.onKeyDown(t)),this.input.addEventListener("copy",t=>this.onClipboard(t,"copy")),this.input.addEventListener("cut",t=>this.onClipboard(t,"cut")),this.input.addEventListener("paste",t=>{t.preventDefault();let i=t.clipboardData,o=i?.getData(sl)||i?.getData("text/plain")||"";(!o||!this.model.paste(o))&&this.pasteInternal()}),this.latexArea.addEventListener("input",()=>{this.latexTimer&&clearTimeout(this.latexTimer),this.latexTimer=setTimeout(()=>this.flushLatex(),wc)})}onClipboard(t,i){let o=i==="copy"?this.model.copySelection():this.model.cutSelection();o!==null&&(t.preventDefault(),this.internalClipboard=o,t.clipboardData?.setData(sl,o),t.clipboardData?.setData("text/plain",o))}onKeyDown(t){if(this.composing||t.isComposing)return;let i=this.model,o=this.isCommand(t),n=t.ctrlKey&&!t.altKey&&!t.metaKey?gc.exec(t.code):null;if(n?.[1]!==void 0){let s=Number(n[1]);t.preventDefault(),this.toolbar.selectTab(s===0?bc-1:s-1,!1);return}let r=!0,l=i.isRtl();switch(t.key){case"ArrowLeft":l?i.moveRight(t.shiftKey):i.moveLeft(t.shiftKey);break;case"ArrowRight":l?i.moveLeft(t.shiftKey):i.moveRight(t.shiftKey);break;case"ArrowUp":o?this.insertMathML(pc):i.moveVertical("up");break;case"ArrowDown":o?this.insertMathML(hc):i.moveVertical("down");break;case"Home":i.moveHome(t.shiftKey);break;case"End":i.moveEnd(t.shiftKey);break;case"Backspace":i.deleteBackward();break;case"Delete":i.deleteForward();break;case"Enter":o||t.altKey?r=!1:i.insertNewline();break;default:r=o&&this.onCommandKey(t)}r&&t.preventDefault()}onCommandKey(t){let i=this.model,o=t.key.toLowerCase();if(t.key==="/"||t.code==="Slash")return this.insertMathML(uc),!0;switch(o){case"a":return i.selectAll(),!0;case"b":return i.toggleBold(),!0;case"i":return i.toggleItalic(),!0;case"z":return t.shiftKey?i.redo():i.undo(),!0;case"y":return i.redo(),!0;default:return!1}}bindPointer(){let t=this.view.element;t.addEventListener("pointerdown",o=>{if(o.button!==0)return;o.preventDefault(),this.focus();let n=this.view.caretFromPoint(o.clientX,o.clientY);n&&this.model.setCaret(n,o.shiftKey),this.dragging=!0,t.setPointerCapture?.(o.pointerId),this.view.updateOverlay(),this.toolbar.refresh()}),t.addEventListener("pointermove",o=>{if(!this.dragging)return;let n=this.view.caretFromPoint(o.clientX,o.clientY);n&&(this.model.setCaret(n,!0),this.view.updateOverlay())});let i=o=>{this.dragging&&(this.dragging=!1,t.releasePointerCapture?.(o.pointerId),this.toolbar.refresh())};t.addEventListener("pointerup",i),t.addEventListener("pointercancel",i),t.addEventListener("dblclick",o=>{let n=this.view.caretFromPoint(o.clientX,o.clientY);if(!n)return;let r=this.model.treeIndex.rows.get(n.rowId)?.children.length??0;r!==0&&(this.model.selectAtom(n.rowId,Math.max(0,Math.min(r-1,n.offset-1))),this.view.updateOverlay(),this.toolbar.refresh())})}get isLatexMode(){return this.latexMode}setLatexMode(t){if(t!==this.latexMode){t||this.flushLatex(),this.latexMode=t,this.latexButton?.setAttribute("aria-pressed",String(t)),this.latexArea.hidden=!t,this.area.hidden=t,this.latexStatus.hidden=!0;for(let i of this.toolbar.element.querySelectorAll(".sw-panel"))i.classList.toggle("sw-inactive",t);t?this.latexArea.value=Pt(this.model.document):this.view.render(),this.focus()}}flushLatex(){this.latexTimer&&(clearTimeout(this.latexTimer),this.latexTimer=null);let t=this.latexArea.value.trim();try{let i=kt(t),o=q(i);o!==this.model.getMathML()&&this.model.setMathML(o,!0),this.latexStatus.hidden=!0,this.latexArea.removeAttribute("aria-invalid")}catch(i){if(!(i instanceof M))throw i;this.latexStatus.textContent=`${this.strings.latexInvalid} (${i.message})`,this.latexStatus.hidden=!1,this.latexArea.setAttribute("aria-invalid","true")}}openHelp(t){let i=this.mac?"\u2318":"Ctrl",o=[{keys:`${i}+/`,action:"Fraction"},{keys:`${i}+\u2191 / ${i}+\u2193`,action:"Superscript / Subscript"},{keys:`${i}+B / ${i}+I`,action:"Bold / Italic"},{keys:`${i}+Z / ${i}+Shift+Z / ${i}+Y`,action:"Undo / Redo"},{keys:`${i}+C / ${i}+X / ${i}+V`,action:"Copy / Cut / Paste"},{keys:`${i}+A`,action:"Select all"},{keys:"Ctrl+1 \u2026 Ctrl+0",action:"Toolbar tabs 1 to 10"},{keys:"\u2190 \u2192 \u2191 \u2193, Home, End",action:"Move the caret (Shift extends the selection)"},{keys:"Enter",action:"New line"},{keys:"Esc",action:"Close"}],n=g(this.doc,"table",{class:"sw-help"},[g(this.doc,"caption",{},[this.strings.helpTitle]),g(this.doc,"tbody",{},o.map(l=>g(this.doc,"tr",{},[g(this.doc,"th",{scope:"row"},[g(this.doc,"kbd",{},[l.keys])]),g(this.doc,"td",{},[l.action])])))]),r=g(this.doc,"button",{type:"button",class:"sw-button"},[this.strings.close]);r.addEventListener("click",()=>{this.toolbar.closePopover(),t.focus()}),this.toolbar.openPopover(t,this.strings.helpTitle,g(this.doc,"div",{class:"sw-help-popover"},[n,r]),r)}};var St={width:580,height:338},Zt={width:250,height:30},ji={width:1200,height:700},kc=.8,Vi=0,qi={width:420,height:300},yc=St.width,ml=["resize","scroll"],xc=`<math xmlns="${O}" dir="rtl"/>`,vc='button:not([disabled]):not([hidden]), [href], input:not([disabled]), select:not([disabled]):not([hidden]), textarea:not([disabled]):not([hidden]), [tabindex]:not([tabindex="-1"])',dl=new WeakMap,Yi=0,Qt=class{constructor(t,i){p(this,"options",i);p(this,"element");p(this,"editor");p(this,"doc");p(this,"overlay");p(this,"titleBar");p(this,"minimizeButton");p(this,"fullscreenButton");p(this,"body");p(this,"confirm");p(this,"state","stack");p(this,"previousState","stack");p(this,"geometry",null);p(this,"opened",!1);p(this,"returnFocus",null);p(this,"lockedScroll",[]);p(this,"onWindowResize",()=>this.applyGeometry());p(this,"onDocKeyDown",t=>this.handleKey(t));this.doc=t.ownerDocument,We(this.doc),Yi+=1;let o=`sw-modal${Yi}-title`,n=ht(i.language,i.strings);this.overlay=g(this.doc,"div",{class:"sw-overlay",hidden:""}),this.element=g(this.doc,"div",{class:"sw-modal",role:"dialog","aria-labelledby":o,"aria-modal":"false",hidden:"","data-state":"stack",dir:Wt(i.language)?"rtl":"ltr",lang:i.language});let r=g(this.doc,"span",{id:o,class:"sw-modal-title"},[n.title]);this.minimizeButton=this.titleButton("_",n.minimize,()=>this.setState(this.state==="minimized"?this.previousState:"minimized")),this.fullscreenButton=this.titleButton("\u25A1",n.fullscreen,()=>this.setState(this.state==="fullscreen"?"stack":"fullscreen"));let l=this.titleButton("\xD7",n.close,()=>this.requestClose());this.titleBar=g(this.doc,"div",{class:"sw-modal-titlebar"},[r,g(this.doc,"div",{class:"sw-modal-actions"},[this.minimizeButton,this.fullscreenButton,l])]),this.body=g(this.doc,"div",{class:"sw-modal-body"});let s=g(this.doc,"button",{type:"button",class:"sw-button sw-primary","data-action":"insert"},[n.insert]),a=g(this.doc,"button",{type:"button",class:"sw-button","data-action":"cancel"},[n.cancel]);s.addEventListener("click",()=>this.insert()),a.addEventListener("click",()=>this.requestClose());let m=g(this.doc,"div",{class:"sw-modal-footer"},[s,a]),d=g(this.doc,"button",{type:"button",class:"sw-button","data-action":"discard"},[n.confirmDiscard]),c=g(this.doc,"button",{type:"button",class:"sw-button sw-primary","data-action":"return"},[n.confirmReturn]),u=`sw-modal${Yi}-confirm`;this.confirm=g(this.doc,"div",{class:"sw-confirm",role:"alertdialog","aria-modal":"true","aria-describedby":u,"aria-label":n.close,hidden:""},[g(this.doc,"p",{id:u},[n.confirmMessage]),g(this.doc,"div",{class:"sw-confirm-actions"},[d,c])]),d.addEventListener("click",()=>this.close()),c.addEventListener("click",()=>this.hideConfirm());let f=["left","right"].map(b=>{let h=g(this.doc,"div",{class:`sw-resizer sw-resizer-${b}`,"aria-hidden":"true"});return h.addEventListener("pointerdown",w=>this.startResize(w,b)),h});this.element.append(this.titleBar,this.body,m,this.confirm,...f),t.append(this.overlay,this.element),this.editor=new Je(this.body,i),this.titleBar.addEventListener("pointerdown",b=>this.startDrag(b)),this.titleBar.addEventListener("click",b=>{this.state==="minimized"&&!b.target?.closest("button")&&this.setState(this.previousState)}),this.overlay.addEventListener("pointerdown",b=>b.preventDefault())}get isOpen(){return this.opened}get currentState(){return this.state}open(t={}){t.latex!==void 0?this.editor.setLatex(t.latex):this.editor.setMathML(t.mathml??(this.options.rtl?xc:"")),this.returnFocus=this.doc.activeElement instanceof HTMLElement?this.doc.activeElement:null,this.opened=!0,this.element.hidden=!1,this.hideConfirm(),this.geometry=dl.get(this.doc)??null,this.isCompact()&&this.lockScroll(),this.setState(this.options.fullScreen?"fullscreen":"stack"),this.doc.defaultView?.addEventListener("resize",this.onWindowResize);for(let i of ml)this.doc.defaultView?.visualViewport?.addEventListener(i,this.onWindowResize);this.doc.addEventListener("keydown",this.onDocKeyDown,!0),this.editor.focus()}close(){if(this.opened){this.geometry&&dl.set(this.doc,this.geometry),this.opened=!1,this.editor.closePopups(),this.element.hidden=!0,this.overlay.hidden=!0,this.hideConfirm(),this.doc.defaultView?.removeEventListener("resize",this.onWindowResize);for(let t of ml)this.doc.defaultView?.visualViewport?.removeEventListener(t,this.onWindowResize);this.doc.removeEventListener("keydown",this.onDocKeyDown,!0),this.unlockScroll(),this.options.onClose?.(),this.returnFocus?.isConnected&&this.returnFocus.focus(),this.returnFocus=null}}requestClose(){this.editor.hasChanges()?this.showConfirm():this.close()}insert(){let t=this.editor.getMathML();this.options.onInsert(t,this.editor)!==!1&&this.close()}setState(t){t!=="minimized"&&(this.previousState=t),this.state=t,this.element.dataset.state=t;let i=this.editor.strings;this.overlay.hidden=t!=="fullscreen"||!this.opened,this.element.setAttribute("aria-modal",String(t==="fullscreen")),this.setButtonLabel(this.fullscreenButton,t==="fullscreen"?i.exitFullscreen:i.fullscreen),this.setButtonLabel(this.minimizeButton,t==="minimized"?i.restore:i.minimize),this.body.hidden=t==="minimized",this.applyGeometry(),t!=="minimized"&&(this.editor.relayout(),this.opened&&this.editor.focus())}destroy(){this.close(),this.editor.destroy(),this.element.remove(),this.overlay.remove()}titleButton(t,i,o){let n=g(this.doc,"button",{type:"button",class:"sw-title-button","aria-label":i,title:i},[g(this.doc,"span",{"aria-hidden":"true"},[t])]);return n.addEventListener("click",o),n.addEventListener("pointerdown",r=>r.stopPropagation()),n}setButtonLabel(t,i){t.setAttribute("aria-label",i),t.title=i}viewport(){let t=this.doc.defaultView,i=t?.visualViewport;return{width:t?.innerWidth??St.width,height:i?.height??t?.innerHeight??St.height,top:i?.offsetTop??0}}isCompact(){return this.viewport().width<yc}lockScroll(){let t=[this.doc.documentElement,this.doc.body].filter(i=>i instanceof HTMLElement);this.lockedScroll=t.map(i=>({element:i,overflow:i.style.overflow}));for(let i of t)i.style.overflow="hidden"}unlockScroll(){for(let{element:t,overflow:i}of this.lockedScroll)t.style.overflow=i;this.lockedScroll=[]}stackGeometry(){let t=this.viewport(),i=Math.min(St.width,t.width),o=Math.min(St.height,t.height);return{left:this.dockLeft(i),top:t.top+t.height-o-Vi,width:i,height:o}}dockLeft(t){return this.options.rtl?Vi:this.viewport().width-t-Vi}clampGeometry(t){let i=this.viewport(),o=Math.min(Math.max(qi.width,t.width),i.width),n=Math.min(Math.max(qi.height,t.height),i.height);return{width:o,height:n,left:Math.min(Math.max(0,t.left),Math.max(0,i.width-o)),top:Math.min(Math.max(i.top,t.top),Math.max(i.top,i.top+i.height-n))}}applyGeometry(){let t=this.element.style,i=this.viewport();if(this.state==="minimized"){t.width=`${Zt.width}px`,t.height=`${Zt.height}px`,t.left=`${this.dockLeft(Zt.width)}px`,t.top=`${i.top+i.height-Zt.height}px`;return}if(this.state==="fullscreen"){let n=this.isCompact()?1:kc,r=Math.min(ji.width,Math.round(i.width*n)),l=Math.min(ji.height,Math.round(i.height*n));t.width=`${r}px`,t.height=`${l}px`,t.left=`${Math.round((i.width-r)/2)}px`,t.top=`${Math.round(i.top+(i.height-l)/2)}px`;return}let o=this.geometry?this.clampGeometry(this.geometry):this.stackGeometry();t.width=`${o.width}px`,t.height=`${o.height}px`,t.left=`${o.left}px`,t.top=`${o.top}px`}currentGeometry(){let t=this.element.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}startDrag(t){if(t.button!==0||this.state!=="stack"||t.target?.closest("button"))return;t.preventDefault();let i=this.currentGeometry(),o=t.clientX,n=t.clientY;this.trackPointer(t,(r,l)=>{this.geometry=this.clampGeometry({...i,left:i.left+r-o,top:i.top+l-n}),this.applyGeometry()})}startResize(t,i){if(t.button!==0||this.state!=="stack")return;t.preventDefault(),t.stopPropagation();let o=this.currentGeometry(),n=t.clientX,r=t.clientY;this.trackPointer(t,(l,s)=>{let a=l-n,m=s-r,d=i==="right"?o.width+a:o.width-a,c=Math.max(qi.width,d),u=i==="right"?o.left:o.left+o.width-c;this.geometry=this.clampGeometry({left:u,top:o.top,width:c,height:o.height+m}),this.applyGeometry(),this.editor.relayout()})}trackPointer(t,i){let o=t.currentTarget;o.setPointerCapture?.(t.pointerId);let n=l=>i(l.clientX,l.clientY),r=l=>{o.releasePointerCapture?.(l.pointerId),o.removeEventListener("pointermove",n),o.removeEventListener("pointerup",r),o.removeEventListener("pointercancel",r)};o.addEventListener("pointermove",n),o.addEventListener("pointerup",r),o.addEventListener("pointercancel",r)}showConfirm(){this.state==="minimized"&&this.setState(this.previousState),this.confirm.hidden=!1,this.confirm.querySelector('[data-action="return"]')?.focus()}hideConfirm(){let t=!this.confirm.hidden;this.confirm.hidden=!0,t&&this.opened&&this.editor.focus()}handleKey(t){if(!this.opened)return;let i=t.target,o=i?this.element.contains(i):!1;if(t.key==="Escape"&&o){if(this.editor.hasOpenPopup)return;t.preventDefault(),t.stopPropagation(),this.confirm.hidden?this.requestClose():this.hideConfirm();return}t.key==="Tab"&&o&&this.trapFocus(t)}trapFocus(t){let i=this.confirm.hidden?this.element:this.confirm,o=[...i.querySelectorAll(vc)].filter(s=>!s.closest("[hidden]")&&s.getClientRects().length>0),n=o[0],r=o[o.length-1];if(!n||!r)return;let l=this.doc.activeElement;t.shiftKey&&(l===n||!i.contains(l))?(t.preventDefault(),r.focus()):!t.shiftKey&&(l===r||!i.contains(l))&&(t.preventDefault(),n.focus())}};var Wi='<svg width="24" height="24" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 13h3l3 7 5-15h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.5 11l5 6m0-6l-5 6" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>';function Rc(e){return e.text.isConnected&&e.text.data.slice(e.start,e.end)===`$$${e.latex}$$`}var Jt=class{constructor(t,{options:i,conventions:o}){p(this,"adapter",t);p(this,"options");p(this,"strings");p(this,"ctx");p(this,"modal",null);p(this,"target",{kind:"new",bookmark:null});p(this,"destroyed",!1);this.options=i,this.strings=ht(i.language,i.strings),this.ctx={options:i,conventions:o,doc:t.uiDocument,fontLoaded:!1},Jn(t.uiDocument).then(()=>{this.ctx.fontLoaded=!0,this.refreshStaleImages()})}toEditingHtml(t,i){return kr(t,this.ctx,i)}toSavedHtml(t){return yr(t,this.ctx)}isFormula(t){return fr(t,this.options)}isOpen(){return this.modal?.isOpen??!1}open(){if(this.destroyed||!this.adapter.canEdit())return;let t=this.ensureModal();if(t.isOpen){if(t.editor.hasChanges()){t.currentState==="minimized"&&t.setState("stack"),t.editor.focus();return}t.close()}this.target=this.currentTarget(),this.target.kind==="image"?t.open({mathml:this.readImage(this.target.img)?.mathml??""}):this.target.kind==="latex"?t.open({latex:this.target.range.latex}):t.open()}editFormula(t){this.adapter.selectFormula(t),this.open()}refreshStaleImages(){if(this.destroyed||!this.ctx.fontLoaded)return;let t=this.adapter.getContentRoot();if(!t)return;let i=this.ctx.conventions.staleAttribute,o=[];for(let n of t.querySelectorAll(`img[${i}]`)){let r=this.readImage(n);r&&o.push([n,{...Et(r,this.ctx),[i]:null}])}o.length>0&&this.adapter.refreshFormulas(o)}destroy(){this.destroyed=!0,this.modal?.destroy(),this.modal=null}readImage(t){return it(t.getAttribute(this.options.imageMathmlAttribute)??"")}currentTarget(){let t=this.adapter.getSelectedNode();if(this.isFormula(t))return{kind:"image",img:t};if(this.options.parseLatex){let i=this.adapter.getSelectionRange(),o=i?xr(i):null;if(o)return{kind:"latex",range:o}}return{kind:"new",bookmark:this.adapter.saveSelection()}}ensureModal(){return this.modal??(this.modal=new Qt(this.adapter.uiDocument.body,{language:this.options.language,strings:this.options.strings,tabs:this.options.toolbar,latexToggle:this.options.latexToggle,fullScreen:this.options.openFullScreen,rtl:this.adapter.isRtl(),onInsert:(t,i)=>this.commit(t,i),onClose:()=>{this.destroyed||this.adapter.focus()}})),this.modal}commit(t,i){let o=it(t);if(!o)return!1;let n=this.target;if(this.target={kind:"new",bookmark:null},this.adapter.focus(),n.kind==="latex"&&Rc(n.range)){let{text:r,start:l,end:s,latex:a}=n.range,m=_e(o)?"":`$$${i.hasChanges()?i.getLatex():a}$$`;return this.adapter.replaceText(r,l,s,m),!0}if(n.kind==="image"&&n.img.isConnected){if(_e(o))this.adapter.removeFormula(n.img);else{let r=this.ctx.conventions.staleAttribute;this.adapter.updateFormula(n.img,{alt:null,[r]:null,...Et(o,this.ctx)})}return!0}return _e(o)||this.adapter.insertFormula(Et(o,this.ctx),n.kind==="new"?n.bookmark:null),!0}};var ul="Wirisformula",pl="data-mathml",Ec=16,Cc=6,Bc=96,Ac=["xml","safeXml","image","base64"],Sc=/^[A-Za-z_][A-Za-z0-9_-]*$/,Mc=/^data-[a-z0-9][a-z0-9._-]*$/,Nc=new Set(Ct.map(e=>e.id));function hl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ti(e,t){return typeof e=="boolean"?e:t}function cl(e,t,i){return typeof e=="string"&&t.test(e)?e:i}function Lc(e){if(!Array.isArray(e))return;let t=e.filter(i=>typeof i=="string"&&Nc.has(i));return t.length>0?t:void 0}function Ic(e){if(!hl(e))return;let t={};for(let[i,o]of Object.entries(e))typeof o=="string"&&(t[i]=o);return t}function Zi(e,t){let i=hl(e)?e:{},o=Ac.find(l=>l===i.saveMode)??"xml",n=i.imageFontSize,r=typeof i.language=="string"?i.language:typeof t=="string"?t:"en";return{saveMode:o,parseLatex:ti(i.parseLatex,!0),imageClassName:cl(i.imageClassName,Sc,ul),imageMathmlAttribute:cl(i.imageMathmlAttribute,Mc,pl),accessibility:ti(i.accessibility,!0),openFullScreen:ti(i.openFullScreen,!1),language:jt(r),toolbar:Lc(i.toolbar),strings:Ic(i.strings),imageFontSize:typeof n=="number"&&n>=Cc&&n<=Bc?n:Ec,latexToggle:ti(i.latexToggle,!0)}}var ei="data-mce-sw-src";function Xc(e){return e.options===void 0}function Qi(e,t){e.options?.register(t,{processor:"object",default:{}})}function ii(e,t){return e.options?e.options.get(t):e.getParam?.(t)}function Gc(e){let t=e.getBody(),i=e.selection.getNode();if(!t?.contains(i))return!1;for(let o=i;o!==null&&o!==t;o=o.parentElement){let n=o.getAttribute("contenteditable");if(n==="false")return!1;if(n==="true")return!0}return!0}function Ji(e){let{selection:t}=e;return t.isEditable?t.isEditable():Gc(e)}function fl(e,t){e.setEnabled?e.setEnabled(t):e.setDisabled?.(!t)}function Dc(e,t){let i=document.createElement("template");i.innerHTML=e;let o=!1;for(let n of Array.from(i.content.querySelectorAll("img"))){let r=n.getAttribute("src");r===null||!t(n)||(n.setAttribute(ei,r),n.removeAttribute("src"),o=!0)}return o?i.innerHTML:e}function Fc(e){for(let t of e)t.attr("src",t.attr(ei)??null),t.attr(ei,null)}function gl(e,t){Xc(e)&&(e.on("PreInit",()=>{e.editorUpload?.addFilter(i=>!t(i)),e.parser?.addAttributeFilter(ei,Fc)}),e.on("BeforeSetContent",i=>{i.paste!==!0||typeof i.content!="string"||(i.content=Dc(i.content,t))}))}var Oc="formulacomposer",_c="formulaComposer",Kc="formulaComposer",bl="formulaComposer",to="formula-composer",Pc="sylarwiris",wl="sylarMathType",Tl="sylarWiris",$c={internalAttributePrefix:"data-mce-",staleAttribute:"data-mce-sw-stale",imageAttributes:{"data-mce-resize":"false"}},Hc=2;function zc(e){return{uiDocument:document,isRtl:()=>ii(e,"directionality")==="rtl",canEdit:()=>e.initialized&&!e.mode.isReadOnly()&&Ji(e),getSelectedNode:()=>e.selection.getNode(),getSelectionRange:()=>e.selection.getRng(),saveSelection:()=>e.selection.getBookmark(Hc,!0),insertFormula:(t,i)=>{i!==null&&e.selection.moveToBookmark(i),e.insertContent(e.dom.createHTML("img",t))},updateFormula:(t,i)=>{e.undoManager.transact(()=>e.dom.setAttribs(t,i)),t.isConnected&&e.selection.select(t),e.nodeChanged()},removeFormula:t=>{e.undoManager.transact(()=>e.dom.remove(t)),e.nodeChanged()},replaceText:(t,i,o,n)=>{e.undoManager.transact(()=>{t.replaceData(i,o-i,n),e.selection.setCursorLocation(t,i+n.length)}),e.nodeChanged()},selectFormula:t=>e.selection.select(t),getContentRoot:()=>e.initialized?e.getBody():null,refreshFormulas:t=>{let i=!e.isDirty()&&!e.undoManager.hasUndo();e.undoManager.ignore(()=>{for(let[o,n]of t)e.dom.setAttribs(o,n)}),i&&(e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1))},focus:()=>e.focus()}}function kl(e,t){let i=ii(e,t);return typeof i=="object"&&i!==null?{...i}:{}}function Uc(e){Qi(e,bl),Qi(e,Tl);let t={...kl(e,Tl),...kl(e,bl)},i=Zi(t,ii(e,"language")),o=new Jt(zc(e),{options:i,conventions:$c}),n=()=>o.open(),r=l=>{let s=()=>fl(l,!e.mode.isReadOnly()&&Ji(e));return e.on("NodeChange",s),e.initialized&&s(),()=>e.off("NodeChange",s)};e.ui.registry.addIcon(to,Wi);for(let l of[_c,wl])e.ui.registry.addButton(l,{icon:to,tooltip:o.strings.insertFormula,onAction:n,onSetup:r});for(let l of[Kc,wl])e.ui.registry.addMenuItem(l,{icon:to,text:o.strings.menuItem,onAction:n,onSetup:r});return e.on("BeforeSetContent",l=>{typeof l.content!="string"||l.format==="raw"||(l.content=o.toEditingHtml(l.content,!1))}),gl(e,l=>o.isFormula(l)),e.on("PastePreProcess",l=>{l.content=o.toEditingHtml(l.content,!0)}),e.on("GetContent",l=>{typeof l.content!="string"||l.selection===!0||l.format!==void 0&&l.format!=="html"||(l.content=o.toSavedHtml(l.content))}),e.on("dblclick",l=>{o.isFormula(l.target)&&(l.preventDefault(),o.editFormula(l.target))}),e.on("init",()=>o.refreshStaleImages()),e.on("remove",()=>o.destroy()),{options:i,open:n,isOpen:()=>o.isOpen()}}function Vc(e){if(typeof e!="object"||e===null||!("PluginManager"in e))return!1;let t=e.PluginManager;return typeof t=="object"&&t!==null&&"add"in t&&typeof t.add=="function"}function vl(){let e=Reflect.get(globalThis,"tinymce");return Vc(e)?e:null}var yl=new WeakSet,xl=new WeakMap;function qc(e){let t=xl.get(e);if(t)return t;let i=Uc(e);return xl.set(e,i),i}function Rl(e){if(!yl.has(e)){yl.add(e);for(let t of[Oc,Pc])e.PluginManager.add(t,qc)}}var El=vl();El&&Rl(El);})();
|